diff options
Diffstat (limited to 'Plugins/quickcontacts')
24 files changed, 4055 insertions, 0 deletions
diff --git a/Plugins/quickcontacts/Docs/langpack_quickcontacts.txt b/Plugins/quickcontacts/Docs/langpack_quickcontacts.txt new file mode 100644 index 0000000..bb3ce09 --- /dev/null +++ b/Plugins/quickcontacts/Docs/langpack_quickcontacts.txt @@ -0,0 +1,40 @@ +; Quick Contacts
+; Author: micron-x, Pescuma
+; http://pescuma.org/miranda/quickcontacts
+
+[Quick Contacts]
+
+; Hotkey description
+[Open dialog]
+[Open Quick Contacts dialog]
+
+; Menu item
+[Quick Contacts...]
+
+; Main dialog
+[Enter Username:]
+[Show all contacts]
+
+; Tooltips
+[Send message]
+[Make a voice call]
+[Send file]
+[Send URL]
+[Open userinfo]
+[Open history]
+[Open contact menu]
+
+; Options
+[Last Sent]
+[Enable last-sent-to]
+[recognize all messages sent]
+[recognize messages sent with hotkey only]
+
+[Contacts]
+[Show offline contacts on these protocols:]
+[But hide them if protocol is offline]
+[Append group name to contact name]
+[But show it as a column ...]
+[... on left side of name]
+[Hide subcontacts]
+[But keep subcontacts of protocols in above list if meta is hidden]
diff --git a/Plugins/quickcontacts/Docs/quickcontacts.png b/Plugins/quickcontacts/Docs/quickcontacts.png Binary files differnew file mode 100644 index 0000000..0dba1b7 --- /dev/null +++ b/Plugins/quickcontacts/Docs/quickcontacts.png diff --git a/Plugins/quickcontacts/Docs/quickcontacts_changelog.txt b/Plugins/quickcontacts/Docs/quickcontacts_changelog.txt new file mode 100644 index 0000000..bc09470 --- /dev/null +++ b/Plugins/quickcontacts/Docs/quickcontacts_changelog.txt @@ -0,0 +1,75 @@ +Quick Contacts
+
+Changelog:
+
+. 1.0.0.0
+ * Fix for group names (closes issue #83)
+ + Handle metacontacts off (closes issue #61)
+ + Show account name
+ * Removed spaces from frame names in options
+
+. 0.0.3.1
+ + Number of contacts is not limited anymore
+
+. 0.0.3.0
+ + Added support for hotkeys module in 0.8 (some texts changed in langpack)
+
+. 0.0.2.9
+ + Added contact icon
+ * Fix when comparing unicode strings
+
+. 0.0.2.8
+ + Added VoiceService support
+
+. 0.0.2.7
+ + Added support for Miranda 0.8
+
+. 0.0.2.6
+ * Fix for crash on exit
+
+. 0.0.2.5
+ + Added contact menu buttom
+
+. 0.0.2.4
+ * Only to fix upload of wrong file to FL
+
+. 0.0.2.3
+ + Added support for Hotkeys+
+ * Now it will register to all hotkey services if found
+
+. 0.0.2.2
+ * Fix for icons
+ * Fix for backspace
+ * -pv- fix
+
+. 0.0.2.1
+ * Try to fix error reported
+ + Support of Hotkey service (if it exists, will be used instead of HotKeys2)
+ + Support for Magnetic windows
+
+. 0.0.2.0
+ - First version in FL
+ * Fix for more than one contact wth same name
+ * Fix to always open the dialog inside a monitor
+
+. 0.0.1.4
+ + Option to show group as a column
+ + Act as double click when pressing enter in the combo
+ + Disable buttons that protocol do not allow
+ * Bug fixes
+
+. 0.0.1.3
+ + Changes in options
+ + Added unicode release
+
+. 0.0.1.2
+ + Option to append group name to contact name
+
+. 0.0.1.1
+ + Checkbox in main dialog works
+ + Option to hide contacts from offline protocols
+ * Fix in getting metacontact status
+
+. 0.0.1.0
+ First verion based on Hotkey plugin +3.2.1.0
\ No newline at end of file diff --git a/Plugins/quickcontacts/Docs/quickcontacts_readme.txt b/Plugins/quickcontacts/Docs/quickcontacts_readme.txt new file mode 100644 index 0000000..b7d8b5b --- /dev/null +++ b/Plugins/quickcontacts/Docs/quickcontacts_readme.txt @@ -0,0 +1,22 @@ +Quick Contacts plugin
+---------------------
+
+On pressing an user defined hotkey an dialog pops up where you can enter a contacts name or select it from a combobox and send it messages/files/urls an look at his details.
+
+This is a mod of the Hotkey plugin by micron-x
+
+To be able to set the hotkey you need clist_modern (or some other that implements Hotkeys2), Hotkeys+ or HotkeyService.
+
+Available hotkeys:
+- Ctrl-V: Make a voice call
+- Ctrl-F: Send file
+- Ctrl-U: Send URL
+- Ctrl-I: Show userinfo
+- Ctrl-H: Open history
+- Ctrl-M: Open contact menu
+- User defined: Open hotkey dialog
+In Miranda 0.8 all this keys can be configured in options.
+
+To report bugs/make suggestions, go to the forum thread: http://forums.miranda-im.org/showthread.php?t=8797
+
+To report bugs, please create a attache dump using the pdb file (you need to copy to pdb to the same place the dll is)
\ No newline at end of file diff --git a/Plugins/quickcontacts/Docs/quickcontacts_version.txt b/Plugins/quickcontacts/Docs/quickcontacts_version.txt new file mode 100644 index 0000000..15e0482 --- /dev/null +++ b/Plugins/quickcontacts/Docs/quickcontacts_version.txt @@ -0,0 +1 @@ +Quick Contacts 1.0.0.0
\ No newline at end of file diff --git a/Plugins/quickcontacts/ZIP/doit.bat b/Plugins/quickcontacts/ZIP/doit.bat new file mode 100644 index 0000000..181368f --- /dev/null +++ b/Plugins/quickcontacts/ZIP/doit.bat @@ -0,0 +1,102 @@ +@echo off
+
+rem Batch file to build and upload files
+rem
+rem TODO: Integration with FL
+
+set name=quickcontacts
+
+rem To upload, this var must be set here or in other batch
+rem set ftp=ftp://<user>:<password>@<ftp>/<path>
+
+echo Building %name% ...
+
+msdev ..\%name%.dsp /MAKE "%name% - Win32 Release" /REBUILD
+msdev ..\%name%.dsp /MAKE "%name% - Win32 Unicode Release" /REBUILD
+
+echo Generating files for %name% ...
+
+del *.zip
+del *.dll
+copy ..\Release\%name%.pdb
+copy ..\Unicode_Release\%name%W.pdb
+copy ..\Docs\%name%_changelog.txt
+copy ..\Docs\%name%_version.txt
+copy ..\Docs\%name%_readme.txt
+mkdir Docs
+cd Docs
+del /Q *.*
+copy ..\..\Docs\langpack_%name%.txt
+copy ..\..\Docs\%name%_readme.txt
+copy ..\..\m_%name%.h
+cd ..
+mkdir src
+cd src
+del /Q *.*
+copy ..\..\*.h
+copy ..\..\*.cpp
+copy ..\..\*.
+copy ..\..\*.rc
+copy ..\..\*.dsp
+copy ..\..\*.dsw
+mkdir Docs
+cd Docs
+del /Q *.*
+copy ..\..\..\Docs\*.*
+cd ..
+cd ..
+
+mkdir Plugins
+cd Plugins
+del /Q *.*
+copy ..\..\..\..\bin\release\Plugins\%name%.dll
+cd ..
+
+"C:\Program Files\Filzip\Filzip.exe" -a -rp %name%.zip Plugins Docs
+
+cd Plugins
+del /Q *.*
+copy "..\..\..\..\bin\release unicode\Plugins\%name%W.dll"
+cd ..
+
+"C:\Program Files\Filzip\Filzip.exe" -a -rp %name%W.zip Plugins Docs
+
+"C:\Program Files\Filzip\Filzip.exe" -a -rp %name%.pdb.zip %name%.pdb
+"C:\Program Files\Filzip\Filzip.exe" -a -rp %name%W.pdb.zip %name%W.pdb
+"C:\Program Files\Filzip\Filzip.exe" -a -rp %name%_src.zip src\*.*
+
+del *.dll
+del *.pdb
+cd Plugins
+del /Q *.*
+cd ..
+rmdir Plugins
+cd Docs
+del /Q *.*
+cd ..
+rmdir Docs
+cd src
+del /Q *.*
+cd Docs
+del /Q *.*
+cd ..
+rmdir Docs
+cd ..
+rmdir src
+
+if "%ftp%"=="" GOTO END
+
+echo Going to upload files...
+pause
+
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%.zip %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%W.zip %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%.pdb.zip %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%W.pdb.zip %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%_changelog.txt %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%_readme.txt %ftp% -overwrite -close
+"C:\Program Files\FileZilla\FileZilla.exe" -u .\%name%_version.txt %ftp% -overwrite -close
+
+:END
+
+echo Done.
diff --git a/Plugins/quickcontacts/commons.h b/Plugins/quickcontacts/commons.h new file mode 100644 index 0000000..2a8c9e4 --- /dev/null +++ b/Plugins/quickcontacts/commons.h @@ -0,0 +1,111 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+Based on work (C) Heiko Schillinger
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __COMMONS_H__
+# define __COMMONS_H__
+
+
+#define WINVER 0x0500
+#include <windows.h>
+#include <commctrl.h>
+#include <stdio.h>
+#include <tchar.h>
+
+
+// Miranda headers
+#define MIRANDA_VER 0x0700
+#include <newpluginapi.h>
+#include <m_system.h>
+#include <m_system_cpp.h>
+#include <m_protocols.h>
+#include <m_protosvc.h>
+#include <m_clist.h>
+#include <m_ignore.h>
+#include <m_contacts.h>
+#include <m_message.h>
+#include <m_userinfo.h>
+#include <m_skin.h>
+#include <m_langpack.h>
+#include <m_database.h>
+#include <m_options.h>
+#include <m_utils.h>
+#include <m_button.h>
+#include <m_file.h>
+#include <m_url.h>
+#include <m_history.h>
+#include <m_updater.h>
+#include <m_metacontacts.h>
+#include <m_MagneticWindows.h>
+#include <m_hotkeysservice.h>
+#include <m_hotkeysplus.h>
+#include <m_popup.h>
+#include <m_voice.h>
+#include <m_voiceservice.h>
+#include <m_icolib.h>
+#include <m_hotkeys.h>
+
+#include "../utils/mir_memory.h"
+#include "../utils/mir_options.h"
+#include "../utils/utf8_helpers.h"
+
+#include "resource.h"
+#include "m_quickcontacts.h"
+#include "options.h"
+
+
+#define MODULE_NAME "QuickContacts"
+
+
+// Global Variables
+extern HINSTANCE hInst;
+extern PLUGINLINK *pluginLink;
+extern char *metacontacts_proto;
+
+
+#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]) )
+
+
+
+
+
+// Copied from "../modernb/clc.h" ///////////////////////////////////////////////////////////////////
+
+//add a new hotkey so it has a default and can be changed in the options dialog
+//wParam=0
+//lParam=(LPARAM)(SKINHOTKEYDESC*)ssd;
+//returns 0 on success, nonzero otherwise
+
+typedef struct {
+ int cbSize;
+ const char *pszName; //name to refer to sound when playing and in db
+ const char *pszDescription; //description for options dialog
+ const char *pszSection; //section name used to group sounds (NULL is acceptable)
+ const char *pszService; //Service to call when HotKey Pressed
+
+ int DefHotKey; //default hot key for action
+} SKINHOTKEYDESCEX;
+
+#define MS_SKIN_ADDHOTKEY "Skin/HotKeys/AddNew"
+#define MS_SKIN_PLAYHOTKEY "Skin/HotKeys/Run"
+
+
+
+#endif // __COMMONS_H__
diff --git a/Plugins/quickcontacts/m_quickcontacts.h b/Plugins/quickcontacts/m_quickcontacts.h new file mode 100644 index 0000000..5f8acb3 --- /dev/null +++ b/Plugins/quickcontacts/m_quickcontacts.h @@ -0,0 +1,39 @@ +/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_QUICKCONTACTS_H__
+# define __M_QUICKCONTACTS_H__
+
+
+#define MIID_QUICKCONTACTS { 0x5e638aa7, 0x4989, 0x4dbf, { 0x94, 0xa, 0x1e, 0xcb, 0x6c, 0x52, 0xcc, 0x52 } }
+
+
+/*
+Show the dialog to select the contact
+
+wParam: ignored
+lParam: ignored
+*/
+#define MS_QC_SHOW_DIALOG "QuickContacts/ShowDialog"
+
+
+
+
+#endif // __M_QUICKCONTACTS_H__
diff --git a/Plugins/quickcontacts/options.cpp b/Plugins/quickcontacts/options.cpp new file mode 100644 index 0000000..e74bee2 --- /dev/null +++ b/Plugins/quickcontacts/options.cpp @@ -0,0 +1,164 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+Based on work (C) Heiko Schillinger
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include "options.h"
+
+
+
+// Prototypes /////////////////////////////////////////////////////////////////////////////////////
+
+HANDLE hOptHook = NULL;
+
+
+Options opts;
+
+static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+
+
+// Functions //////////////////////////////////////////////////////////////////////////////////////
+
+
+// Initializations needed by options
+void LoadOptions()
+{
+ opts.last_sent_enable = DBGetContactSettingByte(NULL, MODULE_NAME, "EnableLastSentTo", TRUE);
+ opts.last_sent_msg_type = DBGetContactSettingWord(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL);
+ opts.hide_from_offline_proto = DBGetContactSettingByte(NULL, MODULE_NAME, "HideOfflineFromOfflineProto", TRUE);
+ opts.group_append = DBGetContactSettingByte(NULL, MODULE_NAME, "AppendGroupName", FALSE);
+ opts.group_column = DBGetContactSettingByte(NULL, MODULE_NAME, "GroupColumn", FALSE);
+ opts.group_column_left = DBGetContactSettingByte(NULL, MODULE_NAME, "GroupColumnLeft", FALSE);
+ opts.hide_subcontacts = DBGetContactSettingByte(NULL, MODULE_NAME, "HideSubcontacts", TRUE);
+ opts.keep_subcontacts_from_offline = DBGetContactSettingByte(NULL, MODULE_NAME, "KeepSubcontactsFromOffline", TRUE);
+}
+
+int InitOptionsCallback(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+
+ ZeroMemory(&odp,sizeof(odp));
+ odp.cbSize=sizeof(odp);
+ odp.position=0;
+ odp.hInstance=hInst;
+ odp.ptszGroup = TranslateT("Plugins");
+ odp.ptszTitle = TranslateT("Quick Contacts");
+ odp.pfnDlgProc = OptionsDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
+ odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY | ODPF_TCHAR;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ return 0;
+}
+
+
+void InitOptions()
+{
+ LoadOptions();
+
+ hOptHook = HookEvent(ME_OPT_INITIALISE, InitOptionsCallback);
+}
+
+// Deinitializations needed by options
+void DeInitOptions()
+{
+ UnhookEvent(hOptHook);
+}
+
+// Options page
+
+static OptPageControl controls[] = {
+ { NULL, CONTROL_CHECKBOX, IDC_LASTSENTTO, "EnableLastSentTo", (BYTE) TRUE },
+ { NULL, CONTROL_RADIO, IDC_GLOBAL, "MsgTypeRec", (WORD) TYPE_GLOBAL, TYPE_GLOBAL },
+ { NULL, CONTROL_RADIO, IDC_LOCAL, "MsgTypeRec", (WORD) TYPE_GLOBAL, TYPE_LOCAL },
+ { NULL, CONTROL_PROTOCOL_LIST, IDC_PROTOCOLS, "ShowOffline%s", (BYTE) FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_HIDE_OFFLINE, "HideOfflineFromOfflineProto", (BYTE) TRUE },
+ { NULL, CONTROL_CHECKBOX, IDC_APPEND_GROUP, "AppendGroupName", (BYTE) FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_GROUP_COLUMN, "GroupColumn", (BYTE) FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_GROUP_LEFT, "GroupColumnLeft", (BYTE) FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_SUBCONTACTS, "HideSubcontacts", (BYTE) TRUE },
+ { NULL, CONTROL_CHECKBOX, IDC_KEEP_OFFLINE, "KeepSubcontactsFromOffline", (BYTE) TRUE }
+};
+
+static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ int ret = SaveOptsDlgProc(controls, MAX_REGS(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_LASTSENTTO);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GLOBAL), enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOCAL), enabled);
+
+ enabled = IsDlgButtonChecked(hwndDlg, IDC_SUBCONTACTS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_KEEP_OFFLINE), enabled);
+
+ if (metacontacts_proto == NULL)
+ {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SUBCONTACTS), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_KEEP_OFFLINE), SW_HIDE);
+ }
+
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ if(LOWORD(wParam) == IDC_LASTSENTTO)
+ {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_LASTSENTTO);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GLOBAL), enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOCAL), enabled);
+ }
+
+ if(LOWORD(wParam) == IDC_SUBCONTACTS)
+ {
+ BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_SUBCONTACTS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_KEEP_OFFLINE), enabled);
+ }
+
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ {
+ LoadOptions();
+
+ return TRUE;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ return ret;
+}
+
diff --git a/Plugins/quickcontacts/options.h b/Plugins/quickcontacts/options.h new file mode 100644 index 0000000..1036261 --- /dev/null +++ b/Plugins/quickcontacts/options.h @@ -0,0 +1,65 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+Based on work (C) Heiko Schillinger
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __OPTIONS_H__
+# define __OPTIONS_H__
+
+
+#include "commons.h"
+
+#include <windows.h>
+
+
+#define TYPE_GLOBAL 0
+#define TYPE_LOCAL 1
+
+typedef struct
+{
+ BOOL last_sent_enable;
+ int last_sent_msg_type;
+ BOOL hide_from_offline_proto;
+ BOOL hide_subcontacts;
+ BOOL keep_subcontacts_from_offline;
+ BOOL group_append;
+ BOOL group_column;
+ BOOL group_column_left;
+
+ int num_protos;
+} Options;
+
+extern Options opts;
+
+
+// Initializations needed by options
+void InitOptions();
+
+// Deinitializations needed by options
+void DeInitOptions();
+
+
+// Loads the options from DB
+// It don't need to be called, except in some rare cases
+void LoadOptions();
+
+
+
+
+#endif // __OPTIONS_H__
diff --git a/Plugins/quickcontacts/quickcontacts.cpp b/Plugins/quickcontacts/quickcontacts.cpp new file mode 100644 index 0000000..0ad9c76 --- /dev/null +++ b/Plugins/quickcontacts/quickcontacts.cpp @@ -0,0 +1,1379 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+Based on work (C) Heiko Schillinger
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include "commons.h"
+
+
+// Prototypes ///////////////////////////////////////////////////////////////////////////
+
+
+PLUGININFOEX pluginInfo={
+ sizeof(PLUGININFOEX),
+#ifdef UNICODE
+ "Quick Contacts (Unicode)",
+#else
+ "Quick Contacts",
+#endif
+ PLUGIN_MAKE_VERSION(1,0,0,0),
+ "Open contact-specific windows by hotkey",
+ "Ricardo Pescuma Domenecci, Heiko Schillinger",
+ "pescuma@miranda-im.org",
+ "© 2007-2009 Ricardo Pescuma Domenecci",
+ "http://pescuma.org/miranda/quickcontacts",
+ UNICODE_AWARE,
+ 0, //doesn't replace anything built-in
+#ifdef UNICODE
+ { 0xc679e1c9, 0x7967, 0x40ce, { 0x8a, 0x40, 0x95, 0x5b, 0x51, 0xde, 0x64, 0x3b } } // {C679E1C9-7967-40ce-8A40-955B51DE643B}
+#else
+ { 0xd3cc7943, 0xff2e, 0x4c2a, { 0xb3, 0xac, 0x6c, 0xe9, 0xbc, 0x83, 0x18, 0x78 } } // {D3CC7943-FF2E-4c2a-B3AC-6CE9BC831878}
+#endif
+};
+
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+HIMAGELIST hIml;
+LIST_INTERFACE li;
+MM_INTERFACE mmi;
+UTF8_INTERFACE utfi;
+
+HANDLE hModulesLoaded = NULL;
+HANDLE hEventAdded = NULL;
+HANDLE hHotkeyPressed = NULL;
+
+long main_dialog_open = 0;
+HWND hwndMain = NULL;
+
+int ModulesLoaded(WPARAM wParam, LPARAM lParam);
+int EventAdded(WPARAM wparam, LPARAM lparam);
+int HotkeyPressed(WPARAM wParam, LPARAM lParam);
+int ShowDialog(WPARAM wParam,LPARAM lParam);
+void FreeContacts();
+
+int hksModule = 0;
+int hksAction = 0;
+
+BOOL hasNewHotkeyModule = FALSE;
+
+char *metacontacts_proto = NULL;
+
+#define IDC_ICO 12344
+
+
+// Functions ////////////////////////////////////////////////////////////////////////////
+
+
+extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+
+extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ pluginInfo.cbSize = sizeof(PLUGININFO);
+ return (PLUGININFO*) &pluginInfo;
+}
+
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ pluginInfo.cbSize = sizeof(PLUGININFOEX);
+ return &pluginInfo;
+}
+
+
+static const MUUID interfaces[] = { MIID_QUICKCONTACTS, MIID_LAST };
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+
+ mir_getMMI(&mmi);
+ mir_getUTFI(&utfi);
+ mir_getLI(&li);
+
+ CreateServiceFunction(MS_QC_SHOW_DIALOG, ShowDialog);
+
+ // hooks
+ hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ hEventAdded = HookEvent(ME_DB_EVENT_ADDED, EventAdded);
+
+ return 0;
+}
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ FreeContacts();
+
+ DeInitOptions();
+
+ UnhookEvent(hModulesLoaded);
+ UnhookEvent(hEventAdded);
+
+ return 0;
+}
+
+
+// Called when all the modules are loaded
+int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ InitOptions();
+
+ // add our modules to the KnownModules list
+ CallService("DBEditorpp/RegisterSingleModule", (WPARAM) MODULE_NAME, 0);
+
+ // updater plugin support
+ if(ServiceExists(MS_UPDATE_REGISTER))
+ {
+ Update upd = {0};
+ char szCurrentVersion[30];
+
+ upd.cbSize = sizeof(upd);
+ upd.szComponentName = pluginInfo.shortName;
+
+ upd.szUpdateURL = UPDATER_AUTOREGISTER;
+
+ upd.szBetaVersionURL = "http://pescuma.mirandaim.ru/miranda/quickcontacts_version.txt";
+ upd.szBetaChangelogURL = "http://pescuma.mirandaim.ru/miranda/quickcontacts#Changelog";
+ upd.pbBetaVersionPrefix = (BYTE *)"Quick Contacts ";
+ upd.cpbBetaVersionPrefix = strlen((char *)upd.pbBetaVersionPrefix);
+#ifdef UNICODE
+ upd.szBetaUpdateURL = "http://pescuma.mirandaim.ru/miranda/quickcontactsW.zip";
+#else
+ upd.szBetaUpdateURL = "http://pescuma.mirandaim.ru/miranda/quickcontacts.zip";
+#endif
+
+ upd.pbVersion = (BYTE *)CreateVersionStringPlugin((PLUGININFO*) &pluginInfo, szCurrentVersion);
+ upd.cpbVersion = strlen((char *)upd.pbVersion);
+
+ CallService(MS_UPDATE_REGISTER, 0, (LPARAM)&upd);
+ }
+
+ // Get number of protocols
+ int pcount;
+ PROTOCOLDESCRIPTOR** pdesc;
+
+ CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)(int*)&pcount,(LPARAM)(PROTOCOLDESCRIPTOR***)&pdesc);
+
+ opts.num_protos = 0;
+ for (int loop=0;loop<pcount;loop++)
+ {
+ if (pdesc[loop]->type==PROTOTYPE_PROTOCOL)
+ opts.num_protos++;
+ }
+
+ // Add hotkey to multiple services
+
+ if (ServiceExists(MS_HOTKEY_REGISTER))
+ {
+ hasNewHotkeyModule = TRUE;
+
+ HOTKEYDESC hkd = {0};
+ hkd.cbSize = sizeof(hkd);
+ hkd.pszName = Translate("Quick Contacts/Open dialog");
+ hkd.pszDescription = Translate("Open dialog");
+ hkd.pszSection = Translate("Quick Contacts");
+ hkd.pszService = MS_QC_SHOW_DIALOG;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_ALT, 'Q');
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.pszService = NULL;
+
+ hkd.lParam = HOTKEY_VOICE;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'V');
+ hkd.pszName = Translate("Quick Contacts/Voice");
+ hkd.pszDescription = Translate("Make a voice call");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.lParam = HOTKEY_FILE;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'F');
+ hkd.pszName = Translate("Quick Contacts/File");
+ hkd.pszDescription = Translate("Send file");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.lParam = HOTKEY_URL;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'U');
+ hkd.pszName = Translate("Quick Contacts/URL");
+ hkd.pszDescription = Translate("Send URL");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.lParam = HOTKEY_INFO;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'I');
+ hkd.pszName = Translate("Quick Contacts/Info");
+ hkd.pszDescription = Translate("Open userinfo");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.lParam = HOTKEY_HISTORY;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'H');
+ hkd.pszName = Translate("Quick Contacts/History");
+ hkd.pszDescription = Translate("Open history");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.lParam = HOTKEY_MENU;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'M');
+ hkd.pszName = Translate("Quick Contacts/Menu");
+ hkd.pszDescription = Translate("Open contact menu");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hkd.lParam = HOTKEY_ALL_CONTACTS;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'A');
+ hkd.pszName = Translate("Quick Contacts/All Contacts");
+ hkd.pszDescription = Translate("Show all contacts");
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+ }
+
+ hksModule = HKS_RegisterModule("Quick Contacts");
+ if (hksModule >= 0)
+ {
+ hksAction = HKS_RegisterAction(hksModule, "Open dialog", MOD_CONTROL | MOD_ALT | MOD_GLOBAL, 'Q', 0);
+
+ hHotkeyPressed = HookEvent(ME_HKS_KEY_PRESSED, HotkeyPressed);
+ }
+
+ if (ServiceExists(MS_SKIN_ADDHOTKEY))
+ {
+ SKINHOTKEYDESCEX hk = {0};
+ hk.cbSize = sizeof(hk);
+ hk.pszSection = Translate("Quick Contacts");
+ hk.pszName = Translate("Open dialog");
+ hk.pszDescription = Translate("Open dialog");
+ hk.pszService = MS_QC_SHOW_DIALOG;
+ hk.DefHotKey = 0;
+ CallService(MS_SKIN_ADDHOTKEY, 0, (LPARAM)&hk);
+ }
+
+ if (ServiceExists(MS_HOTKEYSPLUS_ADDKEY))
+ CallService(MS_HOTKEYSPLUS_ADDKEY, (WPARAM) MS_QC_SHOW_DIALOG, (LPARAM) "Open Quick Contacts dialog");
+
+ // Get the icons for the listbox
+ hIml = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
+
+ // Add menu item
+ CLISTMENUITEM mi;
+ ZeroMemory(&mi,sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 500100001;
+ mi.flags = 0;
+ mi.pszName = Translate("Quick Contacts...");
+ mi.pszService = MS_QC_SHOW_DIALOG;
+ CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+
+ if (ServiceExists(MS_MC_GETPROTOCOLNAME) && ServiceExists(MS_MC_GETMETACONTACT))
+ metacontacts_proto = (char *) CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
+
+ return 0;
+}
+
+
+// called when a message/file/url was sent
+// handle of contact is set as window-userdata
+int EventAdded(WPARAM wparam, LPARAM lparam)
+{
+ DBEVENTINFO dbei;
+
+ ZeroMemory(&dbei,sizeof(dbei));
+ dbei.cbSize=sizeof(dbei);
+ dbei.cbBlob=0;
+
+ CallService(MS_DB_EVENT_GET,lparam,(LPARAM)&dbei);
+
+ if( !(dbei.flags & DBEF_SENT)
+ || dbei.flags & DBEF_READ
+ || !DBGetContactSettingByte(NULL, MODULE_NAME, "EnableLastSentTo", 0)
+ || DBGetContactSettingWord(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
+ return 0;
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD)(HANDLE)wparam);
+ return 0;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+#define IDC_ENTER 2000 // Pseudo control to handle enter in the main window
+
+
+// array where the contacts are put into
+struct c_struct {
+ TCHAR szname[120];
+ TCHAR szgroup[50];
+ HANDLE hcontact;
+ TCHAR proto[20];
+
+ c_struct()
+ {
+ szname[0] = 0;
+ szgroup[0] = 0;
+ hcontact = 0;
+ proto[0] = 0;
+ }
+};
+
+LIST<c_struct> contacts(200);
+long max_proto_width;
+
+
+// Get the name the contact has in list
+// This was not made to be called by more than one thread!
+TCHAR tmp_list_name[120];
+
+TCHAR *GetListName(c_struct *cs)
+{
+ if (opts.group_append && cs->szgroup[0] != _T('\0'))
+ {
+ mir_sntprintf(tmp_list_name, MAX_REGS(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
+ return tmp_list_name;
+ }
+ else
+ {
+ return cs->szname;
+ }
+}
+
+
+int lstreq(TCHAR *a, TCHAR *b, size_t len = -1)
+{
+#ifdef UNICODE
+ a = CharLower(_tcsdup(a));
+ b = CharLower(_tcsdup(b));
+ int ret;
+ if (len > 0)
+ ret = _tcsncmp(a, b, len);
+ else
+ ret = _tcscmp(a, b);
+ free(a);
+ free(b);
+ return ret;
+#else
+ if (len > 0)
+ return _tcsnicmp(a, b, len);
+ else
+ return _tcsicmp(a, b);
+#endif
+}
+
+
+// simple sorting function to have
+// the contact array in alphabetical order
+void SortArray(void)
+{
+ int loop,doop;
+ c_struct *cs_temp;
+
+ SortedList *sl = (SortedList *) &contacts;
+ for(loop=0;loop<contacts.getCount();loop++)
+ {
+ for(doop=loop+1;doop<contacts.getCount();doop++)
+ {
+ int cmp = lstreq(contacts[loop]->szname,contacts[doop]->szname);
+ if (cmp > 0)
+ {
+ cs_temp=contacts[loop];
+ sl->items[loop]=contacts[doop];
+ sl->items[doop]=cs_temp;
+ }
+ else if (cmp == 0)
+ {
+ if(lstreq(contacts[loop]->proto, contacts[doop]->proto) > 0)
+ {
+ cs_temp=contacts[loop];
+ sl->items[loop]=contacts[doop];
+ sl->items[doop]=cs_temp;
+ }
+ }
+
+ }
+ }
+}
+
+
+int GetStatus(HANDLE hContact, char *proto = NULL)
+{
+ if (proto == NULL)
+ proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+
+ if (proto == NULL)
+ return ID_STATUS_OFFLINE;
+
+ return DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+}
+
+
+void FreeContacts()
+{
+ for (int i = contacts.getCount() - 1; i >= 0; i--)
+ {
+ delete contacts[i];
+ contacts.remove(i);
+ }
+}
+
+
+void LoadContacts(HWND hwndDlg, BOOL show_all)
+{
+ BOOL hasAccounts = ServiceExists(MS_PROTO_GETACCOUNT);
+ BOOL metacontactsEnabled = (metacontacts_proto != NULL
+ && DBGetContactSettingByte(0, metacontacts_proto, "Enabled", 1));
+
+ // Read last-sent-to contact from db and set handle as window-userdata
+ HANDLE hlastsent = (HANDLE)DBGetContactSettingDword(NULL, MODULE_NAME, "LastSentTo", -1);
+ SetWindowLong(hwndMain, GWL_USERDATA, (LONG)hlastsent);
+
+ // enumerate all contacts and write them to the array
+ // item data of listbox-strings is the array position
+ FreeContacts();
+ for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact != NULL;
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ char *pszProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if(pszProto != NULL)
+ {
+ // Get meta
+ HANDLE hMeta = NULL;
+ if (metacontactsEnabled)
+ {
+ if ((!show_all && opts.hide_subcontacts) || opts.group_append)
+ hMeta = (HANDLE) CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ }
+ else
+ {
+ if (metacontacts_proto != NULL && strcmp(metacontacts_proto, pszProto) == 0)
+ continue;
+ }
+
+
+ if (!show_all)
+ {
+ // Check if is offline and have to show
+ if (GetStatus(hContact, pszProto) <= ID_STATUS_OFFLINE)
+ {
+ // See if has to show
+ char setting[128];
+ mir_snprintf(setting, sizeof(setting), "ShowOffline%s", pszProto);
+
+ if (!DBGetContactSettingByte(NULL, MODULE_NAME, setting, FALSE))
+ continue;
+
+ // Check if proto offline
+ else if (opts.hide_from_offline_proto
+ && CallProtoService(pszProto, PS_GETSTATUS, 0, 0) <= ID_STATUS_OFFLINE)
+ continue;
+
+ }
+
+ // Check if is subcontact
+ if (opts.hide_subcontacts && hMeta != NULL)
+ {
+ if (!opts.keep_subcontacts_from_offline)
+ continue;
+
+ if (GetStatus(hMeta, metacontacts_proto) > ID_STATUS_OFFLINE)
+ {
+ continue;
+ }
+ else
+ {
+ char setting[128];
+ mir_snprintf(setting, sizeof(setting), "ShowOffline%s", metacontacts_proto);
+ if (DBGetContactSettingByte(NULL, MODULE_NAME, setting, FALSE))
+ continue;
+ }
+ }
+ }
+
+ // Add to list
+
+ // Get group
+ c_struct *contact = new c_struct();
+
+ if (opts.group_append)
+ {
+ DBVARIANT dbv;
+ if (DBGetContactSettingTString(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
+ {
+ if (dbv.ptszVal != NULL)
+ lstrcpyn(contact->szgroup, dbv.ptszVal, MAX_REGS(contact->szgroup));
+
+ DBFreeVariant(&dbv);
+ }
+ }
+
+ // Make contact name
+ TCHAR *tmp = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_TCHAR);
+ lstrcpyn(contact->szname, tmp, MAX_REGS(contact->szname));
+
+ PROTOACCOUNT *acc = (hasAccounts ? ProtoGetAccount(pszProto) : NULL);
+ if (acc != NULL)
+ {
+ lstrcpyn(contact->proto, acc->tszAccountName, MAX_REGS(contact->proto));
+ }
+ else
+ {
+ char szName[128];
+ CallProtoService(pszProto, PS_GETNAME, sizeof(szName), (LPARAM) szName);
+ lstrcpyn(contact->proto, CharToTchar(szName), MAX_REGS(contact->proto));
+ }
+
+ contact->hcontact = hContact;
+
+ contacts.insert(contact);
+ }
+ }
+
+ SortArray();
+
+ SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_RESETCONTENT, 0, 0);
+ for(int loop = 0; loop < contacts.getCount(); loop++)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETITEMDATA,
+ (WPARAM)SendDlgItemMessage(hwndDlg, IDC_USERNAME,
+ CB_ADDSTRING, 0, (LPARAM) GetListName(contacts[loop])),
+ (LPARAM)loop);
+ }
+}
+
+
+// Enable buttons for the selected contact
+void EnableButtons(HWND hwndDlg, HANDLE hContact)
+{
+ if (hContact == NULL)
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_VOICE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_URL), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USERINFO), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HISTORY), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MENU), FALSE);
+
+ SendMessage(GetDlgItem(hwndDlg, IDC_ICO), STM_SETICON, 0, 0);
+ }
+ else
+ {
+ // Is a meta?
+ if (ServiceExists(MS_MC_GETMOSTONLINECONTACT))
+ {
+ HANDLE hSub = (HANDLE) CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
+ if (hSub != NULL)
+ hContact = hSub;
+ }
+
+ // Get caps
+ int caps = 0;
+
+ char *pszProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (pszProto != NULL)
+ caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0);
+
+ BOOL voice = (ServiceExists(MS_VOICESERVICE_CAN_CALL)
+ && CallService(MS_VOICESERVICE_CAN_CALL, (WPARAM)hContact, 0) > 0);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), caps & PF1_IMSEND ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_VOICE), voice);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), caps & PF1_FILESEND ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_URL), caps & PF1_URLSEND ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USERINFO), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HISTORY), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MENU), TRUE);
+
+ HICON ico = ImageList_GetIcon(hIml, CallService(MS_CLIST_GETCONTACTICON, (WPARAM) hContact, 0), ILD_IMAGE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_ICO), STM_SETICON, (WPARAM) ico, 0);
+ }
+}
+
+
+// check if the char(s) entered appears in a contacts name
+int CheckText(HWND hdlg, TCHAR *sztext, BOOL only_enable = FALSE)
+{
+ EnableButtons(hwndMain, NULL);
+
+ if(sztext == NULL || sztext[0] == _T('\0'))
+ return 0;
+
+ int len = lstrlen(sztext);
+
+ if (only_enable)
+ {
+ for(int loop=0;loop<contacts.getCount();loop++)
+ {
+ if(lstreq(sztext, contacts[loop]->szname)==0 || lstreq(sztext, GetListName(contacts[loop]))==0)
+ {
+ EnableButtons(hwndMain, contacts[loop]->hcontact);
+ return 0;
+ }
+ }
+ }
+ else
+ {
+ for(int loop=0;loop<contacts.getCount();loop++)
+ {
+ if (lstreq(sztext, GetListName(contacts[loop]), len) == 0)
+ {
+ SendMessage(hdlg, WM_SETTEXT, 0, (LPARAM) GetListName(contacts[loop]));
+ SendMessage(hdlg, EM_SETSEL, (WPARAM) len, (LPARAM) -1);
+ EnableButtons(hwndMain, contacts[loop]->hcontact);
+ return 0;
+ }
+ }
+ }
+
+ EnableButtons(hwndMain, NULL);
+ return 0;
+}
+
+HANDLE GetSelectedContact(HWND hwndDlg)
+{
+ // First try selection
+ int sel = SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_GETCURSEL, 0, 0);
+
+ if (sel != CB_ERR)
+ {
+ int pos = SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_GETITEMDATA, sel, 0);
+ if (pos != CB_ERR)
+ return contacts[pos]->hcontact;
+ }
+
+ // Now try the name
+ TCHAR cname[120] = _T("");
+
+ GetDlgItemText(hwndDlg, IDC_USERNAME, cname, MAX_REGS(cname));
+
+ for(int loop = 0; loop < contacts.getCount(); loop++)
+ {
+ if(!lstrcmpi(cname, GetListName(contacts[loop])))
+ return contacts[loop]->hcontact;
+ }
+
+ return NULL;
+}
+
+// get array position from handle
+int GetItemPos(HANDLE hcontact)
+{
+ int loop;
+
+ for(loop=0;loop<contacts.getCount();loop++)
+ {
+ if(hcontact==contacts[loop]->hcontact)
+ return loop;
+ }
+ return -1;
+}
+
+
+WNDPROC wpEditMainProc;
+
+// callback function for edit-box of the listbox
+// without this the autofill function isn't possible
+// this was done like ie does it..as far as spy++ could tell ;)
+LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
+{
+ switch(msg)
+ {
+ case WM_CHAR:
+ {
+ if (wparam<32 && wparam != VK_BACK)
+ break;
+
+ TCHAR sztext[120] = _T("");
+ DWORD start;
+ DWORD end;
+
+ int ret = SendMessage(hdlg,EM_GETSEL,(WPARAM)&start,(LPARAM)&end);
+
+ SendMessage(hdlg,WM_GETTEXT,(WPARAM)MAX_REGS(sztext),(LPARAM)sztext);
+
+ BOOL at_end = (lstrlen(sztext) == (int)end);
+
+ if (ret != -1)
+ {
+ if (wparam == VK_BACK)
+ {
+ if (start > 0)
+ SendMessage(hdlg,EM_SETSEL,(WPARAM)start-1,(LPARAM)end);
+
+ sztext[0]=0;
+ }
+ else
+ {
+ sztext[0]=wparam;
+ sztext[1]=0;
+ }
+
+ SendMessage(hdlg,EM_REPLACESEL,(WPARAM)0,(LPARAM)sztext);
+ SendMessage(hdlg,WM_GETTEXT,(WPARAM)MAX_REGS(sztext),(LPARAM)sztext);
+ }
+
+ CheckText(hdlg, sztext, !at_end);
+
+ return 1;
+ }
+ case WM_KEYUP:
+ {
+ TCHAR sztext[120] = _T("");
+
+ if (wparam == VK_RETURN)
+ {
+ switch(SendMessage(GetParent(hdlg),CB_GETDROPPEDSTATE,0,0))
+ {
+ case FALSE:
+ SendMessage(GetParent(GetParent(hdlg)),WM_COMMAND,MAKEWPARAM(IDC_ENTER,STN_CLICKED),0);
+ break;
+
+ case TRUE:
+ SendMessage(GetParent(hdlg),CB_SHOWDROPDOWN,(WPARAM)FALSE,0);
+ break;
+ }
+ }
+ else if (wparam == VK_DELETE)
+ {
+ SendMessage(hdlg,WM_GETTEXT,(WPARAM)MAX_REGS(sztext),(LPARAM)sztext);
+ CheckText(hdlg, sztext, TRUE);
+ }
+
+ return 0;
+ }
+ case WM_GETDLGCODE:
+ return DLGC_WANTCHARS|DLGC_WANTARROWS;
+
+ }
+
+ return CallWindowProc(wpEditMainProc,hdlg,msg,wparam,lparam);
+}
+
+
+HACCEL hAcct;
+HHOOK hHook;
+
+// This function filters the message queue and translates
+// the keyboard accelerators
+LRESULT CALLBACK HookProc(int code, WPARAM wparam, LPARAM lparam)
+{
+ MSG *msg;
+ HWND htemp;
+
+ if (code!=MSGF_DIALOGBOX)
+ return 0;
+
+ msg = (MSG*)lparam;
+
+
+ if (hasNewHotkeyModule)
+ {
+ int action = CallService(MS_HOTKEY_CHECK, (WPARAM) msg, (LPARAM) "Quick Contacts");
+ if (action != 0)
+ {
+ SendMessage(hwndMain, WM_COMMAND, action, 0);
+ return 1;
+ }
+ }
+ else
+ {
+ htemp = msg->hwnd;
+ msg->hwnd = hwndMain;
+
+ if (TranslateAccelerator(msg->hwnd, hAcct, msg))
+ return 1;
+
+ msg->hwnd=htemp;
+ }
+
+ if (msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE)
+ {
+ switch(SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_GETDROPPEDSTATE, 0, 0))
+ {
+ case FALSE:
+ SendMessage(hwndMain, WM_CLOSE, 0, 0);
+ break;
+
+ case TRUE:
+ SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_SHOWDROPDOWN, (WPARAM)FALSE, 0);
+ break;
+ }
+ }
+
+ return 0;
+}
+
+BOOL ScreenToClient(HWND hWnd, LPRECT lpRect)
+{
+ BOOL ret;
+
+ POINT pt;
+
+ pt.x = lpRect->left;
+ pt.y = lpRect->top;
+
+ ret = ScreenToClient(hWnd, &pt);
+
+ if (!ret) return ret;
+
+ lpRect->left = pt.x;
+ lpRect->top = pt.y;
+
+
+ pt.x = lpRect->right;
+ pt.y = lpRect->bottom;
+
+ ret = ScreenToClient(hWnd, &pt);
+
+ lpRect->right = pt.x;
+ lpRect->bottom = pt.y;
+
+ return ret;
+}
+
+
+BOOL MoveWindow(HWND hWnd, const RECT &rect, BOOL bRepaint)
+{
+ return MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, bRepaint);
+}
+
+
+static void FillButton(HWND hwndDlg, int dlgItem, char *name, char *key, HICON icon)
+{
+ char tmp[256];
+ char *full;
+ if (key == NULL)
+ full = Translate(name);
+ else
+ mir_snprintf(full = tmp, MAX_REGS(tmp), "%s (%s)", Translate(name), key);
+
+ SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONSETASFLATBTN, 0, 0);
+ SendMessageA(GetDlgItem(hwndDlg, dlgItem), BUTTONADDTOOLTIP, (LPARAM) full, 0);
+ SendDlgItemMessage(hwndDlg, dlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM) icon);
+}
+
+
+static void FillCheckbox(HWND hwndDlg, int dlgItem, char *name, char *key)
+{
+ char tmp[256];
+ char *full;
+ if (key == NULL)
+ full = Translate(name);
+ else
+ mir_snprintf(full = tmp, MAX_REGS(tmp), "%s (%s)", Translate(name), key);
+
+ SendMessageA(GetDlgItem(hwndDlg, dlgItem), WM_SETTEXT, 0, (LPARAM) full);
+}
+
+
+static BOOL CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+
+ RECT rc;
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_USERNAME), &rc);
+ ScreenToClient(hwndDlg, &rc);
+
+ HWND icon = CreateWindow(_T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE,
+ rc.left - 20, rc.top + (rc.bottom - rc.top - 16) / 2, 16, 16, hwndDlg, (HMENU) IDC_ICO,
+ hInst, NULL);
+
+ if (!hasNewHotkeyModule)
+ hAcct = LoadAccelerators(hInst, MAKEINTRESOURCE(ACCEL_TABLE));
+
+ hHook = SetWindowsHookEx(WH_MSGFILTER, HookProc, hInst, GetCurrentThreadId());
+
+ // Combo
+ SendMessage(GetDlgItem(hwndDlg, IDC_USERNAME), EM_LIMITTEXT, (WPARAM)119,0);
+ wpEditMainProc = (WNDPROC) SetWindowLong(GetWindow(GetDlgItem(hwndDlg, IDC_USERNAME),GW_CHILD), GWL_WNDPROC, (LONG)EditProc);
+
+ // Buttons
+ FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, "Show all contacts", hasNewHotkeyModule ? NULL : "Ctrl+A");
+ FillButton(hwndDlg, IDC_MESSAGE, "Send message", NULL, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE));
+
+ if (ServiceExists(MS_VOICESERVICE_CAN_CALL))
+ {
+ FillButton(hwndDlg, IDC_VOICE, "Make a voice call", hasNewHotkeyModule ? NULL : "Ctrl+V", (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) "vca_call"));
+ }
+ else
+ {
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_VOICE), &rc);
+ ScreenToClient(hwndDlg, &rc);
+ MoveWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), rc, FALSE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_VOICE), SW_HIDE);
+ }
+
+ FillButton(hwndDlg, IDC_FILE, "Send file", hasNewHotkeyModule ? NULL : "Ctrl+F", LoadSkinnedIcon(SKINICON_EVENT_FILE));
+ FillButton(hwndDlg, IDC_URL, "Send URL", hasNewHotkeyModule ? NULL : "Ctrl+U", LoadSkinnedIcon(SKINICON_EVENT_URL));
+ FillButton(hwndDlg, IDC_USERINFO, "Open userinfo", hasNewHotkeyModule ? NULL : "Ctrl+I", (HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(160),IMAGE_ICON,16,16,LR_DEFAULTCOLOR));
+ FillButton(hwndDlg, IDC_HISTORY, "Open history", hasNewHotkeyModule ? NULL : "Ctrl+H", (HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(174),IMAGE_ICON,16,16,LR_DEFAULTCOLOR));
+ FillButton(hwndDlg, IDC_MENU, "Open contact menu", hasNewHotkeyModule ? NULL : "Ctrl+M", (HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(264),IMAGE_ICON,16,16,LR_DEFAULTCOLOR));
+
+ SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETEXTENDEDUI, (WPARAM)TRUE, 0);
+
+ MagneticWindows_AddWindow(hwndDlg);
+
+ Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE_NAME, "window");
+
+ LoadContacts(hwndDlg, FALSE);
+
+ EnableButtons(hwndDlg, NULL);
+ if (DBGetContactSettingByte(NULL, MODULE_NAME, "EnableLastSentTo", 0))
+ {
+ int pos = GetItemPos((HANDLE) DBGetContactSettingDword(NULL, MODULE_NAME, "LastSentTo", -1));
+
+ if (pos != -1)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETCURSEL, (WPARAM) pos, 0);
+ EnableButtons(hwndDlg, contacts[pos]->hcontact);
+ }
+ }
+
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+
+ return TRUE;
+ }
+
+ case WM_COMMAND:
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDC_USERNAME:
+ {
+ if (HIWORD(wParam) == CBN_SELCHANGE)
+ {
+ int pos = SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_GETCURSEL, 0, 0);
+ EnableButtons(hwndDlg, pos < contacts.getCount() ? contacts[pos]->hcontact : NULL);
+ }
+ break;
+ }
+ case IDC_ENTER:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ break;
+
+ CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case IDC_MESSAGE:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MESSAGE)))
+ break;
+
+ // don't know why it doesn't work with MS_MSG_SENDMESSAGE
+ // when convers is enabled
+ if (ServiceExists("SRMsg/LaunchMessageWindow"))
+ CallService("SRMsg/LaunchMessageWindow", (WPARAM) hContact, 0);
+ else
+ CallService(MS_MSG_SENDMESSAGE, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case HOTKEY_VOICE:
+ case IDC_VOICE:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VOICE)))
+ break;
+
+ if (!ServiceExists(MS_VOICESERVICE_CALL))
+ break;
+
+ CallService(MS_VOICESERVICE_CALL, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case HOTKEY_FILE:
+ case IDC_FILE:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FILE)))
+ break;
+
+ CallService(MS_FILE_SENDFILE, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case HOTKEY_URL:
+ case IDC_URL:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_URL)))
+ break;
+
+ CallService(MS_URL_SENDURL, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case HOTKEY_INFO:
+ case IDC_USERINFO:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_USERINFO)))
+ break;
+
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case HOTKEY_HISTORY:
+ case IDC_HISTORY:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY)))
+ break;
+
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM) hContact, 0);
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ case HOTKEY_MENU:
+ case IDC_MENU:
+ {
+ HANDLE hContact = GetSelectedContact(hwndDlg);
+ if (hContact == NULL)
+ {
+ SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
+ SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
+ break;
+ }
+
+ // Is button enabled?
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MENU)))
+ break;
+
+ RECT rc;
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_MENU), &rc);
+ HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) hContact, 0);
+ int ret = TrackPopupMenu(hMenu, TPM_TOPALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
+ DestroyMenu(hMenu);
+
+ if(ret)
+ {
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(ret),MPCF_CONTACTMENU),(LPARAM) hContact);
+ }
+
+ DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ break;
+ }
+ case HOTKEY_ALL_CONTACTS:
+ case IDC_SHOW_ALL_CONTACTS:
+ {
+ // Get old text
+ HWND hEdit = GetWindow(GetWindow(hwndDlg,GW_CHILD),GW_CHILD);
+ TCHAR sztext[120] = _T("");
+
+ if (SendMessage(hEdit, EM_GETSEL, (WPARAM)NULL, (LPARAM)NULL) != -1)
+ SendMessage(hEdit, EM_REPLACESEL, (WPARAM)0, (LPARAM)_T(""));
+
+ SendMessage(hEdit, WM_GETTEXT, (WPARAM)MAX_REGS(sztext), (LPARAM)sztext);
+
+ // Fill combo
+ BOOL all = IsDlgButtonChecked(hwndDlg, IDC_SHOW_ALL_CONTACTS);
+
+ if (LOWORD(wParam) == HOTKEY_ALL_CONTACTS)
+ {
+ // Toggle checkbox
+ all = !all;
+ CheckDlgButton(hwndDlg, IDC_SHOW_ALL_CONTACTS, all ? BST_CHECKED : BST_UNCHECKED);
+ }
+
+ LoadContacts(hwndDlg, all);
+
+ // Return selection
+ CheckText(hEdit, sztext);
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case WM_CLOSE:
+ {
+ Utils_SaveWindowPosition(hwndDlg, NULL, MODULE_NAME, "window");
+ MagneticWindows_RemoveWindow(hwndDlg);
+ DestroyWindow(hwndDlg);
+ break;
+ }
+
+ case WM_DESTROY:
+ {
+ UnhookWindowsHookEx(hHook);
+ hwndMain = NULL;
+ FreeContacts();
+ InterlockedExchange(&main_dialog_open, 0);
+ break;
+ }
+
+ case WM_NCLBUTTONDBLCLK:
+ {
+ MagneticWindows_SnapWindowToList(hwndDlg, MS_MW_STL_List_Left | MS_MW_STL_List_Top
+ | MS_MW_STL_Wnd_Right | MS_MW_STL_Wnd_Top);
+ break;
+ }
+
+ case WM_DRAWITEM:
+ {
+ // add icons and protocol to listbox
+ LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
+
+ // Handle contact menu
+ if(lpdis->CtlID != IDC_USERNAME)
+ {
+ if (lpdis->CtlType == ODT_MENU)
+ return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ else
+ break;
+ }
+
+ // Handle combo
+ if(lpdis->itemID == -1)
+ break;
+
+ TEXTMETRIC tm;
+ int icon_width=0, icon_height=0;
+ RECT rc;
+
+ GetTextMetrics(lpdis->hDC, &tm);
+ ImageList_GetIconSize(hIml, &icon_width, &icon_height);
+
+ COLORREF clrfore = SetTextColor(lpdis->hDC,GetSysColor(lpdis->itemState & ODS_SELECTED?COLOR_HIGHLIGHTTEXT:COLOR_WINDOWTEXT));
+ COLORREF clrback = SetBkColor(lpdis->hDC,GetSysColor(lpdis->itemState & ODS_SELECTED?COLOR_HIGHLIGHT:COLOR_WINDOW));
+
+ FillRect(lpdis->hDC, &lpdis->rcItem, GetSysColorBrush(lpdis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHT : COLOR_WINDOW));
+
+ // Draw icon
+ rc.left = lpdis->rcItem.left + 5;
+ rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - icon_height) / 2;
+ ImageList_Draw(hIml, CallService(MS_CLIST_GETCONTACTICON, (WPARAM)contacts[lpdis->itemData]->hcontact, 0),
+ lpdis->hDC, rc.left, rc.top, ILD_NORMAL);
+
+ // Make rect for text
+ rc.left += icon_width + 5;
+ rc.right = lpdis->rcItem.right - 1;
+ rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2;
+ rc.bottom = rc.top + tm.tmHeight;
+
+ // Draw Protocol
+ if (opts.num_protos > 1)
+ {
+ if (max_proto_width == 0)
+ {
+ // Has to be done, else the DC isnt the right one
+ // Dont ask me why
+ for(int loop = 0; loop < contacts.getCount(); loop++)
+ {
+ RECT rcc = { 0, 0, 0x7FFF, 0x7FFF };
+
+ DrawText(lpdis->hDC, contacts[loop]->proto, lstrlen(contacts[loop]->proto),
+ &rcc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_CALCRECT);
+ max_proto_width = max(max_proto_width, rcc.right - rcc.left);
+ }
+
+ // Fix max_proto_width
+ if (opts.group_append && opts.group_column)
+ max_proto_width = min(max_proto_width, (rc.right - rc.left) / 5);
+ else if (opts.group_append)
+ max_proto_width = min(max_proto_width, (rc.right - rc.left) / 4);
+ else
+ max_proto_width = min(max_proto_width, (rc.right - rc.left) / 3);
+ }
+
+ RECT rc_tmp = rc;
+
+ rc_tmp.left = rc_tmp.right - max_proto_width;
+
+ DrawText(lpdis->hDC, contacts[lpdis->itemData]->proto, lstrlen(contacts[lpdis->itemData]->proto),
+ &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+
+ rc.right = rc_tmp.left - 5;
+ }
+
+ // Draw group
+ if (opts.group_append && opts.group_column)
+ {
+ RECT rc_tmp = rc;
+
+ if (opts.group_column_left)
+ {
+ rc_tmp.right = rc_tmp.left + (rc.right - rc.left) / 3;
+ rc.left = rc_tmp.right + 5;
+ }
+ else
+ {
+ rc_tmp.left = rc_tmp.right - (rc.right - rc.left) / 3;
+ rc.right = rc_tmp.left - 5;
+ }
+
+ DrawText(lpdis->hDC, contacts[lpdis->itemData]->szgroup, lstrlen(contacts[lpdis->itemData]->szgroup),
+ &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+ }
+
+ // Draw text
+ TCHAR *name;
+ if (opts.group_append && !opts.group_column)
+ name = GetListName(contacts[lpdis->itemData]);
+ else
+ name = contacts[lpdis->itemData]->szname;
+
+ DrawText(lpdis->hDC, name, lstrlen(name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+
+ // Restore old colors
+ SetTextColor(lpdis->hDC, clrfore);
+ SetBkColor(lpdis->hDC, clrback);
+
+ return TRUE;
+ }
+
+ case WM_MEASUREITEM:
+ {
+ LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT)lParam;
+
+ // Handle contact menu
+ if(lpmis->CtlID != IDC_USERNAME)
+ {
+ if (lpmis->CtlType == ODT_MENU)
+ return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ else
+ break;
+ }
+
+ // Handle combo
+
+ TEXTMETRIC tm;
+ int icon_width = 0, icon_height=0;
+
+ GetTextMetrics(GetDC(hwndDlg), &tm);
+ ImageList_GetIconSize(hIml, &icon_width, &icon_height);
+
+ lpmis->itemHeight = max(icon_height, tm.tmHeight);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+int HotkeyPressed(WPARAM wParam, LPARAM lParam)
+{
+ THKSEvent *ev = (THKSEvent *) wParam;
+
+ if (ev->moduleId == hksModule && ev->itemId == hksAction)
+ ShowDialog(0, 0);
+
+ return 0;
+}
+
+
+// Show the main dialog
+int ShowDialog(WPARAM wParam, LPARAM lParam)
+{
+ if (!main_dialog_open)
+ {
+ InterlockedExchange(&main_dialog_open, 1);
+
+ hwndMain = CreateDialog(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc);
+ }
+
+ // Show it
+ SetForegroundWindow(hwndMain);
+ SetFocus(hwndMain);
+ ShowWindow(hwndMain, SW_SHOW);
+
+ return 0;
+}
diff --git a/Plugins/quickcontacts/quickcontacts.dsp b/Plugins/quickcontacts/quickcontacts.dsp new file mode 100644 index 0000000..b739b63 --- /dev/null +++ b/Plugins/quickcontacts/quickcontacts.dsp @@ -0,0 +1,234 @@ +# Microsoft Developer Studio Project File - Name="quickcontacts" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=quickcontacts - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "quickcontacts.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "quickcontacts.mak" CFG="quickcontacts - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "quickcontacts - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "quickcontacts - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "quickcontacts - Win32 Unicode Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "quickcontacts - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "quickcontacts - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O1 /YX /FD /c
+# SUBTRACT BASE CPP /Fr
+# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "../../include" /I "sdk" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FAcs /YX /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x417 /d "NDEBUG"
+# ADD RSC /l 0x417 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 user32.lib shell32.lib wininet.lib gdi32.lib /nologo /base:"0x67100000" /dll /machine:I386 /filealign:0x200
+# SUBTRACT BASE LINK32 /pdb:none /map
+# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /map /debug /machine:I386 /out:"..\..\bin\release\Plugins\quickcontacts.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF "$(CFG)" == "quickcontacts - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G4 /MT /W3 /GX /O2 /Ob0 /I "../../include" /FR /YX /FD /c
+# ADD CPP /nologo /G4 /MTd /W3 /GX /ZI /Od /I "../../include" /I "sdk" /FR /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x417 /d "NDEBUG"
+# ADD RSC /l 0x417 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..bin\release\Plugins\quickcontacts.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT BASE LINK32 /profile /pdb:none
+# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\quickcontacts.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF "$(CFG)" == "quickcontacts - Win32 Unicode Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "quickcontacts___Win32_Unicode_Release"
+# PROP BASE Intermediate_Dir "quickcontacts___Win32_Unicode_Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Unicode_Release"
+# PROP Intermediate_Dir "Unicode_Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G4 /MT /W3 /GX /O2 /Ob0 /I "../../include" /Fr /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "../../include" /I "sdk" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /D "_USRDLL" /FAcs /YX /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x417 /d "NDEBUG"
+# ADD RSC /l 0x417 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /map /machine:I386 /out:"..\..\bin\release\Plugins\quickcontacts.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT BASE LINK32 /profile /pdb:none
+# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /map /debug /machine:I386 /out:"..\..\bin\release unicode\Plugins\quickcontactsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF "$(CFG)" == "quickcontacts - Win32 Unicode Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "quickcontacts___Win32_Unicode_Debug"
+# PROP BASE Intermediate_Dir "quickcontacts___Win32_Unicode_Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Unicode_Debug"
+# PROP Intermediate_Dir "Unicode_Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G4 /MTd /W3 /GX /ZI /Od /I "../../include" /FR /YX /FD /c
+# ADD CPP /nologo /G4 /MTd /W3 /Gm /Gi /ZI /Od /I "../../include" /I "sdk" /D "WIN32" /D "W32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x417 /d "NDEBUG"
+# ADD RSC /l 0x417 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\quickcontacts.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT BASE LINK32 /profile /pdb:none
+# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32110000" /dll /incremental:yes /map /debug /machine:I386 /out:"..\..\bin\Debug Unicode\Plugins\quickcontactsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "quickcontacts - Win32 Release"
+# Name "quickcontacts - Win32 Debug"
+# Name "quickcontacts - Win32 Unicode Release"
+# Name "quickcontacts - Win32 Unicode Debug"
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\commons.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\m_quickcontacts.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\mir_memory.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\mir_options.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# End Group
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\utils\mir_options.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\quickcontacts.cpp
+# End Source File
+# End Group
+# Begin Group "Docs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Docs\langpack_quickcontacts.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\Docs\quickcontacts_changelog.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\Docs\quickcontacts_readme.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\Docs\quickcontacts_version.txt
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Plugins/quickcontacts/quickcontacts.dsw b/Plugins/quickcontacts/quickcontacts.dsw new file mode 100644 index 0000000..de1da4e --- /dev/null +++ b/Plugins/quickcontacts/quickcontacts.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "quickcontacts"=".\quickcontacts.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Plugins/quickcontacts/quickcontacts.sln b/Plugins/quickcontacts/quickcontacts.sln new file mode 100644 index 0000000..c5de439 --- /dev/null +++ b/Plugins/quickcontacts/quickcontacts.sln @@ -0,0 +1,26 @@ +
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quickcontacts", "quickcontacts.vcproj", "{7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ Unicode Debug|Win32 = Unicode Debug|Win32
+ Unicode Release|Win32 = Unicode Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Debug|Win32.Build.0 = Debug|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Release|Win32.ActiveCfg = Release|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Release|Win32.Build.0 = Release|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32
+ {7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}.Unicode Release|Win32.Build.0 = Unicode Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Plugins/quickcontacts/quickcontacts.vcproj b/Plugins/quickcontacts/quickcontacts.vcproj new file mode 100644 index 0000000..99cc78a --- /dev/null +++ b/Plugins/quickcontacts/quickcontacts.vcproj @@ -0,0 +1,671 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="quickcontacts"
+ ProjectGUID="{7FC00D59-03D3-4A6C-AEFE-67349C9C9E10}"
+ RootNamespace="quickcontacts"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Unicode Release|Win32"
+ OutputDirectory=".\Unicode_Release"
+ IntermediateDirectory=".\Unicode_Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Unicode_Release/quickcontacts.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include,sdk"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;UNICODE;_USRDLL"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\Unicode_Release/quickcontacts.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation=".\Unicode_Release/"
+ ObjectFile=".\Unicode_Release/"
+ ProgramDataBaseFileName=".\Unicode_Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1047"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /filealign:0x200 /ignore:4108 "
+ AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\bin\release unicode\Plugins\quickcontactsW.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Unicode_Release/quickcontactsW.pdb"
+ GenerateMapFile="true"
+ MapFileName=".\Unicode_Release/quickcontactsW.map"
+ BaseAddress="0x32100000"
+ ImportLibrary=".\Unicode_Release/quickcontactsW.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Unicode_Release/quickcontacts.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Unicode Debug|Win32"
+ OutputDirectory=".\Unicode_Debug"
+ IntermediateDirectory=".\Unicode_Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Unicode_Debug/quickcontacts.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include,sdk"
+ PreprocessorDefinitions="UNICODE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile=".\Unicode_Debug/quickcontacts.pch"
+ AssemblerListingLocation=".\Unicode_Debug/"
+ ObjectFile=".\Unicode_Debug/"
+ ProgramDataBaseFileName=".\Unicode_Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1047"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /filealign:0x200 /ignore:4108 "
+ AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\bin\Debug Unicode\Plugins\quickcontactsW.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Unicode_Debug/quickcontactsW.pdb"
+ BaseAddress="0x32100000"
+ ImportLibrary=".\Unicode_Debug/quickcontactsW.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Unicode_Debug/quickcontacts.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/quickcontacts.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include,sdk"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\Release/quickcontacts.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1047"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /filealign:0x200 /ignore:4108 "
+ AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\bin\release\Plugins\quickcontacts.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Release/quickcontacts.pdb"
+ GenerateMapFile="true"
+ MapFileName=".\Release/quickcontacts.map"
+ BaseAddress="0x32100000"
+ ImportLibrary=".\Release/quickcontacts.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/quickcontacts.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/quickcontacts.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include,sdk"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile=".\Debug/quickcontacts.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1047"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /filealign:0x200 /ignore:4108 "
+ AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\bin\debug\Plugins\quickcontacts.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/quickcontacts.pdb"
+ BaseAddress="0x32100000"
+ ImportLibrary=".\Debug/quickcontacts.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/quickcontacts.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="commons.h"
+ >
+ </File>
+ <File
+ RelativePath="m_quickcontacts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\utils\mir_memory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\utils\mir_options.h"
+ >
+ </File>
+ <File
+ RelativePath="options.h"
+ >
+ </File>
+ <File
+ RelativePath="resource.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="resource.rc"
+ >
+ <FileConfiguration
+ Name="Unicode Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Unicode Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\utils\mir_memory.cpp"
+ >
+ <FileConfiguration
+ Name="Unicode Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Unicode Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\utils\mir_options.cpp"
+ >
+ <FileConfiguration
+ Name="Unicode Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Unicode Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="options.cpp"
+ >
+ <FileConfiguration
+ Name="Unicode Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Unicode Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="quickcontacts.cpp"
+ >
+ <FileConfiguration
+ Name="Unicode Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Unicode Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Docs"
+ >
+ <File
+ RelativePath="Docs\langpack_quickcontacts.txt"
+ >
+ </File>
+ <File
+ RelativePath="Docs\quickcontacts_changelog.txt"
+ >
+ </File>
+ <File
+ RelativePath="Docs\quickcontacts_readme.txt"
+ >
+ </File>
+ <File
+ RelativePath="Docs\quickcontacts_version.txt"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Plugins/quickcontacts/resource.h b/Plugins/quickcontacts/resource.h new file mode 100644 index 0000000..f7f6a01 --- /dev/null +++ b/Plugins/quickcontacts/resource.h @@ -0,0 +1,47 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define ACCEL_TABLE 103
+#define IDD_OPT 110
+#define IDD_MAIN 1000
+#define IDC_USERNAME 1001
+#define IDC_LASTSENTTO 1004
+#define IDC_GLOBAL 1009
+#define IDC_LOCAL 1010
+#define IDC_PROTOCOLS 1041
+#define IDC_SUBCONTACTS 1058
+#define IDC_KEEP_OFFLINE 1059
+#define IDC_HIDE_OFFLINE 1060
+#define IDC_SHOW_ALL_CONTACTS 1061
+#define IDC_APPEND_GROUP 1061
+#define IDC_MESSAGE 1062
+#define IDC_GROUP_COLUMN 1062
+#define IDC_FILE 1063
+#define IDC_GROUP_LEFT 1063
+#define IDC_URL 1064
+#define IDC_USERINFO 1065
+#define IDC_HISTORY 1066
+#define IDC_MENU 1067
+#define IDC_VOICE 1068
+#define HOTKEY_FILE 40001
+#define HOTKEY_URL 40002
+#define HOTKEY_INFO 40003
+#define HOTKEY_HISTORY 40004
+#define HOTKEY_ALL_CONTACTS 40005
+#define HOTKEY_MENU 40006
+#define HOTKEY_VOICE 40007
+#define IDC_STATIC -1
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_3D_CONTROLS 1
+#define _APS_NEXT_RESOURCE_VALUE 119
+#define _APS_NEXT_COMMAND_VALUE 40008
+#define _APS_NEXT_CONTROL_VALUE 1063
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/Plugins/quickcontacts/resource.rc b/Plugins/quickcontacts/resource.rc new file mode 100644 index 0000000..efdb2e6 --- /dev/null +++ b/Plugins/quickcontacts/resource.rc @@ -0,0 +1,179 @@ +//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "resource.h"
+#include "winresrc.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT DIALOGEX 0, 0, 257, 237
+STYLE DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg"
+BEGIN
+ GROUPBOX "Last Sent",IDC_STATIC,0,0,257,58
+ CONTROL "Enable last-sent-to",IDC_LASTSENTTO,"Button",
+ BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,18,14,221,10
+ CONTROL "recognize all messages sent",IDC_GLOBAL,"Button",
+ BS_AUTORADIOBUTTON | WS_DISABLED,30,27,209,10
+ CONTROL "recognize messages sent with hotkey only",IDC_LOCAL,
+ "Button",BS_AUTORADIOBUTTON | WS_DISABLED,30,39,209,10
+ GROUPBOX "Contacts",IDC_STATIC,0,59,257,177
+ LTEXT "Show offline contacts on these protocols:",IDC_STATIC,
+ 16,72,236,9
+ CONTROL "List1",IDC_PROTOCOLS,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SORTASCENDING | LVS_NOCOLUMNHEADER |
+ LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,28,83,140,71
+ CONTROL "But hide them if protocol is offline",IDC_HIDE_OFFLINE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,27,159,214,8
+ CONTROL "Append group name to contact name",IDC_APPEND_GROUP,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,171,225,8
+ CONTROL "But show it as a column ...",IDC_GROUP_COLUMN,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,27,183,214,8
+ CONTROL "... on left side of name",IDC_GROUP_LEFT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,27,195,214,8
+ CONTROL "Hide subcontacts",IDC_SUBCONTACTS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,16,207,225,8
+ CONTROL "But keep subcontacts of protocols in above list if meta is hidden",
+ IDC_KEEP_OFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 28,219,217,9
+END
+
+IDD_MAIN DIALOGEX 13, 55, 193, 54
+STYLE DS_FIXEDSYS | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION "Enter username:"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ COMBOBOX IDC_USERNAME,20,6,164,130,CBS_DROPDOWN |
+ CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
+ CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Show all contacts (Ctrl+A)",IDC_SHOW_ALL_CONTACTS,
+ "Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,8,23,
+ 176,11
+ CONTROL "",IDC_MESSAGE,"MButtonClass",0x0,41,36,17,15,
+ 0x18000000L
+ CONTROL "",IDC_VOICE,"MButtonClass",0x0,62,36,17,15,0x18000000L
+ CONTROL "",IDC_FILE,"MButtonClass",0x0,83,36,17,15,0x18000000L
+ CONTROL "",IDC_URL,"MButtonClass",0x0,104,36,17,15,0x18000000L
+ CONTROL "",IDC_USERINFO,"MButtonClass",0x0,125,36,17,15,
+ 0x18000000L
+ CONTROL "",IDC_HISTORY,"MButtonClass",0x0,146,36,17,15,
+ 0x18000000L
+ CONTROL "",IDC_MENU,"MButtonClass",0x0,167,36,17,15,0x18000000L
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_OPT, DIALOG
+ BEGIN
+ TOPMARGIN, 3
+ END
+
+ IDD_MAIN, DIALOG
+ BEGIN
+ RIGHTMARGIN, 184
+ BOTTOMMARGIN, 51
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+ACCEL_TABLE ACCELERATORS DISCARDABLE
+BEGIN
+ "A", HOTKEY_ALL_CONTACTS, VIRTKEY, CONTROL, NOINVERT
+ "F", HOTKEY_FILE, VIRTKEY, CONTROL, NOINVERT
+ "H", HOTKEY_HISTORY, VIRTKEY, CONTROL, NOINVERT
+ "I", HOTKEY_INFO, VIRTKEY, CONTROL, NOINVERT
+ "M", HOTKEY_MENU, VIRTKEY, CONTROL, NOINVERT
+ "U", HOTKEY_URL, VIRTKEY, CONTROL, NOINVERT
+ "V", HOTKEY_VOICE, VIRTKEY, CONTROL, NOINVERT
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (Canada) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENC)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""resource.h""\r\n"
+ "#include ""winresrc.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (Canada) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Plugins/quickcontacts/sdk/m_MagneticWindows.h b/Plugins/quickcontacts/sdk/m_MagneticWindows.h new file mode 100644 index 0000000..e011c77 --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_MagneticWindows.h @@ -0,0 +1,86 @@ +#ifndef __M_MAGNETICWINDOWS_H__
+#define __M_MAGNETICWINDOWS_H__
+
+//#include "../include/newpluginapi.h"
+
+// For other Plugins to start snapping for their windows
+// wparam: hwnd of window
+// lparam: 0
+// return: 0 on success, 1 on error
+#define MS_MW_ADDWINDOW "Utils/MagneticWindows/Add"
+
+// For other Plugins to stop snapping for their windows
+// wparam: hwnd of window
+// lparam: 0
+// return: 0 on success, 1 on error
+#define MS_MW_REMWINDOW "Utils/MagneticWindows/Rem"
+
+//decide where to align on the list:
+#define MS_MW_STL_List_Left 0x00000001 //Snaps the window to the left border of the list
+#define MS_MW_STL_List_Top 0x00000002 //Snaps the window to the top border of the list
+#define MS_MW_STL_List_Right 0x00000004 //Snaps the window to the right border of the list
+#define MS_MW_STL_List_Bottom 0x00000008 //Snaps the window to the bottom border of the list
+//decide with what side (of the window you want to snap) to snap to the list
+#define MS_MW_STL_Wnd_Left 0x00000010 //Snaps the window with the left border to the left/right side of the list
+#define MS_MW_STL_Wnd_Top 0x00000020 //Snaps the window with the top border to the top/bottom side of the list
+#define MS_MW_STL_Wnd_Right 0x00000040 //Snaps the window with the right border to the left/right side of the list
+#define MS_MW_STL_Wnd_Bottom 0x00000080 //Snaps the window with the bottom border to the top/bottom side of the list
+
+#define MS_MW_STL_Wnd_FullWidth (MS_MW_STL_Wnd_Left | MS_MW_STL_Wnd_Right)
+ //Snaps to the top/bottom of the list and spans over the full width
+
+#define MS_MW_STL_Wnd_FullHeight (MS_MW_STL_Wnd_Top | MS_MW_STL_Wnd_Bottom)
+ //Snaps to the left/right of the list and spans over the full height
+
+// to place the window in the list combine f.e. MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment*
+
+//For other Plugins to snap a window to the list for other Plugins
+// wparam: hwnd of window
+// lparam: combination of the above constants MS_MW_STL_*
+// return: 0 on success, 1 on error
+#define MS_MW_SNAPTOLIST "Utils/MagneticWindows/SnapToList"
+
+// Helper functions
+#ifndef _MW_NO_HELPPER_FUNCTIONS
+
+
+static inline int MagneticWindows_AddWindow(HWND hWnd)
+{
+ if (ServiceExists(MS_MW_ADDWINDOW))
+ {
+ return CallService(MS_MW_ADDWINDOW, (WPARAM) hWnd, 0);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+static inline int MagneticWindows_RemoveWindow(HWND hWnd)
+{
+ if (ServiceExists(MS_MW_REMWINDOW))
+ {
+ return CallService(MS_MW_REMWINDOW, (WPARAM) hWnd, 0);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+static inline int MagneticWindows_SnapWindowToList(HWND hWnd, int MS_MW_STL_Options)
+{
+ if (ServiceExists(MS_MW_SNAPTOLIST))
+ {
+ return CallService(MS_MW_SNAPTOLIST, (WPARAM) hWnd, (LPARAM) MS_MW_STL_Options);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+#endif
+
+
+#endif // __M_MAGNETICWINDOWS_H__
diff --git a/Plugins/quickcontacts/sdk/m_hotkeysplus.h b/Plugins/quickcontacts/sdk/m_hotkeysplus.h new file mode 100644 index 0000000..3da357f --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_hotkeysplus.h @@ -0,0 +1,22 @@ +#define MS_HOTKEYSPLUS_ADDKEY "HotkeysPlus/Add"
+
+/*
+This service registers hotkey for
+WPARAM - service to perform
+LPARAM - decription of the service
+Returned values:
+ 0 - success,
+ 1 - hotkey for this function is already existing,
+ 2 - the service, that you try to register the hotkey for, not exists
+*/
+
+#define MS_HOTKEYSPLUS_EXISTKEY "HotkeysPlus/Exist"
+/*
+This service checks whether hotkey for service (WPARAM) exists
+LPARAM - not used
+Returned values:
+ 0 - failed,
+ 1 - the hotkey for this function exists,
+ 2 - the service not exists
+*/
+
diff --git a/Plugins/quickcontacts/sdk/m_hotkeysservice.h b/Plugins/quickcontacts/sdk/m_hotkeysservice.h new file mode 100644 index 0000000..274ab0e --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_hotkeysservice.h @@ -0,0 +1,207 @@ +#ifndef __M_HOTKEYSSERVICE__
+# define __M_HOTKEYSSERVICE__
+
+
+#define HKS_SERVICE_NAME "HotkeysService"
+
+// Modifiers for hotkeys
+//#define MOD_ALT 0x0001
+//#define MOD_CONTROL 0x0002
+//#define MOD_SHIFT 0x0004
+//#define MOD_WIN 0x0008
+#define MOD_GLOBAL 0x0010
+
+// FLAGS
+// inherit modifiers from group (specified modifiers ignored)
+#define HKS_ACTION_SHAREMODIFIERS 1
+// register item, but disable
+#define HKS_INITIALLY_DISABLED 2
+
+// Structure of hotkey
+typedef union
+{
+ struct
+ {
+ WORD key;
+ WORD modifiers;
+ };
+ DWORD hotkey;
+
+} THKSHotkey, *PHKSHotkey;
+
+
+// ITEM TYPES
+#define HKS_ITEM_MODULE 1
+#define HKS_ITEM_GROUP 2
+#define HKS_ITEM_ACTION 3
+#define HKS_ITEM_MACRO 4
+
+
+// Structure passed to RegisterItem service.
+// Used only for registration pursposes, so free it after call.
+// name, owner and itemType field is mandatory.
+// owner is item ID or must be 0 for 1st level items (module, single action or macro)
+// itemType can be one of ITEM TYPES constants.
+// flags can be combined from FLAGS constants.
+// Group can contain other groups and items and optionally
+// set group modifiers. Only item can be tree leaf.
+// If creating group, hotkey.modifiers will be used
+// as group modifiers (if nonzero)
+// If creating action, hotkey is optional. If hotkey.key is filled, then
+// hotkey will be assigned to item (if unused).
+// If creating macro, hotkey is mandatory.
+
+typedef struct
+{
+ int owner;
+ char *name;
+ int itemType;
+ THKSHotkey hotkey;
+ int flags;
+
+} THKSItem, *PHKSItem;
+
+
+// Register item
+// wParam: item data in PKHSItem format
+// lParam: 0
+// Returns HANDLE called "ID" in loWord.
+// For actions and macros, hiWord returns state: 0 if ok, other if passed hotkey
+// can't be registered (for example already used)
+// In other cases hiWord is useless
+#define MS_HKS_REGISTER_ITEM HKS_SERVICE_NAME "/RegisterItem"
+
+// Unregister item
+// If item is Group, then all subItems will be unregistered.
+// wParam: item ID
+// lParam: 0
+// Returns: 0 on success, other on fail
+#define MS_HKS_UNREGISTER_ITEM HKS_SERVICE_NAME "/UnregisterItem"
+
+// Assign hotkey to item. If item is group, then only
+// modifiers are taken as group modifiers. Do not call on modules.
+// Hotkey consists of modifiers in hiWord and key in loWord.
+// wParam: item ID
+// lParam: hotkey as PHKS_Hotkey to register
+// Returns:
+// on success: hotkey
+// on error: 0
+#define MS_HKS_ASSIGN_HOTKEY HKS_SERVICE_NAME "/AssignHotkey"
+
+// Get hotkey assigned to item. Don't apply to modules.
+// wParam: item ID
+// lParam: 0
+// Returns: hotkey assigned, 0 otherwise.
+#define MS_HKS_GET_HOTKEY HKS_SERVICE_NAME "/GetAssignedHotkey"
+
+// Unassign hotkey from item. Only valid on action and macro items.
+// wParam: item ID
+// lParam: 0
+// Returns: 0 on success, other on fail
+#define MS_HKS_UNASSIGN_HOTKEY HKS_SERVICE_NAME "/UnassignHotkey"
+
+// Enable/Disable item.
+// If item is group or module, then all subItems will be affected.
+// wParam: item ID
+// lParam: 1 to enable, anything else to disable
+// Returns: 0 on success, other on fail
+#define MS_HKS_ENABLE_ITEM HKS_SERVICE_NAME "/EnableItem"
+
+// Hotkey to text
+// wParam: hotkey to textify
+// lParam: address to place string, space must be allocated
+// Returns: 0
+#define MS_HKS_TO_TEXT HKS_SERVICE_NAME "/HotkeyToText"
+
+// Get hotkey from text
+// wParam: text to convert to hotkey
+// lParam: 0
+// Returns: hotkey
+#define MS_HKS_FROM_TEXT HKS_SERVICE_NAME "/HotkeyFromText"
+
+
+typedef struct
+{
+ int itemId;
+ int moduleId;
+ char *name;
+ int itemType;
+ THKSHotkey hotkey;
+
+} THKSEvent, *PHKSEvent;
+
+// Event when hotkey is pressed
+// wParam: PHKSEvent
+// lParam: 0
+#define ME_HKS_KEY_PRESSED HKS_SERVICE_NAME "/HotkeyPressed"
+
+
+
+
+// Util functions ////////////////////////////////////////////////////////////////////////
+
+
+static int HKS_RegisterModule(char *name)
+{
+ THKSItem item = {0};
+
+ if (!ServiceExists(MS_HKS_REGISTER_ITEM))
+ return -1;
+
+ item.name = name;
+ item.itemType = HKS_ITEM_MODULE;
+
+ return LOWORD(CallService(MS_HKS_REGISTER_ITEM, (WPARAM) &item, 0));
+}
+
+
+static int HKS_RegisterAction(int owner, char *name, int modifiers, char key, int flags)
+{
+ THKSItem item = {0};
+
+ if (!ServiceExists(MS_HKS_REGISTER_ITEM))
+ return -1;
+
+ item.owner = owner;
+ item.name = name;
+ item.itemType = HKS_ITEM_ACTION;
+ item.flags = flags;
+
+ if (key != 0)
+ {
+ item.hotkey.key = (WORD) key;
+ item.hotkey.modifiers = modifiers;
+ }
+
+ return LOWORD(CallService(MS_HKS_REGISTER_ITEM, (WPARAM) &item, 0));
+}
+
+
+static int HKS_RegisterGroup(int owner, char *name, int modifiers, int flags)
+{
+ THKSItem item = {0};
+
+ if (!ServiceExists(MS_HKS_REGISTER_ITEM))
+ return -1;
+
+ item.owner = owner;
+ item.name = name;
+ item.itemType = HKS_ITEM_GROUP;
+ item.flags = flags;
+ item.hotkey.modifiers = modifiers;
+
+ return LOWORD(CallService(MS_HKS_REGISTER_ITEM, (WPARAM) &item, 0));
+}
+
+static int HKS_Unregister(int id)
+{
+ THKSItem item = {0};
+
+ if (!ServiceExists(MS_HKS_UNREGISTER_ITEM))
+ return -1;
+
+ return CallService(MS_HKS_UNREGISTER_ITEM, (WPARAM) id, 0);
+}
+
+
+#endif
diff --git a/Plugins/quickcontacts/sdk/m_metacontacts.h b/Plugins/quickcontacts/sdk/m_metacontacts.h new file mode 100644 index 0000000..9f348bd --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_metacontacts.h @@ -0,0 +1,166 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2004 Universite Louis PASTEUR, STRASBOURG.
+Copyright © 2004 Scott Ellis (www.scottellis.com.au mail@scottellis.com.au)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_METACONTACTS_H__
+#define M_METACONTACTS_H__ 1
+
+#ifndef MIID_METACONTACTS
+#define MIID_METACONTACTS {0xc0325019, 0xc1a7, 0x40f5, { 0x83, 0x65, 0x4f, 0x46, 0xbe, 0x21, 0x86, 0x3e}}
+#endif
+
+//get the handle for a contact's parent metacontact
+//wParam=(HANDLE)hSubContact
+//lParam=0
+//returns a handle to the parent metacontact, or null if this contact is not a subcontact
+#define MS_MC_GETMETACONTACT "MetaContacts/GetMeta"
+
+//gets the handle for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the default contact, or null on failure
+#define MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault"
+
+//gets the contact number for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD contact number, or -1 on failure
+#define MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum"
+
+//gets the handle for the 'most online' contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the 'most online' contact
+#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
+
+//gets the number of subcontacts for a metacontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD representing the number of subcontacts for the given metacontact
+#define MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts"
+
+//gets the handle of a subcontact, using the subcontact's number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns a handle to the specified subcontact
+#define MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact"
+
+//sets the default contact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault"
+
+//sets the default contact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
+
+//'unforces' the metacontact to send using a specific subcontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
+
+//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+// overrides (and clears) 'force send' above, and will even force use of offline contacts
+// will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 1(true) or 0(false) representing new state of 'force default'
+#define MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
+
+// method to get state of 'force' for a metacontact
+// wParam=(HANDLE)hMetaContact
+// lParam= (DWORD)&contact_number or NULL
+//
+// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+// or if none is in force, the value (DWORD)-1 will be copied
+// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
+#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
+
+// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hDefaultContact
+#define ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged"
+
+// fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when
+// contacts are reordered) - a signal to re-read metacontact data
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+
+// fired when a metacontact is forced to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hForceContact
+#define ME_MC_FORCESEND "MetaContacts/ForceSend"
+
+// fired when a metacontact is 'unforced' to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
+
+// method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+// wParam=lParam=0
+#define MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName"
+
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=0
+// convert a given contact into a metacontact
+#define MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=(HANDLE)hMeta
+// add an existing contact to a metacontact
+#define MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=0
+// lParam=(HANDLE)hContact
+// remove a contact from a metacontact
+#define MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
+
+
+// added 0.9.13.2 (6/10/05)
+// wParam=(BOOL)disable
+// lParam=0
+// enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting
+// should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called
+// before the metacontact onmodulesloaded handler where the subcontact hiding is usually done)
+#define MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup"
+
+#endif
diff --git a/Plugins/quickcontacts/sdk/m_updater.h b/Plugins/quickcontacts/sdk/m_updater.h new file mode 100644 index 0000000..371b743 --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_updater.h @@ -0,0 +1,146 @@ +#ifndef _M_UPDATER_H
+#define _M_UPDATER_H
+
+// NOTES:
+// - For langpack updates, include a string of the following format in the langpack text file:
+// ";FLID: <file listing name> <version>"
+// version must be four numbers seperated by '.', in the range 0-255 inclusive
+// - Updater will disable plugins that are downloaded but were not active prior to the update (this is so that, if an archive contains e.g. ansi and
+// unicode versions, the correct plugin will be the only one active after the new version is installed)...so if you add a support plugin, you may need
+// to install an ini file to make the plugin activate when miranda restarts after the update
+// - Updater will replace all dlls that have the same internal shortName as a downloaded update dll (this is so that msn1.dll and msn2.dll, for example,
+// will both be updated) - so if you have a unicode and a non-unicode version of a plugin in your archive, you should make the internal names different (which will break automatic
+// updates from the file listing if there is only one file listing entry for both versions, unless you use the 'MS_UPDATE_REGISTER' service below)
+// - Updater will install all files in the root of the archive into the plugins folder, except for langpack files that contain the FLID string which go into the root folder (same
+// folder as miranda32.exe)...all folders in the archive will also be copied to miranda's root folder, and their contents transferred into the new folders. The only exception is a
+// special folder called 'root_files' - if there is a folder by that name in the archive, it's contents will also be copied into miranda's root folder - this is intended to be used
+// to install additional dlls etc that a plugin may require)
+
+// if you set Update.szUpdateURL to the following value when registering, as well as setting your beta site and version data,
+// Updater will ignore szVersionURL and pbVersionPrefix, and attempt to find the file listing URL's from the backend XML data.
+// for this to work, the plugin name in pluginInfo.shortName must match the file listing exactly (except for case)
+#define UPDATER_AUTOREGISTER "UpdaterAUTOREGISTER"
+// Updater will also use the backend xml data if you provide URL's that reference the miranda file listing for updates (so you can use that method
+// if e.g. your plugin shortName does not match the file listing) - it will grab the file listing id from the end of these URLs
+
+typedef struct Update_tag {
+ int cbSize;
+ char *szComponentName; // component name as it will appear in the UI (will be translated before displaying)
+
+ char *szVersionURL; // URL where the current version can be found (NULL to disable)
+ BYTE *pbVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ // (note that this URL could point at a binary file - dunno why, but it could :)
+ int cpbVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szUpdateURL; // URL where dll/zip is located
+ // set to UPDATER_AUTOREGISTER if you want Updater to find the file listing URLs (ensure plugin shortName matches file listing!)
+
+ char *szBetaVersionURL; // URL where the beta version can be found (NULL to disable betas)
+ BYTE *pbBetaVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ int cpbBetaVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szBetaUpdateURL; // URL where dll/zip is located
+
+ BYTE *pbVersion; // bytes of current version, used for comparison with those in VersionURL
+ int cpbVersion; // number of bytes pointed to by pbVersion
+
+ char *szBetaChangelogURL; // url for displaying changelog for beta versions
+} Update;
+
+// register a comonent with Updater
+//
+// wparam = 0
+// lparam = (LPARAM)&Update
+#define MS_UPDATE_REGISTER "Update/Register"
+
+// utility functions to create a version string from a DWORD or from pluginInfo
+// point buf at a buffer at least 16 chars wide - but note the version string returned may be shorter
+//
+__inline static char *CreateVersionString(DWORD version, char *buf) {
+ mir_snprintf(buf, 16, "%d.%d.%d.%d", (version >> 24) & 0xFF, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
+ return buf;
+}
+
+__inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *buf) {
+ return CreateVersionString(pluginInfo->version, buf);
+}
+
+
+// register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing
+// NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1,
+// four numbers between 0 and 255 inclusivem, so no letters, brackets, etc.)
+//
+// wParam = (int)fileID - this is the file ID from the file listing (i.e. the number at the end of the download link)
+// lParam = (PLUGININFO*)&pluginInfo
+#define MS_UPDATE_REGISTERFL "Update/RegisterFL"
+
+// this function can be used to 'unregister' components - useful for plugins that register non-plugin/langpack components and
+// may need to change those components on the fly
+// lParam = (char *)szComponentName
+#define MS_UPDATE_UNREGISTER "Update/Unregister"
+
+// this event is fired when the startup process is complete, but NOT if a restart is imminent
+// it is designed for status managment plugins to use as a trigger for beggining their own startup process
+// wParam = lParam = 0 (unused)
+// (added in version 0.1.6.0)
+#define ME_UPDATE_STARTUPDONE "Update/StartupDone"
+
+// this service can be used to enable/disable Updater's global status control
+// it can be called from the StartupDone event handler
+// wParam = (BOOL)enable
+// lParam = 0
+// (added in version 0.1.6.0)
+#define MS_UPDATE_ENABLESTATUSCONTROL "Update/EnableStatusControl"
+
+// An description of usage of the above service and event:
+// Say you are a status control plugin that normally sets protocol or global statuses in your ModulesLoaded event handler.
+// In order to make yourself 'Updater compatible', you would move the status control code from ModulesLoaded to another function,
+// say DoStartup. Then, in ModulesLoaded you would check for the existence of the MS_UPDATE_ENABLESTATUSCONTROL service.
+// If it does not exist, call DoStartup. If it does exist, hook the ME_UPDATE_STARTUPDONE event and call DoStartup from there. You may
+// also wish to call MS_UPDATE_ENABLESTATUSCONTROL with wParam == FALSE at this time, to disable Updater's own status control feature.
+
+// this service can be used to determine whether updates are possible for a component with the given name
+// wParam = 0
+// lParam = (char *)szComponentName
+// returns TRUE if updates are supported, FALSE otherwise
+#define MS_UPDATE_ISUPDATESUPPORTED "Update/IsUpdateSupported"
+
+#endif
+
+
+/////////////// Usage Example ///////////////
+
+#ifdef EXAMPLE_CODE
+
+// you need to #include "m_updater.h" and HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded) in your Load function...
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
+
+ Update update = {0}; // for c you'd use memset or ZeroMemory...
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szUpdateURL = "http://scottellis.com.au:81/test/updater.zip";
+ update.szVersionURL = "http://scottellis.com.au:81/test/updater_test.html";
+ update.pbVersionPrefix = (BYTE *)"Updater version ";
+
+ update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
+
+ // do the same for the beta versions of the above struct members if you wish to allow beta updates from another URL
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+
+ // Alternatively, to register a plugin with e.g. file ID 2254 on the file listing...
+ // CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
+
+ return 0;
+}
+
+#endif
diff --git a/Plugins/quickcontacts/sdk/m_voice.h b/Plugins/quickcontacts/sdk/m_voice.h new file mode 100644 index 0000000..a81d866 --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_voice.h @@ -0,0 +1,158 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_VOICE_H__
+# define __M_VOICE_H__
+
+
+#define EVENTTYPE_VOICE_CALL 8739
+
+
+#define PROTOTYPE_VOICE (PROTOTYPE_ENCRYPTION-9)
+
+
+#define VOICE_UNICODE 0x80000000
+
+#ifdef UNICODE
+# define VOICE_TCHAR VOICE_UNICODE
+#else
+# define VOICE_TCHAR 0
+#endif
+
+#define VOICE_STATE_TALKING 0
+#define VOICE_STATE_RINGING 1
+#define VOICE_STATE_CALLING 2
+#define VOICE_STATE_ON_HOLD 3
+#define VOICE_STATE_ENDED 4
+
+typedef struct {
+ int cbSize; // Struct size
+ const char *szModule; // The name of the protocol module (used only in notifications)
+ char *id; // Protocol especific ID for this call
+ int flags; // Can be VOICE_CALL_CONTACT or VOICE_CALL_STRING (VOICE_UNICODE to say the string is unicode)
+ union { // Who to call
+ HANDLE hContact;
+ TCHAR *ptszContact;
+ char *pszContact;
+ WCHAR *pwszContact;
+ };
+ int state; // VOICE_STATE_*
+
+} VOICE_CALL;
+
+
+/*
+Notifies that a voice call changed state
+
+wParam: const VOICE_CALL *
+lParam: ignored
+return: 0 on success
+*/
+#define PE_VOICE_CALL_STATE "/Voice/State"
+
+
+#define VOICE_SUPPORTED 1 // Set if proto support voice calls. Probabilly will be 1 ;)
+#define VOICE_CALL_CONTACT 2 // Set if a call can be made to a hContact
+#define VOICE_CALL_CONTACT_NEED_TEST 4 // Set if the contact need to be tested with PS_VOICE_CALL_CONTACT_VALID (needs VOICE_CALL_CONTACT set to work)
+#define VOICE_CALL_STRING 8 // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string)
+#define VOICE_CAN_SET_DEVICE 16 // Set if the devices to mic in and sound out can be set (or the protocol will handle it internally)
+#define VOICE_CAN_HOLD 32 // Set if a call can be put on hold
+/*
+Get protocol voice support flags
+
+wParam: ignored
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_GETINFO "/Voice/GetInfo"
+
+/*
+Request to the protocol a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_CALL "/Voice/Call"
+
+/*
+Service called to make the protocol answer a call.
+It is an async call. If the call was answered, the PE_VOICE_STARTEDCALL
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_ANSWERCALL "/Voice/AnswerCall"
+
+/*
+Service called to make the protocol answer a call. This can be called if the
+call is ringing or has started. If called any other time it should be ignored.
+It is an async call. If the call was droped, the PE_VOICE_ENDEDCALL
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_DROPCALL "/Voice/DropCall"
+
+/*
+Service called to make the protocol hold a call. This means that the call should not
+be droped, but it should be muted and put in a hold, to allow other call to be answered.
+If the protocol can't hold a cal, it should be droped.
+
+This can be called if the call has started. If called any other time it should be ignored.
+It is an async call. If the call was droped, the PE_VOICE_HOLDEDCALL
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_HOLDCALL "/Voice/HoldCall"
+
+/*
+Used if protocol support VOICE_CALL_STRING. The call string is passed as
+wParam and the proto should validate it.
+
+wParam: (const TCHAR *) call string
+lParam: ignored
+return: 0 if wrong, 1 if correct
+*/
+#define PS_VOICE_CALL_STRING_VALID "/Voice/CallStringValid"
+
+/*
+Used if protocol support VOICE_CALL_CONTACT and VOICE_CALL_CONTACT_NEED_TEST.
+The hContact is passed as wParam and the proto should tell if this contact can be
+called.
+
+wParam: (HANDLE) hContact
+lParam: (BOOL) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?'
+return: 0 if can't be called, 1 if can
+*/
+#define PS_VOICE_CALL_CONTACT_VALID "/Voice/CallContactValid"
+
+
+
+
+
+#endif // __M_VOICE_H__
diff --git a/Plugins/quickcontacts/sdk/m_voiceservice.h b/Plugins/quickcontacts/sdk/m_voiceservice.h new file mode 100644 index 0000000..98c3580 --- /dev/null +++ b/Plugins/quickcontacts/sdk/m_voiceservice.h @@ -0,0 +1,86 @@ +/*
+Copyright (C) 2007 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_VOICESERVICE_H__
+# define __M_VOICESERVICE_H__
+
+#include "m_voice.h"
+
+
+#define MIID_VOICESERVICE { 0x7d64437, 0xef2e, 0x4f60, { 0xbb, 0x2d, 0x3c, 0x51, 0x8f, 0xe2, 0x4d, 0x63 } }
+
+
+/*
+This services are a mirror of the services/notifications in m_voice.h,
+with the difference that that ones are to be used by protocols, and this ones
+are to be used by plugins that can make calls to contacts in multiple protocols.
+*/
+
+
+/*
+Notifies that a voice call changed state
+
+wParam: const VOICE_CALL *
+lParam: ignored
+return: 0 on success
+*/
+#define MS_VOICESERVICE_STATE "VoiceService/State"
+
+
+
+struct VOICE_MODULE
+{
+ int cbSize; // sizeof(VOICE_MODULE)
+ char *name; // The internal name of the plugin. All PS_* serivces (except PS_VOICE_GETINFO)
+ // defined in m_voide.h need to be created based in this name. For example,
+ // PS_VOICE_CALL (/Voice/Call) need to be created as <name>/Voice/Call
+ int flags; // VOICE_* from m_voice.h
+};
+/*
+Register a new plugin that can make/receive voice calls.
+
+wParam: const VOICE_MODULE *
+lParam: ignored
+return: 0 on success
+*/
+#define MS_VOICESERVICE_REGISTER "VoiceService/Register"
+
+
+/*
+Request a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: ignored
+return: the number of option calls for a contact. If > 0, it can be called
+*/
+#define MS_VOICESERVICE_CAN_CALL "VoiceService/CanCall"
+
+/*
+Request a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: (char *) Protocol or NULL to use any proto avaiable
+return: 0 on success
+*/
+#define MS_VOICESERVICE_CALL "VoiceService/Call"
+
+
+
+#endif // __M_VOICESERVICE_H__
|
