summaryrefslogtreecommitdiff
path: root/plugins/Quotes/src/QuotesProviderCurrencyConverter.h
blob: c6138756b3d37f3e3d73b1c725dd29d301aac9ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
};