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/SettingsDlg.h | |
parent | dd7d9954042254e66e3bbbec7195c6be8b1a0663 (diff) |
all protocols (even virtual ones) moved to the Protocols folder
Diffstat (limited to 'protocols/CurrencyRates/src/SettingsDlg.h')
-rw-r--r-- | protocols/CurrencyRates/src/SettingsDlg.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/protocols/CurrencyRates/src/SettingsDlg.h b/protocols/CurrencyRates/src/SettingsDlg.h new file mode 100644 index 0000000000..b6b49b97bd --- /dev/null +++ b/protocols/CurrencyRates/src/SettingsDlg.h @@ -0,0 +1,116 @@ +#ifndef __E211E4D9_383C_43BE_A787_7EF1D585B90D_SettingsDlg_h__ +#define __E211E4D9_383C_43BE_A787_7EF1D585B90D_SettingsDlg_h__ + +class CPopupSettings +{ +public: + enum EColourMode + { + colourDefault, + colourUserDefined, + }; + + enum EDelayMode + { + delayFromPopup, + delayCustom, + delayPermanent + }; + +public: + CPopupSettings(); + + static COLORREF GetDefColourBk(); + static COLORREF GetDefColourText(); + + void InitForContact(MCONTACT hContact); + void SaveForContact(MCONTACT hContact) const; + + EColourMode GetColourMode() const; + void SetColourMode(EColourMode nMode); + + COLORREF GetColourBk() const; + void SetColourBk(COLORREF rgb); + + COLORREF GetColourText() const; + void SetColourText(COLORREF rgb); + + EDelayMode GetDelayMode() const; + void SetDelayMode(EDelayMode nMode); + + WORD GetDelayTimeout() const; + void SetDelayTimeout(WORD delay); + + bool GetHistoryFlag() const; + void SetHistoryFlag(bool flag); + +private: + EColourMode m_modeColour; + EDelayMode m_modeDelay; + COLORREF m_rgbBkg; + COLORREF m_rgbText; + WORD m_wDelay; + bool m_bUseHistory; +}; + + +class CAdvProviderSettings +{ +public: + CAdvProviderSettings(const ICurrencyRatesProvider *pCurrencyRatesProvider); + ~CAdvProviderSettings(); + + void SaveToDb() const; + + const ICurrencyRatesProvider* GetProviderPtr() const; + + WORD GetLogMode() const; + void SetLogMode(WORD wMode); + tstring GetHistoryFormat() const; + void SetHistoryFormat(const tstring& rsFormat); + bool GetHistoryOnlyChangedFlag() const; + void SetHistoryOnlyChangedFlag(bool bMode); + + tstring GetLogFileName() const; + void SetLogFileName(const tstring& rsFile); + tstring GetLogFormat() const; + void SetLogFormat(const tstring& rsFormat); + bool GetLogOnlyChangedFlag() const; + void SetLogOnlyChangedFlag(bool bMode); + + const tstring& GetPopupFormat() const; + void SetPopupFormat(const tstring& val); + + bool GetShowPopupIfValueChangedFlag() const; + void SetShowPopupIfValueChangedFlag(bool val); + + CPopupSettings* GetPopupSettingsPtr() const; + +private: + const ICurrencyRatesProvider *m_pCurrencyRatesProvider; + WORD m_wLogMode; + tstring m_sFormatHistory; + bool m_bIsOnlyChangedHistory; + tstring m_sLogFileName; + tstring m_sFormatLogFile; + bool m_bIsOnlyChangedLogFile; + tstring m_sPopupFormat; + bool m_bShowPopupIfValueChanged; + mutable CPopupSettings* m_pPopupSettings; +}; + +void ShowSettingsDlg(MCONTACT hContact); +bool ShowSettingsDlg(HWND hWndParent, CAdvProviderSettings* pAdvSettings); + +enum +{ + glfnResolveCurrencyRateName = 0x0001, + glfnResolveUserProfile = 0x0002, + glfnResolveAll = glfnResolveCurrencyRateName | glfnResolveUserProfile, +}; +tstring GenerateLogFileName(const tstring& rsLogFilePattern, const tstring& rsCurrencyRateSymbol, int nFlags = glfnResolveAll); +tstring GetContactLogFileName(MCONTACT hContact); +tstring GetContactName(MCONTACT hContact); + +#endif //__E211E4D9_383C_43BE_A787_7EF1D585B90D_SettingsDlg_h__ + |