summaryrefslogtreecommitdiff
path: root/plugins/MirFox/src/MirandaUtils.h
diff options
context:
space:
mode:
authorSzymon Tokarz <wsx22@o2.pl>2013-05-27 22:29:01 +0000
committerSzymon Tokarz <wsx22@o2.pl>2013-05-27 22:29:01 +0000
commitc628a13d98fde8d2555cc6fa8628e0b575021bd4 (patch)
treef25e89f902c0ac82c8f138badbca7f29d331ba18 /plugins/MirFox/src/MirandaUtils.h
parent2f2175b11692b8561fd1018161a62685910d08b0 (diff)
MirFox plugin for Miranda NG added
Version 0.5.0.0 Compatible Firefox addon is now available at: https://addons.mozilla.org/pl/firefox/addon/mirfox/versions/0.5.0.0 or http://wsx22.xpdev-hosted.com/ git-svn-id: http://svn.miranda-ng.org/main/trunk@4826 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirFox/src/MirandaUtils.h')
-rw-r--r--plugins/MirFox/src/MirandaUtils.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/plugins/MirFox/src/MirandaUtils.h b/plugins/MirFox/src/MirandaUtils.h
new file mode 100644
index 0000000000..673a4495eb
--- /dev/null
+++ b/plugins/MirFox/src/MirandaUtils.h
@@ -0,0 +1,125 @@
+#ifndef _MIRANDAUTILS_INC
+#define _MIRANDAUTILS_INC
+
+#include "MirfoxData.h"
+
+
+
+class MirandaUtils;
+
+
+struct ActionThreadArgStruct {
+ wchar_t* userActionSelection;
+ HANDLE targetHandle;
+ char* accountSzModuleName;
+ char userActionType;
+ char menuItemType;
+ char userButton;
+ MirandaUtils* instancePtr;
+ MirfoxData* mirfoxDataPtr;
+};
+
+
+
+
+class MirandaUtils
+{
+
+public:
+
+ static MirandaUtils *
+ getInstance()
+ {
+ if (m_pOnlyOneInstance == NULL) {
+ if (m_pOnlyOneInstance == NULL) {
+ m_pOnlyOneInstance = new MirandaUtils();
+ }
+ }
+ return m_pOnlyOneInstance;
+ }
+
+
+ void netlibRegister(void);
+ void netlibUnregister(void);
+ void netlibLog_int(const wchar_t* szText);
+ static void netlibLog(const wchar_t* szText);
+
+
+ std::wstring& getProfileName();
+
+ std::wstring& getDisplayName();
+
+ //description at MirandaUtils.cpp
+ TCHAR* mfTranslate(const TCHAR* msgCode, TCHAR* msgDefault);
+
+ void mfTranslateControl(HWND parentWindowHwnd, long controlId, const TCHAR* msgCode, TCHAR* msgDefault);
+
+ static void userActionThread(void* threadArg);
+
+ static int onProtoAck(WPARAM wParam, LPARAM lParam);
+
+ void translateOldDBNames();
+
+ struct OnHookOpenMvStruct {
+ HANDLE targetHandle;
+ std::wstring* msgBuffer;
+ };
+
+ static int on_hook_OpenMW(WPARAM wParam, LPARAM lParam);
+
+
+private:
+
+
+ static MirandaUtils * m_pOnlyOneInstance;
+
+ // private constructor
+ MirandaUtils();
+
+
+
+
+ void sendMessageToContact(ActionThreadArgStruct* args);
+
+ void sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_MODE mode);
+
+ int getMirandaSendModeFlag(char* targetHandleSzProto);
+
+ HANDLE sendMessageMiranda(HANDLE hContact, int mirandaSendModeFlag, char* msgBuffer);
+
+ void addMessageToDB(HANDLE hContact, int mirandaSendModeFlag, char* msgBuffer, std::size_t bufSize, char* targetHandleSzProto);
+
+ void setStatusOnAccount(ActionThreadArgStruct* args);
+
+ void onProtoAckOnInstance(ACKDATA* ack);
+
+ static void ForceForegroundWindow(HWND hWnd);
+
+
+ HANDLE netlibHandle;
+
+ std::wstring profileName;
+ std::wstring displayName;
+
+
+
+ typedef struct {
+ const char* szModule;
+ HANDLE hContact;
+ int result;
+ const char* errorDesc;
+ } MIRFOXACKDATA;
+
+ std::map<HANDLE, MIRFOXACKDATA*> ackMap;
+ std::map<HANDLE, MIRFOXACKDATA*>::iterator ackMapIt;
+ CRITICAL_SECTION ackMapCs;
+
+
+ MFLogger* logger;
+
+
+};
+
+
+
+#endif //#IFNDEF _MIRANDAUTILS_INC