summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src/TooltipNotify.h
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-05-17 17:37:22 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-05-17 17:37:22 +0000
commit78d71d2cad6f243c6ff31d41380b8c5b58407de5 (patch)
treed0c05983b315352c5e66d23420da4b8fd8b5aff4 /plugins/TooltipNotify/src/TooltipNotify.h
parenta9e8daee448c229aa3f8ded0c5f5c0fe7aa42529 (diff)
added some plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@20 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TooltipNotify/src/TooltipNotify.h')
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.h143
1 files changed, 143 insertions, 0 deletions
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h
new file mode 100644
index 0000000000..5e17597dd6
--- /dev/null
+++ b/plugins/TooltipNotify/src/TooltipNotify.h
@@ -0,0 +1,143 @@
+// TooltipNotify.h: interface for the CTooltipNotify class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+class CTooltip;
+
+class CTooltipNotify
+{
+private:
+ struct STooltipData;
+
+public:
+ CTooltipNotify(HINSTANCE hinstDLL);
+ virtual ~CTooltipNotify();
+
+ // exceptions
+ class EAlreadyExists {};
+
+ BOOL EndNotify(STooltipData* pTooltipData);
+ VOID EndNotifyAll();
+ CTooltip *BeginNotify(STooltipData *pTooltipData);
+ VOID OnTooltipDblClicked(CTooltip *pTooltip);
+ BOOL OnTooltipBeginMove(CTooltip *pTooltip);
+ VOID OnTooltipEndMove(CTooltip *pTooltip);
+ int InitializeOptions(WPARAM wParam, LPARAM lParam);
+ int ContactSettingChanged(WPARAM wParam, LPARAM lParam);
+ int ProtoAck(WPARAM wParam, LPARAM lParam);
+ int ModulesLoaded(WPARAM wParam,LPARAM lParam);
+ int ProtoContactIsTyping(WPARAM wParam, LPARAM lParam);
+
+ static CTooltipNotify *GetObjInstance() { return s_pInstance; }
+ HINSTANCE GetDllInstance() const { return m_hDllInstance; }
+
+private:
+ // prohibit copying
+ CTooltipNotify(const CTooltipNotify& rhs);
+ CTooltipNotify& operator= (const CTooltipNotify& rhs);
+
+private:
+ static CTooltipNotify *s_pInstance;
+ static const char *s_szModuleNameOld;
+ static const char *s_szModuleName;
+
+ const HINSTANCE m_hDllInstance;
+ const BOOL m_bNt50;
+
+ struct SOptions {
+ BYTE bFirstRun;
+ BYTE bOffline;
+ BYTE bOnline;
+ BYTE bOther;
+ BYTE bTyping;
+ BYTE bIdle;
+ BYTE bConjSOLN;
+ BYTE bX2;
+ BYTE bAutoPos;
+ BYTE bBallonTip;
+ BYTE bTransp;
+ BYTE bTranspInput;
+ BYTE bAlpha;
+ BYTE bLDblClick;
+ BYTE bPrefixProto;
+ WORD wDuration;
+ WORD wXPos;
+ WORD wYPos;
+ WORD wStartupDelay;
+ BYTE bIgnoreNew;
+ BYTE bIgnoreUnknown;
+ } m_sOptions;
+
+ struct STooltipData {
+ CTooltip *pTooltip;
+ UINT_PTR idTimer;
+ UINT uiTimeout;
+ HANDLE hContact;
+ int iStatus;
+ };
+
+ struct ProtoData {
+ const char* proto;
+ UINT_PTR timerId;
+ };
+
+ typedef std::vector<STooltipData*> TooltipsList;
+ typedef TooltipsList::iterator TooltipsListIter;
+ typedef TooltipsList::reverse_iterator TooltipsListRevIter;
+ TooltipsList m_TooltipsList;
+
+ typedef std::vector<ProtoData> MapTimerIdProto;
+ typedef MapTimerIdProto::iterator MapTimerIdProtoIter;
+ MapTimerIdProto m_mapTimerIdProto;
+
+ MapTimerIdProtoIter FindProtoByTimer(UINT idTimer);
+ template<typename T> TooltipsListIter FindBy(T STooltipData::* m, const T& value);
+ TCHAR *StatusToString(int iStatus, TCHAR *szStatus, int iBufSize);
+ TCHAR *MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *szString, int iBufSize);
+ VOID MigrateSettings();
+ void RegisterFonts();
+ void GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg);
+ void ResetCList(HWND hwndDlg);
+ void LoadList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown);
+ void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown);
+ VOID LoadSettings();
+ VOID SaveSettings();
+ VOID ValidateSettings();
+ VOID ReadSettingsFromDlg(HWND hDlg);
+ VOID WriteSettingsToDlg(HWND hDlg);
+
+ VOID SuspendTimer(CTooltip *pTooltip);
+ VOID ResumeTimer(CTooltip *pTooltip);
+ VOID OnConnectionTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
+ VOID OnTooltipTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
+
+ // Dialog procedures
+ BOOL OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+ BOOL ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+ BOOL ContactsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+ static VOID CALLBACK ConnectionTimerProcWrapper(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+ {
+ CTooltipNotify::GetObjInstance()->OnConnectionTimer(hwnd, uMsg, idEvent, dwTime);
+ }
+ static VOID CALLBACK TooltipTimerProcWrapper(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+ {
+ CTooltipNotify::GetObjInstance()->OnTooltipTimer(hwnd, uMsg, idEvent, dwTime);
+ }
+ static BOOL CALLBACK OptionsDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+ {
+ return CTooltipNotify::GetObjInstance()->OptionsDlgProc(hDlg, msg, wParam, lParam);
+ }
+ static BOOL CALLBACK ProtosDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+ {
+ return CTooltipNotify::GetObjInstance()->ProtosDlgProc(hDlg, msg, wParam, lParam);
+ }
+
+ static BOOL CALLBACK ContactsDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+ {
+ return CTooltipNotify::GetObjInstance()->ContactsDlgProc(hDlg, msg, wParam, lParam);
+ }
+
+};