diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-02 12:32:44 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-02 12:32:55 +0300 |
commit | 931a7dc1ac0dbc7e6c1083583ced915e572f5b47 (patch) | |
tree | 9fe9a6448d44030e26aa7107ce16044ed413e0d0 /protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h | |
parent | dd7d9954042254e66e3bbbec7195c6be8b1a0663 (diff) |
all protocols (even virtual ones) moved to the Protocols folder
Diffstat (limited to 'protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h')
-rw-r--r-- | protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.h | 32 |
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; +}; |