summaryrefslogtreecommitdiff
path: root/plugins/CurrencyRates/src/QuotesProviderCurrencyConverter.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CurrencyRates/src/QuotesProviderCurrencyConverter.h')
-rw-r--r--plugins/CurrencyRates/src/QuotesProviderCurrencyConverter.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/CurrencyRates/src/QuotesProviderCurrencyConverter.h b/plugins/CurrencyRates/src/QuotesProviderCurrencyConverter.h
new file mode 100644
index 0000000000..c6138756b3
--- /dev/null
+++ b/plugins/CurrencyRates/src/QuotesProviderCurrencyConverter.h
@@ -0,0 +1,29 @@
+#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 CQuotesProviderCurrencyConverter : public CQuotesProviderBase
+{
+public:
+ using TRateInfo = std::pair<CQuote, CQuote>;
+
+public:
+ CQuotesProviderCurrencyConverter();
+ ~CQuotesProviderCurrencyConverter();
+
+ double Convert(double dAmount, const CQuote& from, const CQuote& 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:
+ virtual void Accept(CQuotesProviderVisitor& visitor)const override;
+ virtual void ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE& odp)override;
+ virtual void RefreshQuotes(TContracts& anContacts)override;
+};
+