summaryrefslogtreecommitdiff
path: root/Plugins/quickcontacts/sdk
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/quickcontacts/sdk')
-rw-r--r--Plugins/quickcontacts/sdk/m_MagneticWindows.h86
-rw-r--r--Plugins/quickcontacts/sdk/m_hotkeysplus.h22
-rw-r--r--Plugins/quickcontacts/sdk/m_hotkeysservice.h207
-rw-r--r--Plugins/quickcontacts/sdk/m_metacontacts.h166
-rw-r--r--Plugins/quickcontacts/sdk/m_updater.h146
-rw-r--r--Plugins/quickcontacts/sdk/m_voice.h158
-rw-r--r--Plugins/quickcontacts/sdk/m_voiceservice.h86
7 files changed, 871 insertions, 0 deletions
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__