summaryrefslogtreecommitdiff
path: root/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h')
-rw-r--r--protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h b/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h
new file mode 100644
index 0000000000..bb65f08737
--- /dev/null
+++ b/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#define DB_STR_FROM_ID "FromID"
+#define DB_STR_TO_ID "ToID"
+#define DB_STR_FROM_DESCRIPTION "FromDesc"
+#define DB_STR_TO_DESCRIPTION "ToDesc"
+
+
+class CCurrencyRatesProviderCurrencyConverter : public CCurrencyRatesProviderBase
+{
+public:
+ typedef CCurrencyRatesProviderBase CSuper;
+ using TRateInfo = std::pair<CCurrencyRate, CCurrencyRate>;
+
+public:
+ CCurrencyRatesProviderCurrencyConverter();
+ ~CCurrencyRatesProviderCurrencyConverter();
+
+ double Convert(double dAmount, const CCurrencyRate &from, const CCurrencyRate &to) const;
+ size_t GetWatchedRateCount() const;
+ bool GetWatchedRateInfo(size_t nIndex, TRateInfo &rRateInfo);
+ bool WatchForRate(const TRateInfo &ri, bool bWatch);
+ MCONTACT GetContactByID(const tstring &rsFromID, const tstring &rsToID) const;
+
+private:
+ void FillFormat(TFormatSpecificators &) const override;
+ void RefreshCurrencyRates(TContacts &anContacts) override;
+ void ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE &odp) override;
+
+ MCONTACT ImportContact(const TiXmlNode*) override;
+ tstring FormatSymbol(MCONTACT hContact, wchar_t c, int nWidth) const override;
+};