diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-05-15 10:38:20 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-05-15 10:38:20 +0000 |
commit | 48540940b6c28bb4378abfeb500ec45a625b37b6 (patch) | |
tree | 2ef294c0763e802f91d868bdef4229b6868527de /plugins/ExternalAPI | |
parent | 5c350913f011e119127baeb32a6aedeb4f0d33bc (diff) |
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI')
88 files changed, 14684 insertions, 0 deletions
diff --git a/plugins/ExternalAPI/m_ContactSettings.h b/plugins/ExternalAPI/m_ContactSettings.h new file mode 100644 index 0000000000..3f58d4cd39 --- /dev/null +++ b/plugins/ExternalAPI/m_ContactSettings.h @@ -0,0 +1,235 @@ +/*
+ Contact Settings plugin for Miranda IM
+ Copyright (c) 2007-2008 Chervov Dmitry
+
+ 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_CONTACTSETTINGS_H
+#define __M_CONTACTSETTINGS_H
+
+
+typedef struct {
+ int cbSize; // sizeof(CONTACTSETTINGSINIT)
+ int Type; // one of CSIT_ constants; value of this field depends on what settings dialog was opened: contact settings or group settings
+ union
+ {
+ HANDLE hContact; // used when Type == CSIT_CONTACT
+ int groupID; // used when Type == CSIT_GROUP
+ };
+} CONTACTSETTINGSINIT;
+
+// CONTACTSETTINGSINIT::Type
+#define CSIT_CONTACT 1 // CONTACTSETTINGSINIT::hContact is valid
+#define CSIT_GROUP 2 // CONTACTSETTINGSINIT::groupID is valid; in general, if Type == CSIT_GROUP, you MUST call MS_CONTACTSETTINGS_ADDCONTROL and add _all_ your per-contact controls, independently of current group contents, because potentially the group can contain any contacts in future.
+
+/* ME_CONTACTSETTINGS_INITIALISE
+The user opened a contact settings dialog. Modules should do whatever initialisation they need and call MS_CONTACTSETTINGS_ADDCONTROL one or more times if they want controls displayed in the dialog
+wParam=(WPARAM)(CONTACTSETTINGSINIT*)csi
+lParam=0
+*/
+#define ME_CONTACTSETTINGS_INITIALISE "ContactSettings/Init"
+
+
+/* MS_CONTACTSETTINGS_ADDCONTROL
+Must only be called during a ME_CONTACTSETTINGS_INITIALISE hook
+Adds a control to the contact settings dialog
+wParam=(WPARAM)(CONTACTSETTINGSINIT*)csi
+lParam=(LPARAM)(CONTACTSETTINGSCONTROL*)csc
+Returns 0 on success, nonzero on failure
+csi must have come straight from the wParam of ME_CONTACTSETTINGS_INITIALISE
+Strings in the structure can be released as soon as the service returns.
+*/
+
+// CONTACTSETTINGSCONTROL::Position
+#define CSPOS_SORTBYALPHABET 0x40000000 // recommended value for Position if you don't need a specific sorting order
+// Group = "Notifications":
+#define CSPOS_NOTIFICATIONS_SERVICES 0x20000000 // recommended control position for notification SERVICE PROVIDERS (popups, osd, tickers, etc). Notification plugins that use these services should use CSPOS_SORTBYALPHABET, so that notification service provider settings are above any other specific notification settings.
+
+// CONTACTSETTINGSCONTROL::Flags
+#define CSCF_UNICODE 1 // string fields in CONTACTSETTINGSCONTROL and CSCONTROLSTATE are WCHAR*
+#define CSCF_DONT_TRANSLATE_STRINGS 2 // specifies that strings in CONTACTSETTINGSCONTROL and CSCONTROLSTATE are translated already
+
+#ifdef _UNICODE
+#define CSCF_TCHAR CSCF_UNICODE
+#else
+#define CSCF_TCHAR 0
+#endif
+
+// CONTACTSETTINGSCONTROL::ControlType
+typedef enum
+{
+ CSCT_LABEL = -1, // CSCT_LABEL is used internally in ContactSettings, and mustn't be used by other plugins
+ CSCT_CHECKBOX, // checkbox control
+ CSCT_COMBOBOX // combobox control with a title above it
+} CSCONTROLTYPE;
+
+// some common values for CONTACTSETTINGSCONTROL::ptszGroup
+#define CSGROUP_NOTIFICATIONS LPGENT("Notifications")
+
+// special values for CONTACTSETTINGSCONTROL::szModule
+#define CSMODULE_PROTO "%proto%" // ContactSettings will replace this by contact's protocol module name
+
+struct CSCONTROLSTATE
+{
+#ifdef __cplusplus
+ CSCONTROLSTATE(): ptszName(NULL) {dbvValue.type = 0; dbvValue.dVal = 0; dbvValue.pbVal = 0; }
+ CSCONTROLSTATE(char *pszName, BYTE Value) { this->pszName = pszName; dbvValue.type = DBVT_BYTE; dbvValue.bVal = Value; }
+ CSCONTROLSTATE(char *pszName, char Value) { this->pszName = pszName; dbvValue.type = DBVT_BYTE; dbvValue.cVal = Value; }
+ CSCONTROLSTATE(char *pszName, WORD Value) { this->pszName = pszName; dbvValue.type = DBVT_WORD; dbvValue.wVal = Value; }
+ CSCONTROLSTATE(char *pszName, short Value) { this->pszName = pszName; dbvValue.type = DBVT_WORD; dbvValue.sVal = Value; }
+ CSCONTROLSTATE(char *pszName, DWORD Value) { this->pszName = pszName; dbvValue.type = DBVT_DWORD; dbvValue.dVal = Value; }
+ CSCONTROLSTATE(char *pszName, long Value) { this->pszName = pszName; dbvValue.type = DBVT_DWORD; dbvValue.lVal = Value; }
+ CSCONTROLSTATE(char *pszName, const char *szValue) { this->pszName = pszName; dbvValue.type = DBVT_ASCIIZ; dbvValue.pszVal = (char*)szValue; }
+ CSCONTROLSTATE(char *pszName, const WCHAR *wszValue) { this->pszName = pszName; dbvValue.type = DBVT_WCHAR; dbvValue.pwszVal = (WCHAR*)wszValue; }
+ CSCONTROLSTATE(WCHAR *pwszName, BYTE Value) { this->pwszName = pwszName; dbvValue.type = DBVT_BYTE; dbvValue.bVal = Value; }
+ CSCONTROLSTATE(WCHAR *pwszName, char Value) { this->pwszName = pwszName; dbvValue.type = DBVT_BYTE; dbvValue.cVal = Value; }
+ CSCONTROLSTATE(WCHAR *pwszName, WORD Value) { this->pwszName = pwszName; dbvValue.type = DBVT_WORD; dbvValue.wVal = Value; }
+ CSCONTROLSTATE(WCHAR *pwszName, short Value) { this->pwszName = pwszName; dbvValue.type = DBVT_WORD; dbvValue.sVal = Value; }
+ CSCONTROLSTATE(WCHAR *pwszName, DWORD Value) { this->pwszName = pwszName; dbvValue.type = DBVT_DWORD; dbvValue.dVal = Value; }
+ CSCONTROLSTATE(WCHAR *pwszName, long Value) { this->pwszName = pwszName; dbvValue.type = DBVT_DWORD; dbvValue.lVal = Value; }
+ CSCONTROLSTATE(WCHAR *pwszName, const char *szValue) { this->pwszName = pwszName; dbvValue.type = DBVT_ASCIIZ; dbvValue.pszVal = (char*)szValue; }
+ CSCONTROLSTATE(WCHAR *pwszName, const WCHAR *wszValue) { this->pwszName = pwszName; dbvValue.type = DBVT_WCHAR; dbvValue.pwszVal = (WCHAR*)wszValue; }
+#endif
+
+ union
+ {
+ TCHAR *ptszName; // item text for CSCT_COMBOBOX; not used for CSCT_CHECKBOX
+ char *pszName;
+ WCHAR *pwszName;
+ };
+ DBVARIANT dbvValue; // database value for this state
+};
+
+// WARNING: do not use Translate(TS) for ptszTitle, ptszGroup, ptszTooltip or CSCONTROLSTATE::ptszName as they are translated by ContactSettings. The only exception is when you use CSCF_DONT_TRANSLATE_STRINGS flag
+typedef struct {
+ int cbSize; // sizeof(CONTACTSETTINGSCONTROL)
+ int cbStateSize; // sizeof(CSCONTROLSTATE)
+ int Position; // position in the group, lower numbers are topmost. CSPOS_SORTBYALPHABET is recommended if you don't need a specific sorting order
+ DWORD Flags; // a combination of CSCF_ constants
+ CSCONTROLTYPE ControlType; // one of CSCT_ constants
+ union
+ {
+ TCHAR *ptszTitle; // label above the control
+ char *pszTitle;
+ WCHAR *pwszTitle;
+ };
+ union
+ {
+ TCHAR *ptszGroup; // group title (several controls may be grouped together); may be NULL.
+ char *pszGroup;
+ WCHAR *pwszGroup;
+ };
+ union
+ {
+ TCHAR *ptszTooltip; // tooltip for the control; may be NULL
+ char *pszTooltip;
+ WCHAR *pwszTooltip;
+ };
+ const char *szModule; // database module; may contain variables (see above; currently the only existing variable is CSMODULE_PROTO)
+ const char *szSetting; // database setting
+ int StateNum; // number of possible states; always 2 or 3 for CSCT_CHECKBOX, and can be any number starting from 2 for CSCT_COMBOBOX
+ int DefState; // default state index
+ CSCONTROLSTATE *pStates; // array of StateNum items, describing all possible control states. Can be NULL for CSCT_COMBOBOX, in this case ContactSettings will use DBVT_BYTE database values, 0 is unchecked, 1 is checked, 2 is indeterminate. Can't be NULL for CSCT_COMBOBOX.
+ DWORD ValueMask; // in most cases simply set this to 0. when not 0, it allows to define a bit mask to access separate bits of a db value instead of reading/writing the whole value. is valid only for DBVT_BYTE, DBVT_WORD and DBVT_DWORD values
+} CONTACTSETTINGSCONTROL;
+
+#define MS_CONTACTSETTINGS_ADDCONTROL "ContactSettings/AddControl"
+
+
+typedef struct {
+ int cbSize; // sizeof(CONTACTSETTINGSCHANGEINFO)
+ HANDLE hContact;
+ const char *szModule; // variables in szModule and szSetting are NOT parsed, i.e. ContactSettings copies the values straight from CONTACTSETTINGSCONTROL
+ const char *szSetting;
+} CONTACTSETTINGSCHANGEINFO;
+
+/* ME_CONTACTSETTINGS_SETTINGCHANGED
+Called for every changed setting when the user applied changes in a contact settings dialog
+wParam=(WPARAM)(CONTACTSETTINGSCHANGEINFO*)csci
+lParam=0
+This event will be triggered many times rapidly when a whole bunch of values are set.
+Modules which hook this should be aware of this fact and quickly return if they are not interested in the value that has been changed.
+*/
+#define ME_CONTACTSETTINGS_SETTINGCHANGED "ContactSettings/SettingChanged"
+
+
+/* MS_CONTACTSETTINGS_SHOWDIALOG
+Shows Contact Settings dialog for a contact
+wParam=hContact
+lParam=0
+*/
+#define MS_CONTACTSETTINGS_SHOWDIALOG "ContactSettings/ShowDialog"
+
+/* MS_CONTACTSETTINGS_SHOWGROUPDIALOG. Not implemented yet.
+Shows dialog for a group
+wParam=groupId (0 is the main group)
+lParam=0
+*/
+#define MS_CONTACTSETTINGS_SHOWGROUPDIALOG "ContactSettings/ShowGroupDialog"
+
+
+/*
+Example of use:
+
+// in ME_SYSTEM_MODULESLOADED handler:
+ HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit);
+
+// ME_CONTACTSETTINGS_INITIALISE handler
+static int ContactSettingsInit(WPARAM wParam, LPARAM lParam)
+{
+ CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam;
+
+// check first whether to add controls or not
+// we need to get a protocol name for that, if it's a contact settings dialog:
+ char *szProto = (csi->Type == CSIT_CONTACT) ? (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)csi->hContact, 0) : NULL;
+// in general, you MUST add all your controls if csi->Type == CSIT_GROUP (i.e. user opened a group settings dialog), otherwise your plugin won't support group settings well:
+ if ((csi->Type == CSIT_GROUP) ||
+// otherwise (for a contact settings dialog), you can add controls depending on some conditions, like protocol caps, etc.
+// in this example, we check whether the protocol has a PS_GETCUSTOMSTATUSICON service (i.e. does it support xstatuses or not):
+ (csi->Type == CSIT_CONTACT && szProto && ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSICON)))
+// your plugin must ignore cases when csi->Type is neither CSIT_GROUP nor CSIT_CONTACT
+ {
+ CONTACTSETTINGSCONTROL csc = {0};
+ csc.cbSize = sizeof(csc);
+ csc.Position = CSPOS_SORTBYALPHABET;
+ csc.Flags = CSCF_TCHAR;
+ csc.ControlType = CSCT_COMBOBOX;
+ csc.StateNum = 3;
+ csc.ptszTitle = LPGENT("XStatus change notifications:") _T("\0") LPGENT("Ignore") _T("\0") LPGENT("Notify always") _T("\0") LPGENT("Use global settings") _T("\0");
+ csc.ptszGroup = CSGROUP_NOTIFICATIONS;
+ csc.ptszTooltip = LPGENT("Tooltip text");
+ csc.pszDBSetting = "ModuleName/XSNotifications";
+ csc.DefValue = 2; // "Use global settings"
+ CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc);
+
+ // and CSCT_CHECKBOX example:
+ csc.Position = CSPOS_SORTBYALPHABET;
+ csc.Flags = CSCF_TCHAR;
+ csc.ControlType = CSCT_CHECKBOX;
+ csc.StateNum = 3;
+ csc.ptszTitle = LPGENT("Other setting");
+ csc.ptszGroup = LPGENT("Some group");
+ csc.ptszTooltip = LPGENT("Tooltip text");
+ csc.pszDBSetting = "ModuleName/OtherSetting";
+ csc.DefValue = 2; // BST_INDETERMINATE
+ CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc);
+ }
+ return 0;
+}
+
+*/
+
+#endif // __M_CONTACTSETTINGS_H
diff --git a/plugins/ExternalAPI/m_DataAsMessage.h b/plugins/ExternalAPI/m_DataAsMessage.h new file mode 100644 index 0000000000..2f1f2eb441 --- /dev/null +++ b/plugins/ExternalAPI/m_DataAsMessage.h @@ -0,0 +1,182 @@ +/*
+ DataAsMessage plugin for Miranda IM
+ Copyright (c) 2006-2007 Chervov Dmitry
+
+ 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_DATAASMESSAGE_H
+#define __M_DATAASMESSAGE_H
+
+// DAM_SENDRESULTINFO::iResult values
+#define DAM_SR_SUCCESS 0
+#define DAM_SR_TIMEOUT 1 // timeout period expired; this value is returned also if the contact went offline for a time longer than a timeout period
+#define DAM_SR_NOTSUPPORTED 2 // means this szDataType is not supported by the remote side
+#define DAM_SR_NODAM 3 // means there is no DataAsMessage plugin on the remote side; keep in mind that this error can also appear accidentally because of a bad connectivity during the handshake (if there was a timeout when waiting for a response)
+#define DAM_SR_CANCELLEDLOCAL 4 // cancelled from the local(sending) side
+#define DAM_SR_CANCELLEDREMOTE 5 // cancelled from the remote(receiving) side
+#define DAM_SR_BADCRC 6 // bad CRC; we can't do anything with this error. the most probable cause is that protocol filters some of characters in our messages
+#define DAM_SR_UNKNOWN 7 // unknown error
+
+// Return values for DAM_SENDRESULTPROC
+#define DAM_SRA_RETRY 1
+
+typedef struct
+{
+ int cbSize; // sizeof(DAM_SENDRESULTINFO)
+ HANDLE hContact;
+ char *szDataType;
+ DWORD SessionID;
+ int iResult; // transmission result code
+} DAM_SENDRESULTINFO; // hContact, szDataType and SessionID fields correspond to the fields of the DAM_SENDDATAINFO structure
+
+typedef int (*DAM_SENDRESULTPROC)(DAM_SENDRESULTINFO *sri); // this procedure receives the result of the transmission. it's called when the session closes (either the data was sent successfully or there was an error)
+// you can return DAM_SRA_RETRY when iResult is DAM_SR_TIMEOUT if you want to retry sending
+
+
+// DAM_SENDDATAINFO::Flags constants
+#define DAM_SDF_DONTPACK 1 // don't compress the data (by default all the data is compressed)
+#define DAM_SDF_NOTIMEOUT 2 // don't generate a timeout error ever, keep trying to send the data. If the contact is offline, the data is saved in the memory until the contact goes online. Loss of the data occurs only if the sender's miranda closes (this may change in future to allow fully functional offline sending that will guarantee the data to be sent in any case, but of course the sending starts only when the both contacts are online). other errors than the timeout error can be still generated though.
+
+typedef struct
+{
+ int cbSize; // sizeof(DAM_SENDDATAINFO)
+ HANDLE hContact;
+ char *szDataType; // zero-terminated string, containing data type, preferably in format "YourPluginName" or "YourPluginName/Something" (make sure this string won't coincide by an accident with someone else's string!). you can identify your data by this ID later
+ int nDataLen; // keep in mind that if the length is too big (more than about 8 KB), it's more preferable to split your data into several chunks, as you won't be able to "pick up" your data at the other end until all the data is transferred
+ char *cData;
+ int Flags; // combination of the DAM_SDF_ constants
+ DWORD SendAfterSessionID; // may be NULL; otherwise it's guaranteed that the sending starts only after successful completion of SendAfterSessionID session
+ DAM_SENDRESULTPROC SendResultProc; // pointer to a procedure that receives the result; can be NULL
+ DWORD SessionID; // OUT; receives the session ID
+} DAM_SENDDATAINFO;
+
+// MS_DAM_SENDDATA return values
+#define DAM_SDA_NOERROR 0
+#define DAM_SDA_NOTSUPPORTED (-1) // contact's protocol doesn't support sending/receiving messages
+#define DAM_SDA_TOOMANYSESSIONS (-2) // too many sessions
+
+// MS_DAM_SENDDATA
+// sends the data
+// wParam = (WPARAM)(DAM_SENDDATAINFO*)sdi;
+// lParam = 0
+// Returns 0 (DAM_SDA_NOERROR) and fills SessionID if the session was queued for sending successfully; returns one of the DAM_SDA_ values on failure
+#define MS_DAM_SENDDATA "DataAsMessage/SendData"
+
+static int __inline DAMSendData(HANDLE hContact, char *szDataType, int nDataLen, char *cData, int Flags, DWORD SendAfterSessionID, DAM_SENDRESULTPROC SendResultProc, DWORD *pSessionID)
+{
+ int Result;
+ DAM_SENDDATAINFO sdi;
+ ZeroMemory(&sdi, sizeof(sdi));
+ sdi.cbSize = sizeof(sdi);
+ sdi.hContact = hContact;
+ sdi.szDataType = szDataType;
+ sdi.nDataLen = nDataLen;
+ sdi.cData = cData;
+ sdi.Flags = Flags;
+ sdi.SendAfterSessionID = SendAfterSessionID;
+ sdi.SendResultProc = SendResultProc;
+ Result = CallService(MS_DAM_SENDDATA, (WPARAM)&sdi, 0);
+ if (pSessionID)
+ {
+ *pSessionID = sdi.SessionID;
+ }
+ return Result;
+}
+
+
+typedef struct
+{
+ int cbSize; // sizeof(DAM_RECVDATAINFO)
+ HANDLE hContact;
+ char *szDataType;
+ int nDataLen;
+ char *cData;
+} DAM_RECVDATAINFO;
+
+// ME_DAM_RECVDATA
+// hook up to this event to check for incoming data
+// make sure rdi->szDataType is yours before doing anything!
+// The important thing here is that your plugin will receive TWO ME_DAM_RECVDATA notifications on every single MS_DAM_SENDDATA call from a remote side:
+// The first notification arrives when the remote side starts to transmit the data. In this case DAM_RECVDATAINFO::cData = NULL (and DAM_RECVDATAINFO::nDataLen = -1) as we didn't receive any data yet. Return 1 to indicate that your plugin recognized the DAM_RECVDATAINFO::szDataType, otherwise return 0. If there are no any plugin that recognized the data, DAM cancels the transfer and there won't be any second notification for it.
+// The second notification is when the data is transmitted successfully. nDataLen contains the usual data size and cData points to the data buffer. cData is guaranteed to be valid only during the ME_DAM_RECVDATA call. You must copy the data to your own plugin's memory if you need to use it later. And again, return 1 to indicate that your plugin recognized the data, otherwise return 0
+// wParam = (WPARAM)(DAM_RECVDATAINFO*)rdi;
+// lParam = 0
+#define ME_DAM_RECVDATA "DataAsMessage/RecvData"
+
+
+typedef struct
+{
+ int cbSize; // sizeof(DAM_COMPRESSION_DATA)
+ void *(*malloc)(size_t); // pointer to the malloc() function of the calling module
+ int nInputDataLen; // IN; length of the input data in bytes
+ char *cInputData; // IN; pointer to the input data
+ int nOutputDataLen; // OUT; length of the output data in bytes
+ char *cOutputData; // OUT; pointer to the output data
+} DAM_COMPRESSION_DATA;
+
+// Compression/decompression services. You DON'T have to use them if you want to send compressed data using DAM services, as DAM compresses the data automatically. These services are here just in case you need to compress/decompress data for your own needs
+
+// MS_DAM_COMPRESS
+// compresses the data using BZip2
+// wParam = (WPARAM)(DAM_COMPRESSION_DATA*)bd;
+// lParam = 0
+// cbSize, malloc, nInputDataLen and cInputData fields must be valid when calling the service.
+// Returns 0 and fills nOutputDataLen and cOutputData on success; returns non-zero on failure
+// This service allocates the memory for cOutputData using the specified malloc function; you must call free(cOutputData) when you've finished working with cOutputData
+#define MS_DAM_COMPRESS "DataAsMessage/Compress"
+
+// MS_DAM_DECOMPRESS
+// decompresses the data
+// wParam = (WPARAM)(DAM_COMPRESSION_DATA*)bd;
+// lParam = 0
+// cbSize, malloc, nInputDataLen and cInputData fields must be valid when calling the service.
+// Returns 0 and fills nOutputDataLen and cOutputData on success; returns non-zero on failure
+// This service allocates the memory for cOutputData using the specified malloc function; you must call free(cOutputData) when you've finished working with cOutputData
+#define MS_DAM_DECOMPRESS "DataAsMessage/Decompress"
+
+
+__inline int DAM_Compress(char *cInputData, int nInputDataLen, char **cOutputData, int *nOutputDataLen)
+{
+ int Result;
+ DAM_COMPRESSION_DATA bd;
+ ZeroMemory(&bd, sizeof(bd));
+ bd.cbSize = sizeof(bd);
+ bd.malloc = malloc;
+ bd.nInputDataLen = nInputDataLen;
+ bd.cInputData = cInputData;
+ Result = CallService(MS_DAM_COMPRESS, (WPARAM)&bd, 0);
+ *nOutputDataLen = bd.nOutputDataLen;
+ *cOutputData = bd.cOutputData;
+ return Result;
+}
+
+__inline int DAM_Decompress(char *cInputData, int nInputDataLen, char **cOutputData, int *nOutputDataLen)
+{
+ int Result;
+ DAM_COMPRESSION_DATA bd;
+ ZeroMemory(&bd, sizeof(bd));
+ bd.cbSize = sizeof(bd);
+ bd.malloc = malloc;
+ bd.nInputDataLen = nInputDataLen;
+ bd.cInputData = cInputData;
+ Result = CallService(MS_DAM_DECOMPRESS, (WPARAM)&bd, 0);
+ *nOutputDataLen = bd.nOutputDataLen;
+ *cOutputData = bd.cOutputData;
+ return Result;
+}
+
+
+#endif // __M_DATAASMESSAGE_H
diff --git a/plugins/ExternalAPI/m_HTTPServer.h b/plugins/ExternalAPI/m_HTTPServer.h new file mode 100644 index 0000000000..6cb6549ee0 --- /dev/null +++ b/plugins/ExternalAPI/m_HTTPServer.h @@ -0,0 +1,105 @@ +//This file is part of HTTPServer a Miranda IM plugin
+//Copyright (C)2002 Kennet Nielsen
+//
+//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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+#ifndef M_HTTP_SERVER_H
+#define M_HTTP_SERVER_H
+
+
+#define OPT_SEND_LINK 0x1
+
+
+typedef struct {
+ DWORD lStructSize; // Set to sizeof(STFileShareInfo)
+ char * pszSrvPath; // Server path
+ DWORD dwMaxSrvPath; // Buffer allocated for Server path only used when information is requested from HTTP server.
+ char * pszRealPath; // Real path can be relative or complete
+ DWORD dwMaxRealPath;// Buffer allocated for Real path only used when information is requested from HTTP server.
+ DWORD dwAllowedIP; // The IP address which is allowed to access this share
+ DWORD dwAllowedMask; // A mask which is applied to IP address to allow other IP addresses
+ int nMaxDownloads; // The maximum number of download which can be made on this share.
+ DWORD dwOptions; // Use OPT_SEND_LINK to open a message window with the link to file
+} STFileShareInfo, * LPSTFileShareInfo;
+
+// dwMaxSrvPath Specifies the size, in chars, of the buffer pointed to by pszSrvPath.
+// The buffer must be large enough to store the path and file name string,
+// including the terminating null character.
+
+
+/////////////////////////////////////////////
+/// Service MS_HTTP_ADD_CHANGE_REMOVE ///
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)0
+// lParam = (LPARAM)LPSTFileShareInfo;
+// Server path is the key when working with FileShareInfo.
+// Two files can not be shared with the same "Server path" in the HTTP server.
+// If the server path does not exists it will be added.
+// If it does exists the action depends on what real path is.
+// If real path is empty the entity will be removed else it
+// will just be updated with the new settings.
+
+//
+// returns 0 on success, nonzero on failure
+#define MS_HTTP_ADD_CHANGE_REMOVE "HTTPServer/AddChangeRemove"
+
+
+/////////////////////////////////////////////
+////// Service MS_HTTP_GET_SHARE //////
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)0;
+// lParam = (LPARAM)LPSTFileShareInfo;
+// Returns the information for a share
+// Server path must be set the the share you wish information for.
+//
+// returns 0 on success, nonzero on failure
+
+#define MS_HTTP_GET_SHARE "HTTPServer/GetShare"
+
+
+
+/////////////////////////////////////////////
+/// Service MS_HTTP_ACCEPT_CONNECTIONS ///
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)boolean(true/false);
+// lParam = (LPARAM)0;
+// Toggles the HTTP server state if wParam is FALSE
+// Force enable HTTP server if wParam is TRUE
+// returns 0 on success, nonzero on failure
+
+#define MS_HTTP_ACCEPT_CONNECTIONS "HTTPServer/AcceptConnections"
+
+/////////////////////////////////////////////
+//// Service MS_HTTP_GET_ALL_SHARES /////
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)0;
+// lParam = (LPARAM)&LPSTFileShareInfo;
+// Returns an array of all currently shared files in the HTTP Server
+// LPSTFileShareInfo points to the first share.
+// You must free the memory returned by using the miranda MS_SYSTEM_GET_MMI
+// and calling MM_INTERFACE->free( LPSTFileShareInfo )
+//
+// returns the count of shares in the buffer pointed to by LPSTFileShareInfo
+
+#define MS_HTTP_GET_ALL_SHARES "HTTPServer/GetAllShares"
+
+
+
+#endif
diff --git a/plugins/ExternalAPI/m_LogService.h b/plugins/ExternalAPI/m_LogService.h new file mode 100644 index 0000000000..dc6c9f0012 --- /dev/null +++ b/plugins/ExternalAPI/m_LogService.h @@ -0,0 +1,217 @@ +/*
+ LogService - Plugin for Miranda IM
+ Copyright (c) 2006-2008 Chervov Dmitry
+
+ 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_LOGSERVICE_H
+#define __M_LOGSERVICE_H
+
+#define MIID_LOGSERVICE {0xe60bc9eb, 0xa099, 0x4846, {0xbc, 0x11, 0xba, 0x39, 0xf6, 0x60, 0x8b, 0x94}}
+// {E60BC9EB-A099-4846-BC11-BA39F6608B94}
+
+
+// LS_REGINFO::Flags constants
+#define LSRF_WCHAR 1 // specifies that LS_REGINFO::szTitle, szDefLogPath and szDefFormat are WCHAR*
+#ifdef _UNICODE
+ #define LSRF_TCHAR LSRF_WCHAR
+#else
+ #define LSRF_TCHAR 0
+#endif
+
+typedef struct {
+ int cbSize; // sizeof(LS_REGINFO)
+ char *szID; // Log ID; it's a good idea to use your plugin name here
+ union
+ {
+ char *szTitle; // Title shown in the options. Cannot be NULL or empty. This is translated by LogService automatically
+ WCHAR *wszTitle;
+ TCHAR *tszTitle;
+ };
+ union
+ {
+ char *szDefLogPath; // Default log file path, may contain variables. May be NULL - in this case the default path is "<log ID>.log". Usually it's relative to <Miranda profile dir>\Logs dir, but it can be changed by user through Folders plugin.
+ WCHAR *wszDefLogPath; // if there's no Variables plugin installed, LogService will use szDefLogPath with all the variables removed from it
+ TCHAR *tszDefLogPath;
+ };
+ union
+ {
+ char *szDefFormat; // Default log format; contains variables. May be NULL - in this case the default formatting is "`[`!cdate()-!ctime()`]` %extratext%"
+ WCHAR *wszDefFormat;
+ TCHAR *tszDefFormat;
+ };
+ int Flags;
+} LS_REGINFO;
+
+// MS_LOGSERVICE_REGISTER
+// Registers a log. Your plugin can register several different logs with different settings. This service must be called once for every needed log ID at every startup.
+// wParam = (WPARAM)(LS_REGINFO*)pri - pointer to LS_REGINFO item
+// lParam = 0
+// returns 0 on success
+#define MS_LOGSERVICE_REGISTER "LogService/Register"
+
+__inline static int logservice_register(char *szID, TCHAR *tszTitle, TCHAR *tszDefLogPath, TCHAR *tszDefFormat)
+{
+ LS_REGINFO ri;
+ ZeroMemory(&ri, sizeof(LS_REGINFO));
+ ri.cbSize = sizeof(LS_REGINFO);
+ ri.szID = szID;
+ ri.tszTitle = tszTitle;
+ ri.tszDefLogPath = tszDefLogPath;
+ ri.tszDefFormat = tszDefFormat;
+ ri.Flags = LSRF_TCHAR;
+ return CallService(MS_LOGSERVICE_REGISTER, (WPARAM)&ri, 0);
+}
+
+
+
+// LS_MSGINFO::Flags constants
+#define LSMF_WCHAR 1 // specifies that LS_MSGINFO::szMsg is a WCHAR*
+#ifdef _UNICODE
+ #define LSMF_TCHAR LSMF_WCHAR
+#else
+ #define LSMF_TCHAR 0
+#endif
+
+typedef struct {
+ int cbSize; // sizeof(LS_MSGINFO)
+ char *szID;
+ HANDLE hContact; // may be NULL if no contact is associated with the message
+ union
+ {
+ char *szMsg; // the message
+ WCHAR *wszMsg;
+ TCHAR *tszMsg;
+ };
+ int Flags;
+} LS_MSGINFO;
+
+// MS_LOGSERVICE_LOG
+// Logs szMsg message. You don't have to specify in szMsg anything else than the actual message. i.e. LogService will take care of date, time, contact nick etc by itself, using the format string
+// wParam = (WPARAM)(LS_MSGINFO*)pmi - pointer to LS_MSGINFO item
+// lParam = 0
+// returns 0 on success
+#define MS_LOGSERVICE_LOG "LogService/Log"
+
+__inline static int logservice_log(char *szID, HANDLE hContact, TCHAR *tszMsg)
+{
+ LS_MSGINFO mi;
+ ZeroMemory(&mi, sizeof(LS_MSGINFO));
+ mi.cbSize = sizeof(LS_MSGINFO);
+ mi.szID = szID;
+ mi.hContact = hContact;
+ mi.tszMsg = tszMsg;
+ mi.Flags = LSMF_TCHAR;
+ return CallService(MS_LOGSERVICE_LOG, (WPARAM)&mi, 0);
+}
+
+
+// LS_LOGINFO::Flags constants
+#define LSLI_WCHAR 1 // [in]; specifies that LS_LOGINFO::szLogPath is a WCHAR*
+#ifdef _UNICODE
+ #define LSLI_TCHAR LSLI_WCHAR
+#else
+ #define LSLI_TCHAR 0
+#endif
+#define LSLI_LOGENABLED 2 // [out]; LogService will set this flag if log with ID szID is enabled in the options. Setting this flag before calling MS_LOGSERVICE_GETLOGINFO is ignored. This flag is independent of hContact.
+
+typedef struct {
+ int cbSize; // [in]; sizeof(LS_LOGINFO)
+ char *szID; // [in]
+ HANDLE hContact; // [in]; may be NULL
+ union
+ {
+ char *szLogPath; // [in]; pointer to a string to receive log file name, including full path. May be NULL. The string must be at least MAX_PATH characters long
+ WCHAR *wszLogPath;
+ TCHAR *tszLogPath;
+ };
+ int Flags; // [in,out]
+} LS_LOGINFO;
+
+// MS_LOGSERVICE_GETLOGINFO
+// Returns various information about log with ID szID.
+// wParam = (WPARAM)(LS_LOGINFO*)pli - pointer to LS_LOGINFO item
+// lParam = 0
+// If szFileName is not NULL, MS_LOGSERVICE_GETLOGINFO gets full log file path by szID and hContact and copies it to *szLogPath
+// Also the service will set LSLI_LOGENABLED flag if the specified log is enabled in the options.
+// returns 0 on success
+#define MS_LOGSERVICE_GETLOGINFO "LogService/GetLogInfo"
+
+
+/*
+1) Example of the simpliest way to use LogService:
+
+ // define szID
+ #define LOG_ID "MyPluginName"
+
+ // in ME_SYSTEM_MODULESLOADED handler:
+ logservice_register(LOG_ID, LPGENT("My plugin - log title"), NULL, NULL);
+
+ // whenever you need to log something:
+ logservice_log(LOG_ID, NULL, _T("Test message"));
+ // (don't forget to specify hContact instead of NULL here if there's a contact associated with the message)
+
+MyPluginName.log will be created with the following contents:
+[20.08.2007-14:30:00] Test message
+
+
+2) If you want to offer additional customizability of log format using Variables, but still want the log to be usable even when Variables plugin is not installed, you can specify different messages depending on existence of MS_VARS_FORMATSTRING service. This example will explain how to do this and also will show you some other useful hints related to Variables plugin.
+
+ // define szID
+ #define LOG_ID "ClientChangeNotify"
+
+ // For example, say, we want to append user's ICQ UIN (or Yahoo ID, etc) to file name, to log CCN events to different files, depending on protocol (i.e. ClientChangeNotify_310927.log for ICQ). That's why custom log file path with variables is used here:
+
+ logservice_register(LOG_ID, LPGENT("ClientChangeNotify"),
+ _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"),
+ TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%"));
+
+ // When Variables plugin is not installed, LogService will automatically cut all the variables from the log path, and we'll get usual "ClientChangeNotify.log" - so everyting is ok here.
+ // But note that %extratext% in the log format is supposed to contain only client name in CCN, and without some special measures, we would get something like this in the log when Variables plugin is not installed:
+ // [20.08.2007-14:30:00] Miranda IM 0.7.0.33 alpha (ICQ v0.3.8.105 alpha)
+ // Without at least contact nick, such log will be just useless. So when logging, we'll handle this case in a special way:
+
+ if (ServiceExists(MS_VARS_FORMATSTRING))
+ { // Variables plugin is installed
+ logservice_log(LOG_ID, hContact, tszClientName);
+ } else
+ { // Variables plugin is not installed, so we have to generate the string by ourselves, using some simple predefined format:
+ TCHAR tszNickAndClient[1024];
+ mir_sntprintf(tszNickAndClient, SIZEOF(tszNickAndClient), TranslateT("%s changed his client to %s"),
+ (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR), tszClientName);
+ logservice_log(LOG_ID, hContact, tszNickAndClient);
+ }
+
+3) The other solution to the case when there's no Variables plugin, is to sacrifice customizability of log format for a simplier implementation:
+
+ // define szID
+ #define LOG_ID "ClientChangeNotify"
+
+ // in ME_SYSTEM_MODULESLOADED handler:
+ logservice_register(LOG_ID, LPGENT("ClientChangeNotify"),
+ _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"),
+ NULL);
+
+ // logging:
+ TCHAR tszNickAndClient[1024];
+ mir_sntprintf(tszNickAndClient, SIZEOF(tszNickAndClient), TranslateT("%s changed his client to %s"),
+ (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR), tszClientName);
+ logservice_log(LOG_ID, hContact, tszNickAndClient);
+
+ // Note that %extratext% now always contains the whole "<contact> changed his client to <client>" string, and user is almost unable to customize this; perhaps only by using another translation or some advanced Variables scripts.
+*/
+
+#endif // __M_LOGSERVICE_H
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_MagneticWindows.h b/plugins/ExternalAPI/m_MagneticWindows.h new file mode 100644 index 0000000000..e011c773fd --- /dev/null +++ b/plugins/ExternalAPI/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/ExternalAPI/m_MathModule.h b/plugins/ExternalAPI/m_MathModule.h new file mode 100644 index 0000000000..04ae06a7f7 --- /dev/null +++ b/plugins/ExternalAPI/m_MathModule.h @@ -0,0 +1,263 @@ +#ifndef M_MATHMODULE_H_
+#define M_MATHMODULE_H_
+//---------------------------------------------------
+
+
+/*
+ **************************
+ * 2 *
+ ** * x + 2 Pi
+ ** ************* + R
+ * Sin(wt)
+ *
+
+ Math-Module
+ **************
+
+ Miranda Plugin by Stephan Kassemeyer
+
+
+ MathModule API - (c) Stephan Kassemeyer
+ 8 May, 2004
+
+*/
+
+
+// ---------
+
+/*
+ Miranda Service-functions defined by MathModule
+ call with the
+ int (*CallService)(const char * servicename,WPARAM,LPARAM)
+ that you get from miranda when Miranda calls the
+ Load(PLUGINLINK * link)
+ of your PlugIn-dll
+ the CallService function then is:
+ link->CallServiceSync(Servicename,wparam,lparam)
+*/
+
+// ---------
+
+#define MATH_RTF_REPLACE_FORMULAE "Math/RtfReplaceFormulae"
+// replace all formulas in a RichEdit with bitmaps.
+// wParam = 0
+// lParam = *TMathRichedit Info
+// return: TRUE if replacement succeeded, FALSE if not (disable by user?).
+typedef struct
+{
+ HWND hwndRichEditControl; // handle of richedit.
+ CHARRANGE* sel; // NULL: replace all.
+ int disableredraw;
+} TMathRicheditInfo;
+// WARNING: !!!
+// Strange things happen if you use this function twice on the same CHARRANGE:
+// if Math-startDelimiter == Math-endDelimiter, there is the following problem:
+// it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter.
+// if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up.
+// The same problem occours if we have empty formulae, because two succeding delimiters are
+// replaced with a single delimiter.
+
+
+#define MTH_GETBITMAP "Math/GetBitmap"
+//returns Bitmap that represents the formula given in lparam (string-pointer)
+//this formula has NO Delimiters.
+//wparam=0
+//lparam=(*char)Formula
+//result=(HBITMAP) bitmap
+//!!! the bitmap must be deleted with DeleteObject(hobject)
+//example:
+//HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula);
+
+#define MTH_GET_GIF "Math/GetGif"
+// this renders a formula given in lparam and produces a gif-image in a temporary-folder
+// and returns the filename (full path). Be sure to copy the file if you want to preserve it,
+// because the files are managed as a ring-buffer, if 99 files already exist, this
+// function overwrites the first one.
+// wparam=0
+// lparam=*char text // formula WITHOUT delimiters
+// result=(*char)path
+// !!! the result-buffer must be deleted with MTH_FREE_GIFPATH
+#define MTH_GET_GIF_UNICODE "Math/GetGifUnicode"
+// wparam=0
+// lparam=*wchar_t text
+// result=*char path
+// !!! the result-buffer must be deleted with MTH_FREE_GIFPATH
+#define MTH_FREE_GIFPATH "Math/FreeRTFBitmapText"
+
+#define MTH_GET_RTF_BITMAPTEXT "Math/GetRTFBitmapText"
+// returns rich-text stream that includes bitmaps from text given in lparam
+// text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER
+// hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula
+// wparam=0
+// lparam=*char text
+// result=*char rtfstream
+// !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT
+#define MTH_FREE_RTF_BITMAPTEXT "Math/FreeRTFBitmapText"
+// deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created.
+// wparam=0
+// lparam=(*char) buffer
+// result=0
+
+#define MTH_GET_HTML_SOURCE "Math/GetHTMLSource"
+// this is similar to MTH_GET_RTF_BITMAPTEXT, but
+// as we cannot include embedded images, the bitmaps are saved in a
+// temporary directory (relative to Miranda-dir) and the images are linked into
+// the html-source
+// wparam=0
+// lparam=*char text // this has to be html-source already. this function only adds formula-links.
+// result=*char htmlsource
+// !!! the result-buffer must be deleted with MTH_FREE_HTML_BUFFER
+#define MTH_GET_HTML_SOURCE_UNICODE "Math/GetHTMLSourceUnicode"
+// wparam=0
+// lparam=*wchar_t text
+// result=*wchar_t htmlsource
+#define MTH_FREE_HTML_BUFFER "Math/FreeRTFBitmapText"
+// deletes string-buffers that MathModule has created.
+// wparam=(bool) unicode // 0 if no unicode-buffer; 1 if unicode-buffer !!!
+// lparam=(*char) buffer
+// result=0
+
+
+// **********parameter functions:
+
+#define MATH_SET_PARAMS "Math/SetParams"
+//--------------------------------------
+// sets a parameter (only integer values) specified in wparam
+// wparam=paramcode
+// lparam=parametervalue
+// paramcodes:
+ #define MATH_PARAM_BKGCOLOR 0 // (COLORREF) std-rgb-color or TRANSPARENT_Color
+ // you can make the BKGCOLOR Transparent (default) by using this color:
+ #define TRANSPARENT_Color 0xffffffff -1 // this is default
+ #define MATH_PARAM_FONTCOLOR 1 // (COLORREF) std-rgb-color
+ #define MATH_PARAM_RESIZE_HWND 2 // (HWND) preview window resizes RESIZE_HWND when it is being resized.
+ #define MATH_PARAM_ToolboxEdit_HWND 3 // (HWND) If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox.
+
+#define MATH_GET_PARAMS "Math/GetParams"
+//---------------------------------------
+// get a parameter (only integer values) specified in wparam
+// wparam=paramcode
+// lparam=lparamOfPARAM // see below
+// paramcodes and returnvalues:
+ #define MATH_PARAM_STARTDELIMITER 4 // retval: *char delimiter // the delimiter that marks the beginning of a formula
+ // !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER
+ // lparam=0
+ #define MATH_PARAM_ENDDELIMITER 5 // retval: *char delimiter // the delimiter that marks the end of a formula
+ // !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER
+ // lparam=0
+// ************end parameter functions.
+
+#define MTH_FREE_MATH_BUFFER "Math/FreeRTFBitmapText"
+// deletes string-buffers that MathModule has created. (at the moment only the *DELIMITER-services create such strings)
+// wparam=0
+// lparam=(*char) buffer
+// result=0
+
+
+
+// ********* preview-window functions
+
+#define MTH_SHOW "Math/Show"
+// shows the preview-window
+// wparam=0
+// lparam=0
+// result=0
+
+#define MTH_HIDE "Math/Hide"
+// hides the preview-window
+// wparam=0
+// lparam=0
+// result=0
+
+#define MTH_RESIZE "Math/Resize"
+// sets the size of the preview-window
+// wparam=0
+// lparam=(*TMathWindowInfo)
+// result=0
+typedef struct
+{
+ int top;
+ int left;
+ int right;
+ int bottom;
+} TMathWindowInfo;
+
+#define MTH_SETFORMULA "Math/SetFormula"
+// sets the text that the preview-window should parse to display formulas found inside
+// wparam=0
+// lparam=(*char) text
+// result=0
+
+#define MTH_GET_PREVIEW_HEIGHT "Math/getPreviewHeight"
+// returns the height of the whole preview-window (including system-menu-bar)
+// consider this when maximizing a window to that preview-window is hooked on top or bottom
+// it returns the height no matter whether preview-window is visible or not
+// wparam=0
+// lparam=0
+// result=(int) height
+
+#define MTH_GET_PREVIEW_SHOWN "Math/getPreviewShown"
+// returns 1 if preview window is visible
+// returns 0 if preview window is invisible
+// result=(int) shown
+
+//---------------end preview functions
+
+
+#define MTH_SUBSTITUTE_DELIMITER "Math/SubstituteDelimiter"
+// replaces Substitute in an edit-box given in lparam-structure with internal Math-Delimiter.
+// MathSrmm uses this for the shortcut-functionality
+// I do not recommend to use this, it's not Unicode-safe
+// wparam=0
+// lparam=(TMathSubstInfo) substInfo
+// result=0
+typedef struct
+{
+ HWND EditHandle;
+ char* Substitute;
+} TMathSubstInfo;
+
+
+
+
+
+//
+// ---- here are some obsolete services. I plan to remove them soon. Use MATH_SET_PARAMS or MATH_GET_PARAMS instead !!
+//
+
+#define MATH_SETBKGCOLOR "Math/SetBackGroundColor"
+// changes the background color of the next formula to be rendered.
+// wparam=0
+// lparam=(COLORREF) color
+// result=0
+
+#define MTH_Set_ToolboxEditHwnd "Math/SetTBhwnd"
+// If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox.
+// wparam=0
+// lparam=handle
+
+#define MTH_Set_Resize_HWND "Math/SetResizeHWND" //übergibt fenster-Handle des aktuellen Message-Dialogs
+// If MathModule knows the handle of a SRMM-based window, following features exist:
+// - preview window resizes Math-Srmm when it is being resized.
+// wparam=0
+// lparam=handle
+// result=0
+
+#define MATH_GET_STARTDELIMITER "Math/GetStartDelimiter"
+// returns the delimiter that marks the beginning of a formula
+// wparam=0
+// lparam=0
+// result=*char Delimiter
+// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER
+
+#define MATH_GETENDDELIMITER "Math/GetEndDelimiter"
+// returns the delimiter that marks the end of a formula
+// wparam=0
+// lparam=0
+// result=*char Delimiter
+// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER
+
+//---------------------------------------------------
+#endif
+//#ifndef M_MATHMODULE_H_
+
diff --git a/plugins/ExternalAPI/m_NewAwaySys.h b/plugins/ExternalAPI/m_NewAwaySys.h new file mode 100644 index 0000000000..596c85e26d --- /dev/null +++ b/plugins/ExternalAPI/m_NewAwaySys.h @@ -0,0 +1,119 @@ +/*
+ New Away System plugin for Miranda IM
+ Copyright (c) 2005-2007 Chervov Dmitry
+
+ 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_NEWAWAYSYS_H
+#define __M_NEWAWAYSYS_H
+
+// NAS_PROTOINFO::Flags constants
+#define PIF_NO_CLIST_SETSTATUSMODE 1 // NAS won't call MS_CLIST_SETSTATUSMODE service on a global status change, if this flag is set. it's useful if you want to change the global message and status in NAS without changing current "real" protocol statuses. NAS ignores this flag if szProto != NULL
+#define PIF_NOTTEMPORARY 2
+// usually you should NOT set this flag
+// for MS_NAS_SETSTATE: NAS will overwrite current user-defined message for szProto if this flag is specified; otherwise (if the flag isn't specified), your szMsg will be stored only until the next szProto status change, and won't overwrite any messages specified by user
+// for MS_NAS_GETSTATE: NAS ignores any temporary messages and returns only non-temporary ones. this flag affects something only when status == 0
+
+typedef struct {
+ int cbSize;
+ char *szProto; // pointer to protocol modulename (NULL means global)
+ union
+ {
+ char *szMsg;
+ WCHAR *wszMsg;
+ TCHAR *tszMsg;
+ }; // pointer to the status message _format_ (i.e. it's an unparsed message containing variables, in any case. NAS takes care of parsing) (may be NULL - means that there's no specific message for this protocol - then the global status message will be used)
+/*
+ Be aware that MS_NAS_GETSTATE allocates memory for szMsg through Miranda's
+ memory management interface (MS_SYSTEM_GET_MMI). And MS_NAS_SETSTATE
+ expects szMsg to be allocated through the same service. MS_NAS_SETSTATE deallocates szMsg.
+*/
+ WORD status; // status mode. 0 means current (NAS will overwrite 0 with the current status mode)
+// for MS_NAS_GETSTATE if the specified status is not 0, MS_NAS_GETSTATE will return the default/last status message (depends on settings) - i.e. the same message that will be shown by default when user changes status to the specified one. please note that, for example, if current status mode is ID_STATUS_AWAY, then status messages returned by MS_NAS_GETSTATE for status=0 and status=ID_STATUS_AWAY may be different! for status=ID_STATUS_AWAY it always returns the default/last status message, and for status=0 it returns _current_ status message.
+ int Flags;
+} NAS_PROTOINFO;
+
+// MS_NAS_GETSTATE
+// Fills specified array of NAS_PROTOINFO items with protocol data.
+// You must construct the array and specify cbSize and szProto fields of
+// all items in the array before calling this service.
+// Remember to free szMsg fields through Miranda's MMI if you don't pass them back to NAS through MS_NAS_SETSTATE later.
+// wParam = (WPARAM)(NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items to be filled.
+// lParam = (LPARAM)(int)protoCount - number of items in pi.
+// returns 0 on success
+#define MS_NAS_GETSTATEA "NewAwaySystem/GetStateA"
+#define MS_NAS_GETSTATEW "NewAwaySystem/GetStateW"
+#ifdef _UNICODE
+ #define MS_NAS_GETSTATE MS_NAS_GETSTATEW
+#else
+ #define MS_NAS_GETSTATE MS_NAS_GETSTATEA
+#endif
+
+// MS_NAS_SETSTATE
+// Changes status mode and message of specified protocols.
+// (Note that this service deallocates szMsg field of the specified items through
+// Miranda's MMI, so the array is not valid anymore after MS_NAS_SETSTATE returns!)
+// wParam = (WPARAM)(NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items.
+// lParam = (LPARAM)(int)protoCount - number of items in pi.
+// returns 0 on success
+#define MS_NAS_SETSTATEA "NewAwaySystem/SetStateA"
+#define MS_NAS_SETSTATEW "NewAwaySystem/SetStateW"
+#ifdef _UNICODE
+ #define MS_NAS_SETSTATE MS_NAS_SETSTATEW
+#else
+ #define MS_NAS_SETSTATE MS_NAS_SETSTATEA
+#endif
+
+// NAS_ISWINFO::Flags constants
+#define ISWF_NOCOUNTDOWN 1 // don't start the countdown to close the window
+#define ISWF_UNICODE 2 // specifies that NAS_ISWINFO::szMsg is a WCHAR*
+#ifdef _UNICODE
+ #define ISWF_TCHAR ISWF_UNICODE // will use WCHAR* instead of char*
+#else
+ #define ISWF_TCHAR 0 // will use char*, as usual
+#endif
+
+typedef struct {
+ int cbSize;
+ char *szProto; // pointer to initial protocol modulename (NULL means global); ignored when hContact is not NULL.
+ HANDLE hContact; // NAS will select this contact in the window initially, if it's not NULL.
+ union
+ {
+ char *szMsg;
+ WCHAR *wszMsg;
+ TCHAR *tszMsg;
+ }; // pointer to an initial status message (may be NULL, NAS will use the default message then)
+ WORD status; // status mode. 0 means current.
+ int Flags; // a combination of ISWF_ constants
+} NAS_ISWINFO;
+
+// MS_NAS_INVOKESTATUSWINDOW
+// Invokes the status message change window.
+// Though if the window is open already, this service just activates an existing window and changes protocol status (i.e. it ignores szMsg and hContact). This behavior may change in future.
+// wParam = (WPARAM)(NAS_ISWINFO*)iswi - pointer to a NAS_ISWINFO structure.
+// lParam = 0
+// returns HWND of the window on success, or NULL on failure.
+#define MS_NAS_INVOKESTATUSWINDOW "NewAwaySystem/InvokeStatusWindow"
+
+/* An example:
+ NAS_ISWINFO iswi = {0}; // for C you may use ZeroMemory() instead
+ iswi.cbSize = sizeof(iswi);
+ iswi.tszMsg = _T("New global status message.");
+ iswi.Flags = ISWF_TCHAR;
+ CallService(MS_NAS_INVOKESTATUSWINDOW, (WPARAM)&iswi, 0);
+*/
+
+#endif // __M_NEWAWAYSYS_H
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_Quotes.h b/plugins/ExternalAPI/m_Quotes.h new file mode 100644 index 0000000000..f4bbb06cd3 --- /dev/null +++ b/plugins/ExternalAPI/m_Quotes.h @@ -0,0 +1,35 @@ +#ifndef __7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__
+#define __7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__
+
+/*
+ * Export the contact (or all contacts) to xml file
+ * wParam = (WPARAM)(HANDLE)hContact to export or 0 to export all contacts
+ * lParam = (LPARAM)(const char*)pszFileName - pointer to file name to export or
+ * 0 in this case the dialog to select a file to export would be shown
+ * returns 0 if export was successfull,
+ * -1 if user canceled export and
+ * value greater than zero if error occurred during exporting
+ */
+#define MS_QUOTES_EXPORT "Quotes/Export"
+
+/*
+ * Import the contact (or all contacts) from xml file
+ * wParam = flags
+ * lParam = (LPARAM)(const char*)pszFileName - pointer to file name to import or
+ * 0 in this case the dialog to select a file to import would be shown
+ * returns 0 if import was successfull,
+ * -1 if user canceled import and
+ * value greater than zero if error occurred during importing
+ */
+
+// if contact(s) exists user would be asked to overwrite these contacts
+// #define QUOTES_IMPORT_PROMPT_TO_OVERWRITE_EXISTING_CONTACTS 0x0000
+// if contact(s) exists it would be overwrite without any prompt
+// #define QUOTES_IMPORT_SILENT_OVERWRITE_EXISTING_CONTACTS 0x0001
+// if contact(s) exists during importing it would be ignored
+#define QUOTES_IMPORT_SKIP_EXISTING_CONTACTS 0x0002
+
+#define MS_QUOTES_IMPORT "Quotes/Import"
+
+
+#endif //__7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__
diff --git a/plugins/ExternalAPI/m_account.h b/plugins/ExternalAPI/m_account.h new file mode 100644 index 0000000000..2baadd2189 --- /dev/null +++ b/plugins/ExternalAPI/m_account.h @@ -0,0 +1,239 @@ +/*
+ * This file defines all needed parameters for one account.
+ * Other plugin can use this (so YAMN does not check it and another plugin can inform YAMN about new mail e.g.),
+ * this can be usefull for plugins like Yahoo or MSN (Hotmail notify)
+ *
+ * (c) majvan 2002-2004
+ */
+
+#ifndef __ACCOUNT_H
+#define __ACCOUNT_H
+
+#include <windows.h>
+#include <tchar.h>
+#include "m_synchro.h" //include synchronizing objects. If you want to write protocol plugin, which works with YAMN accounts, it must use YAMN synchronizing objects
+
+//
+//================================== OTHER DEFINITIONS ========================================
+//
+
+enum
+{
+// Error codes returned from functions (services) working with account book files
+ EACC_SYSTEM=1, //use GetLastError() to retrieve detailed information about error
+ EACC_ALLOC, //problem with memory allocation
+ EACC_FILECOMPATIBILITY, //file is corrupted
+ EACC_ENDOFFILE, //unexpected end of file occured
+ EACC_FILEVERSION, //file should be YAMN book format, but newer version that expected
+ EACC_FILESIZE, //file has wrong size
+};
+
+enum
+{
+// Status of account
+// used in messages WM_YAMN_CHANGESTATUS
+// used also in function GetStatus and SetStatus
+ ACC_IDLE=0, //account is IDLE (no work is performed with account)
+ ACC_FINDING, //DNS lookup for account
+ ACC_CONNECTING, //connecting in progress
+ ACC_LOGGING, //logging in progress
+ ACC_WORKING, //working
+ ACC_DISCONNECTING, //disconnecting from server
+};
+
+typedef struct CNotification
+{
+//#define YAMN_NOTIFICATIONVERSION is not implemented, use YAMN_ACCOUNTVERSION instead
+ CNotification(): PopUpB(0), PopUpT(0), PopUpTime(0), App(NULL), AppParam(NULL), Sound(NULL), TrayIcon1(NULL), TrayIcon2(NULL) {}
+
+#define YAMN_ACC_SND 0x00000001 //Plays sound (1)
+#define YAMN_ACC_MSG 0x00000002 //Shows dialog
+#define YAMN_ACC_ICO 0x00000004 //Shows system tray icon (1)
+#define YAMN_ACC_ICOB 0x00000008 //not used now, enables tray icon flashing (1)
+#define YAMN_ACC_APP 0x00000010 //Runs application (1)
+#define YAMN_ACC_POP 0x00000020 //Shows popup
+#define YAMN_ACC_POPC 0x00000040 //Use custom colors in popup
+#define YAMN_ACC_MSGP 0x00000080 //Persistant messgage. This means, when an situation occurs (e.g. new mail) and message is displayed, it is not destroyed when YAMN_ACC_MSG is not set
+#define YAMN_ACC_KBN 0x00000100 //Use Keyboard notify
+#define YAMN_ACC_CONT 0x00000200 //Use Contact notify
+#define YAMN_ACC_CONTNICK 0x00000400 //Use Contact Nick replacement
+#define YAMN_ACC_CONTNOEVENT 0x00000800 //Suppress event for this contact
+//(1) - usable only in newmail notification
+ DWORD Flags;
+
+ COLORREF PopUpB;
+ COLORREF PopUpT;
+ DWORD PopUpTime;
+ WCHAR *App;
+ WCHAR *AppParam;
+
+//These parameters are not stored in standard YAMN book file and therefore must be set by plugin
+ char *Sound;
+ HICON TrayIcon1;
+ HICON TrayIcon2;
+} YAMN_NOTIFICATION,*PYAMN_NOTIFICATION;
+
+typedef struct CServer
+{
+ CServer(): Name(NULL),Login(NULL),Passwd(NULL) {}
+
+ TCHAR *Name;
+ DWORD Port;
+
+ TCHAR *Login;
+
+// Password encryption definitions
+#define STARTCODEPSW 0x50
+#define ADDCODEPSW 0x0
+ TCHAR *Passwd;
+
+} *PSERVER;
+
+//
+//================================== ACCOUNT DEFINITION ==================================
+//
+
+typedef struct CAccount
+{
+#define YAMN_ACCOUNTFILEVERSION 2 //version of standard file format (YAMN book file format)
+#define YAMN_ACCOUNTVERSION 3
+//If changes are made in this structure, version is changed.
+//So then YAMN does not initialzie your structure, if version does not matches.
+
+ BOOL AbleToWork; //This is set to TRUE by default. When it is needed to stop working on this account, YAMN sets this to zero.
+
+ struct CYAMNProtoPlugin *Plugin; //free access, because this member should not be changed. The same as YAMN_PLUGIN structure
+
+ TCHAR *Name; //access only through AccountAccessSO
+
+// DWORD Abilities; //access only through AccountAccessSO
+
+ PSERVER Server; //access only through AccountAccessSO
+
+ WORD Interval; //access only through AccountAccessSO
+
+// YAMN account flags (set by user)
+#define YAMN_ACC_ENA 0x00000001 //Enables account. If account is disabled, no countdown is performed
+#define YAMN_ACC_POPN 0x00000002 //Shows one popup per one new mail or for N mails
+#define YAMN_ACC_APOP 0x00000004 //Use APOP authentication
+#define YAMN_ACC_SSL23 0x00000008 //Use SSLv2,3
+#define YAMN_ACC_NOTLS 0x00000010 //Don't try StartTLS (STLS) even available
+#define YAMN_ACC_BODY 0x00000020 //Always retrieve body of the message
+ DWORD Flags; //access only through AccountAccessSO
+
+// YAMN account flags (set by plugin)
+#define YAMN_ACC_BROWSE 0x00000001 //Can browse mails. On this account we can run mailbrowser window
+#define YAMN_ACC_POPUP 0x00000002 //Popups of new mail belonging to this account can be showed
+ DWORD AbilityFlags;
+
+// YAMN account status flags
+#define YAMN_ACC_ST0 0x00000001 //Check (countdown) when Offline
+#define YAMN_ACC_ST1 0x00000002 //Check (countdown) when Online
+#define YAMN_ACC_ST2 0x00000004 //Check (countdown) when Away
+#define YAMN_ACC_ST3 0x00000008 //Check (countdown) when N/A
+#define YAMN_ACC_ST4 0x00000010 //Check (countdown) when Occupied
+#define YAMN_ACC_ST5 0x00000020 //Check (countdown) when DND
+#define YAMN_ACC_ST6 0x00000040 //Check (countdown) when Free for chat
+#define YAMN_ACC_ST7 0x00000080 //Check (countdown) when Invisible
+#define YAMN_ACC_ST8 0x00000100 //Check (countdown) when On the phone
+#define YAMN_ACC_ST9 0x00000200 //Check (countdown) when Out to lunch
+#define YAMN_ACC_STARTA 0x00010000 //Check on start anyway
+#define YAMN_ACC_STARTS 0x00020000 //Check on start regarding to status setting
+#define YAMN_ACC_FORCE 0x00040000 //Check when "check new mail" item pressed (it is called forced checking)
+ DWORD StatusFlags; //access only through AccountAccessSO
+
+// Plugin flags. Use this DWORD if you want YAMN to store it to YAMN book file. You can set here any value
+ DWORD PluginFlags;
+
+ YAMN_NOTIFICATION NewMailN; //access only through AccountAccessSO
+ YAMN_NOTIFICATION NoNewMailN; //access only through AccountAccessSO
+ YAMN_NOTIFICATION BadConnectN; //access only through AccountAccessSO
+
+ SYSTEMTIME LastChecked; //last check, access only through AccountAccessSO
+ SYSTEMTIME LastSChecked; //last check (successfull), access only through AccountAccessSO
+ SYSTEMTIME LastSynchronised; //last synchronisation (successfull), access only through AccountAccessSO
+ SYSTEMTIME LastMail; //last check when new mail detected, access only through AccountAccessSO
+
+ char Status[255]; //access only through GetStatusFcn() and SetStatusFcn() functions
+
+ DWORD TimeLeft; //access only through AccountAccessSO
+
+ HANDLE Mails; //access only through MessagesAccessSO
+
+//Account members are mostly the same, but there can be protocol (POP3,IMAP...) special features.
+//To use them, only inherit this class and add your own features.
+//First idea was to add pointer to void, where plugin can store its own values.
+//But this solution is better in my opinion.
+
+//This is event with counter. Event is signaled when no threads are using account (and will not be using)
+//Very usefull for account delete operation
+ PSCOUNTER UsingThreads;
+
+//We have to achieve, that only one thread can write to account and more threads can read.
+//Writing to account means that we change account parameters
+//Reading from account meands we read account parameters
+//Use WaitToRead(), ReadDone(), WaitToWrite(), WriteDone() synchronization functions
+//For plugins, this is a pointer to void. It does not matter for plugin what is this variable for,
+//because plugin works only with synchronization routines. And why is this void * ? It is because
+//plugin does not need to include headers for SWMRG structures...
+ PSWMRG AccountAccessSO;
+
+//We have to achieve, that only one thread can write to account mails and more threads can read.
+//While some thread writes mails, other thread can write to account. This can be small problem, but it never appears in YAMN.
+//But you should think about this note if you want to add some features in the future
+//Writing to messages means any changes to message queue or message data
+//Reading from messages means reading message queue (browsing through all messages) or reading message data
+//Use MsgsWaitToRead(),MsgsReadDone(),MsgsWaitToWrite(),MsgsWriteDone() synchronization functions
+ PSWMRG MessagesAccessSO;
+
+//For clist contact notification
+ HANDLE hContact;
+ BOOL isCounting;
+
+ struct CAccount *Next;
+} *HACCOUNT;
+
+//
+//================================== FUNCTIONS DEFINITIONS ========================================
+//
+
+typedef void (WINAPI *YAMN_SETSTATUSFCN)(HACCOUNT,TCHAR *);
+typedef void (WINAPI *YAMN_GETSTATUSFCN)(HACCOUNT,TCHAR *);
+
+//
+//================================== QUICK FUNCTION CALL DEFINITIONS ========================================
+//
+
+//These are defininitions for YAMN exported functions. Your plugin can use them.
+//pYAMNFcn is global variable, it is pointer to your structure containing YAMN functions.
+//It is something similar like pluginLink variable in Miranda plugin. If you use
+//this name of variable, you have already defined these functions and you can use them.
+//It's similar to Miranda's CreateService function.
+
+//How to use YAMN functions:
+//Create a structure containing pointer to functions you want to use in your plugin
+//This structure can look something like this:
+//
+// struct
+// {
+// YAMN_SETSTATUSFCN SetStatusFcn;
+// YAMN_GETSTATUSFCN GetStatusFcn;
+// } *pYAMNFcn;
+//
+//then you have to fill this structure with pointers...
+//
+// pYAMNFcn->SetStatusFcn=(YAMN_SETSTATUSFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SETSTATUSID,(LPARAM)0);
+// pYAMNFcn->GetStatusFcn=(YAMN_GETSTATUSFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_GETSTATUSID,(LPARAM)0);
+//
+//and in your plugin just simply use e.g.:
+//
+// SetAccountStatus(ActualAccount,ACC_CONNECTING); //this command set account status to "connecting to server"
+//
+
+#define YAMN_SETSTATUSID "YAMN/SetStatus"
+#define YAMN_GETSTATUSID "YAMN/GetStatus"
+
+#define SetAccountStatus(x,y) pYAMNFcn->SetStatusFcn(x,y)
+#define GetAccountStatus(x,y) pYAMNFcn->GetStatusFcn(x,y)
+
+#endif
diff --git a/plugins/ExternalAPI/m_actman.h b/plugins/ExternalAPI/m_actman.h new file mode 100644 index 0000000000..c900ba9c6c --- /dev/null +++ b/plugins/ExternalAPI/m_actman.h @@ -0,0 +1,96 @@ +#ifndef M_ACTMAN
+#define M_ACTMAN
+
+#define ACCF_DISABLED 0x10000000 // action disabled
+#define ACCF_EXPORT 0x08000000 // action to export
+#define ACCF_VOLATILE 0x04000000 // don't save in DB
+#define ACCF_IMPORTED ACF_EXPORT
+#define ACCF_FLAGS (ACCF_DISABLED | ACCF_EXPORT | ACCF_IMPORTED | ACCF_VOLATILE)
+#define ACCF_ID 0x02000000 // for MS_ACT_SELECT, lParam is ID (else name)
+#define ACCF_CLEAR 0x01000000 // clear other flags, else - set
+
+
+typedef struct{
+ WCHAR* Descr;
+ DWORD ID;
+ DWORD flags; // ACCF_* flags
+ } TChain, *PChain;
+
+// Service to get list of all configured actions;
+// wParam : 0
+// lParam : address of destination list variable (address of pointer to TChain)
+// Notes: first 4 bytes of list = size of TChain structure (to add new fields in future)
+// Return value: count of elements;
+#define MS_ACT_GETLIST "Actions/GetList"
+
+// Service to free list of all configured actions got with MS_ACT_GETLIST service call;
+// wParam : 0
+// lParam : list address (pointer to ACTION returned by MS_ACT_GETLIST)
+#define MS_ACT_FREELIST "Actions/FreeList"
+
+// Service to call action defined in wParam;
+// wParam: ID of an action (see ACTION.ActID) when calling MS_ACT_RUN
+// or description of an action (see ACTION.ActDescr) when calling MS_ACT_RUNGROUP
+// lParam: parameter (will be passed to action called)
+#define MS_ACT_RUNBYID "Actions/RunById"
+#define MS_ACT_RUNBYNAME "Actions/RunByName"
+
+// Event: action group list was changed: something was added or deleted
+// wParam: set of ACTM_* flags
+// lParam : 0
+#define ME_ACT_CHANGED "Actions/Changed"
+
+// Starts action with 2 parameters
+// wParam: 0
+// lParam: pointer to TAct_Param
+
+#define MS_ACT_RUNPARAMS "Actions/RunWithParams"
+typedef struct TAct_Param
+ {
+ DWORD flags; // 0 - ID, 1 - Name
+ DWORD ID; // Id or name
+ WPARAM wParam;
+ LPARAM lParam;
+ } TAct_Param, *PAct_Param;
+
+#define ACTM_NEW 0x00000001
+#define ACTM_DELETE 0x00000002
+#define ACTM_RELOAD 0x00000004
+#define ACTM_RENAME 0x00000008
+#define ACTM_SORT 0x00000010
+#define ACTM_ACT 0x10000000 // do not check, internal
+#define ACTM_ACTS 0x20000000 // do not check, internal
+#define ACTM_LOADED 0x80000000
+
+
+#define ACIO_EXPORT 0x00000001 // export, else - import
+#define ACIO_APPEND 0x00000002 // append file on export
+#define ACIO_ASKEXIST 0x00000004 // ask, if action exists on import
+#define ACIO_SELECTED 0x00000008 // export selected actions only
+
+// wParam: ACIO_* flags
+// lParam: Unicode file name
+// Return - true, if totally succesful
+#define MS_ACT_INOUT "Actions/ImpExp"
+
+
+//Event: Export actions
+// wParam - ACIO_* flags
+// lParam - unicode filename
+#define ME_ACT_INOUT "Actions/InOut"
+
+
+// Select/unselect specified action
+// wParam: set of ACCF_* consts
+// lParam: unicode action name / number
+// Return - -1 if unsuccesful
+#define MS_ACT_SELECT "Actions/Select"
+
+
+// Event: Action started/finished
+// wParam - Action status: 0 - started, 1 - finished
+// lParam - action id
+
+#define ME_ACT_ACTION "Actions/Action"
+
+#endif
diff --git a/plugins/ExternalAPI/m_actman.inc b/plugins/ExternalAPI/m_actman.inc new file mode 100644 index 0000000000..02a84a4470 --- /dev/null +++ b/plugins/ExternalAPI/m_actman.inc @@ -0,0 +1,115 @@ +{$IFNDEF M_ACTMAN}
+{$DEFINE M_ACTMAN}
+
+// defined in interfaces.inc
+//const MIID_ACTMANAGER:MUUID='{9584DA04-FB4F-40c1-9325-E4F9CAAFCB5D}';
+
+const
+ ACCF_DISABLED = $10000000; // action disabled
+ ACCF_EXPORT = $08000000; // action to export
+ ACCF_VOLATILE = $04000000; // don't save in DB
+ ACCF_IMPORTED = ACF_EXPORT;
+ ACCF_FLAGS = ACCF_DISABLED or ACCF_EXPORT or ACCF_IMPORTED or ACCF_VOLATILE;
+ ACCF_ID = $02000000; // for MS_ACT_SELECT, lParam is ID (else name)
+ ACCF_CLEAR = $01000000; // clear other flags, else - set
+type
+ pChain = ^tChain;
+ TChain = record
+ descr:pWideChar;
+ id :dword;
+ flags:dword; // ACCF_* flags
+ end;
+
+const
+ {
+ wParam - 0
+ lParam - address of destination list variable (address of pointer to tChain)
+ Return - count of elements
+ Notes: first 4 bytes = size of TChain structure (to add new fields in future)
+ }
+ MS_ACT_GETLIST:PAnsiChar = 'Actions/GetList';
+ {
+ wParam - 0
+ lParam - list address (pointer to data returned by MS_ACT_GETLIST)
+ }
+ MS_ACT_FREELIST:PAnsiChar = 'Actions/FreeList';
+ {
+ wParam - id: dword
+ lParam - parameter
+ }
+ MS_ACT_RUNBYID :PAnsiChar = 'Actions/RunById';
+ {
+ wParam - unicode action name
+ lParam - parameter
+ }
+ MS_ACT_RUNBYNAME:PAnsiChar = 'Actions/RunByName';
+
+{ Starts action with 2 parameters
+ wParam: 0
+ lParam: pointer to TAct_Param
+}
+ MS_ACT_RUNPARAMS:PAnsiChar = 'Actions/RunWithParams';
+const
+ ACTP_BYNAME = 1;
+ ACTP_WAIT = 2;
+type
+ PAct_Param = ^TAct_Param;
+ TAct_Param = record
+ flags :dword; // ACTP_*
+ ID :dword; // Id or name
+ wParam:WPARAM;
+ lParam:LPARAM;
+ end;
+
+const
+ ACTM_NEW = $00000001;
+ ACTM_DELETE = $00000002;
+ ACTM_RELOAD = $00000004;
+ ACTM_RENAME = $00000008;
+ ACTM_SORT = $00000010;
+ ACTM_ACT = $10000000; // do not check, internal
+ ACTM_ACTS = $20000000; // do not check, internal
+ ACTM_LOADED = $80000000;
+
+ {
+ Event: action group list was changed: some was added or deleted
+ wParam - set of ACTM_* flags
+ lParam - 0
+ }
+ ME_ACT_CHANGED:PAnsiChar = 'Actions/Changed';
+
+ ACIO_EXPORT = $00000001; // export, else - import
+ ACIO_APPEND = $00000002; // append file on export
+ ACIO_ASKEXIST = $00000004; // ask, if action exists on import
+ ACIO_SELECTED = $00000008; // export selected actions only
+
+ {
+ wParam - ACIO_* flags
+ lParam - Unicode file name
+ Return - true, if totally succesful
+ }
+ MS_ACT_INOUT:PAnsiChar = 'Actions/ImpExp';
+
+ {
+ Event: Export actions
+ wParam - ACIO_* flags
+ lParam - unicode filename
+ }
+ ME_ACT_INOUT:PAnsiChar = 'Actions/InOut';
+
+ {
+ Select/unselect specified action
+ wParam - set of ACCF_* consts
+ lParam - unicode action name / number
+ Return - -1 if unsuccesful
+ }
+ MS_ACT_SELECT:PAnsiChar = 'Actions/Select';
+
+ {
+ Event: Action started/finished
+ wParam - Action status: 0 - started, 1 - finished
+ lParam - action id
+ }
+ ME_ACT_ACTION:PAnsiChar = 'Actions/Action';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/m_assocmgr.h b/plugins/ExternalAPI/m_assocmgr.h new file mode 100644 index 0000000000..4e15168643 --- /dev/null +++ b/plugins/ExternalAPI/m_assocmgr.h @@ -0,0 +1,301 @@ +/*
+
+'File Association Manager'-Plugin for
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright (C) 2005-2007 H. Herkenrath
+
+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 (AssocMgr-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_ASSOCMGR_H__
+#define M_ASSOCMGR_H__
+
+#if defined (_MSC_VER) && (_MSC_VER >= 1020)
+ #pragma once
+#endif
+
+#if !defined(_TCHAR_DEFINED)
+ #include <tchar.h>
+#endif
+
+#if defined(_MSC_VER)
+#pragma warning(push) /* save warning settings */
+#pragma warning(disable:4201) /* nonstandard extension used : nameless struct/union */
+#endif
+
+/*
+ File Association Manager v0.1.1.0
+*/
+
+/* interface id */
+#if !defined(MIID_ASSOCMGR)
+ #define MIID_ASSOCMGR {0xa05b56c0,0xcf7b,0x4389,{0xa1,0xe9,0xf1,0x3d,0xb9,0x36,0xe,0xf1}}
+#endif
+#if !defined(MIID_AUTORUN)
+ #define MIID_AUTORUN {0xeb0465e2,0xceee,0x11db,{0x83,0xef,0xc1,0xbf,0x55,0xd8,0x95,0x93}}
+#endif
+
+/* Add a new file type v0.1.0.0+
+Add a new file type to be registered with Windows.
+You probably want to call this event when
+ME_SYSTEM_MODULESLOADED is fired.
+ wParam=0
+ lParam=(LPARAM)(FILETYPEDESC*)ftd
+Returns 0 on success, nonzero otherwise.
+*/
+#define MS_ASSOCMGR_ADDNEWFILETYPE "AssocMgr/AddNewFileType"
+
+typedef struct {
+ int cbSize; // set to sizeof(FILETYPEDESC), in bytes
+ union {
+ const char *pszDescription; // description for options dialog and in registry.
+ const TCHAR *ptszDescription; // please Translate(), use singular form here.
+ const WCHAR *pwszDescription;
+ };
+ HINSTANCE hInstance; // instance of the calling module and where the icon
+ // resource is located.
+ // always be sure you set this to your own hInstance even if
+ // you use the generic default icon
+
+ UINT nIconResID; // resource id of an icon to use for the file type.
+ // this icon should contain icons of all sizes and color depths
+ // needed by Windows.
+ // set this to 0 to use the generic 'miranda file' icon
+ // provided by assocmgr.
+
+ const char *pszService; // service to call when a file is opened
+ // this service will be called with lParam set to
+ // the file name being opened including path.
+ // it can be assumed that the provided file name
+ // is always the long path name.
+ // return zero on suceess, nonzero on error.
+ // Note: set this to NULL to pass the file name as
+ // commandline argument to miranda32.exe (db file).
+
+ DWORD flags; // see FTDF_* flags below
+
+ const char *pszFileExt; // file extension, e.g. ".ext"
+ // first character must be a dot, assumed to be all lower case.
+ // may only consist of ascii characters.
+
+ const char *pszMimeType; // MIME type of the file, e.g. "application/x-icq"
+ // may only consist of ascii characters.
+ union {
+ const char *pszVerbDesc; // description for the open verb e.g. "&Install".
+ const TCHAR *ptszVerbDesc; // set this to NULL to use the default description.
+ const WCHAR *pwszVerbDesc; // include an ampersand (&) character for a mnemonic key.
+ }; // please Translate().
+} FILETYPEDESC;
+
+#define FTDF_UNICODE 0x0001 // pszDescription and pszVerbDesc in struct are Unicode.
+ // the specified service is called with Unicode parameters.
+
+#define FTDF_DEFAULTDISABLED 0x0002 // file type is not registered by default, it needs to be
+ // enabled explicitly on the options page.
+
+#define FTDF_BROWSERAUTOOPEN 0x0004 // tells the browser to download and open the file directly
+ // without prompt (currently IE and Opera6+) - be careful!
+ // use only in conjunction with pszMimeType set.
+ // this tells Windows that open can be safely invoked for
+ // downloaded files.
+ // Note that this flag may create a security risk,
+ // because downloaded files could contain malicious content.
+ // you need to protect against such an exploit.
+
+#define FTDF_ISTEXT 0x0008 // tells Windows that this file can be opened
+ // as a text file using e.g Notepad.
+ // only has an effect on Windows XP and higher.
+
+#define FTDF_ISSHORTCUT 0x0010 // file type behaves as shortcut, this means a
+ // small overlay arrow is applied and the extension is never shown
+
+#if defined(_UNICODE)
+ #define FTDF_TCHAR FTDF_UNICODE // strings in struct are WCHAR*, service accepts WCHAR*
+#else
+ #define FTDF_TCHAR 0 // strings in struct are char*, service accepts char*
+#endif
+
+#if !defined(ASSOCMGR_NOHELPERFUNCTIONS)
+__inline static int AssocMgr_AddNewFileType(const char *ext,const char *mime,const char *desc,const char *verb,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+{
+ FILETYPEDESC ftd;
+ ftd.cbSize=sizeof(FILETYPEDESC);
+ ftd.pszFileExt=ext;
+ ftd.pszMimeType=mime;
+ ftd.pszDescription=desc;
+ ftd.pszVerbDesc=verb;
+ ftd.hInstance=hinst;
+ ftd.nIconResID=iconid;
+ ftd.pszService=service;
+ ftd.flags=flags&~FTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWFILETYPE,0,(LPARAM)&ftd);
+}
+__inline static int AssocMgr_AddNewFileTypeW(const char *ext,const char *mime,const WCHAR *desc,const WCHAR *verb,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+{
+ FILETYPEDESC ftd;
+ ftd.cbSize=sizeof(FILETYPEDESC);
+ ftd.pszFileExt=ext;
+ ftd.pszMimeType=mime;
+ ftd.pwszDescription=desc;
+ ftd.pwszVerbDesc=verb;
+ ftd.hInstance=hinst;
+ ftd.nIconResID=iconid;
+ ftd.pszService=service;
+ ftd.flags=flags|FTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWFILETYPE,0,(LPARAM)&ftd);
+}
+#if defined(_UNICODE)
+ #define AssocMgr_AddNewFileTypeT AssocMgr_AddNewFileTypeW
+#else
+ #define AssocMgr_AddNewFileTypeT AssocMgr_AddNewFileType
+#endif
+#endif
+
+/* Remove a file type v0.1.0.0+
+Remove a file type registered previously using
+MS_ASSOCMGR_ADDNEWFILETYPE.
+This removes all settings in database and in registry
+associated with the file type.
+ wParam=0
+ lParam=(WPARAM)(char*)pszFileExt
+Returns 0 on success, nonzero otherwise.
+*/
+#define MS_ASSOCMGR_REMOVEFILETYPE "AssocMgr/RemoveFileType"
+
+/* Add a new url protocol type v0.1.0.0+
+Add a new url type to be registered with Windows.
+You probably want to call this event when
+ME_SYSTEM_MODULESLOADED is fired.
+ wParam=0
+ lParam=(LPARAM)(URLTYPEDESC*)utd
+Returns 0 on success, nonzero otherwise.
+*/
+#define MS_ASSOCMGR_ADDNEWURLTYPE "AssocMgr/AddNewUrlType"
+
+typedef struct {
+ int cbSize; // set to sizeof(URLTYPEDESC), in bytes
+ union {
+ const char *pszDescription; // description for options dialog and in registry.
+ const TCHAR *ptszDescription; // please Translate(), use singular form here.
+ const WCHAR *pwszDescription;
+ };
+ HINSTANCE hInstance; // instance of the calling module and where the icon
+ // resource is located.
+ // always be sure you set this to your own hInstance even if
+ // you use the generic default icon
+
+ UINT nIconResID; // resource id of an icon to use for the url type.
+ // only a small one (16x16) is needed by Windows,
+ // e.g. proto icon as used in Miranda.
+ // set this to 0 to use the default miranda icon.
+
+ const char *pszService; // service to call when a url is opened (can't be NULL)
+ // this service will be called with lParam set to
+ // the url being opened including the prefix.
+ // return zero on suceess, nonzero on error.
+
+ DWORD flags; // see UTDF_* flags below
+
+ const char *pszProtoPrefix; // protocol prefix, e.g. "http:"
+ // last character must be a colon, assumed to be all lower case.
+ // may only consist of ascii characters.
+} URLTYPEDESC;
+
+#define UTDF_UNICODE 0x0001 // pszDescription in struct is Unicode.
+ // the specified service is called with Unicode parameters.
+
+#define UTDF_DEFAULTDISABLED 0x0002 // url type is not registered by default, it needs to be
+ // enabled explicitly on the options page.
+#if defined(_UNICODE)
+ #define UTDF_TCHAR UTDF_UNICODE // strings in struct are WCHAR*, service accepts WCHAR*
+#else
+ #define UTDF_TCHAR 0 // strings in struct are char*, service accepts char*
+#endif
+
+#if !defined(ASSOCMGR_NOHELPERFUNCTIONS)
+static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+{
+ URLTYPEDESC utd;
+ utd.cbSize=sizeof(URLTYPEDESC);
+ utd.pszProtoPrefix=prefix;
+ utd.pszDescription=desc;
+ utd.hInstance=hinst;
+ utd.nIconResID=iconid;
+ utd.pszService=service;
+ utd.flags=flags&~UTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWURLTYPE,0,(LPARAM)&utd);
+}
+static int __inline AssocMgr_AddNewUrlTypeW(const char *prefix,const WCHAR *desc,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+{
+ URLTYPEDESC utd;
+ utd.cbSize=sizeof(URLTYPEDESC);
+ utd.pszProtoPrefix=prefix;
+ utd.pwszDescription=desc;
+ utd.hInstance=hinst;
+ utd.nIconResID=iconid;
+ utd.pszService=service;
+ utd.flags=flags|UTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWURLTYPE,0,(LPARAM)&utd);
+}
+#if defined(_UNICODE)
+ #define AssocMgr_AddNewUrlTypeT AssocMgr_AddNewUrlTypeW
+#else
+ #define AssocMgr_AddNewUrlTypeT AssocMgr_AddNewUrlType
+#endif
+#endif
+
+/* Remove an url protocol type v0.1.0.0+
+Remove an url registered previously using
+MS_ASSOCMGR_ADDNEWURLTYPE.
+This removes all settings in database and in registry
+associated with the url type.
+ wParam=0
+ lParam=(WPARAM)(char*)pszProtoPrefix
+Returns 0 on success, nonzero otherwise.
+*/
+#define MS_ASSOCMGR_REMOVEURLTYPE "AssocMgr/RemoveUrlType"
+
+/* utility which should be moved as service into m_netlib.h (MS_NETLIB_URLENCODE already exists) */
+#if defined(MoveMemory) && defined(lstrlen)
+static __inline char *Netlib_UrlDecode(char *str)
+{
+ char *psz=str;
+ for(;*psz;++psz)
+ switch(*psz) {
+ case '+':
+ *psz=' ';
+ break;
+ case '%':
+ if(!psz[1] || !psz[2]) break;
+ MoveMemory(psz,&psz[1],2);
+ psz[2]=0;
+ *psz=(char)strtol(psz,NULL,16);
+ MoveMemory(&psz[1],&psz[3],lstrlenA(&psz[3])+1);
+ break;
+ }
+ return str;
+}
+#endif
+
+#if defined(_MSC_VER)
+#pragma warning(pop) /* restore warning settings */
+#endif
+
+#ifndef ASSOCMGR_NOSETTINGS
+#define SETTING_ONLYWHILERUNNING_DEFAULT 0
+#endif
+
+#endif // M_ASSOCMGR_H
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_avatarhistory.h b/plugins/ExternalAPI/m_avatarhistory.h new file mode 100644 index 0000000000..2613dee3b4 --- /dev/null +++ b/plugins/ExternalAPI/m_avatarhistory.h @@ -0,0 +1,51 @@ +/*
+Copyright (C) 2006 MattJ, 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_AVATARHISTORY_H__
+# define __M_AVATARHISTORY_H__
+
+
+#define EVENTTYPE_AVATAR_CHANGE 9003
+
+
+/*
+Return TRUE is Avatar History is enabled for this contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_AVATARHISTORY_ENABLED "AvatarHistory/IsEnabled"
+
+
+/*
+Get cached avatar
+
+wParam: (char *) protocol name
+lParam: (char *) hash
+return: (TCHAR *) NULL if none is found or the path to the avatar. You need to free this string
+ with mir_free.
+*/
+#define MS_AVATARHISTORY_GET_CACHED_AVATAR "AvatarHistory/GetCachedAvatar"
+
+
+
+
+
+#endif // __M_AVATARHISTORY_H__
diff --git a/plugins/ExternalAPI/m_buttonbar.h b/plugins/ExternalAPI/m_buttonbar.h new file mode 100644 index 0000000000..9be67e965b --- /dev/null +++ b/plugins/ExternalAPI/m_buttonbar.h @@ -0,0 +1,54 @@ +#ifndef _BUTTONSBAR_H
+#define _BUTTONSBAR_H
+
+#define MIN_CBUTTONID 4000
+#define MAX_CBUTTONID 5000
+
+#define BBSF_IMBUTTON (1<<0)
+#define BBSF_CHATBUTTON (1<<1)
+#define BBSF_CANBEHIDDEN (1<<2)
+#define BBSF_NTBSWAPED (1<<3)
+#define BBSF_NTBDESTRUCT (1<<4)
+
+typedef struct _tagCustomButtonData
+ {
+ DWORD dwButtonOrigID; // id of button used while button creation and to store button info in DB
+ char * pszModuleName; //module name without spaces and underline symbols (e.g. "tabsrmm")
+
+ DWORD dwButtonCID;
+ DWORD dwArrowCID; //only use with BBBF_ISARROWBUTTON flag
+
+ TCHAR * ptszTooltip; //button's tooltip
+
+ DWORD dwPosition; // default order pos of button, counted from window edge (left or right)
+ int iButtonWidth; //must be 22 for regular button and 33 for button with arrow
+ HANDLE hIcon; //Handle to icolib registred icon
+ BOOL bIMButton,bChatButton;
+ BOOL bCanBeHidden,bHidden,bAutoHidden,bDummy,bDisabled,bPushButton;
+ BOOL bLSided,bRSided;
+ BYTE opFlags;
+ }CustomButtonData;
+
+static INT_PTR CB_ModifyButton(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_RemoveButton(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam);
+static void CB_GetButtonSettings(HANDLE hContact,CustomButtonData *cbd);
+
+void CB_WriteButtonSettings(HANDLE hContact,CustomButtonData *cbd);
+int sstSortButtons(const void * vmtbi1, const void * vmtbi2);
+
+void CB_DeInitCustomButtons();
+void CB_InitCustomButtons();
+void CB_InitDefaultButtons();
+void CB_ReInitCustomButtons();
+
+/* MinGW doesn't like this struct declatations below */
+void BB_UpdateIcons(HWND hdlg,struct TWindowData *dat);
+void BB_RefreshTheme(const TWindowData *dat);
+void CB_DestroyAllButtons(HWND hwndDlg,struct TWindowData *dat);
+void CB_DestroyButton(HWND hwndDlg,struct TWindowData *dat,DWORD dwButtonCID,DWORD dwFlags);
+void CB_ChangeButton(HWND hwndDlg,struct TWindowData *dat,CustomButtonData* cbd);
+
+#endif
diff --git a/plugins/ExternalAPI/m_cln_skinedit.h b/plugins/ExternalAPI/m_cln_skinedit.h new file mode 100644 index 0000000000..5ee66829c5 --- /dev/null +++ b/plugins/ExternalAPI/m_cln_skinedit.h @@ -0,0 +1,147 @@ +
+/*
+ * services
+ */
+
+#define MS_CLNSE_INVOKE "CLN_Skinedit/Invoke"
+#define MS_CLNSE_FILLBYCURRENTSEL "CLN_Skinedit/FillByCurrentSel"
+
+/*
+ * data structs
+ */
+
+struct TWindowData;
+class CImageItem;
+
+struct ButtonItem {
+ TCHAR szName[40];
+ HWND hWnd;
+ LONG xOff, yOff;
+ LONG width, height;
+ CImageItem *imgNormal, *imgPressed, *imgHover;
+ LONG_PTR normalGlyphMetrics[4];
+ LONG_PTR hoverGlyphMetrics[4];
+ LONG_PTR pressedGlyphMetrics[4];
+ DWORD dwFlags, dwStockFlags;
+ DWORD uId;
+ TCHAR szTip[256];
+ char szService[256];
+ char szModule[256], szSetting[256];
+ BYTE bValuePush[256], bValueRelease[256];
+ DWORD type;
+ void (*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
+ void (*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
+ TCHAR tszLabel[40];
+ ButtonItem* nextItem;
+ HANDLE hContact;
+ TWindowData *dat;
+};
+
+typedef struct _tagButtonSet {
+ ButtonItem *items;
+ LONG left, top, right, bottom; // client area offsets, calculated from button layout
+} ButtonSet;
+
+struct CSkinItem {
+ TCHAR szName[40];
+ char szDBname[40];
+ int statusID;
+
+ BYTE GRADIENT;
+ BYTE CORNER;
+
+ DWORD COLOR;
+ DWORD COLOR2;
+
+ BYTE COLOR2_TRANSPARENT;
+
+ DWORD TEXTCOLOR;
+
+ int ALPHA;
+
+ int MARGIN_LEFT;
+ int MARGIN_TOP;
+ int MARGIN_RIGHT;
+ int MARGIN_BOTTOM;
+ BYTE IGNORED;
+ DWORD BORDERSTYLE;
+ CImageItem *imageItem;
+};
+
+typedef struct _tagSkinDescription {
+ DWORD cbSize;
+ CSkinItem *StatusItems;
+ int lastItem;
+ int firstItem;
+ char szModule[100];
+ HWND hWndParent, hWndTab;
+ HWND hwndCLUI;
+ HWND hwndSkinEdit; /* out param */
+ HWND hwndImageEdit; /* out param */
+ HMENU hMenuItems;
+ void (*pfnSaveCompleteStruct)(void);
+ void (*pfnClcOptionsChanged )(void);
+ void* (*pfnMalloc)(unsigned int);
+ void (*pfnFree)(void);
+ void* (*pfnRealloc)(void *, unsigned int);
+ void* reserved[20];
+} SKINDESCRIPTION;
+
+// defines
+
+// FLAGS
+#define CORNER_NONE 0
+#define CORNER_ACTIVE 1
+#define CORNER_TL 2
+#define CORNER_TR 4
+#define CORNER_BR 8
+#define CORNER_BL 16
+#define CORNER_ALL (CORNER_TL | CORNER_TR | CORNER_BR | CORNER_BL | CORNER_ACTIVE)
+
+#define GRADIENT_NONE 0
+#define GRADIENT_ACTIVE 1
+#define GRADIENT_LR 2
+#define GRADIENT_RL 4
+#define GRADIENT_TB 8
+#define GRADIENT_BT 16
+
+#define IMAGE_PERPIXEL_ALPHA 1
+#define IMAGE_FLAG_DIVIDED 2
+#define IMAGE_FILLSOLID 4
+#define IMAGE_GLYPH 8
+
+#define IMAGE_STRETCH_V 1
+#define IMAGE_STRETCH_H 2
+#define IMAGE_STRETCH_B 4
+
+#define BUTTON_ISINTERNAL 1
+#define BUTTON_ISTOGGLE 2
+#define BUTTON_ISSERVICE 4
+#define BUTTON_ISPROTOSERVICE 8
+#define BUTTON_PASSHCONTACTW 16
+#define BUTTON_PASSHCONTACTL 32
+#define BUTTON_ISDBACTION 64
+#define BUTTON_ISCONTACTDBACTION 128
+#define BUTTON_DBACTIONONCONTACT 256
+#define BUTTON_ISSIDEBAR 512
+#define BUTTON_NORMALGLYPHISICON 1024
+#define BUTTON_PRESSEDGLYPHISICON 2048
+#define BUTTON_HOVERGLYPHISICON 4096
+#define BUTTON_HASLABEL 8192
+
+#define CLCDEFAULT_GRADIENT 0
+#define CLCDEFAULT_CORNER 0
+
+#define CLCDEFAULT_COLOR 0xd0d0d0
+#define CLCDEFAULT_COLOR2 0xd0d0d0
+
+#define CLCDEFAULT_TEXTCOLOR 0x000000
+
+#define CLCDEFAULT_COLOR2_TRANSPARENT 1
+
+#define CLCDEFAULT_ALPHA 100
+#define CLCDEFAULT_MRGN_LEFT 0
+#define CLCDEFAULT_MRGN_TOP 0
+#define CLCDEFAULT_MRGN_RIGHT 0
+#define CLCDEFAULT_MRGN_BOTTOM 0
+#define CLCDEFAULT_IGNORE 1
diff --git a/plugins/ExternalAPI/m_cluiframes.h b/plugins/ExternalAPI/m_cluiframes.h new file mode 100644 index 0000000000..dbed148cea --- /dev/null +++ b/plugins/ExternalAPI/m_cluiframes.h @@ -0,0 +1,318 @@ +/*
+Miranda ICQ: the free icq client for MS Windows
+Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+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.
+*/
+
+//Extra columns type.
+//column arranged in this way
+//
+// [statusicon] ContactName [WEB][ADV1][ADV2][SMS][EMAIL][PROTO][CLIENT]
+//
+#define EXTRA_ICON_RES0 0 // only used by nicer
+#define EXTRA_ICON_EMAIL 1
+#define EXTRA_ICON_PROTO 2 // used by mwclist and modern
+#define EXTRA_ICON_RES1 2 // only used by nicer
+#define EXTRA_ICON_SMS 3
+#define EXTRA_ICON_ADV1 4
+#define EXTRA_ICON_ADV2 5
+#define EXTRA_ICON_WEB 6
+#define EXTRA_ICON_CLIENT 7
+#define EXTRA_ICON_VISMODE 8 // only used by modern
+#define EXTRA_ICON_RES2 8 // only used by nicer
+#define EXTRA_ICON_ADV3 9
+#define EXTRA_ICON_ADV4 10
+
+#ifndef EXTRA_ICON_COUNT
+#define EXTRA_ICON_COUNT 10 // define this inside clist-plugin depending on used icon slots
+#endif
+
+typedef struct
+{
+ int cbSize; //must be sizeof(IconExtraColumn)
+ int ColumnType;
+ HANDLE hImage; //return value from MS_CLIST_EXTRA_ADD_ICON
+}IconExtraColumn,*pIconExtraColumn;
+
+//Set icon for contact at needed column
+//wparam=hContact
+//lparam=pIconExtraColumn
+//return 0 on success,-1 on failure
+//
+//See above for supported columns
+#define MS_CLIST_EXTRA_SET_ICON "CListFrames/SetIconForExraColumn"
+
+//Adding icon to extra image list.
+//Call this in ME_CLIST_EXTRA_LIST_REBUILD event
+//
+//wparam=hIcon
+//lparam=0
+//return hImage on success,-1 on failure
+#define MS_CLIST_EXTRA_ADD_ICON "CListFrames/AddIconToExtraImageList"
+
+#define ME_CLIST_EXTRA_LIST_REBUILD "CListFrames/OnExtraListRebuild"
+
+//called with wparam=hContact
+#define ME_CLIST_EXTRA_IMAGE_APPLY "CListFrames/OnExtraImageApply"
+
+//called with wparam=hContact lparam=extra
+#define ME_CLIST_EXTRA_CLICK "CListFrames/OnExtraClick"
+
+//End of extra images header. TODO move it to separate m_extraimages.h file
+//Cause it has not any relationship to cluiframes engine
+
+
+/************************************************************************/
+/* CLUI Frames Support */
+/************************************************************************/
+
+
+// Constants used below
+typedef struct tagCLISTFrame {
+ DWORD cbSize;
+ HWND hWnd ;
+ HICON hIcon;
+ int align; //al flags below
+ union {
+ int height;
+ int minSize; //the actual meaning depends from type of frame
+ };
+ int Flags; //F_flags below
+ union {
+ char *name; //frame window name indentifier (DO NOT TRANSLATE)
+ wchar_t *wname;
+ LPTSTR tname;
+ };
+ union {
+ char *TBname; //titlebar & menu caption
+ wchar_t *TBwname;
+ LPTSTR TBtname;
+ };
+} CLISTFrame;
+
+#define F_VISIBLE 1 //Frame visible
+#define F_SHOWTB 2 //Show TitleBar
+#define F_UNCOLLAPSED 4 //UnCollapse frame
+#define F_LOCKED 8 //Lock Frame
+#define F_NOBORDER 16 //Dont apply WS_BORDER style for window
+#define F_SHOWTBTIP 32 //Show titlebar tooltip
+#define F_CANBEVERTICAL 64 //frames can be vertical
+#define F_CANNOTBEHORIZONTAL 128 //frames can NOT be horizontal F_CANBEVERTICAL have to be set
+#define F_NO_SUBCONTAINER 1024 //Support skining no subcontainer needed
+#define F_SKINNED 2048 // skinned frame (for owned subframe only)
+#define F_UNICODE 32768 //Use unicode text
+#ifdef _UNICODE
+# define F_TCHAR F_UNICODE
+#else
+# define F_TCHAR 0
+#endif
+
+// frame alignment
+#define alTop 0x00000001
+#define alBottom 0x00000002
+#define alClient 0x00000004 //only one alClient frame
+
+// since 0.7.0.20
+#define alLeft 0x00000011 // frame is vertical
+#define alRight 0x00000012
+
+#define alVertFrameMask 0x00000010
+
+#define FU_TBREDRAW 1 //redraw titlebar
+#define FU_FMREDRAW 2 //redraw Frame
+#define FU_FMPOS 4 //update Frame position
+
+#define FO_FLAGS 0x0001 //return set of F_VISIBLE,F_SHOWTB,F_UNCOLLAPSED,F_LOCKED,F_NOBORDER,F_SHOWTBTIP
+#define FO_NAME 0x0002 //Change m_cacheTName
+#define FO_TBNAME 0x0003 //Change TB caption
+#define FO_TBSTYLE 0x0004 //Change TB style
+#define FO_TBEXSTYLE 0x0005 //Change TB exstyle
+#define FO_ICON 0x0006 //Change icon
+#define FO_HEIGHT 0x0007 //Change height
+#define FO_ALIGN 0x0008 //Change align
+#define FO_TBTIPNAME 0x0009 //Change TB tooltip
+#define FO_FLOATING 0x000a //Change floating mode
+
+#define FO_UNICODETEXT 0x8000 // flag for FO_NAME,FO_TBNAME, FO_TBTIPNAME set/get lPAram as unicode wchar_t
+#ifdef _UNICODE
+ #define FO_TCHAR FO_UNICODETEXT
+#else
+ #define FO_TCHAR 0x0000
+#endif
+
+
+//////////////////////////////////////////////////////////////////////////
+//want show tooltip for statusbar
+//wparam=(char *)protocolname
+//lparam=0
+#define ME_CLIST_FRAMES_SB_SHOW_TOOLTIP "CListFrames/StatusBarShowToolTip"
+
+//////////////////////////////////////////////////////////////////////////
+//want hide tooltip for statusbar
+//wparam=lparam=0
+#define ME_CLIST_FRAMES_SB_HIDE_TOOLTIP "CListFrames/StatusBarHideToolTip"
+
+//////////////////////////////////////////////////////////////////////////
+//adds a frame window
+//wParam=(CLISTFrame*)
+//lParam=0
+//returns an integer, the frame id.
+#define MS_CLIST_FRAMES_ADDFRAME "CListFrames/AddFrame"
+
+//////////////////////////////////////////////////////////////////////////
+// remove frame. It destroy your window
+//
+#define MS_CLIST_FRAMES_REMOVEFRAME "CListFrames/RemoveFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//shows all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_SHOWALLFRAMES "CListFrames/ShowALLFrames"
+
+//////////////////////////////////////////////////////////////////////////
+//shows the titlebars of all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_SHOWALLFRAMESTB "CListFrames/ShowALLFramesTB"
+
+//////////////////////////////////////////////////////////////////////////
+//hides the titlebars of all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_HIDEALLFRAMESTB "CListFrames/HideALLFramesTB"
+
+//////////////////////////////////////////////////////////////////////////
+//shows the frame if it is hidden,
+//hides the frame if it is shown
+//wParam = FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_SHFRAME "CListFrames/SHFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//shows the frame titlebar if it is hidden,
+//hides the frame titlebar if it is shown
+//wParam=FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_SHFRAMETITLEBAR "CListFrame/SHFrameTitleBar"
+
+//////////////////////////////////////////////////////////////////////////
+//locks the frame if it is unlocked,
+//unlock the frame if it is locked
+//wParam=FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_ULFRAME "CListFrame/ULFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//collapses the frame if it is uncollapsed,
+//uncollapses the frame if it is collapsed
+//wParam=FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_UCOLLFRAME "CListFrame/UCOLLFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//trigger border flags
+//wparam=frameid
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_SETUNBORDER "CListFrame/SetUnBorder"
+
+//////////////////////////////////////////////////////////////////////////
+//trigger skinned flags
+//wparam=frameid
+//lparam=0
+#define MS_CLIST_FRAMES_SETSKINNED "CListFrame/SetSkinnedFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//redraws the frame
+//wParam=FrameId, -1 for all frames
+//lparam=FU_flags
+//returns a pointer to option, -1 on failure
+#define MS_CLIST_FRAMES_UPDATEFRAME "CListFrame/UpdateFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//gets the frame options
+//(HIWORD)wParam=FrameId
+//(LOWORD)wParam=FO_flag
+//lParam=0
+//returns a pointer to option, -1 on failure
+#define MS_CLIST_FRAMES_GETFRAMEOPTIONS "CListFrame/GetFrameOptions"
+
+//sets the frame options
+//(HIWORLD)wParam=FrameId
+//(LOWORD)wParam=FO_flag
+//lParam=value
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_SETFRAMEOPTIONS "CListFrame/SetFrameOptions"
+
+//////////////////////////////////////////////////////////////////////////
+//Frames related menu stuff
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+//add a new item to the context frame menu
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+//returns a handle to the new item
+//popupposition=frameid
+//contactowner=advanced parameter
+#define MS_CLIST_ADDCONTEXTFRAMEMENUITEM "CList/AddContextFrameMenuItem"
+
+//////////////////////////////////////////////////////////////////////////
+//remove a item from context frame menu
+//wParam=hMenuItem returned by MS_CLIST_ADDCONTACTMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVECONTEXTFRAMEMENUITEM "CList/RemoveContextFrameMenuItem"
+
+//////////////////////////////////////////////////////////////////////////
+//builds the context menu for a frame
+//wparam=frameid
+//lParam=0
+//returns a HMENU on success, or NULL on failure
+#define MS_CLIST_MENUBUILDFRAMECONTEXT "CList/BuildContextFrameMenu"
+
+//////////////////////////////////////////////////////////////////////////
+// the frame menu is about to be built
+// wparam=frameid
+// lparam=
+// -1 for build from titlebar,
+// use
+// MS_CLIST_ADDCONTEXTFRAMEMENUITEM
+// MS_CLIST_REMOVECONTEXTFRAMEMENUITEM
+//
+// >0 for build in main menu,
+// must be popupname=lparam to place your items in right popup of main menu.
+// use
+// MS_CLIST_ADDMAINMENUITEM
+// MS_CLIST_REMOVEMAINMENUITEM
+//
+#define ME_CLIST_PREBUILDFRAMEMENU "CList/PreBuildFrameMenu"
+
+//////////////////////////////////////////////////////////////////////////
+//needed by cluiframes module to add frames menu to main menu.
+//it just calls NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
+#define MS_CLIST_FRAMEMENUNOTIFY "CList/ContextFrameMenuNotify"
+
diff --git a/plugins/ExternalAPI/m_db3xsa.h b/plugins/ExternalAPI/m_db3xsa.h new file mode 100644 index 0000000000..b6dbfd0429 --- /dev/null +++ b/plugins/ExternalAPI/m_db3xsa.h @@ -0,0 +1,119 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2007 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+*/
+
+/* DB/SetPassword v0.5.1.3+
+This service is used to set, change or clear the password used for encrypting the profile.
+It opens the password change dialog.
+wParam=0
+lParam=0
+*/
+#define MS_DB_SETPASSWORD "DB/SetPassword"
+
+/* DB/Backup v0.5.1.3+
+This service will make a backup of your current profile. Backups are named
+<ProfileName> xx.bak where xx is the number of backups. The larger the number, the
+older the backup.
+wParam=0
+lParam=0
+*/
+#define MS_DB_BACKUP "DB/Backup"
+
+/* DB/Backup v0.5.1.3+
+This service is the trigger action service and does the same as the service above.
+Only difference is wParam carries flags from trigger plugin.
+wParam=flags
+lParam=0
+*/
+#define MS_DB_BACKUPTRIGGER "DB/BackupTriggerAct"
+
+/* DB/GetProfilePath( W ) v0.5.1.5+
+Gets the path of the profile currently being used by the database module. This
+path does not include the last '\'. It is appended with the profile's name if
+ProfileSubDir=yes is set in the mirandaboot.ini.
+ wParam=( WPARAM )( int )cbName
+ lParam=( LPARAM )( char* )pszName
+pszName is a pointer to the buffer that receives the path of the profile
+cbName is the size in bytes of the pszName buffer
+Returns 0 on success or nonzero otherwise
+*/
+#define MS_DB_GETPROFILEPATHW "DB/GetProfilePathW"
+
+
+/* DB/GetProfilePathBasic( W ) v0.5.1.5+
+Gets the path of the profile currently being used by the database module. This
+path does not include the last '\'. This is never appended with the profile's name.
+ wParam=( WPARAM )( int )cbName
+ lParam=( LPARAM )( char* )pszName
+pszName is a pointer to the buffer that receives the path of the profile
+cbName is the size in bytes of the pszName buffer
+Returns 0 on success or nonzero otherwise
+*/
+#define MS_DB_GETPROFILEPATH_BASIC "DB/GetProfilePathBasic"
+#define MS_DB_GETPROFILEPATH_BASICW "DB/GetProfilePathBasicW"
+
+/* Utils/PathToAbsolute( W ) v0.5.1.5+
+This service routine expands all environment variables of a path string.
+It supports:
+%MIRANDAPATH% - expands to the installation folder of miranda,
+%PROFILEPATH% - expands to the folder the current profile is stored in,
+%PROFILENAME% - expands to the name of the current profile,
+and all windows like environment variables such as:
+%USERPROFILE%, %WINDIR%, ...
+It returns the length of the absolute path in characters on success or
+0 if any of the environment variables was not translated.
+wParam=relative source path ( must be smaller than MAX_PATH )
+lParam=absolute destination path ( must be larger or equal to MAX_PATH )
+*/
+#define MIRANDAPATH "%MIRANDAPATH%"
+#define MIRANDAPATHW L"%MIRANDAPATH%"
+#define PROFILEPATH "%PROFILEPATH%"
+#define PROFILEPATHW L"%PROFILEPATH%"
+#define PROFILENAME "%PROFILENAME%"
+#define PROFILENAMEW L"%PROFILENAME%"
+
+#ifndef MS_UTILS_PATHTOABSOLUTE
+ #define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute"
+#endif
+#define MS_UTILS_PATHTOABSOLUTEW "Utils/PathToAbsoluteW"
+
+/* Utils/PathToRelative( W ) v0.5.1.5+
+This service parses the given absolute path and translates it to a string
+containing as much environment variables as possible.
+The return value is the length of the relative path in characters.
+wParam=absolute source path ( must be smaller than MAX_PATH )
+lParam=relative destination path ( must be larger or equal to MAX_PATH )
+*/
+#ifndef MS_UTILS_PATHTORELATIVE
+ #define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative"
+#endif
+#define MS_UTILS_PATHTORELATIVEW "Utils/PathToRelativeW"
+
+/* Unicode/Multibyte wrapping via TCHAR
+*/
+#ifdef _UNICODE
+ #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTEW
+ #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVEW
+#else
+ #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTE
+ #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVE
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_dbx_tree.h b/plugins/ExternalAPI/m_dbx_tree.h new file mode 100644 index 0000000000..932b1bcdb6 --- /dev/null +++ b/plugins/ExternalAPI/m_dbx_tree.h @@ -0,0 +1,688 @@ +/*
+
+dbx_tree: tree database driver for Miranda IM
+
+Copyright 2007-2010 Michael "Protogenes" Kunz,
+
+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_DBX_TREE_H__
+
+#define M_DBX_TREE_H__ 1
+
+#ifndef _MSC_VER
+#include <stdint.h>
+#else
+#include "stdint.h"
+#endif
+#pragma pack(push, 8)
+
+
+/**
+ \brief general return value if invalid param or invalid combination of params specified
+**/
+static const unsigned int DBT_INVALIDPARAM = 0xFFFFFFFF;
+
+
+///////////////////////////////////////////////////////////
+// Entities
+///////////////////////////////////////////////////////////
+
+/**
+ \brief A handle to a Entity
+**/
+typedef uint32_t TDBTEntityHandle;
+
+static const uint32_t DBT_NF_IsRoot = 0x00000001; /// Entity is the Root
+static const uint32_t DBT_NF_IsGroup = 0x00000002; /// Entity is a group
+static const uint32_t DBT_NF_IsAccount = 0x00000004; /// Entity is an account
+
+static const uint32_t DBT_NF_HasChildren = 0x00010000; /// Entity has Children (for Groups and Metacontacts)
+static const uint32_t DBT_NF_HasVirtuals = 0x00020000; /// Entity has at least one Virtual duplicate
+static const uint32_t DBT_NF_IsVirtual = 0x00040000; /// Entity is a Virtual duplicate
+
+static const uint32_t DBT_NFM_SpecialEntity = DBT_NF_IsRoot | DBT_NF_IsGroup | DBT_NF_IsAccount | DBT_NF_IsVirtual;
+
+///////////////////////////////////////////////////////////
+// Entities
+///////////////////////////////////////////////////////////
+
+/**
+ \brief
+ \param wParam = 0
+ \param lParam = 0
+
+ \return Handle to root Entity
+**/
+#define MS_DBT_ENTITY_GETROOT "DBT/Entity/GetRoot"
+
+
+/**
+ \brief
+ \param wParam = hEntity
+ \param lParam = 0
+
+ \return ChildCount of specified Entity
+**/
+#define MS_DBT_ENTITY_CHILDCOUNT "DBT/Entity/ChildCount"
+
+
+/**
+ \brief
+ \param wParam = hEntity
+ \param lParam = 0
+
+ \return Parent hEntity of specified Entity
+**/
+#define MS_DBT_ENTITY_GETPARENT "DBT/Entity/GetParent"
+
+
+/**
+ \brief
+ \param wParam = hEntity
+ \param lParam = hNewEntity
+
+ \return 0 on success
+**/
+#define MS_DBT_ENTITY_MOVE "DBT/Entity/Move"
+
+/**
+ \brief
+ \param wParam = hEntity
+ \param lParam = hNewParent
+**/
+#define ME_DBT_ENTITY_MOVING "DBT/Entity/Moving"
+/**
+ \brief
+ \param wParam = hEntity
+ \param lParam = hOldParent
+**/
+#define ME_DBT_ENTITY_MOVED "DBT/Entity/Moved"
+
+/**
+ \brief Read the flags of an Entity
+ \param wParam = hEntity
+ \param lParam = 0
+
+ \return Flags
+**/
+#define MS_DBT_ENTITY_GETFLAGS "DBT/Entity/GetFlags"
+
+
+
+static const uint32_t DBT_NIFO_OSC_AC = 0x00000001; /// onStartEntity - AddChildren
+static const uint32_t DBT_NIFO_OSC_AP = 0x00000002; /// onStartEntity - AddParent
+static const uint32_t DBT_NIFO_OSC_AO = 0x00000004; /// onStartEntity - AddOriginal (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OSC_AOC = 0x00000008 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalChildren (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OSC_AOP = 0x00000010 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalParent (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OSC_USEACCOUNT = 0x00000080; /// onStartEntity - use Account as fallback, only for settings
+
+static const uint32_t DBT_NIFO_OC_AC = 0x00000001 <<8; /// onChildEntity - AddChildren
+//static const uint32_t DBT_LC_OC_AP = 0x00000002 <<8; /// invalid for children
+static const uint32_t DBT_NIFO_OC_AO = 0x00000004 <<8; /// onChildEntity - AddOriginal (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OC_AOC = 0x00000008 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalChildren (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OC_AOP = 0x00000010 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalParent (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OC_USEACCOUNT = 0x00000080 <<8; /// onStartEntity - use Account as fallback, only for settings
+
+static const uint32_t DBT_NIFO_OP_AC = 0x00000001 <<16; /// onParentEntity - AddChildren
+static const uint32_t DBT_NIFO_OP_AP = 0x00000002 <<16; /// onParentEntity - AddParent
+static const uint32_t DBT_NIFO_OP_AO = 0x00000004 <<16; /// onParentEntity - AddOriginal (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OP_AOC = 0x00000008 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalChildren (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OP_AOP = 0x00000010 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalParent (only if Entity is virtual)
+static const uint32_t DBT_NIFO_OP_USEACCOUNT = 0x00000080 <<16; /// onStartEntity - use Account as fallback, only for settings
+
+static const uint32_t DBT_NIFO_GF_DEPTHFIRST = 0x01000000; /// general flags - depth first iteration instead of breath first
+static const uint32_t DBT_NIFO_GF_USEROOT = 0x02000000; /// general flags - use root as fallback, only for settings
+static const uint32_t DBT_NIFO_GF_VL1 = 0x10000000; /// general flags - limit virtual lookup depth to 1
+static const uint32_t DBT_NIFO_GF_VL2 = 0x20000000; /// general flags - limit virtual lookup depth to 2
+static const uint32_t DBT_NIFO_GF_VL3 = 0x30000000; /// general flags - limit virtual lookup depth to 3
+static const uint32_t DBT_NIFO_GF_VL4 = 0x40000000; /// general flags - limit virtual lookup depth to 4
+
+/**
+ \brief Entityfilter options for Entity iteration
+**/
+typedef
+ struct TDBTEntityIterFilter
+ {
+ uint32_t cbSize; /// size of the structur in bytes
+ uint32_t Options; /// Options for iteration: DB_EIFO_*
+ uint32_t fHasFlags; /// flags an Entity must have to be iterated
+ uint32_t fDontHasFlags; /// flags an Entity have not to have to be iterated
+ } TDBTEntityIterFilter, *PDBTEntityIterFilter;
+
+/**
+ \brief Handle of an Entity-Iteration
+**/
+typedef uintptr_t TDBTEntityIterationHandle;
+/**
+ \brief initialize an iteration of Entities
+ \param wParam = PDBTEntityIterFilter, NULL to iterate all Entities (breadthfirst, all but root)
+ \param lParam = TDBTEntityHandle Entity, where iteration starts
+
+ \return EnumID
+**/
+#define MS_DBT_ENTITY_ITER_INIT "DBT/Entity/Iter/Init"
+
+
+/**
+ \brief get the next Entity
+ \param wParam = EnumID returned by MS_DBT_ENTITY_ITER_INIT
+ \param lParam = 0
+
+ \return hEntity, 0 at the end
+**/
+#define MS_DBT_ENTITY_ITER_NEXT "DBT/Entity/Iter/Next"
+
+/**
+ \brief closes an iteration and frees its ressourcs
+ \param wParam = IterationHandle returned by MS_DBT_ENTITY_ITER_INIT
+ \param lParam = 0
+
+ \return 0 on success
+**/
+#define MS_DBT_ENTITY_ITER_CLOSE "DBT/Entity/Iter/Close"
+
+/**
+ \brief Deletes an Entity.
+
+ All children will be moved to its parent.
+ If the Entity has virtual copies, history and settings will be transfered to the first duplicate.
+
+ \param wParam = hEntity
+ \param lParam = 0
+
+ \return 0 on success
+**/
+#define MS_DBT_ENTITY_DELETE "DBT/Entity/Delete"
+
+
+typedef struct TDBTEntity
+{
+ uint32_t bcSize;
+ TDBTEntityHandle hParentEntity;
+ uint32_t fFlags; /// Flags DBT_NF_
+ TDBTEntityHandle hAccountEntity; /// Needed for normal Entities, reference to AccountEntity for the created one
+} TDBTEntity, *PDBTEntity;
+
+/**
+ \brief Creates a new Entity.
+ \param wParam = PDBTEntity
+ \param lParam = 0
+
+ \return hEntity on success, 0 otherwise
+**/
+#define MS_DBT_ENTITY_CREATE "DBT/Entity/Create"
+
+
+/**
+ \brief returns the account entity handle specified during creation
+ \param wParam = TDBTEntityHandle
+ \param lParam = 0
+
+ \return hEntity on success, 0 otherwise
+**/
+#define MS_DBT_ENTITY_GETACCOUNT "DBT/Entity/GetAccount"
+
+
+///////////////////////////////////////////////////////////
+// Virtual Entities
+///////////////////////////////////////////////////////////
+
+/**
+ \brief Creates a virtual duplicate of an Entity
+ \param wParam = hEntity to duplicate, couldn't be a group (DBT_NF_IsGroup set to 0)
+ \param lParam = hParentEntity to place duplicate
+
+ \return hEntity of created duplicate
+**/
+#define MS_DBT_VIRTUALENTITY_CREATE "DBT/VirtualEntity/Create"
+
+/**
+ \brief Retrieves the original Entity, which this is a duplicate of
+ \param wParam = hEntity of virtual Entity
+ \param lParam = 0
+
+ \return hEntity of original Entity
+**/
+#define MS_DBT_VIRTUALENTITY_GETPARENT "DBT/VirtualEntity/GetParent"
+
+/**
+ \brief Retrieves the first virtual duplicate of an Entity (if any)
+ \param wParam = hEntity with virtual copies
+ \param lParam
+
+ \return hEntity of first virtual duplicate
+**/
+#define MS_DBT_VIRTUALENTITY_GETFIRST "DBT/VirtualEntity/GetFirst"
+
+/**
+ \brief Retrieves the following duplicate
+ \param wParam = hVirtualEntity of virtual Entity
+ \param lParam = 0
+
+ \return hEntity of next duplicate, 0 if hVirtualEntity was the last duplicate
+**/
+#define MS_DBT_VIRTUALENTITY_GETNEXT "DBT/VirtualEntity/GetNext"
+
+
+///////////////////////////////////////////////////////////
+// Settings
+///////////////////////////////////////////////////////////
+
+/**
+ \brief Handle of a Setting
+**/
+typedef uint32_t TDBTSettingHandle;
+
+
+static const uint16_t DBT_ST_BYTE = 0x01;
+static const uint16_t DBT_ST_WORD = 0x02;
+static const uint16_t DBT_ST_DWORD = 0x03;
+static const uint16_t DBT_ST_QWORD = 0x04;
+
+static const uint16_t DBT_ST_CHAR = 0x11;
+static const uint16_t DBT_ST_SHORT = 0x12;
+static const uint16_t DBT_ST_INT = 0x13;
+static const uint16_t DBT_ST_INT64 = 0x14;
+
+static const uint16_t DBT_ST_BOOL = 0x20;
+static const uint16_t DBT_ST_FLOAT = 0x21;
+static const uint16_t DBT_ST_DOUBLE = 0x22;
+
+static const uint16_t DBT_ST_ANSI = 0xff;
+static const uint16_t DBT_ST_BLOB = 0xfe;
+static const uint16_t DBT_ST_UTF8 = 0xfd;
+static const uint16_t DBT_ST_WCHAR = 0xfc;
+
+#if (defined(_UNICODE) || defined(UNICODE))
+ static const uint16_t DBT_ST_TCHAR = DBT_ST_WCHAR;
+#else
+ static const uint16_t DBT_ST_TCHAR = DBT_ST_ANSI;
+#endif
+
+static const uint16_t DBT_STF_Signed = 0x10;
+static const uint16_t DBT_STF_VariableLength = 0x80;
+
+
+
+static const uint32_t DBT_SDF_FoundValid = 0x00000001;
+static const uint32_t DBT_SDF_HashValid = 0x00000002;
+
+/**
+ \brief Describes a setting, its name and location
+**/
+typedef
+ struct TDBTSettingDescriptor {
+ uint32_t cbSize; /// size of the structure in bytes
+ TDBTEntityHandle Entity; /// Entityhandle where the setting can be found, or where searching starts
+ char * pszSettingName; /// Setting name
+ uint32_t Options; /// options describing where the setting can be found DBT_NIFO_*
+ uint32_t Flags; /// Valid Flags. DBT_SDF_* describes which following values are valid (internal use)
+
+ TDBTEntityHandle FoundInEntity; /// internal use to avoid to do the searching twice
+ uint32_t Hash; /// internal used HashValue for settingname
+ TDBTSettingHandle FoundHandle; /// internal used SettingHandle
+ } TDBTSettingDescriptor, * PDBTSettingDescriptor;
+
+/**
+ \brief Describes a settings value
+
+ it is never used alone, without a type qualifier
+**/
+typedef
+ union TDBTSettingValue {
+ bool Bool;
+ int8_t Char; uint8_t Byte;
+ int16_t Short; uint16_t Word;
+ uint32_t Int; uint32_t DWord;
+ int64_t Int64; uint64_t QWord;
+ float Float;
+ double Double;
+
+ struct {
+ uint32_t Length; // length in bytes of pBlob, length in characters of char types including trailing null
+ union {
+ uint8_t * pBlob;
+ char * pAnsi;
+ char * pUTF8;
+ wchar_t * pWide;
+ TCHAR * pTChar;
+ };
+ };
+ } TDBTSettingValue;
+
+/**
+ \brief Describes a setting
+**/
+typedef
+ struct TDBTSetting {
+ uint32_t cbSize; /// size of the structure in bytes
+ PDBTSettingDescriptor Descriptor; /// pointer to a Setting descriptor used to locate the setting
+ uint16_t Type; /// type of the setting, see DBT_ST_*
+ TDBTSettingValue Value; /// Value of the setting according to Type
+ } TDBTSetting, * PDBTSetting;
+
+
+
+/**
+ \brief retrieves the handle of the setting
+ \param wParam = PDBTSettingDescriptor
+ \param lParam = 0
+
+ \return hSetting when found, 0 otherwise
+**/
+#define MS_DBT_SETTING_FIND "DBT/Setting/Find"
+
+
+/**
+ \brief deletes the specified Setting
+ \param wParam = PDBTSettingDescriptor
+ \param lParam = 0
+
+ \return hSetting when found, 0 otherwise
+**/
+#define MS_DBT_SETTING_DELETE "DBT/Setting/Delete"
+
+/**
+ \brief deletes the specified Setting
+ \param wParam = TDBTSettingHandle
+ \param lParam = 0
+
+ \return 0 on success
+**/
+#define MS_DBT_SETTING_DELETEHANDLE "DBT/Setting/DeleteHandle"
+
+
+/**
+ \brief Write a setting (and creates it if neccessary)
+ \param wParam = PDBTSetting
+ \param lParam = 0
+
+ \return TDBTSettingHandle on success, 0 otherwise
+**/
+#define MS_DBT_SETTING_WRITE "DBT/Setting/Write"
+
+/**
+ \brief retrieves the handle of the setting
+ \param wParam = PDBTSetting
+ \param lParam = TDBTSettingHandle, could be 0 to create new setting, but needs wParam->Descriptor with valid data
+
+ \return hSetting when found or created, 0 otherwise
+**/
+#define MS_DBT_SETTING_WRITEHANDLE "DBT/Setting/WriteHandle"
+
+/**
+ \brief retrieves the value of the setting
+ \param wParam = PDBTSetting
+ \param lParam = 0
+
+ \return SettingHandle
+**/
+#define MS_DBT_SETTING_READ "DBT/Setting/Read"
+
+/**
+ \brief retrieves the value of the setting
+
+ Also retrieves the SettingDescriptor if it is set and prepared correctly (name buffers set etc)
+ \param wParam = PDBTSetting
+ \param lParam = TDBTSettingHandle
+
+ \return original settings type
+**/
+#define MS_DBT_SETTING_READHANDLE "DBT/Setting/ReadHandle"
+
+
+
+/**
+ \brief Settings Filter Options for setting iteration
+**/
+typedef
+ struct TDBTSettingIterFilter {
+ uint32_t cbSize; /// size in bytes of this structure
+ uint32_t Options; /// DBT_NIFO_* flags
+ TDBTEntityHandle hEntity; /// hEntity which settings should be iterated (or where iteration begins)
+ char * NameStart; /// if set != NULL the iteration will only return settings which name starts with this string
+ uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities
+ TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order
+
+ PDBTSettingDescriptor Descriptor; /// if set, the iteration will fill in the correct data, you may set SettingsNameLength and SettingName to a buffer to recieve the name of each setting
+ PDBTSetting Setting; /// if set, iteration loads every settings value, except variable length data (blob, strings) but returns their length
+
+ } TDBTSettingIterFilter, *PDBTSettingIterFilter;
+
+
+/**
+ \brief Handle of a Setting-Iteration
+**/
+typedef uintptr_t TDBTSettingIterationHandle;
+/**
+ \brief initialize an iteration of settings
+ \param wParam = PDBTSettingIterFilter
+ \param lParam = 0
+
+ \return EnumID
+**/
+#define MS_DBT_SETTING_ITER_INIT "DBT/Setting/Iter/Init"
+
+
+/**
+ \brief get the next setting
+ \param wParam = EnumID returned by MS_DBT_SETTING_ITER_INIT
+ \param lParam = 0
+
+ \return hSetting, 0 at the end
+**/
+#define MS_DBT_SETTING_ITER_NEXT "DBT/Setting/Iter/Next"
+
+/**
+ \brief closes an iteration and frees its ressourcs
+ \param wParam = IterationHandle returned by MS_DBT_SETTING_ITER_INIT
+ \param lParam = 0
+
+ \return 0 on success
+**/
+#define MS_DBT_SETTING_ITER_CLOSE "DBT/Setting/Iter/Close"
+
+
+///////////////////////////////////////////////////////////
+// Events
+///////////////////////////////////////////////////////////
+
+typedef uint32_t TDBTEventHandle;
+
+
+/**
+ \brief this event was sent by the user. If not set this event was received.
+**/
+static const uint32_t DBT_EF_SENT = 0x00000002;
+
+/**
+ \brief event has been read by the user. It does not need to be processed any more except for history.
+**/
+static const uint32_t DBT_EF_READ = 0x00000004;
+
+/**
+ \brief event contains the right-to-left aligned text
+**/
+static const uint32_t DBT_EF_RTL = 0x00000008;
+
+/**
+ \brief event contains a text in utf-8
+**/
+static const uint32_t DBT_EF_UTF = 0x00000010;
+
+/**
+ \brief event is virtual. it is not stored to db file yet.
+**/
+static const uint32_t DBT_EF_VIRTUAL = 0x00000020;
+
+/**
+ \brief describes an event
+**/
+typedef struct TDBTEvent {
+ uint32_t cbSize; /// size of the structure in bytes
+ char * ModuleName; ///
+ uint32_t Timestamp; /// seconds since 00:00, 01/01/1970. Gives us times until 2106 unless you use the standard C library which is signed and can only do until 2038. In GMT.
+ uint32_t Flags; /// the omnipresent flags
+ uint32_t EventType; /// module-unique event type ID
+ uint32_t cbBlob; /// size of pBlob in bytes
+ uint8_t * pBlob; /// pointer to buffer containing module-defined event data
+} TDBTEvent, *PDBTEvent;
+
+static const uint32_t DBT_EventType_Message = 0;
+static const uint32_t DBT_EventType_URL = 1;
+static const uint32_t DBT_EventType_Contacts = 2;
+static const uint32_t DBT_EventType_Added = 1000;
+static const uint32_t DBT_EventType_AuthRequest = 1001; //specific codes, hence the module-
+static const uint32_t DBT_EventType_File = 1002; //specific limit has been raised to 2000
+
+
+/**
+ \brief retrieves the blobsize of an event in bytes
+ \param wParam = hEvent
+ \param lParam = 0
+
+ \return blobsize
+**/
+#define MS_DBT_EVENT_GETBLOBSIZE "DBT/Event/GetBlobSize"
+
+
+
+/**
+ \brief retrieves all information of an event
+ \param wParam = hEvent
+ \param lParam = PDBTEvent
+
+ \return 0 on success
+**/
+#define MS_DBT_EVENT_GET "DBT/Event/Get"
+
+/**
+ \brief retrieves all information of an event
+ \param wParam = hEntity
+ \param lParam = 0
+
+ \return Event count of specified Entity on success, DBT_INVALIDPARAM on error
+**/
+#define MS_DBT_EVENT_GETCOUNT "DBT/Event/GetCount"
+
+
+/**
+ \brief Deletes the specfied event
+ \param wParam = hEntity
+ \param lParam = hEvent
+
+ \return 0 on success
+**/
+#define MS_DBT_EVENT_DELETE "DBT/Event/Delete"
+
+/**
+ \brief Creates a new Event
+ \param wParam = hEntity
+ \param lParam = PDBTEvent
+
+ \return hEvent on success, 0 otherwise
+**/
+
+#define MS_DBT_EVENT_ADD "DBT/Event/Add"
+
+
+/**
+ \brief Changes the flags for an event to mark it as read.
+ \param wParam = hEntity
+ \param lParam = hEvent
+
+ \return New flags
+**/
+#define MS_DBT_EVENT_MARKREAD "DBT/Event/MarkRead"
+
+/**
+ \brief Saves a virtual event to file and changes the flags.
+ \param wParam = hEntity
+ \param lParam = hEvent
+
+ \return 0 on success
+**/
+#define MS_DBT_EVENT_WRITETODISK "DBT/Event/WriteToDisk"
+
+/**
+ \brief Retrieves a handle to a Entity that owns hEvent.
+ \param wParam = hEvent
+ \param lParam = 0
+
+ \return NULL is a valid return value, meaning, as usual, the user.
+ DBT_INVALIDPARAM if hDbEvent is invalid, or the handle to the Entity on
+ success
+**/
+#define MS_DBT_EVENT_GETENTITY "DBT/Event/GetEntity"
+
+/**
+ \brief Event Filter Options for event iteration
+**/
+typedef
+ struct TDBTEventIterFilter {
+ uint32_t cbSize; /// size in bytes of this structure
+ uint32_t Options; /// DBT_NIFO_* flags
+ TDBTEntityHandle hEntity; /// hEntity which events should be iterated (or where iteration begins)
+ uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities
+ TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order
+
+ uint32_t tSince; /// timestamp when to start iteration, 0 for first item
+ uint32_t tTill; /// timestamp when to stop iteration, 0 for last item
+
+ PDBTEvent Event; /// if set every events data gets stored there
+
+ } TDBTEventIterFilter, *PDBTEventIterFilter;
+
+
+/**
+ \brief Handle of a Event-Iteration
+**/
+typedef uintptr_t TDBTEventIterationHandle;
+/**
+ \brief initialize an iteration of events
+ \param wParam = PDBTEventIterFilter
+ \param lParam = 0
+
+ \return EnumID
+**/
+#define MS_DBT_EVENT_ITER_INIT "DBT/Event/Iter/Init"
+
+
+/**
+ \brief get the next event
+ \param wParam = EnumID returned by MS_DBT_EVENT_ITER_INIT
+ \param lParam = 0
+
+ \return hSetting, 0 at the end
+**/
+#define MS_DBT_EVENT_ITER_NEXT "DBT/Event/Iter/Next"
+
+/**
+ \brief closes an iteration and frees its resourcs
+ \param wParam = IterationHandle returned by MS_DBT_EVENT_ITER_INIT
+ \param lParam = 0
+
+ \return 0 on success
+**/
+#define MS_DBT_EVENT_ITER_CLOSE "DBT/Event/Iter/Close"
+
+
+
+#pragma pack(pop)
+
+#endif
diff --git a/plugins/ExternalAPI/m_dos.h b/plugins/ExternalAPI/m_dos.h new file mode 100644 index 0000000000..db0aadfc0f --- /dev/null +++ b/plugins/ExternalAPI/m_dos.h @@ -0,0 +1,22 @@ +// Copyright © 2008 sss, chaos.persei
+//
+// 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.
+
+//Start sending messages to contact
+//effect depend on DOS plugin settings
+//wParam=(HANDLE)hContact
+//lParam=int
+//always returns 0
+#define MS_DOS_SERVICE "/StartDos"
diff --git a/plugins/ExternalAPI/m_ersatz.h b/plugins/ExternalAPI/m_ersatz.h new file mode 100644 index 0000000000..8136a8bd5d --- /dev/null +++ b/plugins/ExternalAPI/m_ersatz.h @@ -0,0 +1,40 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2006 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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_ERSATZ_H__
+# define __M_ERSATZ_H__
+
+
+//Returns the current status message for yourself
+//wParam=(WPARAM)0
+//lParam=(LPARAM)0
+//returns status msg or NULL if there is none. Remember to mir_free the return value
+#define PS_GETMYAWAYMSG "/GetMyAwayMsg"
+
+//Created if ersatz is installed
+//wParam=(WPARAM)0
+//lParam=(LPARAM)0
+//returns always 1
+#define MS_ERSATZ_ENABLED "ERSATZ/Enabled"
+
+
+#endif // __M_ERSATZ_H__
diff --git a/plugins/ExternalAPI/m_extraicons.h b/plugins/ExternalAPI/m_extraicons.h new file mode 100644 index 0000000000..1e86cb168e --- /dev/null +++ b/plugins/ExternalAPI/m_extraicons.h @@ -0,0 +1,182 @@ +/*
+ Copyright (C) 2009 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_EXTRAICONS_H__
+#define __M_EXTRAICONS_H__
+
+
+/*
+
+There is 2 ways of registering with Extra Icons service:
+
+1. Using callbacks
+ This works similar to clist API. When you register you provide 2 callbacks, one to rebuild the icons
+and one to apply the icons for a contact.
+ In the RebuildIcons callback, all icons that will be used have to be registered calling
+MS_CLIST_EXTRA_ADD_ICON service. The value returned by this service has to be stored and used in the
+apply icons.
+ The ApplyIcons callback will be called for all the needed contacts. Inside it, you must call
+MS_EXTRAICON_SET_ICON to set the icon for the contact, sending the value returned by MS_CLIST_EXTRA_ADD_ICON
+as the hImage.
+
+2. Using icolib
+ In this case no callback is needed and the plugin just need to call MS_EXTRAICON_SET_ICON passing the
+icolib name in icoName when needed. If your plugin can have extra icons on startup, remember to do a loop
+over all contacts to set the initial icon.
+
+
+To register a new extra icon, you have to call MS_EXTRAICON_REGISTER passing the needed atributes.
+
+*/
+
+#define MIID_EXTRAICONSSERVICE { 0x62d80749, 0xf169, 0x4592, { 0xb4, 0x4d, 0x3d, 0xd6, 0xde, 0x9d, 0x50, 0xc5 } }
+
+
+#define EXTRAICON_TYPE_CALLBACK 0 // Similar to old clist callbacks, it fires 2 notifications
+#define EXTRAICON_TYPE_ICOLIB 1 // This extra icon will use only icons registered with icolib. No callbacks
+ // needed. Just call MS_EXTRAICON_SET_ICON passing the name of the extraicon to set one.
+
+
+typedef struct {
+ int cbSize;
+ int type; // One of EXTRAICON_TYPE_*
+ const char *name; // Internal name. More than one plugin can register extra icons with the same name
+ // if both have the same type. In this case, both will be handled as one.
+ // If the types are different the second one will be denied.
+ const char *description; // [Translated by plugin] Description to be used in GUI
+ const char *descIcon; // [Optional] Name of an icon registered with icolib to be used in GUI.
+
+ // If type == EXTRAICON_TYPE_CALLBACK this two must be set
+
+ // Callback to add icons to clist, calling MS_CLIST_EXTRA_ADD_ICON
+ // wParam=lParam=0
+ MIRANDAHOOK RebuildIcons;
+
+ // Callback to set the icon to clist, calling MS_CLIST_EXTRA_SET_ICON or MS_EXTRAICON_SET_ICON
+ // wParam = HANDLE hContact
+ // lParam = 0
+ MIRANDAHOOK ApplyIcon;
+
+ // Other optional callbacks
+
+ // [Optional] Callback called when extra icon was clicked
+ // wParam = HANDLE hContact
+ // lParam = int slot
+ // param = onClickParam
+ MIRANDAHOOKPARAM OnClick;
+
+ LPARAM onClickParam;
+
+} EXTRAICON_INFO;
+
+
+// Register an extra icon
+// wParam = (EXTRAICON_INFO *) Extra icon info
+// lParam = 0
+// Return: (HANDLE) id of extra icon on success, 0 on error
+#define MS_EXTRAICON_REGISTER "ExtraIcon/Register"
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hExtraIcon; // Value returned by MS_EXTRAICON_REGISTER
+ HANDLE hContact; // Contact to set the extra icon
+ union { // The icon to be set. This depends on the type of the extra icon:
+ HANDLE hImage; // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK)
+ const char *icoName; // Name of the icon registered with icolib (if EXTRAICON_TYPE_ICOLIB)
+ };
+} EXTRAICON;
+
+// Set an extra icon icon
+// wParam = (EXTRAICON *) Extra icon
+// Return: 0 on success
+#define MS_EXTRAICON_SET_ICON "ExtraIcon/SetIcon"
+
+
+
+#ifndef _NO_WRAPPERS
+#ifdef __cplusplus
+
+static HANDLE ExtraIcon_Register(const char *name, const char *description, const char *descIcon,
+ MIRANDAHOOK RebuildIcons,
+ MIRANDAHOOK ApplyIcon,
+ MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
+{
+ if (!ServiceExists(MS_EXTRAICON_REGISTER))
+ return NULL;
+
+ EXTRAICON_INFO ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.type = EXTRAICON_TYPE_CALLBACK;
+ ei.name = name;
+ ei.description = description;
+ ei.descIcon = descIcon;
+ ei.RebuildIcons = RebuildIcons;
+ ei.ApplyIcon = ApplyIcon;
+ ei.OnClick = OnClick;
+ ei.onClickParam = onClickParam;
+
+ return (HANDLE) CallService(MS_EXTRAICON_REGISTER, (WPARAM) &ei, 0);
+}
+
+static HANDLE ExtraIcon_Register(const char *name, const char *description, const char *descIcon = NULL,
+ MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
+{
+ if (!ServiceExists(MS_EXTRAICON_REGISTER))
+ return NULL;
+
+ EXTRAICON_INFO ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.type = EXTRAICON_TYPE_ICOLIB;
+ ei.name = name;
+ ei.description = description;
+ ei.descIcon = descIcon;
+ ei.OnClick = OnClick;
+ ei.onClickParam = onClickParam;
+
+ return (HANDLE) CallService(MS_EXTRAICON_REGISTER, (WPARAM) &ei, 0);
+}
+
+static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage)
+{
+ EXTRAICON ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.hExtraIcon = hExtraIcon;
+ ei.hContact = hContact;
+ ei.hImage = hImage;
+
+ return CallService(MS_EXTRAICON_SET_ICON, (WPARAM) &ei, 0);
+}
+
+static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, const char *icoName)
+{
+ EXTRAICON ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.hExtraIcon = hExtraIcon;
+ ei.hContact = hContact;
+ ei.icoName = icoName;
+
+ return CallService(MS_EXTRAICON_SET_ICON, (WPARAM) &ei, 0);
+}
+
+#endif
+#endif
+
+
+#endif // __M_EXTRAICONS_H__
diff --git a/plugins/ExternalAPI/m_fddnotify.h b/plugins/ExternalAPI/m_fddnotify.h new file mode 100644 index 0000000000..a2b30f425f --- /dev/null +++ b/plugins/ExternalAPI/m_fddnotify.h @@ -0,0 +1,57 @@ +/*
+
+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 _FDDNOTIFY_
+#define _FDDNOTIFY_
+
+//Enables all notifications (for use by BossKey)
+//wParam=0
+//lParam=0
+//returns 0
+#define MS_FDDNOTIFY_ENABLE "FddNotify/NotifyEnable"
+
+
+//Disables all notifications (for use by BossKey)
+//wParam=0
+//lParam=0
+//returns 0
+#define MS_FDDNOTIFY_DISABLE "FddNotify/NotifyDisable"
+
+
+//Makes the flashing begin
+//wParam=(unsigned int)eventCount
+//lParam=0
+//returns 0
+#define MS_FDDNOTIFY_STARTBLINK "FddNotify/StartBlinking"
+
+
+//Receives the number of events that were opened (usuful for the 'until events opened' setting)
+//wParam=(unsigned int)eventCount
+//lParam=0
+//returns 0
+#define MS_FDDNOTIFY_EVENTSOPENED "FddNotify/EventsWereOpened"
+
+
+//Informs if the flashing is active
+//wParam=0
+//lParam=0
+//returns 0 if the flashing is inactive or 1 if it is active
+#define MS_FDDNOTIFY_FLASHINGACTIVE "FddNotify/IsFlashingActive"
+
+
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_filterplugin.h b/plugins/ExternalAPI/m_filterplugin.h new file mode 100644 index 0000000000..5c39ac9397 --- /dev/null +++ b/plugins/ExternalAPI/m_filterplugin.h @@ -0,0 +1,139 @@ +#ifndef __M_FILTERPLUGIN_H
+#define __M_FILTERPLUGIN_H
+
+#include <windows.h>
+#include "m_mails.h" //for mail definition
+
+//
+//================================== IMPORTED FUNCTIONS ==================================
+//
+
+#ifndef YAMN_STANDARDFCN
+typedef DWORD (WINAPI *YAMN_STANDARDFCN)(LPVOID);
+#endif
+typedef DWORD (WINAPI *YAMN_FILTERMAILFCN)(HACCOUNT,DWORD,HYAMNMAIL,DWORD);
+
+typedef struct CFilterImportFcn
+{
+//If changes are made in this structure, version is changed.
+//So then YAMN does not initialize your structure, if version does not match.
+#define YAMN_FILTERIMPORTFCNVERSION 2
+
+//Function is called to get info from mail and mark mail as spam or not...
+ YAMN_FILTERMAILFCN FilterMailFcnPtr;
+
+//Function is called when application exits. Plugin should unload
+ YAMN_STANDARDFCN UnLoadFcn;
+} YAMN_FILTERIMPORTFCN, *PYAMN_FILTERIMPORTFCN;
+
+//
+//================================== FILTER PLUGIN REGISTRATION STRUCTURES ==================================
+//
+
+typedef struct CFilterPluginRegistration
+{
+#define YAMN_FILTERREGISTRATIONVERSION 2
+//Name of plugin
+//this member CANNOT be NULL. Just write here description, i.e. "PopFile filter plugin for YAMN"
+ char *Name;
+
+//The version of plugin. CANNOT be NULL.
+ char *Ver;
+
+//Plugin copyright
+//Write here your copyright if you want (or NULL)
+ char *Copyright;
+
+//Plugin description. Can be NULL.
+ char *Description;
+
+//Your contact (email). Can be NULL.
+ char *Email;
+
+//The web page. Can be NULL.
+ char *WWW;
+} YAMN_FILTERREGISTRATION, *PYAMN_FILTERREGISTRATION;
+
+typedef struct CYAMNFilterPlugin
+{
+//Importance of plugin. Mails are filtered in the way, that filter with smallest importance number
+//filters and marks mails first and the filter using the highest number marks mails the last. It means,
+//that number with highest number is the most important, because it can set or clear flags as it wants,
+//if another plugin set some flag, plugin with higher number can clear it.
+ DWORD Importance;
+
+//All needed other info from plugin
+ PYAMN_FILTERREGISTRATION PluginInfo;
+
+//Imported functions
+ PYAMN_FILTERIMPORTFCN FilterFcn;
+} YAMN_FILTERPLUGIN, *PYAMN_FILTERPLUGIN, *HYAMNFILTERPLUGIN;
+
+typedef struct CFilterPluginQueue
+{
+ HYAMNFILTERPLUGIN Plugin;
+ struct CFilterPluginQueue *Next;
+} YAMN_FILTERPLUGINQUEUE,*PYAMN_FILTERPLUGINQUEUE;
+
+//
+//================================== YAMN SERVICES FOR PROTOCOL PLUGIN ==================================
+//
+
+//RegisterFilterPlugin Service
+//Registers filter plugin
+//WPARAM- pointer to YAMN_FILTERREGISTRATION structure. Plugin must not delete this structure from memory.
+//LPARAM- version of YAMN_FILTERREGISTRATION structure (use YAMN_PROTOREGISTRATIONVERSION definition)
+//returns handle to plugin (HYAMNFILTERPLUGIN), if registration failed (plugin not registered) returns NULL
+//You need next to call SetFilterPluginFcnImportFcn to have your plugin cooperated with YAMN.
+#define MS_YAMN_REGISTERFILTERPLUGIN "YAMN/Service/RegisterFilterPlugin"
+
+//UnregisterFilterPlugin Service
+//Unregisters filter plugin
+//WPARAM- (HYAMNFILTERPLUGIN) plugin handle
+//LPARAM- any value
+//returns nonzero if success
+#define MS_YAMN_UNREGISTERFILTERPLUGIN "YAMN/Service/UnregisterFilterPlugin"
+
+//
+//================================== FUNCTIONS DEFINITIONS ========================================
+//
+
+typedef int (WINAPI *YAMN_SETFILTERPLUGINFCNIMPORTFCN)(HYAMNFILTERPLUGIN Plugin,DWORD Importance,PYAMN_FILTERIMPORTFCN YAMNFilterFcn,DWORD YAMNFilterFcnVer);
+
+//
+//================================== QUICK FUNCTION CALL DEFINITIONS ========================================
+//
+
+//These are defininitions for YAMN exported functions. Your plugin can use them.
+//pYAMNFcn is global variable, it is pointer to your structure containing YAMN functions.
+//It is something similar like pluginLink variable in Miranda plugin. If you use
+//this name of variable, you have already defined these functions and you can use them.
+//It's similar to Miranda's CreateService function.
+
+//How to use YAMN functions:
+//Create a structure containing pointer to functions you want to use in your plugin
+//This structure can look something like this:
+//
+// struct
+// {
+// YAMN_SETFILTERPLUGINFCNIMPORTFCN SetFilterPluginFcnImportFcn;
+// } *pYAMNFcn;
+//
+//then you have to fill this structure with pointers... If you use Miranda services, you will do it like this
+//
+// pYAMNFcn->SetFilterPluginFcnImportFcn=(YAMN_SETFILTERPLUGINFCNIMPORTFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SETFILTERPLUGINFCNIMPORTID,(LPARAM)0);
+//
+//If you do not use Miranda services, call service MS_YAMN_GETFCNPTR directly. The address to the MS_YAMN_GETFCNPTR is sent to you in LoadFilter function:
+//
+// pYAMNFcn->SetFilterPluginFcnImportFcn=(YAMN_SETFILTERPLUGINFCNIMPORTFCN)YAMN_GetFcnPtr((WPARAM)YAMN_SETFILTERPLUGINFCNIMPORTID,(LPARAM)0);
+//
+//and in your plugin just simply use e.g.:
+//
+// SetFilterPluginFcnImport(...);
+//
+
+#define YAMN_SETFILTERPLUGINFCNIMPORTID "YAMN/SetFilterPluginFcnImport"
+
+#define SetFilterPluginFcnImport(a,b,c,d) pYAMNFcn->SetFilterPluginFcnImportFcn(a,b,c,d)
+
+#endif
diff --git a/plugins/ExternalAPI/m_fingerprint.h b/plugins/ExternalAPI/m_fingerprint.h new file mode 100644 index 0000000000..b44e937dbb --- /dev/null +++ b/plugins/ExternalAPI/m_fingerprint.h @@ -0,0 +1,70 @@ +/*
+Fingerprint Mod+ (client version) icons module for Miranda IM
+
+Copyright © 2006-2007 Artem Shpynov aka FYR, Bio, Faith Healer. 2009-2010 HierOS
+
+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.
+*/
+
+/************************************************************************/
+/* Author: Artem Shpynov aka FYR mailto:shpynov@nm.ru */
+/* icons by Angeli-Ka */
+/* January 12, 2006 */
+/************************************************************************/
+
+
+/*
+ * FINGERPRINT PLUGIN SERVICES HEADER
+ */
+
+/*
+ * Service SameClients MS_FP_SAMECLIENTS
+ * wParam - char * first MirVer value
+ * lParam - char * second MirVer value
+ * return pointer to char string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
+ */
+#define MS_FP_SAMECLIENTS "Fingerprint/SameClients"
+
+/*
+ * Service SameClientsW MS_FP_SAMECLIENTSW
+ * wParam - LPWSTR first MirVer value
+ * lParam - LPWSTR second MirVer value
+ * return pointer to char string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
+ */
+#define MS_FP_SAMECLIENTSW "Fingerprint/SameClientsW"
+
+/*
+ * Service GetClientIcon MS_FP_GETCLIENTICON
+ * wParam - char * MirVer value to get client for.
+ * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+ * the returned in this case handler is static valid only till next service call.
+ */
+#define MS_FP_GETCLIENTICON "Fingerprint/GetClientIcon"
+
+/*
+ * Service GetClientIconW MS_FP_GETCLIENTICONW
+ * wParam - LPWSTR MirVer value to get client for.
+ * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+ * the returned in this case handler is static valid only till next service call.
+ */
+#define MS_FP_GETCLIENTICONW "Fingerprint/GetClientIconW"
+
+#if defined( _UNICODE )
+ #define MS_FP_SAMECLIENTST MS_FP_SAMECLIENTSW
+ #define MS_FP_GETCLIENTICONT MS_FP_GETCLIENTICONW
+#else
+ #define MS_FP_SAMECLIENTST MS_FP_SAMECLIENTS
+ #define MS_FP_GETCLIENTICONT MS_FP_GETCLIENTICON
+#endif
diff --git a/plugins/ExternalAPI/m_flags.h b/plugins/ExternalAPI/m_flags.h new file mode 100644 index 0000000000..aafa2fb251 --- /dev/null +++ b/plugins/ExternalAPI/m_flags.h @@ -0,0 +1,102 @@ +/*
+Miranda IM Country Flags Plugin
+Copyright (C) 2006-2007 H. Herkenrath
+
+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 (Flags-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_FLAGS_H__
+#define M_FLAGS_H__
+
+#if defined (_MSC_VER) && (_MSC_VER >= 1020)
+ #pragma once
+#endif
+
+/*
+ Country Flags Plugin v0.1.0.3
+*/
+
+/* interface id */
+#if !defined(MIID_FLAGS)
+ #define MIID_FLAGS {0x88a3b66e,0xc438,0x4381,{0xbc,0x17,0x71,0xd9,0x9d,0x22,0x5f,0x9c}}
+#endif
+
+/* Load a country flag icon from the skin library. v0.1.0.0+
+The retrieved icon should be released using MS_SKIN2_RELEASEICON after use.
+The country numbers can be retrieved using MS_UTILS_GETCOUNTRYLIST.
+Another way to get the country numbers are the CTRY_* constants in winnls.h of WinAPI.
+To retrieve the country number from a locale, call GetLocaleInfo().
+with LOCALE_ICOUNTRY.
+ wParam=countryNumber
+ lParam=(BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
+Returns a icon handle (HICON) on success, NULL on error.
+*/
+#define MS_FLAGS_LOADFLAGICON "Flags/LoadFlagIcon"
+
+#if !defined(FLAGS_NOHELPERFUNCTIONS)
+__inline static HICON LoadFlagIcon(int countryNumber) {
+ if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,0);
+}
+__inline static HANDLE LoadFlagIconHandle(int countryNumber) {
+ if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,1);
+}
+#endif
+
+#define CTRY_UNSPECIFIED 0
+#define CTRY_OTHER 9999
+#define CTRY_UNKNOWN 0xFFFF
+
+/* Create a merged country flag icon. v0.1.0.0+
+The retrieved icon should be released using DestroyIcon() after use.
+ wParam=countryNumberUpper
+ lParam=countryNumberLower
+Returns a icon handle (HICON) on success, NULL on error.
+*/
+#define MS_FLAGS_CREATEMERGEDFLAGICON "Flags/CreateMergedFlagIcon"
+
+/* Get a corresponding country given an (external) IP address. v0.1.0.0+
+The retrieved number can be converted to a normal country name
+using MS_UTILS_GETCOUNTRYBYNUMBER.
+ wParam=dwExternalIP (same format as used in Netlib)
+ lParam=0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+*/
+#define MS_FLAGS_IPTOCOUNTRY "Flags/IpToCountry"
+
+/* Detect the origin country of a contact. v0.1.0.0+
+This uses the contacts's IP first, and falls back on using
+CNF_COUNTRY and CNF_COCOUNTRY of contact details.
+To get the contact's IP it relies on the db setting
+"RealIP" in the proto module.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+*/
+#define MS_FLAGS_DETECTCONTACTORIGINCOUNTRY "Flags/DetectContactOriginCountry"
+#define MS_FLAGS_GETCONTACTORIGINCOUNTRY "Flags/GetContactOriginCountry" //for beta version 0.1.1.0
+
+#if !defined(FLAGS_NOSETTINGS) && defined(EXTRA_ICON_ADV2)
+#define SETTING_SHOWSTATUSICONFLAG_DEFAULT 1
+#define SETTING_SHOWEXTRAIMGFLAG_DEFAULT 1
+#define SETTING_EXTRAIMGFLAGCOLUMN_DEFAULT EXTRA_ICON_ADV2
+#define SETTING_USEUNKNOWNFLAG_DEFAULT 1
+#define SETTING_USEIPTOCOUNTRY_DEFAULT 1
+#endif
+
+#endif // M_FLAGS_H
diff --git a/plugins/ExternalAPI/m_flags.inc b/plugins/ExternalAPI/m_flags.inc new file mode 100644 index 0000000000..f3dc0e8367 --- /dev/null +++ b/plugins/ExternalAPI/m_flags.inc @@ -0,0 +1,74 @@ +{
+Miranda IM Country Flags Plugin
+Copyright (C) 2006-2007 H. Herkenrath
+
+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 (Flags-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$ifndef M_FLAGS_H}
+{$define M_FLAGS_H}
+
+const
+
+{
+ Country Flags Plugin v0.1.0.3
+}
+
+{ interface id }
+MIID_FLAGS: TGUID = '{88A3B66E-C438-4381-BC17-71D99D225F9C}';
+
+{ Load a country flag icon from the skin library. v0.1.0.0+
+The retrieved icon should be released using MS_SKIN2_RELEASEICON after use.
+The country numbers can be retrieved using MS_UTILS_GETCOUNTRYLIST.
+Another way to get the country numbers are the CTRY_* constants in winnls.h of WinAPI.
+To retrieve the country number from a locale, call GetLocaleInfo().
+with LOCALE_ICOUNTRY.
+ wParam : countryNumber
+ lParam : (BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
+Returns a icon handle (HICON) on success, NULL on error.
+}
+MS_FLAGS_LOADCOUNTRYFLAGICON = 'Flags/LoadCountryFlagIcon';
+
+{ Create a merged country flag icon. v0.1.0.0+
+The retrieved icon should be released using DestroyIcon() after use.
+ wParam : countryNumberUpper
+ lParam : countryNumberLower
+Returns a icon handle (HICON) on success, NULL on error.
+}
+MS_FLAGS_CREATEMERGEDFLAGICON = 'Flags/CreateMergedFlagIcon';
+
+{ Get a corresponding country given an (external) IP address. v0.1.0.0+
+The retrieved number can be converted to a normal country name
+using MS_UTILS_GETCOUNTRYBYNUMBER.
+ wParam : dwExternalIP (same format as used Netlib)
+ lParam : 0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+}
+MS_FLAGS_IPTOCOUNTRY = 'Flags/IpToCountry';
+
+{ Detect the origin country of a contact. v0.1.0.0+
+This uses the contacts's IP first, and falls back on using
+CNF_COUNTRY and CNF_COCOUNTRY of contact details.
+To get the contact's IP it relies on the db setting
+"RealIP" in the proto module.
+ wParam : (WPARAM)(HANDLE)hContact
+ lParam : 0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+}
+MS_FLAGS_DETECTCONTACTORIGINCOUNTRY = 'Flags/DetectContactOriginCountry';
+
+{$endif} // M_FLAGS_H
diff --git a/plugins/ExternalAPI/m_flash.h b/plugins/ExternalAPI/m_flash.h new file mode 100644 index 0000000000..97348dee61 --- /dev/null +++ b/plugins/ExternalAPI/m_flash.h @@ -0,0 +1,89 @@ +/*
+Miranda FlashAvatars Plugin
+Plugin support header file
+Copyright (C) 2006 Big Muscle
+
+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.
+*/
+
+// Service functions
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+ */
+#define MS_FAVATAR_DESTROY "FlashAvatar/Destroy"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+ */
+#define MS_FAVATAR_MAKE "FlashAvatar/Make"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM LPRECT
+ */
+#define MS_FAVATAR_RESIZE "FlashAvatar/Resize"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM LPRECT
+ */
+#define MS_FAVATAR_SETPOS "FlashAvatar/SetPos"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+ */
+#define MS_FAVATAR_GETINFO "FlashAvatar/GetInfo"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM BSTR
+ */
+#define MS_FAVATAR_SETEMOFACE "FlashAvatar/SetEmoFace"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM COLORREF
+ */
+#define MS_FAVATAR_SETBKCOLOR "FlashAvatar/SetBkColor"
+
+// Avatar emotion faces
+#define AV_SMILE "smile"
+#define AV_SAD "sad"
+#define AV_LAUGH "laugh"
+#define AV_MAD "mad"
+#define AV_CRY "cry"
+#define AV_OFFLINE "offline"
+#define AV_BUSY "busy"
+#define AV_LOVE "love"
+#define AV_NORMAL "stam"
+
+// Avatar default size
+#define FAVATAR_WIDTH 52
+#define FAVATAR_HEIGHT 64
+
+// FLASHAVATAR structure
+typedef struct {
+ HANDLE hContact; // contact who flash avatar belongs to
+ HWND hWindow; // handle of flash avatar object
+ HWND hParentWindow; // handle of flash avatar's parent object
+ char* cUrl; // url of .swf file
+ int id; // unique number of plugin which wants to use avatar service
+ char* cProto; // contact's protocol
+ char reserved[16];
+} FLASHAVATAR;
diff --git a/plugins/ExternalAPI/m_folders.h b/plugins/ExternalAPI/m_folders.h new file mode 100644 index 0000000000..02d4d3564e --- /dev/null +++ b/plugins/ExternalAPI/m_folders.h @@ -0,0 +1,292 @@ +/*
+Custom profile folders plugin for Miranda IM
+
+Copyright © 2005 Cristian Libotean
+
+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_CUSTOM_FOLDERS_H
+#define M_CUSTOM_FOLDERS_H
+
+#define FOLDERS_API 501 //dunno why it's here but it is :)
+
+#define PROFILE_PATH "%profile_path%"
+#define CURRENT_PROFILE "%current_profile%"
+#define MIRANDA_PATH "%miranda_path%"
+#define PLUGINS_PATH "%miranda_path%" "\\plugins"
+#define MIRANDA_USERDATA "%miranda_userdata%"
+
+#define PROFILE_PATHW L"%profile_path%"
+#define CURRENT_PROFILEW L"%current_profile%"
+#define MIRANDA_PATHW L"%miranda_path%"
+#define MIRANDA_USERDATAW L"%miranda_userdata%"
+
+#ifdef _UNICODE
+ #define PROFILE_PATHT PROFILE_PATHW
+ #define CURRENT_PROFILET CURRENT_PROFILEW
+ #define MIRANDA_PATHT MIRANDA_PATHW
+ #define MIRANDA_USERDATAT MIRANDA_USERDATAW
+#else
+ #define PROFILE_PATHT PROFILE_PATH
+ #define CURRENT_PROFILET CURRENT_PROFILE
+ #define MIRANDA_PATHT MIRANDA_PATH
+ #define MIRANDA_USERDATAT MIRANDA_USERDATA
+#endif
+
+#define FOLDER_AVATARS PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\avatars")
+#define FOLDER_VCARDS PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\vcards")
+#define FOLDER_LOGS PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\logs")
+#define FOLDER_RECEIVED_FILES PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\received files")
+#define FOLDER_DOCS MIRANDA_PATHT _T("\\") _T("docs")
+#define FOLDER_CONFIG PLUGINS_PATHT _T("\\") _T("config")
+#define FOLDER_SCRIPTS MIRANDA_PATHT _T("\\") _T("scripts")
+#define FOLDER_UPDATES MIRANDA_PATHT _T("\\") _T("updates")
+
+#define FOLDER_CUSTOMIZE MIRANDA_PATHT _T("\\") _T("customize")
+#define FOLDER_CUSTOMIZE_SOUNDS FOLDER_CUSTOMIZE _T("\\sounds")
+#define FOLDER_CUSTOMIZE_ICONS FOLDER_CUSTOMIZE _T("\\icons")
+#define FOLDER_CUSTOMIZE_SMILEYS FOLDER_CUSTOMIZE _T("\\smileys")
+#define FOLDER_CUSTOMIZE_SKINS FOLDER_CUSTOMIZE _T("\\skins")
+#define FOLDER_CUSTOMIZE_THEMES FOLDER_CUSTOMIZE _T("\\themes")
+
+#define TO_WIDE(x) L ## x
+
+#define FOLDERS_NAME_MAX_SIZE 64 //maximum name and section size
+
+#define FF_UNICODE 0x00000001
+
+#if defined (UNICODE)
+ #define FF_TCHAR FF_UNICODE
+#else
+ #define FF_TCHAR 0
+#endif
+
+typedef struct{
+ int cbSize; //size of struct
+ char szSection[FOLDERS_NAME_MAX_SIZE]; //section name, if it doesn't exist it will be created otherwise it will just add this entry to it
+ char szName[FOLDERS_NAME_MAX_SIZE]; //entry name - will be shown in options
+ union{
+ const char *szFormat; //default string format. Fallback string in case there's no entry in the database for this folder. This should be the initial value for the path, users will be able to change it later.
+ const wchar_t *szFormatW; //String is dup()'d so you can free it later. If you set the unicode string don't forget to set the flag accordingly.
+ const TCHAR *szFormatT;
+ };
+ DWORD flags; //FF_* flags
+} FOLDERSDATA;
+
+/*Folders/Register/Path service
+ wParam - not used, must be 0
+ lParam - (LPARAM) (const FOLDERDATA *) - Data structure filled with
+ the necessary information.
+ Returns a handle to the registered path or 0 on error.
+ You need to use this to call the other services.
+*/
+#define MS_FOLDERS_REGISTER_PATH "Folders/Register/Path"
+
+/*Folders/Get/PathSize service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (int *) - pointer to the variable that receives the size of the path
+ string (not including the null character). Depending on the flags set when creating the path
+ it will either call strlen() or wcslen() to get the length of the string.
+ Returns the size of the buffer.
+*/
+#define MS_FOLDERS_GET_SIZE "Folders/Get/PathSize"
+
+typedef struct{
+ int cbSize;
+ int nMaxPathSize; //maximum size of buffer. This represents the number of characters that can be copied to it (so for unicode strings you don't send the number of bytes but the length of the string).
+ union{
+ char *szPath; //pointer to the buffer that receives the path without the last "\\"
+ wchar_t *szPathW; //unicode version of the buffer.
+ TCHAR *szPathT;
+ };
+} FOLDERSGETDATA;
+
+/*Folders/Get/Path service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (FOLDERSGETDATA *) pointer to a FOLDERSGETDATA that has all the relevant fields filled.
+ Should return 0 on success, or nonzero otherwise.
+*/
+#define MS_FOLDERS_GET_PATH "Folders/Get/Path"
+
+typedef struct{
+ int cbSize;
+ union{
+ char **szPath; //address of a string variable (char *) or (wchar_t*) where the path should be stored (the last \ won't be copied).
+ wchar_t **szPathW; //unicode version of string.
+ TCHAR **szPathT;
+ };
+} FOLDERSGETALLOCDATA;
+
+/*Folders/GetRelativePath/Alloc service
+ wParam - (WPARAM) (int) - Handle to registered path
+ lParam - (LPARAM) (FOLDERSALLOCDATA *) data
+ This service is the same as MS_FOLDERS_GET_PATH with the difference that this service
+ allocates the needed space for the buffer. It uses miranda's memory functions for that and you need
+ to use those to free the resulting buffer.
+ Should return 0 on success, or nonzero otherwise. Currently it only returns 0.
+*/
+#define MS_FOLDERS_GET_PATH_ALLOC "Folders/Get/Path/Alloc"
+
+
+/*Folders/On/Path/Changed
+ wParam - (WPARAM) 0
+ lParam - (LPARAM) 0
+ Triggered when the folders change, you should reget the paths you registered.
+*/
+#define ME_FOLDERS_PATH_CHANGED "Folders/On/Path/Changed"
+
+#ifndef FOLDERS_NO_HELPER_FUNCTIONS
+
+#ifndef M_UTILS_H__
+#error The helper functions require that m_utils.h be included in the project. Please include that file if you want to use the helper functions. If you don''t want to use the functions just define FOLDERS_NO_HELPER_FUNCTIONS.
+#endif
+//#include "../../../include/newpluginapi.h"
+
+__inline static HANDLE FoldersRegisterCustomPath(const char *section, const char *name, const char *defaultPath)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ fd.szFormat = defaultPath;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static HANDLE FoldersRegisterCustomPathW(const char *section, const char *name, const wchar_t *defaultPathW)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ fd.szFormatW = defaultPathW;
+ fd.flags = FF_UNICODE;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static INT_PTR FoldersGetCustomPath(HANDLE hFolderEntry, char *path, const int size, const char *notFound)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ char buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+
+ return res;
+}
+
+__inline static INT_PTR FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *pathW, const int count, const wchar_t *notFoundW)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ return res;
+}
+
+__inline static INT_PTR FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, const int size, char *notFound, char *fileName)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ char buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+ if (strlen(path) > 0)
+ {
+ strcat(path, "\\");
+ }
+ else{
+ path[0] = '\0';
+ }
+
+ if (fileName)
+ {
+ strcat(path, fileName);
+ }
+
+ return res;
+}
+
+__inline static INT_PTR FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW, wchar_t *fileNameW)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ if (wcslen(pathW) > 0)
+ {
+ wcscat(pathW, L"\\");
+ }
+ else{
+ pathW[0] = L'\0';
+ }
+
+ if (fileNameW)
+ {
+ wcscat(pathW, fileNameW);
+ }
+
+ return res;
+}
+
+# ifdef _UNICODE
+# define FoldersGetCustomPathT FoldersGetCustomPathW
+# define FoldersGetCustomPathExT FoldersGetCustomPathExW
+# define FoldersRegisterCustomPathT FoldersRegisterCustomPathW
+#else
+# define FoldersGetCustomPathT FoldersGetCustomPath
+# define FoldersGetCustomPathExT FoldersGetCustomPath
+# define FoldersRegisterCustomPathT FoldersRegisterCustomPath
+#endif
+
+#endif
+
+#endif //M_CUSTOM_FOLDERS_H
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_fortunemsg.h b/plugins/ExternalAPI/m_fortunemsg.h new file mode 100644 index 0000000000..bf13dc422c --- /dev/null +++ b/plugins/ExternalAPI/m_fortunemsg.h @@ -0,0 +1,71 @@ +/*
+
+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 _FORTUNEMSG_
+#define _FORTUNEMSG_
+
+#define MIN_FORTUNEMSG 10
+#define MAX_FORTUNEMSG 1024
+#define FORTUNE_BUFSIZE (MAX_FORTUNEMSG + 1)
+
+//returns the fortune message (from a random file)
+//wParam=0
+//lParam=(char *)buffer or 0
+//returns (char *)status msg (buffer if specified), or 0 on failure
+//If lParam != 0 then the fortune msg is to be stored there, make sure
+//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then
+//the plugin will allocate the memory, but don't forget to free it (the
+//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!)
+#define MS_FORTUNEMSG_GETMESSAGE "FortuneMsg/GetMessage"
+
+//returns the fortune message for a protocol
+//wParam=(char*)szProtoName
+//lParam=(char *)buffer or 0
+//returns (char *)status msg (buffer if specified), or 0 on failure
+//If lParam != 0 then the fortune msg is to be stored there, make sure
+//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then
+//the plugin will allocate the memory, but don't forget to free it (the
+//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!)
+#define MS_FORTUNEMSG_GETPROTOMSG "FortuneMsg/GetProtoMessage"
+
+//returns the fortune status message for a status
+//wParam=(int)status
+//lParam=(char *)buffer or 0
+//returns (char *)status msg (buffer if specified), or 0 on failure
+//If lParam != 0 then the fortune msg is to be stored there, make sure
+//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then
+//the plugin will allocate the memory, but don't forget to free it (the
+//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!)
+#define MS_FORTUNEMSG_GETSTATUSMSG "FortuneMsg/GetStatusMessage"
+
+//frees the memory allocated by one of the other three services
+//wParam=0
+//lParam=(void *)pointer to the memory to be freed
+//(the returned value from one of the other three services if called with lParam=0)
+//return value: 0 on success, -1 on failure (argument was NULL)
+#define MS_FORTUNEMSG_FREEMEMORY "FortuneMsg/FreeMemory"
+
+
+//this service was created for being used by Variables plugin
+//wParam=0
+//lParam=(ARGUMENTSINFO *) see m_variables.h for description of the structure
+//returns (char *)status msg, or 0 on failure
+#define MS_FORTUNEMSG_FROMVARIABLES "FortuneMsg/FromVariables"
+
+
+#endif
diff --git a/plugins/ExternalAPI/m_gender.h b/plugins/ExternalAPI/m_gender.h new file mode 100644 index 0000000000..988242565f --- /dev/null +++ b/plugins/ExternalAPI/m_gender.h @@ -0,0 +1,30 @@ +/*
+ Show Contact Gender plugin for Miranda-IM (www.miranda-im.org)
+ (c) 2006-2007 by Thief
+
+ 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
+
+ File name : $URL: http://svn.miranda.im/mainrepo/gender/trunk/m_gender.h $
+ Revision : $Rev: 957 $
+ Last change on : $Date: 2007-10-19 13:46:08 +0300 (Пт, 19 окт 2007) $
+ Last change by : $Author: Thief $
+
+*/
+
+// Returns gender icon for specific contact
+// wParam = hContact
+// lParam = 0
+// return = HICON
+#define MS_GENDER_GETICON "Gender/GenderGetIcon"
diff --git a/plugins/ExternalAPI/m_help.h b/plugins/ExternalAPI/m_help.h new file mode 100644 index 0000000000..04425a5e8d --- /dev/null +++ b/plugins/ExternalAPI/m_help.h @@ -0,0 +1,93 @@ +/*
+
+Miranda IM Help Plugin
+Copyright (C) 2002 Richard Hughes, 2005-2007 H. Herkenrath
+
+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 (Help-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_HELP_H__
+#define M_HELP_H__
+
+#if defined (_MSC_VER) && (_MSC_VER >= 1020)
+ #pragma once
+#endif
+
+/*
+ Help Plugin 0.2.1.2
+ All services in here except MS_HELP_SHOWLANGDIALOG should be thread-safe,
+ you can call them from any thread
+*/
+
+/* interface id */
+#if !defined(MIID_HELP)
+ #define MIID_HELP {0x302660c5,0x1bf6,0x4054,{0xa7,0x9f,0x77,0xb1,0x96,0x5d,0x6f,0x48}}
+#endif
+
+/* Enable/disable the help context menu for a specific control. v0.2.0.0+
+Note: You normally do not need to call this, read below.
+You can can use this to deactivate the appearance of the help context menu
+being shown when the user right clicks on an control.
+You can use this service to disable the context menu.
+
+You do *not* need to use this service when you would like to show
+a context menu by yourself, just handle WM_CONTEXTMENU correctly instead.
+You need to return TRUE in your DlgProc or 0 in your WndProc, indicating 'message handled'.
+
+The context menu is disabled by default on the following controls (looks silly on multi-component controls):
+ListView, TreeView, Statusbar, Toolbar, CLC
+AutoTips are disabled by default for controls stating DLGC_WANTALLKEYS or DLGC_HASSETSEL at
+WM_GETDLGCODE (autotips are annoying on edits).
+ wParam=(WPARAM)(HWND)hwndCtl
+ lParam=(LPARAM)flags (see below)
+Returns 0 on success or nonzero on failure
+*/
+#define MS_HELP_SETCONTEXTSTATE "Help/SetContextState"
+#define HCSF_CONTEXTMENU 0x01 // show help context menu for this control
+#define HCSF_AUTOTIP 0x02 // show automatic help tip on hover for this control
+ // only works for non-editable
+#if !defined(HELP_NOHELPERFUNCTIONS)
+__inline static int Help_SetContextState(HWND hwndCtl,DWORD flags) {
+ if(!ServiceExists(MS_HELP_SETCONTEXTSTATE)) return -1;
+ return CallService(MS_HELP_SETCONTEXTSTATE,(WPARAM)hwndCtl,flags);
+}
+#endif
+
+/* Show a help tooltip for a specific control or dialog. v0.2.0.0+
+You can call this if you would like to show help at a specific time.
+ wParam=(WPARAM)(HWND)hwndCtl
+ lParam=0 (unused)
+Returns 0 on success or nonzero on failure.
+The service fails when the help tooltip cannot be instantiated.
+*/
+#define MS_HELP_SHOWHELP "Help/ShowHelp"
+
+/* Show the download language dialog. v0.2.1.0+
+ wParam=lParam=0
+The dialog can't have a parent due to it's asynchronous nature.
+If the language window is already opened it will be
+brought to front instead (returns success).
+Returns 0 on success, nonzero otherwise.
+*/
+#define MS_HELP_SHOWLANGDIALOG "Help/ShowLangDialog"
+
+
+#ifndef HELP_NOSETTINGS
+#define SETTING_AUTOTIPSENABLED_DEFAULT 0
+#define SETTING_AUTOTIPDELAY_DEFAULT 4000
+#define SETTING_ENABLEHELPUPDATES_DEFAULT 1
+#endif
+
+#endif // M_HELP_H__
diff --git a/plugins/ExternalAPI/m_historyevents.h b/plugins/ExternalAPI/m_historyevents.h new file mode 100644 index 0000000000..aa44637861 --- /dev/null +++ b/plugins/ExternalAPI/m_historyevents.h @@ -0,0 +1,453 @@ +/*
+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_HISTORYEVENTS_H__
+# define __M_HISTORYEVENTS_H__
+
+
+#define MIID_HISTORYEVENTS { 0xc8be8543, 0x6618, 0x4030, { 0x85, 0xcf, 0x90, 0x82, 0xc7, 0xde, 0x7f, 0xf7 } }
+
+
+#define HISTORYEVENTS_FORMAT_CHAR 1
+#define HISTORYEVENTS_FORMAT_WCHAR 2
+#define HISTORYEVENTS_FORMAT_RICH_TEXT 4
+#define HISTORYEVENTS_FORMAT_HTML 8
+
+#define HISTORYEVENTS_FLAG_DEFAULT (1 << 0) // Is a miranda core event type
+#define HISTORYEVENTS_FLAG_SHOW_IM_SRMM (1 << 1) // If this event has to be shown in srmm dialog
+#define HISTORYEVENTS_FLAG_USE_SENT_FLAG (1 << 2) // Means that it can be a sent or received and uses DBEF_SENT to mark that
+#define HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE (1 << 3) // Means that who is drawing this should draw the contact name before the text
+#define HISTORYEVENTS_FLAG_ONLY_LOG_IF_SRMM_OPEN (1 << 4) // If this event will be logged only if the message window is open
+#define HISTORYEVENTS_FLAG_FLASH_MSG_WINDOW (1 << 5) // If this event will trigger the openning/flashing of the message window
+#define HISTORYEVENTS_REGISTERED_IN_ICOLIB (9 << 16) // If the icon is a name already registered in icolib
+#define HISTORYEVENTS_FLAG_KEEP_ONE_YEAR (1 << 8) // By default store in db for 1 year
+#define HISTORYEVENTS_FLAG_KEEP_SIX_MONTHS (2 << 8) // By default store in db for 6 months
+#define HISTORYEVENTS_FLAG_KEEP_ONE_MONTH (3 << 8) // By default store in db for 1 month
+#define HISTORYEVENTS_FLAG_KEEP_ONE_WEEK (4 << 8) // By default store in db for 1 week
+#define HISTORYEVENTS_FLAG_KEEP_ONE_DAY (5 << 8) // By default store in db for 1 day
+#define HISTORYEVENTS_FLAG_KEEP_FOR_SRMM (6 << 8) // By default store in db only enought for message log
+#define HISTORYEVENTS_FLAG_KEEP_MAX_TEN (7 << 8) // By default store in db max 10 entries
+#define HISTORYEVENTS_FLAG_KEEP_MAX_HUNDRED (8 << 8) // By default store in db for 100 entries
+#define HISTORYEVENTS_FLAG_KEEP_DONT (9 << 8) // By default don't store in db (aka ignore it)
+
+
+// This function must be implemented by subscribers. It must return a pointer or NULL
+// to say it can't handle the text
+typedef void * (*fGetHistoryEventText)(HANDLE hContact, HANDLE hDbEvent, DBEVENTINFO *dbe, int format);
+
+typedef struct {
+ int cbSize;
+ char *module;
+ char *name; // Internal event name
+ char *description; // Will be translated. When retrieving it is already translated
+ WORD eventType; // The event type it can handle
+ union {
+ HICON defaultIcon;
+ char * defaultIconName; // if HISTORYEVENTS_REGISTERED_IN_ICOLIB is set. Always use this one when retrieving
+ };
+ int supports; // What kind of return is supported - or of HISTORYEVENTS_FORMAT_*
+ int flags; // or of HISTORYEVENTS_FLAG_*
+ fGetHistoryEventText pfGetHistoryEventText; // NULL to use default get text (similar to message, without extra format)
+
+ // Aditional data if wants to use add to history services
+ char **templates; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription"
+ int numTemplates;
+
+} HISTORY_EVENT_HANDLER;
+
+
+/*
+Get the number of registered events
+
+wParam: ignored
+lParam: ignored
+Return: The number of events registered with the plugin
+*/
+#define MS_HISTORYEVENTS_GET_COUNT "HistoryEvents/GetCount"
+
+
+/*
+Get an event by number or by type.
+To retrieve by number, pass -1 as type. To retrieve by type, pass -1 as number.
+
+wParam: (int) event number
+lParam: (int) event type
+Return: (const HISTORY_EVENT_HANDLER *) if the event exists, NULL otherwise. Don't change the
+ returned strunc: it is a pointer to the internall struct.
+*/
+#define MS_HISTORYEVENTS_GET_EVENT "HistoryEvents/GetEvent"
+
+
+/*
+Register a plugin that can handle an event type. This must be called during the call to the
+Load function of the plugin. In ModulesLoaded callback all plugins have to be already registered,
+so srmm and history modules can query then.
+
+wParam: HISTORY_EVENT_HANDLER *
+lParam: ignored
+Return: 0 for success
+*/
+#define MS_HISTORYEVENTS_REGISTER "HistoryEvents/Register"
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hDbEvent;
+ DBEVENTINFO *dbe; // Optional
+ int format; // one of HISTORYEVENTS_FORMAT_*
+
+} HISTORY_EVENT_PARAM;
+
+/*
+Check if an event can be handled by any subscribers
+
+wParam: WORD - event type
+lParam: ignored
+Return: BOOL
+*/
+#define MS_HISTORYEVENTS_CAN_HANDLE "HistoryEvents/CanHandle"
+
+/*
+Get the icon for a history event type
+
+wParam: WORD - event type
+lParam: BOOL - TRUE to copy the icon (should be released with DestroyObject),
+ FALSE to use icolib one (should be released with MS_HISTORYEVENTS_RELEASE_ICON)
+Return: HICON
+*/
+#define MS_HISTORYEVENTS_GET_ICON "HistoryEvents/GetIcon"
+
+/*
+Get the flags for a history event type
+
+wParam: WORD - event type
+lParam: ignored
+Return: int - or of HISTORYEVENTS_FLAG_* or -1 if error
+*/
+#define MS_HISTORYEVENTS_GET_FLAGS "HistoryEvents/GetFlags"
+
+/*
+Release the icon for a history event type. This is really just a forward to icolib
+
+wParam: HICON
+lParam: ignored
+*/
+#define MS_HISTORYEVENTS_RELEASE_ICON "Skin2/Icons/ReleaseIcon"
+
+/*
+Get the text for a history event type
+
+wParam: HISTORY_EVENT_PARAM *
+lParam: ignored
+Return: char * or wchar * depending on sent flags. Free with mir_free or MS_HISTORYEVENTS_RELEASE_TEXT
+*/
+#define MS_HISTORYEVENTS_GET_TEXT "HistoryEvents/GetText"
+
+/*
+Release the text for a history event type. Internally is just a call to mir_free
+
+wParam: char * or wchar *
+lParam: ignored
+*/
+#define MS_HISTORYEVENTS_RELEASE_TEXT "HistoryEvents/ReleaseText"
+
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact;
+ WORD eventType;
+ int templateNum;
+ TCHAR **variables;
+ int numVariables;
+ PBYTE additionalData;
+ int additionalDataSize;
+ int flags; // Flags for the event type
+ DWORD timestamp; // 0 for now
+ BOOL addToMetaToo;
+} HISTORY_EVENT_ADD;
+
+/*
+Add an registered event to the history. This is a helper service
+
+wParam: HISTORY_EVENT_ADD
+lParam: ignored
+Return: HANDLE to the db event
+*/
+#define MS_HISTORYEVENTS_ADD_TO_HISTORY "HistoryEvents/AddToHistory"
+
+/*
+Check if a template is enabled
+
+wParam: event type
+lParam: template num
+Return: TRUE or FALSE
+*/
+#define MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE "HistoryEvents/IsEnabledTemplate"
+
+
+
+// Helper functions //////////////////////////////////////////////////////////////////////////////
+
+
+
+
+static int HistoryEvents_Register(char *module, char *name, char *description, int eventType, HICON defaultIcon,
+ int supports, int flags, fGetHistoryEventText pfGetHistoryEventText)
+{
+ HISTORY_EVENT_HANDLER heh = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_REGISTER))
+ return 1;
+
+ heh.cbSize = sizeof(heh);
+ heh.module = module;
+ heh.name = name;
+ heh.description = description;
+ heh.eventType = eventType;
+ heh.defaultIcon = defaultIcon;
+ heh.supports = supports;
+ heh.flags = flags;
+ heh.pfGetHistoryEventText = pfGetHistoryEventText;
+ return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0);
+}
+
+static int HistoryEvents_RegisterWithTemplates(char *module, char *name, char *description, int eventType, HICON defaultIcon,
+ int supports, int flags, fGetHistoryEventText pfGetHistoryEventText,
+ char **templates, int numTemplates)
+{
+ HISTORY_EVENT_HANDLER heh = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_REGISTER))
+ return 1;
+
+ heh.cbSize = sizeof(heh);
+ heh.module = module;
+ heh.name = name;
+ heh.description = description;
+ heh.eventType = eventType;
+ heh.defaultIcon = defaultIcon;
+ heh.supports = supports;
+ heh.flags = flags;
+ heh.pfGetHistoryEventText = pfGetHistoryEventText;
+ heh.templates = templates;
+ heh.numTemplates = numTemplates;
+ return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0);
+}
+
+static int HistoryEvents_RegisterMessageStyle(char *module, char *name, char *description, int eventType, HICON defaultIcon,
+ int flags, char **templates, int numTemplates)
+{
+ HISTORY_EVENT_HANDLER heh = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_REGISTER))
+ return 1;
+
+ heh.cbSize = sizeof(heh);
+ heh.module = module;
+ heh.name = name;
+ heh.description = description;
+ heh.eventType = eventType;
+ heh.defaultIcon = defaultIcon;
+ heh.flags = flags;
+ heh.templates = templates;
+ heh.numTemplates = numTemplates;
+ return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0);
+}
+
+static BOOL HistoryEvents_CanHandle(WORD eventType)
+{
+ if (!ServiceExists(MS_HISTORYEVENTS_CAN_HANDLE))
+ return FALSE;
+
+ return (BOOL) CallService(MS_HISTORYEVENTS_CAN_HANDLE, (WPARAM) eventType, 0);
+}
+
+static HICON HistoryEvents_GetIcon(WORD eventType)
+{
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_ICON))
+ return NULL;
+
+ return (HICON) CallService(MS_HISTORYEVENTS_GET_ICON, (WPARAM) eventType, 0);
+}
+
+static int HistoryEvents_GetFlags(WORD eventType)
+{
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_FLAGS))
+ return -1;
+
+ return (int) CallService(MS_HISTORYEVENTS_GET_FLAGS, (WPARAM) eventType, 0);
+}
+
+static void HistoryEvents_ReleaseIcon(HICON icon)
+{
+ CallService(MS_HISTORYEVENTS_RELEASE_ICON, (WPARAM) icon, 0);
+}
+
+static char * HistoryEvents_GetTextA(HANDLE hDbEvent, DBEVENTINFO *dbe)
+{
+ HISTORY_EVENT_PARAM hep = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT))
+ return NULL;
+
+ hep.cbSize = sizeof(hep);
+ hep.hDbEvent = hDbEvent;
+ hep.dbe = dbe;
+ hep.format = HISTORYEVENTS_FORMAT_CHAR;
+ return (char *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0);
+}
+
+static wchar_t * HistoryEvents_GetTextW(HANDLE hDbEvent, DBEVENTINFO *dbe)
+{
+ HISTORY_EVENT_PARAM hep = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT))
+ return NULL;
+
+ hep.cbSize = sizeof(hep);
+ hep.hDbEvent = hDbEvent;
+ hep.dbe = dbe;
+ hep.format = HISTORYEVENTS_FORMAT_WCHAR;
+ return (wchar_t *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0);
+}
+
+static char * HistoryEvents_GetRichText(HANDLE hDbEvent, DBEVENTINFO *dbe)
+{
+ HISTORY_EVENT_PARAM hep = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT))
+ return NULL;
+
+ hep.cbSize = sizeof(hep);
+ hep.hDbEvent = hDbEvent;
+ hep.dbe = dbe;
+ hep.format = HISTORYEVENTS_FORMAT_RICH_TEXT;
+ return (char *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0);
+}
+
+#define HistoryEvents_ReleaseText mir_free
+//static void HistoryEvents_ReleaseText(void *str)
+//{
+// if (!ServiceExists(MS_HISTORYEVENTS_RELEASE_TEXT))
+// return;
+//
+// CallService(MS_HISTORYEVENTS_RELEASE_TEXT, (WPARAM) str, 0);
+//}
+
+
+#ifdef __cplusplus
+static HANDLE HistoryEvents_AddToHistoryEx(HANDLE hContact, WORD eventType, int templateNum,
+ TCHAR **variables, int numVariables,
+ PBYTE additionalData, int additionalDataSize,
+ int flags = 0, DWORD timestamp = 0, BOOL addToMetaToo = FALSE)
+#else
+static HANDLE HistoryEvents_AddToHistoryEx(HANDLE hContact, WORD eventType, int templateNum,
+ TCHAR **variables, int numVariables,
+ PBYTE additionalData, int additionalDataSize,
+ int flags, DWORD timestamp, BOOL addToMetaToo)
+#endif
+{
+ HISTORY_EVENT_ADD hea = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY))
+ return NULL;
+
+ hea.cbSize = sizeof(hea);
+ hea.hContact = hContact;
+ hea.eventType = eventType;
+ hea.templateNum = templateNum;
+ hea.numVariables = numVariables;
+ hea.variables = variables;
+ hea.additionalData = additionalData;
+ hea.additionalDataSize = additionalDataSize;
+ hea.flags = flags;
+ hea.timestamp = timestamp;
+ hea.addToMetaToo = addToMetaToo;
+
+ return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0);
+}
+
+#ifdef __cplusplus
+static HANDLE HistoryEvents_AddToHistoryVars(HANDLE hContact, WORD eventType, int templateNum,
+ TCHAR **variables, int numVariables,
+ int flags = 0, DWORD timestamp = 0, BOOL addToMetaToo = FALSE)
+#else
+static HANDLE HistoryEvents_AddToHistoryVars(HANDLE hContact, WORD eventType, int templateNum,
+ TCHAR **variables, int numVariables,
+ int flags, DWORD timestamp, BOOL addToMetaToo)
+#endif
+{
+ HISTORY_EVENT_ADD hea = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY))
+ return NULL;
+
+ hea.cbSize = sizeof(hea);
+ hea.hContact = hContact;
+ hea.eventType = eventType;
+ hea.templateNum = templateNum;
+ hea.numVariables = numVariables;
+ hea.variables = variables;
+ hea.flags = flags;
+ hea.timestamp = timestamp;
+ hea.addToMetaToo = addToMetaToo;
+
+ return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0);
+}
+
+#ifdef __cplusplus
+static HANDLE HistoryEvents_AddToHistorySimple(HANDLE hContact, WORD eventType, int templateNum,
+ int flags = 0, DWORD timestamp = 0, BOOL addToMetaToo = FALSE)
+#else
+static HANDLE HistoryEvents_AddToHistorySimple(HANDLE hContact, WORD eventType, int templateNum,
+ int flags, DWORD timestamp, BOOL addToMetaToo)
+#endif
+{
+ HISTORY_EVENT_ADD hea = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY))
+ return NULL;
+
+ hea.cbSize = sizeof(hea);
+ hea.hContact = hContact;
+ hea.eventType = eventType;
+ hea.templateNum = templateNum;
+ hea.flags = flags;
+ hea.timestamp = timestamp;
+ hea.addToMetaToo = addToMetaToo;
+
+ return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0);
+}
+
+static BOOL HistoryEvents_IsEnabledTemplate(WORD eventType, int templateNum)
+{
+ return (BOOL) CallService(MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE, eventType, templateNum);
+}
+
+#ifdef UNICODE
+# define HistoryEvents_GetTextT HistoryEvents_GetTextW
+#else
+# define HistoryEvents_GetTextT HistoryEvents_GetTextA
+#endif
+
+
+
+#endif // __M_HISTORYEVENTS_H__
diff --git a/plugins/ExternalAPI/m_historykeeper.h b/plugins/ExternalAPI/m_historykeeper.h new file mode 100644 index 0000000000..7c4a25de84 --- /dev/null +++ b/plugins/ExternalAPI/m_historykeeper.h @@ -0,0 +1,95 @@ +/*
+Copyright (C) 2006-2009 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_HISTORYKEEPER_H__
+# define __M_HISTORYKEEPER_H__
+
+
+#define MIID_STATUS_MESSAGE_CHANGE_LOGGER { 0x821be252, 0xe20b, 0x41e7, { 0xa5, 0x1d, 0x3c, 0x34, 0x2e, 0x38, 0xae, 0x22 } }
+#define MIID_STATUS_MESSAGE_CHANGE_NOTIFIER { 0xb628b23b, 0x47ae, 0x430e, { 0x94, 0x81, 0x15, 0x9f, 0xa7, 0x26, 0xc4, 0x3a } }
+#define MIID_NICKNAME_CHANGE_LOGGER { 0x478be45e, 0xd331, 0x4d63, { 0xa6, 0x57, 0x85, 0xda, 0x45, 0xf8, 0xc, 0xe0 } }
+#define MIID_NICKNAME_CHANGE_NOTIFIER { 0xc749d46a, 0x885e, 0x46bf, { 0xaa, 0x4c, 0xe1, 0xae, 0xc5, 0xc9, 0xd0, 0x93 } }
+
+#define EVENTTYPE_STATUSCHANGE 25368
+#define EVENTTYPE_NICKNAME_CHANGE 9001
+#define EVENTTYPE_STATUSMESSAGE_CHANGE 9002
+#define EVENTTYPE_CLIENT_CHANGE 9005
+#define EVENTTYPE_XSTATUS_CHANGE 9006
+#define EVENTTYPE_LISTENINGTO_CHANGE 9007
+#define EVENTTYPE_XSTATUS_MESSAGE_CHANGE 9008
+#define EVENTTYPE_IDLE_CHANGE 9009
+
+
+/*
+Return TRUE is Status Message History is enabled for this contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_SMH_ENABLED "SMH/Enabled"
+
+
+/*
+Enable Status Message History for a contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_SMH_ENABLE "SMH/Enable"
+
+
+/*
+Disable Status Message History for a contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_SMH_DISABLE "SMH/Disable"
+
+
+/*
+Return TRUE is Nick History is enabled for this contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_NICKHISTORY_ENABLED "NickHistory/Enabled"
+
+
+/*
+Enable Nick History for a contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_NICKHISTORY_ENABLE "NickHistory/Enable"
+
+
+/*
+Disable Nick History for a contact
+
+wParam: hContact
+lParam: ignored
+*/
+#define MS_NICKHISTORY_DISABLE "NickHistory/Disable"
+
+
+
+#endif // __M_HISTORYKEEPER_H__
diff --git a/plugins/ExternalAPI/m_hotkeysplus.h b/plugins/ExternalAPI/m_hotkeysplus.h new file mode 100644 index 0000000000..3da357f109 --- /dev/null +++ b/plugins/ExternalAPI/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/ExternalAPI/m_hpp.h b/plugins/ExternalAPI/m_hpp.h new file mode 100644 index 0000000000..169b666209 --- /dev/null +++ b/plugins/ExternalAPI/m_hpp.h @@ -0,0 +1,11 @@ +#ifndef __m_hhp__
+#define __m_hhp__
+
+#define MS_HPP_GETVERSION "History++/GetVersion"
+
+#define MS_HPP_EG_WINDOW "History++/ExtGrid/NewWindow"
+#define MS_HPP_EG_EVENT "History++/ExtGrid/Event"
+#define MS_HPP_EG_NAVIGATE "History++/ExtGrid/Navigate"
+#define MS_HPP_EG_OPTIONSCHANGED "History++/ExtGrid/OptionsChanged"
+
+#endif // __m_hhp__
diff --git a/plugins/ExternalAPI/m_ieview.h b/plugins/ExternalAPI/m_ieview.h new file mode 100644 index 0000000000..e8fa237900 --- /dev/null +++ b/plugins/ExternalAPI/m_ieview.h @@ -0,0 +1,194 @@ +/*
+
+IEView Plugin for Miranda IM
+Copyright (C) 2005 Piotr Piastucki
+
+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_IEVIEW_INCLUDED
+#define M_IEVIEW_INCLUDED
+
+#define MS_IEVIEW_WINDOW "IEVIEW/NewWindow"
+#define MS_IEVIEW_EVENT "IEVIEW/Event"
+#define MS_IEVIEW_NAVIGATE "IEVIEW/Navigate"
+
+#define ME_IEVIEW_OPTIONSCHANGED "IEVIEW/OptionsChanged"
+
+/* IEView window commands */
+#define IEW_CREATE 1 // create new window (control)
+#define IEW_DESTROY 2 // destroy control
+#define IEW_SETPOS 3 // set window position and size
+#define IEW_SCROLLBOTTOM 4 // scroll text to bottom
+
+/* IEView window type/mode */
+#define IEWM_TABSRMM 1 // TabSRMM-compatible HTML builder
+#define IEWM_SCRIVER 3 // Scriver-compatible HTML builder
+#define IEWM_MUCC 4 // MUCC group chats GUI
+#define IEWM_CHAT 5 // chat.dll group chats GUI
+#define IEWM_HISTORY 6 // history viewer
+#define IEWM_BROWSER 256 // empty browser window
+
+typedef struct {
+ int cbSize; // size of the strusture
+ int iType; // one of IEW_* values
+ DWORD dwMode; // compatibility mode - one of IEWM_* values
+ DWORD dwFlags; // flags, one of IEWF_* values
+ HWND parent; // parent window HWND
+ HWND hwnd; // IEW_CREATE returns WebBrowser control's HWND here
+ int x; // IE control horizontal position
+ int y; // IE control vertical position
+ int cx; // IE control horizontal size
+ int cy; // IE control vertical size
+
+} IEVIEWWINDOW;
+
+#define IEEDF_UNICODE 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string
+#define IEEDF_UNICODE_TEXT 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string
+#define IEEDF_UNICODE_NICK 0x00000002 // if set pszNick is a pointer to wchar_t string instead of char string
+#define IEEDF_UNICODE_TEXT2 0x00000004 // if set pszText2 is a pointer to wchar_t string instead of char string
+
+/* The following flags are valid only for message events (IEED_EVENT_MESSAGE) */
+#define IEEDF_FORMAT_FONT 0x00000100 // if set pszFont (font name) is valid and should be used
+#define IEEDF_FORMAT_SIZE 0x00000200 // if set fontSize is valid and should be used
+#define IEEDF_FORMAT_COLOR 0x00000400 // if set color is valid and should be used
+#define IEEDF_FORMAT_STYLE 0x00000800 // if set fontSize is valid and should be used
+
+#define IEEDF_READ 0x00001000 // if set
+#define IEEDF_SENT 0x00002000 // if set
+#define IEEDF_RTL 0x00004000 // if set
+
+#define IEED_EVENT_MESSAGE 0x0001 // message
+#define IEED_EVENT_STATUSCHANGE 0x0002 // status change
+#define IEED_EVENT_FILE 0x0003 // file
+#define IEED_EVENT_URL 0x0004 // url
+#define IEED_EVENT_ERRMSG 0x0005 // error message
+#define IEED_EVENT_SYSTEM 0x0006 // system event
+
+#define IEED_MUCC_EVENT_MESSAGE 0x0001 // message
+#define IEED_MUCC_EVENT_TOPIC 0x0002 // topic change
+#define IEED_MUCC_EVENT_JOINED 0x0003 // user joined
+#define IEED_MUCC_EVENT_LEFT 0x0004 // user left
+#define IEED_MUCC_EVENT_ERROR 0x0005 // error
+
+/* MUCC-related dwData bit flags */
+#define IEEDD_MUCC_SHOW_NICK 0x00000001
+#define IEEDD_MUCC_MSG_ON_NEW_LINE 0x00000002
+#define IEEDD_MUCC_SHOW_DATE 0x00000010
+#define IEEDD_MUCC_SHOW_TIME 0x00000020
+#define IEEDD_MUCC_SECONDS 0x00000040
+#define IEEDD_MUCC_LONG_DATE 0x00000080
+
+#define IEED_GC_EVENT_HIGHLIGHT 0x8000
+#define IEED_GC_EVENT_MESSAGE 0x0001
+#define IEED_GC_EVENT_TOPIC 0x0002
+#define IEED_GC_EVENT_JOIN 0x0003
+#define IEED_GC_EVENT_PART 0x0004
+#define IEED_GC_EVENT_QUIT 0x0006
+#define IEED_GC_EVENT_NICK 0x0007
+#define IEED_GC_EVENT_ACTION 0x0008
+#define IEED_GC_EVENT_KICK 0x0009
+#define IEED_GC_EVENT_NOTICE 0x000A
+#define IEED_GC_EVENT_INFORMATION 0x000B
+#define IEED_GC_EVENT_ADDSTATUS 0x000C
+#define IEED_GC_EVENT_REMOVESTATUS 0x000D
+
+/* GC-related dwData bit flags */
+#define IEEDD_GC_SHOW_NICK 0x00000001
+#define IEEDD_GC_SHOW_TIME 0x00000002
+#define IEEDD_GC_SHOW_ICON 0x00000004
+#define IEEDD_GC_MSG_ON_NEW_LINE 0x00001000
+
+#define IE_FONT_BOLD 0x000100 // Bold font flag
+#define IE_FONT_ITALIC 0x000200 // Italic font flag
+#define IE_FONT_UNDERLINE 0x000400 // Underlined font flags
+
+typedef struct tagIEVIEWEVENTDATA {
+ int cbSize;
+ int iType; // Event type, one of MUCC_EVENT_* values
+ DWORD dwFlags; // Event flags - IEEF_*
+ const char *fontName; // Text font name
+ int fontSize; // Text font size (in pixels)
+ int fontStyle; // Text font style (combination of IE_FONT_* flags)
+ COLORREF color; // Text color
+ union {
+ const TCHAR *ptszNick; // Nick, usage depends on type of event
+ const char *pszNick; // Nick - ANSII
+ const wchar_t *pszNickW; // Nick - Unicode
+ };
+ union {
+ const TCHAR *ptszText; // Text, usage depends on type of event
+ const char *pszText; // Text - ANSII
+ const wchar_t *pszTextW; // Text - Unicode
+ };
+ DWORD dwData; // DWORD data e.g. status see IEEDD_* values
+ BOOL bIsMe; // TRUE if the event is related to the user
+ DWORD time; // Time of the event
+ struct tagIEVIEWEVENTDATA *next;
+ union {
+ const TCHAR *ptszText2; // Text2, usage depends on type of event
+ const char *pszText2; // Text2 - ANSII
+ const wchar_t *pszText2W; // Text2 - Unicode
+ };
+} IEVIEWEVENTDATA;
+
+/* IEView events */
+#define IEE_LOG_DB_EVENTS 1 // log specified number of DB events
+#define IEE_CLEAR_LOG 2 // clear log
+#define IEE_GET_SELECTION 3 // get selected text
+#define IEE_SAVE_DOCUMENT 4 // save current document
+#define IEE_LOG_MEM_EVENTS 5 // log specified number of IEView events
+
+/* IEView event flags */
+#define IEEF_RTL 1 // turn on RTL support
+#define IEEF_NO_UNICODE 2 // disable Unicode support - valid for IEE_LOG_DB_EVENTS and IEE_GET_SELECTION events
+
+#define IEVIEWEVENT_SIZE_V1 28
+#define IEVIEWEVENT_SIZE_V2 32
+#define IEVIEWEVENT_SIZE_V3 36
+
+typedef struct {
+ int cbSize; // size of the strusture
+ int iType; // one of IEE_* values
+ DWORD dwFlags; // one of IEEF_* values
+ HWND hwnd; // HWND returned by IEW_CREATE
+ HANDLE hContact; // contact
+ union {
+ HANDLE hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
+ // the last event actually logged or NULL if no event was logged (IEE_LOG_EVENTS)
+ IEVIEWEVENTDATA *eventData; // the pointer to an array of IEVIEWEVENTDATA objects (IEE_LOG_IEV_EVENTS)
+ };
+ int count; // number of events to log
+ int codepage; // ANSI codepage
+ const char *pszProto; // Name of the protocol
+} IEVIEWEVENT;
+
+#define IEN_NAVIGATE 1 // navigate to the given destination
+#define IENF_UNICODE 1 // if set urlW is used instead of urlW
+
+typedef struct {
+ int cbSize; // size of the strusture
+ int iType; // one of IEN_* values
+ DWORD dwFlags; // one of IEEF_* values
+ HWND hwnd; // HWND returned by IEW_CREATE
+ union {
+ const char *url; // Text, usage depends on type of event
+ const wchar_t *urlW; // Text - Unicode
+ };
+} IEVIEWNAVIGATE;
+
+#endif
+
diff --git a/plugins/ExternalAPI/m_kbdnotify.h b/plugins/ExternalAPI/m_kbdnotify.h new file mode 100644 index 0000000000..2ab53fe4f5 --- /dev/null +++ b/plugins/ExternalAPI/m_kbdnotify.h @@ -0,0 +1,64 @@ +/*
+
+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 _KBDNOTIFY_
+#define _KBDNOTIFY_
+
+//Enables all notifications (for use by BossKey)
+//wParam=0
+//lParam=0
+//returns 0
+#define MS_KBDNOTIFY_ENABLE "KeyboardNotify/Enable"
+
+
+//Disables all notifications (for use by BossKey)
+//wParam=0
+//lParam=0
+//returns 0
+#define MS_KBDNOTIFY_DISABLE "KeyboardNotify/Disable"
+
+
+//Makes the flashing begin
+//wParam=(unsigned int)eventCount
+//lParam=(char *)szFlashingSequence or NULL if you want the plugin to use current settings
+//returns 0
+#define MS_KBDNOTIFY_STARTBLINK "KeyboardNotify/StartBlinking"
+
+
+//Receives the number of events that were opened (usuful for the 'until events opened' setting)
+//wParam=(unsigned int)eventCount
+//lParam=0
+//returns 0
+#define MS_KBDNOTIFY_EVENTSOPENED "KeyboardNotify/EventsWereOpened"
+
+
+//Informs if the flashing is active
+//wParam=0
+//lParam=0
+//returns 0 if the flashing is inactive or a pointer to the string representing the sequence being used
+#define MS_KBDNOTIFY_FLASHINGACTIVE "KeyboardNotify/IsFlashingActive"
+
+
+//Normalizes the flashing sequence informed
+//wParam=0
+//lParam=(char *)szFlashingSequence <- it is rewritten
+//returns a pointer to the string representing the sequence normalized (which is in fact lParam)
+#define MS_KBDNOTIFY_NORMALSEQUENCE "KeyboardNotify/NormalizeSequence"
+
+
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_langman.h b/plugins/ExternalAPI/m_langman.h new file mode 100644 index 0000000000..3165e04c6b --- /dev/null +++ b/plugins/ExternalAPI/m_langman.h @@ -0,0 +1,56 @@ +/*
+
+'Language Pack Manager'-Plugin for
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright (C) 2005-2007 H. Herkenrath
+
+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 (LangMan-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_LANGMAN_H__
+#define M_LANGMAN_H__
+
+#if defined (_MSC_VER) && (_MSC_VER >= 1020)
+ #pragma once
+#endif
+
+/*
+ Language Pack Manager v1.0.2.2
+ If you have any question or extension whishes please let me know:
+ hrathh at users.sourceforge.net
+*/
+
+/* interface id */
+#if !defined(MIID_LANGMAN)
+ #define MIID_LANGMAN {0xd80370d5,0x4b1e,0x46a8,{0xac,0xa4,0x1f,0xaa,0xd7,0x9b,0x7d,0x1e}}
+#endif
+
+/* Show the download language dialog. v1.0.2.0+
+ wParam=lParam=0
+The dialog can't have a parent due to it's asynchronous nature.
+If the language window is already opened it will be
+brought to front instead (returns success).
+Returns 0 on success, nonzero otherwise.
+*/
+#define MS_LANGMAN_SHOWLANGDIALOG "LangMan/ShowLangDialog"
+
+
+#ifndef LANGMAN_NOSETTINGS
+#define SETTING_ENABLEAUTOUPDATES_DEFAULT 1
+#endif
+
+#endif // M_LANGMAN_H
+
diff --git a/plugins/ExternalAPI/m_langman.inc b/plugins/ExternalAPI/m_langman.inc new file mode 100644 index 0000000000..dce69e38e6 --- /dev/null +++ b/plugins/ExternalAPI/m_langman.inc @@ -0,0 +1,48 @@ +{
+
+'Language Pack Manager'-Plugin for
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2005-2007 H. Herkenrath
+
+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 (LangMan-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$ifndef M_LANGMAN_H}
+{$define M_LANGMAN_H}
+
+const
+
+{
+ Language Pack Manager v1.0.2.2
+ If you have any question or extension whishes please let me know:
+ hrathh at users.sourceforge.net
+}
+
+{ interface id }
+MIID_LANGMAN: TGUID = '{D80370D5-4B1E-46a8-ACA4-1FAAD79B7D1E}';
+
+{ Show the download language dialog. v1.0.2.0+
+ wParam : 0
+ lParam : 0
+The dialog can't have a parent due to it's asynchronous nature.
+If the language window is already opened it will be
+brought to front instead (returns success).
+Returns 0 on success, nonzero otherwise.
+}
+MS_LANGMAN_SHOWLANGDIALOG = 'LangMan/ShowLangDialog';
+
+
+{$endif} // M_LANGMAN_H
diff --git a/plugins/ExternalAPI/m_listeningto.h b/plugins/ExternalAPI/m_listeningto.h new file mode 100644 index 0000000000..c1d8d63052 --- /dev/null +++ b/plugins/ExternalAPI/m_listeningto.h @@ -0,0 +1,82 @@ +/*
+ListeningTo plugin for Miranda IM
+==========================================================================
+Copyright (C) 2005-2011 Ricardo Pescuma Domenecci
+ (C) 2010-2011 Merlin_de
+
+This 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 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_LISTENINGTO_H__
+# define __M_LISTENINGTO_H__
+
+#ifndef MIID_LISTENINGTO
+#define MIID_LISTENINGTO { 0x1fc1efa, 0xaa9f, 0x461b, { 0x92, 0x69, 0xaf, 0x66, 0x6b, 0x89, 0x31, 0xee } }
+#endif
+
+// To be used by other plugins to send listening info to miranda
+#define MIRANDA_WINDOWCLASS _T("Miranda.ListeningTo")
+#define MIRANDA_DW_PROTECTION 0x8754
+
+#define LISTENINGTO_ANSI 1
+#define LISTENINGTO_UNICODE 2
+
+#ifdef UNICODE
+# define LISTENINGTO_TCHAR LISTENINGTO_UNICODE
+#else
+# define LISTENINGTO_TCHAR LISTENINGTO_ANSI
+#endif
+
+
+/*
+Return TRUE if sending listening to is enabled for this protocol
+
+wParam: char * - protocol name or NULL for all protocols
+lParam: ignored
+*/
+#define MS_LISTENINGTO_ENABLED "ListeningTo/Enabled"
+
+
+/*
+Enable/disable sending listening to this protocol
+
+wParam: char * - protocol name or NULL for all protocols
+lParam: BOOL - TRUE to enable, FALSE to disable
+*/
+#define MS_LISTENINGTO_ENABLE "ListeningTo/Enable"
+
+
+/*
+Notification fired when enable state changed
+
+wParam: char * - protocol name or NULL for all protocols
+lParam: BOOL - enabled
+*/
+#define ME_LISTENINGTO_ENABLE_STATE_CHANGED "ListeningTo/EnableStateChanged"
+
+
+/*
+Provide new info about a song change to listening to
+
+wParam: WCHAR * or char * - song data, in format "<Status 0-stoped 1-playing>\\0<Player>\\0<Type>\\0<Title>\\0<Artist>\\0<Album>\\0<Track>\\0<Year>\\0<Genre>\\0<Length (secs)>\\0<Radio Station>\\0"
+lParam: format of wParam: one of LISTENINGTO_ANSI or LISTENINGTO_UNICODE . Anything else will be handled as unicode
+*/
+#define MS_LISTENINGTO_SET_NEW_SONG "ListeningTo/SetNewSong"
+
+
+
+#endif // __M_LISTENINGTO_H__
diff --git a/plugins/ExternalAPI/m_mails.h b/plugins/ExternalAPI/m_mails.h new file mode 100644 index 0000000000..06bd9dfd80 --- /dev/null +++ b/plugins/ExternalAPI/m_mails.h @@ -0,0 +1,284 @@ +#ifndef __MAILS_H
+#define __MAILS_H
+
+#include <windows.h>
+#include <tchar.h>
+#include "m_account.h"
+
+//
+//================================== OTHER DEFINITIONS ========================================
+//
+
+typedef struct CShortNames
+{
+ char *Value;
+ char *ValueNick;
+ struct CShortNames *Next;
+} YAMN_MIMESHORTNAMES,*PYAMN_MIMESHORTNAMES;
+
+typedef struct CNames
+{
+ WCHAR *Value;
+ WCHAR *ValueNick;
+ struct CNames *Next;
+} YAMN_MIMENAMES,*PYAMN_MIMENAMES;
+
+struct CShortHeader
+//this header is used in to get non-unicode data from mime header
+{
+ char *From;
+ char *FromNick;
+ char *ReturnPath;
+ char *ReturnPathNick;
+ char *Subject;
+ PYAMN_MIMESHORTNAMES To;
+ PYAMN_MIMESHORTNAMES Cc;
+ PYAMN_MIMESHORTNAMES Bcc;
+ char *Date;
+ char Priority;
+ char *Body;
+
+ int CP;
+
+ CShortHeader() {}
+ ~CShortHeader() {}
+};
+
+struct CHeader
+//this header is used in miranda to store final results of mime reading in Unicode
+{
+ WCHAR *From;
+ WCHAR *FromNick;
+ WCHAR *ReturnPath;
+ WCHAR *ReturnPathNick;
+ WCHAR *Subject;
+ PYAMN_MIMENAMES To;
+ PYAMN_MIMENAMES Cc;
+ PYAMN_MIMENAMES Bcc;
+ WCHAR *Date;
+ TCHAR Priority;
+ WCHAR *Body;
+
+ CHeader() {}
+ ~CHeader() {}
+};
+
+struct CMimeItem
+{
+ char *name;
+ char *value;
+ struct CMimeItem *Next;
+ CMimeItem(): name(NULL), value(NULL), Next(NULL){}
+};
+
+typedef struct CMailData //this is plugin-independent
+{
+#define YAMN_MAILDATAVERSION 3
+
+ DWORD Size;
+ int CP;
+
+ struct CMimeItem *TranslatedHeader; //MIME items
+ struct CMimeItem *Additional; //MIME items not read from server (custom, for filter plugins etc.)
+ char *Body; //Message body
+
+ CMailData(): CP(-1), Size(0), TranslatedHeader(NULL), Body(NULL){}
+} MAILDATA,*PMAILDATA;
+
+typedef struct CMimeMsgQueue
+{
+#define YAMN_MAILVERSION 3
+ char *ID; //The ID of mail. This ID identifies every mail in the account, so plugin should set it
+
+ DWORD Number;
+
+#define YAMN_MSG_ANY 0xffffffff //any mail
+
+//The difference between new and unseen: when new mail is found in account, it becomes unseen and new. But in the next check, if the same mail is found, it is not new.
+//However, when user was not near computer, he does not know about this mail- it is unseen. After user accepts, that he saw new mails, it becomes seen.
+#define YAMN_MSG_NEW 0x80000000 //this mail is new
+#define YAMN_MSG_UNSEEN 0x40000000 //this mail is mailbrowser unseen
+#define YAMN_MSG_DISPLAY 0x20000000 //this mail can be displayed in mailbrowser
+#define YAMN_MSG_POPUP 0x10000000 //this mail can be displayed in popup and can invoke a popup
+#define YAMN_MSG_SYSTRAY 0x08000000 //this mail can invoke systray icon
+#define YAMN_MSG_BROWSER 0x04000000 //this mail can run mailbrowser
+#define YAMN_MSG_DISPLAYC 0x02000000 //this mail is inserted to browser mail counter system (the "Account - xx new mails, yy total" phrase)
+#define YAMN_MSG_POPUPC 0x01000000 //this mail is inserted to popup counter system (the "Account - xx new mails, yy total" phrase)
+
+#define YAMN_MSG_SOUND 0x00800000 //this mail can "play sound"
+#define YAMN_MSG_APP 0x00400000 //this mail can "launch application"
+#define YAMN_MSG_NEVENT 0x00100000 //this mail can launch Miranda "new mail" event
+
+#define YAMN_MSG_VIRTUAL 0x00080000 //this mail is not real- does not exists
+
+#define YAMN_MSG_FILTERED 0x00040000 //this mail has been filtered
+
+#define YAMN_MSG_DELETETRASH 0x00020000 //this mail should be moved to the trash bin rather than really deleting from mailbox (this is only switch doing nothing, perhaps usefull for filter plugins)
+#define YAMN_MSG_DELETED 0x00010000 //this mail is already deleted from server (also must be set virtual flag) (when doing synchronizations between 2 queues, YAMN then does not touch this mail)
+#define YAMN_MSG_MEMDELETE 0x00008000 //this mail will be deleted immidiatelly from memory (and disk) when deleted from server (some opposite of YAMN_MSG_DELETED)
+#define YAMN_MSG_USERDELETE 0x00004000 //this mail is about to delete from server (user deletes manually)
+#define YAMN_MSG_AUTODELETE 0x00002000 //this mail is about to delete from server (plugin marks it for deleting)
+#define YAMN_MSG_DELETEOK 0x00001000 //this mail is confirmed to delete (this flag must be set to delete this mail)
+
+#define YAMN_MSG_BODYREQUESTED 0x00000800 //user requested (part of) the body. In POP3 it should be (TOP <nr> <lines>)
+#define YAMN_MSG_BODYRECEIVED 0x00000200 //(part of) the body.received;
+#define YAMN_MSG_STAYUNSEEN 0x00000400 //this mail stays unseen while user does not really see it
+
+#define YAMN_MSG_DELETE (YAMN_MSG_USERDELETE | YAMN_MSG_AUTODELETE)
+
+#define YAMN_MSG_NORMALNEW (YAMN_MSG_NEW | YAMN_MSG_UNSEEN | YAMN_MSG_BROWSER | YAMN_MSG_DISPLAY | YAMN_MSG_DISPLAYC | YAMN_MSG_POPUP | YAMN_MSG_POPUPC | YAMN_MSG_SYSTRAY | YAMN_MSG_SOUND | YAMN_MSG_APP | YAMN_MSG_NEVENT | YAMN_MSG_MEMDELETE | YAMN_MSG_STAYUNSEEN)
+
+#define YAMN_MSG_FLAGSSET(maildata,flag) ((maildata & flag)==flag)
+
+#define YAMN_MSG_SPAML1 1 //spam level 1: notify, show in another color in mail browser
+#define YAMN_MSG_SPAML2 2 //spam level 2: do not notify, show in another color in mail browser
+#define YAMN_MSG_SPAML3 3 //spam level 3: delete, show in another color in mail browser that it was deleted, you do not need to set YAMN_MSG_AUTODELETE
+#define YAMN_MSG_SPAML4 4 //spam level 4: delete, do not show, you do not need to set YAMN_MSG_AUTODELETE
+#define YAMN_MSG_SPAMMASK 0x0000000F
+
+#define YAMN_MSG_SPAML(maildata,level) ((maildata & YAMN_MSG_SPAMMASK)==level)
+ DWORD Flags;
+//Plugins can read mail data, but it can be NULL!!! So plugin should use Load and Save services to load or save data and Unload to release data from memory
+ PMAILDATA MailData;
+//Here YAMN stores its own informations about this mail. Not usefull for plugins...
+// void *YAMNData;
+ HWND MsgWindow;
+//plugins can store here its own data
+ void *PluginData;
+
+ CMimeMsgQueue(): ID(NULL), Number(0), Flags(0), MailData(NULL), MsgWindow(NULL), PluginData(NULL), Next(NULL){}
+ ~CMimeMsgQueue(){}
+
+ struct CMimeMsgQueue *Next;
+} YAMNMAIL,*HYAMNMAIL;
+#define LoadedMailData(x) (x->MailData!=NULL)
+
+//
+//================================== YAMN MAIL SERVICES ==================================
+//
+
+//CreateAccountMail Service
+//Your plugin should call this to create new mail for your plugin.
+//WPARAM- (HACCOUNT) Account handle
+//LPARAM- CMailData version (use YAMN_MAILVERSION definition)
+//returns pointer to (HYAMNMAIL) or pointer to your structure returned from imported NewMailFcnPtr, if implemented
+#define MS_YAMN_CREATEACCOUNTMAIL "YAMN/Service/CreateMail"
+#define CreateAccountMail(x) (HYAMNMAIL)CallService(MS_YAMN_CREATEACCOUNTMAIL,(WPARAM)x,(LPARAM)YAMN_MAILVERSION)
+
+//DeleteAccountMail Service
+//Deletes plugin's mail from memory. You probably won't use this service, because it deletes only account
+//without any synchronization. Use MS_YAMN_DELETEACCOUNT instead. Note that deleting mail is something like "this mail is
+//not more in the account".
+//WPARAM- (HYAMNPROTOPLUGIN) handle of plugin, which is going to delete mail
+//LPARAM- (HYAMNMAIL) mail going to delete
+//returns zero if failed, otherwise returns nonzero
+#define MS_YAMN_DELETEACCOUNTMAIL "YAMN/Service/DeletePluginMail"
+#define DeleteAccountMail(x,y) CallService(MS_YAMN_DELETEACCOUNTMAIL,(WPARAM)x,(LPARAM)y)
+
+//LoadMailData Service
+//This service loads mail from standard YAMN storage (now it is 1 file, from which mails are loaded once at startup, but
+//in the future it can be Miranda profile file or separate file (1 file per 1 mail). It depends on YAMN implementation...
+//Use this function if you want to read or write to MailData member of mail structure. Please use synchronization obejcts
+//before calling this service (so you must have read or write access to mails)
+//WPARAM- (HYAMNMAIL) mail where to load data
+//LPARAM- (DWORD) version of MAILDATA structure (use YAMN_MAILDATAVERSION definition)
+//returns pointer to new allocated MailData structure (the same value as MailData member)
+#define MS_YAMN_LOADMAILDATA "YAMN/Service/LoadMailData"
+#define LoadMailData(x) (PMAILDATA)CallService(MS_YAMN_LOADMAILDATA,(WPARAM)x,(LPARAM)YAMN_MAILDATAVERSION)
+
+//UnloadMailData Service
+//This service frees mail data from memory. It does not care if data were saved or not. So you should save mail before you
+//release data from memory.
+//WPARAM- (HYAMNMAIL) mail whose data are about to free
+//LPARAM- nothing yet
+//returns nonzero if success
+#define MS_YAMN_UNLOADMAILDATA "YAMN/Service/UnloadMailData"
+#define UnloadMailData(x) CallService(MS_YAMN_UNLOADMAILDATA,(WPARAM)x,(LPARAM)0)
+
+//SaveMailData Service
+//This service saves mail to standard YAMN storage (when using now 1 book file, it does nothing, because save is done when
+//using MS_YAMN_WRITEACCOUNT service. In the future, mail can be saved to Miranda profile or to separate file...)
+//WPARAM- (HYAMNMAIL) mail to save
+//LPARAM- (DWORD) version of MAILDATA structure (use YAMN_MAILDATAVERSION definition)
+//returns ZERO! if succes
+#define MS_YAMN_SAVEMAILDATA "YAMN/Service/SaveMailData"
+#define SaveMailData(x) CallService(MS_YAMN_SAVEMAILDATA,(WPARAM)x,(LPARAM)YAMN_MAILDATAVERSION)
+
+//
+//================================== FUNCTIONS DEFINITIONS ========================================
+//
+
+//typedef void (WINAPI *YAMN_SENDMESSAGEFCN)(UINT,WPARAM,LPARAM);
+typedef void (WINAPI *YAMN_SYNCHROMIMEMSGSFCN)(HACCOUNT,HYAMNMAIL *,HYAMNMAIL *,HYAMNMAIL *,HYAMNMAIL *);
+typedef void (WINAPI *YAMN_TRANSLATEHEADERFCN)(char *,int,struct CMimeItem **);
+typedef void (WINAPI *YAMN_APPENDQUEUEFCN)(HYAMNMAIL,HYAMNMAIL);
+typedef void (WINAPI *YAMN_DELETEMIMEQUEUEFCN)(HACCOUNT,HYAMNMAIL);
+typedef void (WINAPI *YAMN_DELETEMIMEMESSAGEFCN)(HYAMNMAIL *,HYAMNMAIL,int);
+typedef HYAMNMAIL (WINAPI *YAMN_FINDMIMEMESSAGEFCN)(HYAMNMAIL,char *);
+typedef HYAMNMAIL (WINAPI *YAMN_CREATENEWDELETEQUEUEFCN)(HYAMNMAIL);
+typedef void (WINAPI *YAMN_SETREMOVEQUEUEFLAGSFCN)(HYAMNMAIL,DWORD,DWORD,DWORD,int);
+
+//
+//================================== QUICK FUNCTION CALL DEFINITIONS ========================================
+//
+
+//These are defininitions for YAMN exported functions. Your plugin can use them.
+//pYAMNFcn is global variable, it is pointer to your structure containing YAMN functions.
+//It is something similar like pluginLink variable in Miranda plugin. If you use
+//this name of variable, you have already defined these functions and you can use them.
+//It's similar to Miranda's CreateService function.
+
+//How to use YAMN functions:
+//Create a structure containing pointer to functions you want to use in your plugin
+//This structure can look something like this:
+//
+// struct
+// {
+// YAMN_SYNCHROMIMEMSGSFCN SynchroMessagesFcn;
+// YAMN_APPENDQUEUEFCN AppendQueueFcn;
+// } *pYAMNMailFcn;
+//
+//then you have to fill this structure with pointers...
+//you have to use YAMN service to get pointer, like this (I wrote here all functions you may need,
+//you can copy to your sources only those you need):
+//
+// pYAMNMailFcn->SynchroMessagesFcn=(YAMN_SYNCHROMIMEMSGSFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SYNCHROMIMEMSGSID,(LPARAM)0);
+// pYAMNMailFcn->TranslateHeaderFcn=(YAMN_TRANSLATEHEADERFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_TRANSLATEHEADERID,(LPARAM)0);
+// pYAMNMailFcn->AppendQueueFcn=(YAMN_APPENDQUEUEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_APPENDQUEUEID,(LPARAM)0);
+// pYAMNMailFcn->DeleteMessagesToEndFcn=(YAMN_DELETEMIMEQUEUEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_DELETEMIMEQUEUEID,(LPARAM)0);
+// pYAMNMailFcn->DeleteMessageFromQueueFcn=(YAMN_DELETEMIMEMESSAGEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_DELETEMIMEMESSAGEID,(LPARAM)0);
+// pYAMNMailFcn->FindMessageByIDFcn=(YAMN_FINDMIMEMESSAGEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_FINDMIMEMESSAGEID,(LPARAM)0);
+// pYAMNMailFcn->CreateNewDeleteQueueFcn=(YAMN_CREATENEWDELETEQUEUEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_CREATENEWDELETEQUEUEID,(LPARAM)0);
+// pYAMNMailFcn->SetRemoveQueueFlagsFcn=(YAMN_SETREMOVEQUEUEFLAGSFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SETREMOVEQUEUEFLAGSID,(LPARAM)0);
+//
+//
+//and in your plugin just simply use e.g.:
+//
+// DeleteMIMEQueue(MyAccount,OldMessages); //this command deletes all messages in the mail queue OldMessages
+//
+
+#define YAMN_SYNCHROMIMEMSGSID "YAMN/SynchroMessages"
+#define YAMN_TRANSLATEHEADERID "YAMN/TranslateHeader"
+#define YAMN_APPENDQUEUEID "YAMN/AppendQueue"
+#define YAMN_DELETEMIMEQUEUEID "YAMN/DeleteMIMEQueue"
+#define YAMN_DELETEMIMEMESSAGEID "YAMN/DeleteMIMEMessage"
+#define YAMN_FINDMIMEMESSAGEID "YAMN/FindMIMEMessageByID"
+#define YAMN_CREATENEWDELETEQUEUEID "YAMN/CreateNewDeleteQueue"
+#define YAMN_SETREMOVEQUEUEFLAGSID "YAMN/SetRemoveQueueFlags"
+
+#define YAMN_FLAG_REMOVE 0
+#define YAMN_FLAG_SET 1
+
+
+#define SynchroMessages(a,b,c,d,e) pYAMNMailFcn->SynchroMessagesFcn(a,b,c,d,e)
+#define TranslateHeader(a,b,c) pYAMNMailFcn->TranslateHeaderFcn(a,b,c)
+#define AppendQueue(x,y) pYAMNMailFcn->AppendQueueFcn(x,y)
+#define DeleteMIMEQueue(x,y) pYAMNMailFcn->DeleteMessagesToEndFcn(x,y)
+#define DeleteMIMEMessage(x,y) pYAMNMailFcn->DeleteMessageFromQueueFcn(x,y,0)
+#define DeleteMIMEMessageEx(x,y,z) pYAMNMailFcn->DeleteMessageFromQueueFcn(x,y,z)
+#define FindMIMEMessageByID(x,y) pYAMNMailFcn->FindMessageByIDFcn(x,y)
+#define CreateNewDeleteQueue(x) pYAMNMailFcn->CreateNewDeleteQueueFcn(x)
+#define SetQueueFlags(a,b,c,d) pYAMNMailFcn->SetRemoveQueueFlagsFcn(a,b,c,d,1)
+#define RemoveQueueFlags(a,b,c,d) pYAMNMailFcn->SetRemoveQueueFlagsFcn(a,b,c,d,0)
+
+#endif
diff --git a/plugins/ExternalAPI/m_messages.h b/plugins/ExternalAPI/m_messages.h new file mode 100644 index 0000000000..7fc0fbed20 --- /dev/null +++ b/plugins/ExternalAPI/m_messages.h @@ -0,0 +1,41 @@ +#ifndef __MESSAGES_H
+#define __MESSAGES_H
+
+//#include "list.h"
+
+// structure for chained list of handles (window handles, account handles, whatever)
+struct WndHandles
+{
+ HANDLE Handle;
+
+ struct WndHandles *Next;
+};
+
+#define WM_YAMN WM_APP+0x2800 //(0xA800 in fact)
+enum
+{
+ WM_YAMN_CHANGEHOTKEY=WM_YAMN,
+ WM_YAMN_CHANGETIME,
+
+//ChangeStatus message
+//WPARAM- (HACCOUNT) Account whose status is changed
+//LPARAM- new status of account
+ WM_YAMN_CHANGESTATUS,
+
+//StopAccount message
+//WPARAM- (HACCOUNT) Account, which should stop its work and finish immidiatelly
+ WM_YAMN_STOPACCOUNT,
+
+//Account content changed
+ WM_YAMN_CHANGECONTENT,
+
+ WM_YAMN_UPDATEMAILS,
+
+ WM_YAMN_NOTIFYICON,
+
+ WM_YAMN_CHANGESTATUSOPTION,
+
+ WM_YAMN_SHOWSELECTED,
+};
+
+#endif
diff --git a/plugins/ExternalAPI/m_metacontacts.h b/plugins/ExternalAPI/m_metacontacts.h new file mode 100644 index 0000000000..9f348bd2c6 --- /dev/null +++ b/plugins/ExternalAPI/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/ExternalAPI/m_msg_buttonsbar.h b/plugins/ExternalAPI/m_msg_buttonsbar.h new file mode 100644 index 0000000000..8a55627b40 --- /dev/null +++ b/plugins/ExternalAPI/m_msg_buttonsbar.h @@ -0,0 +1,120 @@ +#ifndef M_MSG_BUTTONSBAR_H__
+#define M_MSG_BUTTONSBAR_H__
+
+//////////////////////////////////////////////////////////////////////////
+// Services
+//
+//////////////////////////////////////////////////////////////////////////
+// Adding a button
+//
+// wParam = 0
+// lParam = (BBButton *) &description
+#define MS_BB_ADDBUTTON "TabSRMM/ButtonsBar/AddButton"
+
+//////////////////////////////////////////////////////////////////////////
+// Remove button
+//
+// wParam = 0
+// lParam = (BBButton *) &description, only button ID and ModuleName used
+#define MS_BB_REMOVEBUTTON "TabSRMM/ButtonsBar/RemoveButton"
+
+//////////////////////////////////////////////////////////////////////////
+// ModifyButton(global)
+//
+// wParam = 0
+// lParam = (BBButton *) &description
+#define MS_BB_MODIFYBUTTON "TabSRMM/ButtonsBar/ModifyButton"
+
+
+#define BBSF_HIDDEN (1<<0)
+#define BBSF_DISABLED (1<<1)
+#define BBSF_PUSHED (1<<2)
+#define BBSF_RELEASED (1<<3)
+
+//////////////////////////////////////////////////////////////////////////
+// GetButtonState(local)
+//
+// wParam = hContact
+// lParam = (BBButton *) &description , only ModuleName and ID used
+// Returns BBButton struct with BBSF_ bbbFlags:
+#define MS_BB_GETBUTTONSTATE "TabSRMM/ButtonsBar/GetButtonState"
+
+//////////////////////////////////////////////////////////////////////////
+// SetButtonState (local)
+//
+// wParam = hContact
+// lParam = (BBButton *) &description , ModuleName, ID,hIcon,Tooltip, and BBSF_ bbbFlags are used
+#define MS_BB_SETBUTTONSTATE "TabSRMM/ButtonsBar/SetButtonState"
+
+
+////////////////////////////////////////////////////////////////
+//Events
+//
+///////////////////////////////////////////////////
+// ToolBar loaded event
+// wParam = 0;
+// lParam = 0;
+// This event will be send after module loaded and after each toolbar reset
+// You should add your buttons on this event
+#define ME_MSG_TOOLBARLOADED "TabSRMM/ButtonsBar/ModuleLoaded"
+
+///////////////////////////////////////////////////
+// ButtonClicked event
+// wParam = (HANDLE)hContact;
+// lParam = (CustomButtonClickData *)&CustomButtonClickData;
+// catch to show a popup menu, etc.
+#define ME_MSG_BUTTONPRESSED "TabSRMM/ButtonsBar/ButtonPressed"
+
+
+//event flags
+#define BBCF_RIGHTBUTTON (1<<0)
+#define BBCF_SHIFTPRESSED (1<<1)
+#define BBCF_CONTROLPRESSED (1<<2)
+#define BBCF_ARROWCLICKED (1<<3)
+
+typedef struct {
+ int cbSize;
+ POINT pt; // screen coordinates for menus
+ char* pszModule; // button owners name
+ DWORD dwButtonId; // registered button ID
+ HWND hwndFrom; // button parents HWND
+ HANDLE hContact; //
+ DWORD flags; // BBCF_ flags
+ } CustomButtonClickData;
+
+
+//button flags
+#define BBBF_DISABLED (1<<0)
+#define BBBF_HIDDEN (1<<1)
+#define BBBF_ISPUSHBUTTON (1<<2)
+#define BBBF_ISARROWBUTTON (1<<3)
+#define BBBF_ISCHATBUTTON (1<<4)
+#define BBBF_ISIMBUTTON (1<<5)
+#define BBBF_ISLSIDEBUTTON (1<<6)
+#define BBBF_ISRSIDEBUTTON (1<<7)
+#define BBBF_CANBEHIDDEN (1<<8)
+#define BBBF_ISDUMMYBUTTON (1<<9)
+#define BBBF_ANSITOOLTIP (1<<10)
+
+#define BBBF_CREATEBYID (1<<11) //only for tabsrmm internal use
+
+typedef struct _tagBBButton
+ {
+ int cbSize; // size of structure
+
+ DWORD dwButtonID; // your button ID, will be combined with pszModuleName for storing settings, etc...
+
+ char* pszModuleName; //module name without spaces and underline symbols (e.g. "tabsrmm")
+ union{
+ char* pszTooltip; //button's tooltip
+ TCHAR* ptszTooltip;
+ };
+ DWORD dwDefPos; // default order pos of button, counted from window edge (left or right)
+ // use value >100, because internal buttons using 10,20,30... 80, etc
+ int iButtonWidth; // must be 0
+ DWORD bbbFlags; // combine of BBBF_ flags above
+ HANDLE hIcon; //Handle to icolib registered icon, it's better to register with pszSection = "TabSRMM/Toolbar"
+ }BBButton;
+
+
+#endif //M_MSG_BUTTONSBAR_H__
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_music.h b/plugins/ExternalAPI/m_music.h new file mode 100644 index 0000000000..0246fabe34 --- /dev/null +++ b/plugins/ExternalAPI/m_music.h @@ -0,0 +1,386 @@ +#ifndef M_MUSIC
+#define M_MUSIC
+
+#define MIID_WATRACK {0xfc6c81f4, 0x837e, 0x4430, {0x96, 0x01, 0xa0, 0xaa, 0x43, 0x17, 0x7a, 0xe3}}
+
+typedef struct tSongInfoA {
+ CHAR* artist;
+ CHAR* title;
+ CHAR* album;
+ CHAR* genre;
+ CHAR* comment;
+ CHAR* year;
+ CHAR* mfile; // media file
+ DWORD kbps;
+ DWORD khz;
+ DWORD channels;
+ DWORD track;
+ DWORD total; // music length
+ DWORD time; // elapsed time
+ CHAR* wndtext; // window title
+ CHAR* player; // player name
+ DWORD plyver; // player version
+ HANDLE icon; // player icon
+ DWORD fsize; // media file size
+ DWORD vbr;
+ int status; // WAT_MES_* const
+ HWND plwnd; // player window
+ // video part
+ DWORD codec;
+ DWORD width;
+ DWORD height;
+ DWORD fps;
+ __int64 date;
+ CHAR* txtver;
+ CHAR* lyric;
+ CHAR* cover;
+ DWORD volume;
+ CHAR* url; // player homepage
+} SONGINFOA, *LPSONGINFOA;
+
+typedef struct tSongInfo {
+ WCHAR* artist;
+ WCHAR* title;
+ WCHAR* album;
+ WCHAR* genre;
+ WCHAR* comment;
+ WCHAR* year;
+ WCHAR* mfile; // media file
+ DWORD kbps;
+ DWORD khz;
+ DWORD channels;
+ DWORD track;
+ DWORD total; // music length
+ DWORD time; // elapsed time
+ WCHAR* wndtext; // window title
+ WCHAR* player; // player name
+ DWORD* plyver; // player version
+ HANDLE icon; // player icon
+ DWORD fsize; // media file size
+ DWORD vbr;
+ int status; // WAT_MES_* const
+ HWND plwnd; // player window
+ // video part
+ DWORD codec;
+ DWORD width;
+ DWORD height;
+ DWORD fps;
+ __int64 date;
+ WCHAR* txtver;
+ WCHAR* lyric;
+ WCHAR* cover; // cover path
+ DWORD volume;
+ WCHAR* url; // player homepage
+} SONGINFO, *LPSONGINFO;
+
+#if defined(_UNICODE)
+ #define WAT_INF_TCHAR WAT_INF_UNICODE
+ #define SongInfoT tSongInfo
+#else
+ #define WAT_INF_TCHAR WAT_INF_ANSI
+ #define SongInfoT tSongInfoA
+#endif
+
+ // result codes
+#define WAT_RES_UNKNOWN -2
+#define WAT_RES_NOTFOUND -1
+#define WAT_RES_ERROR WAT_RES_NOTFOUND
+#define WAT_RES_OK 0
+#define WAT_RES_ENABLED WAT_RES_OK
+#define WAT_RES_DISABLED 1
+ // internal
+#define WAT_RES_NEWFILE 3
+#define WAT_RES_NEWPLAYER 4
+
+// result for MS_WAT_GETMUSICINFO service
+#define WAT_PLS_NORMAL WAT_RES_OK
+#define WAT_PLS_NOMUSIC WAT_RES_DISABLED
+#define WAT_PLS_NOTFOUND WAT_RES_NOTFOUND
+
+#define WAT_INF_UNICODE 0
+#define WAT_INF_ANSI 1
+#define WAT_INF_UTF8 2
+#define WAT_INF_CHANGES 0x100
+
+/*
+ wParam : WAT_INF_* constant
+ lParam : pointer to LPSONGINGO (Unicode) or LPSONGINFOA (ANSI/UTF8)
+ Affects: Fill structure by currently played music info
+ returns: WAT_PLS_* constant
+ note: pointer will be point to global SONGINFO structure of plugin
+ warning: Non-Unicode data filled only by request
+ if lParam=0 only internal SongInfo structure will be filled
+ Example:
+ LPSONGINFO p;
+ PluginLink->CallService(MS_WAT_GETMUSICINFO,0,(DWORD)&p);
+*/
+#define MS_WAT_GETMUSICINFO "WATrack/GetMusicInfo"
+
+/*
+ wParam:0
+ lParam : pointer to pSongInfo (Unicode)
+ Affects: Fill structure by info from file named in SongInfo.mfile
+ returns: 0, if success
+ note: fields, which values can't be obtained, leaves old values.
+ you must free given strings by miranda mmi.free
+*/
+#define MS_WAT_GETFILEINFO "WATrack/GetFileInfo"
+
+/*
+ wParam: encoding (WAT_INF_* consts, 0 = WAT_INF_UNICODE)
+ lParam: codepage (0 = ANSI)
+ Returns Global unicode SongInfo pointer or tranlated to Ansi/UTF8 structure
+*/
+#define MS_WAT_RETURNGLOBAL "WATrack/GetMainStructure"
+
+//!! DON'T CHANGE THESE VALUES!
+#define WAT_CTRL_FIRST 1
+
+#define WAT_CTRL_PREV 1
+#define WAT_CTRL_PLAY 2
+#define WAT_CTRL_PAUSE 3
+#define WAT_CTRL_STOP 4
+#define WAT_CTRL_NEXT 5
+#define WAT_CTRL_VOLDN 6
+#define WAT_CTRL_VOLUP 7
+#define WAT_CTRL_SEEK 8 // lParam is new position (sec)
+
+#define WAT_CTRL_LAST 8
+
+/*
+ wParam: button code (WAT_CTRL_* const)
+ lParam: 0, or value (see WAT_CTRL_* const comments)
+ Affects: emulate player button pressing
+ returns: 0 if unsuccesful
+*/
+#define MS_WAT_PRESSBUTTON "WATrack/PressButton"
+
+/*
+ Get user's Music Info
+*/
+#define MS_WAT_GETCONTACTINFO "WATrack/GetContactInfo"
+
+// ------------ Plugin/player status ------------
+
+/*
+ wParam: 1 - switch off plugin
+ 0 - switch on plugin
+ -1 - switch plugin status
+ 2 - get plugin version
+ other - get plugin status
+ lParam: 0
+ Affects: Switch plugin status to enabled or disabled
+ returns: old plugin status, 0, if was enabled
+*/
+#define MS_WAT_PLUGINSTATUS "WATrack/PluginStatus"
+
+// ---------- events ------------
+
+/*ME_WAT_MODULELOADED
+ wParam: 0, lParam: 0
+*/
+#define ME_WAT_MODULELOADED "WATrack/ModuleLoaded"
+
+#define WAT_EVENT_PLAYERSTATUS 1 //lParam: WAT_PLS_* const
+#define WAT_EVENT_NEWTRACK 2 //lParam: LPSONGINFO
+#define WAT_EVENT_PLUGINSTATUS 3 //lParam: 0-enabled; 1-dis.temporary; 2-dis.permanent
+#define WAT_EVENT_NEWPLAYER 4 //
+#define WAT_EVENT_NEWTEMPLATE 5 //lParam: TM_* constant
+
+/*ME_WAT_NEWSTATUS
+ Plugin or player status changed:
+ wParam: type of event (see above)
+ lParam: value
+*/
+#define ME_WAT_NEWSTATUS "WATrack/NewStatus"
+
+// ---------- Popup module ------------
+
+/*
+ wParam: not used
+ lParam: not used
+ Affects: Show popup or Info window with current music information
+ note: Only Info window will be showed if Popup plugin disabled
+*/
+#define MS_WAT_SHOWMUSICINFO "WATrack/ShowMusicInfo"
+
+// --------- Statistic (report) module -------------
+
+/*
+ wParam: pointer to log file name or NULL
+ lParam: pointer to report file name or NULL
+ Affects: Create report from log and run it (if option is set)
+ returns: 0 if unsuccesful
+ note: if wParam or lParam is a NULL then file names from options are used
+*/
+#define MS_WAT_MAKEREPORT "WATrack/MakeReport"
+
+/*
+ wParam, lParam - not used
+ Affects: pack statistic file
+*/
+#define MS_WAT_PACKLOG = "WATrack/PackLog"
+
+/*
+ wParam: not used
+ lParam: pointer to SongInfo
+*/
+#define MS_WAT_ADDTOLOG = "WATrack/AddToLog"
+
+// ----------- Formats and players -----------
+
+// media file status
+
+#define WAT_MES_STOPPED 0
+#define WAT_MES_PLAYING 1
+#define WAT_MES_PAUSED 2
+#define WAT_MES_UNKNOWN -1
+
+#define WAT_ACT_REGISTER 1
+#define WAT_ACT_UNREGISTER 2
+#define WAT_ACT_DISABLE 3
+#define WAT_ACT_ENABLE 4
+#define WAT_ACT_GETSTATUS 5 // not found/enabled/disabled
+#define WAT_ACT_SETACTIVE 6
+#define WAT_ACT_REPLACE 0x10000 // can be combined with WAT_REGISTERFORMAT
+
+ // flags
+#define WAT_OPT_DISABLED 0x00001 // format registered but disabled
+#define WAT_OPT_ONLYONE 0x00002 // format can't be overwriten
+#define WAT_OPT_PLAYERINFO 0x00004 // song info from player
+#define WAT_OPT_WINAMPAPI 0x00008 // Winamp API support
+#define WAT_OPT_CHECKTIME 0x00010 // check file time for changes
+#define WAT_OPT_VIDEO 0x00020 // only for format registering used
+#define WAT_OPT_LAST 0x00040 // (internal)
+#define WAT_OPT_FIRST 0x00080 // (internal)
+#define WAT_OPT_TEMPLATE 0x00100 // (internal)
+#define WAT_OPT_IMPLANTANT 0x00200 // use process implantation
+#define WAT_OPT_HASURL 0x00400 // (player registration) URL field present
+#define WAT_OPT_CHANGES 0x00800 // obtain only chaged values
+ // (volume, status, window text, elapsed time)
+#define WAT_OPT_APPCOMMAND 0x01000 // Special (multimedia) key support
+#define WAT_OPT_CHECKALL 0x02000 // Check all players
+#define WAT_OPT_KEEPOLD 0x04000 // Keep Old opened file
+#define WAT_OPT_MULTITHREAD 0x08000 // Use multithread scan
+#define WAT_OPT_SINGLEINST 0x10000 // Single player instance
+#define WAT_OPT_PLAYERDATA 0x20000 // (internal) to obtain player data
+
+
+typedef BOOL (__cdecl *LPREADFORMATPROC)(LPSONGINFO Info);
+
+typedef struct tMusicFormat {
+ LPREADFORMATPROC proc;
+ CHAR ext[8];
+ UINT flags;
+} MUSICFORMAT, *LPMUSICFORMAT;
+
+/*
+ wParam: action
+ lParam: pointer to MUSICFORMAT if wParam = WAT_ACT_REGISTER,
+ else - pointer to extension string (ANSI)
+ returns: see result codes
+*/
+#define MS_WAT_FORMAT "WATrack/Format"
+
+/*
+ wParam - pointer to SONGINFO structure (plwind field must be initialized)
+ lParam - flags
+ Affects: trying to fill SongInfo using Winamp API
+*/
+#define MS_WAT_WINAMPINFO "WATrack/WinampInfo"
+
+/*
+ wParam: window
+ lParam: LoWord - command; HiWord - value
+*/
+#define MS_WAT_WINAMPCOMMAND "WATrack/WinampCommand"
+
+typedef int (__cdecl *LPINITPROC) ();
+typedef int (__cdecl *LPDEINITPROC) ();
+typedef int (__cdecl *LPSTATUSPROC) (HWND wnd);
+typedef WCHAR (__cdecl *LPNAMEPROC) (HWND wnd, int flags);
+typedef HWND (__cdecl *LPCHECKPROC) (HWND wnd,int flags);
+typedef int (__cdecl *LPINFOPROC) (LPSONGINFO Info, int flags);
+typedef int (__cdecl *LPCOMMANDPROC)(HWND wnd, int command, int value);
+
+typedef struct tPlayerCell {
+ CHAR* Desc; // Short player name
+ UINT flags;
+ HICON Icon; // can be 0. for registration only
+ LPINITPROC Init; // LPINITPROC; can be NULL. initialize any data
+ LPDEINITPROC DeInit; // LPDEINITPROC; can be NULL. finalize player processing
+ LPCHECKPROC Check; // check player
+ LPSTATUSPROC GetStatus; // tStatusProc; can be NULL. get player status
+ LPNAMEPROC GetName; // can be NULL. get media filename
+ LPINFOPROC GetInfo; // can be NULL. get info from player
+ LPCOMMANDPROC Command; // can be NULL. send command to player
+ CHAR* URL; // only if WAT_OPT_HASURL flag present
+ WCHAR* Notes; // any tips, notes etc for this player
+} PLAYERCELL, *LPPLAYERCELL;
+
+/*
+ wParam: action
+ lParam: pointer to PLAYERCELL if wParam = WAT_ACT_REGISTER,
+ else - pointer to player description string (ANSI)
+ returns: player window handle or value>0 if found
+ note: If you use GetName or GetInfo field, please, do not return empty
+ filename even when mediafile is remote!
+*/
+#define MS_WAT_PLAYER "WATrack/Player"
+
+// --------- Last FM ---------
+
+/*
+ Toggle LastFM scrobbling status
+ wParam,lParam=0
+ Returns: previous state
+*/
+#define MS_WAT_LASTFM "WATrack/LastFM"
+
+/*
+ Get Info based on currently played song
+ wParam: pLastFMInfo
+ lParam: int language (first 2 bytes - 2-letters language code)
+*/
+typedef struct tLastFMInfo {
+ UINT request; // 0 - artist, 1 - album, 2 - track
+ WCHAR* artist; // artist
+ WCHAR* album; // album or similar artists for Artist info request
+ WCHAR* title; // track title
+ WCHAR* tags; // tags
+ WCHAR* info; // artist bio or wiki article
+ WCHAR* image; // photo/cover link
+ WCHAR* similar;
+ WCHAR* release;
+ UINT trknum;
+}PLASTFMINFO, *LPLASTFMINFO;
+
+#define MS_WAT_LASTFMINFO "WATrack/LastFMInfo"
+
+// --------- Templates ----------
+
+/*
+ wParam: 0 (standard Info) or pSongInfo
+ lParam: Unicode template
+ returns: New Unicode (replaced) string
+*/
+#define MS_WAT_REPLACETEXT "WATrack/ReplaceText"
+
+/*
+ event types for History
+ Blob structure for EVENTTYPE_WAT_ANSWER:
+ Uniciode artist#0title#0album#0answer
+*/
+#define EVENTTYPE_WAT_REQUEST 9601
+#define EVENTTYPE_WAT_ANSWER 9602
+#define EVENTTYPE_WAT_ERROR 9603
+#define EVENTTYPE_WAT_MESSAGE 9604
+
+/*
+ wParam: 0 or parent window
+ lParam: 0
+ note: Shows Macro help window with edit aliases ability
+*/
+#define MS_WAT_MACROHELP "WATrack/MacroHelp"
+
+#endif
diff --git a/plugins/ExternalAPI/m_mydetails.h b/plugins/ExternalAPI/m_mydetails.h new file mode 100644 index 0000000000..ad604332b1 --- /dev/null +++ b/plugins/ExternalAPI/m_mydetails.h @@ -0,0 +1,187 @@ +/*
+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_MYDETAILS_H__
+# define __M_MYDETAILS_H__
+
+
+#define MIID_MDETAILS { 0xdba18dbc, 0x5be6, 0x4504, { 0xa7, 0x99, 0x29, 0xec, 0x6c, 0xca, 0x0, 0x65 } }
+
+
+
+/*
+MyDetails/SetMyNickname service
+Set the nickname for all possible protocols
+
+wparam = (const char *) protocol name or NULL for all protocols
+lparam = (const char *) new nickname
+returns: -2 if proto can't set this, -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_SETMYNICKNAME "MyDetails/SetMyNickname"
+
+
+/*
+MyDetails/SetMyNicknameUI service
+Shows a dialog to set the nickname for all possible protocols
+
+wparam = 0
+lparam = (const char *) protocol name or NULL for all protocols
+returns: -2 if proto can't set this, -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_SETMYNICKNAMEUI "MyDetails/SetMyNicknameUI"
+
+
+/*
+MyDetails/SetMyAvatar service
+Set the avatar for all possible protocols
+
+wparam = (const char *) protocol name or NULL for all protocols
+lparam = (const char *) new avatar file name
+returns: -2 if proto can't set this, -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_SETMYAVATAR "MyDetails/SetMyAvatar"
+
+
+/*
+MyDetails/SetMyAvatarUI service
+Shows a dialog to set the avatar for all possible protocols
+
+wparam = 0
+lparam = (const char *) protocol name or NULL for all protocols
+returns: -2 if proto can't set this, -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_SETMYAVATARUI "MyDetails/SetMyAvatarUI"
+
+
+/*
+MyDetails/GetMyNickname service
+Get the nickname
+
+wparam = (const char *) protocol name or NULL for default nick
+lparam = (char *) the buffer to save the nickname. Has to have at least 1024 chars
+returns: -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_GETMYNICKNAME "MyDetails/GetMyNickname"
+#define MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE 1024
+
+
+/*
+MyDetails/GetMyAvatar service
+Get the avatar file name
+
+wparam = (const char *) protocol name or NULL for default avatar
+lparam = (char *) the buffer to save the file name. Has to have at least 1024 chars
+returns: -2 if proto can't get this, -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_GETMYAVATAR "MyDetails/GetMyAvatar"
+#define MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE 1024
+
+
+/*
+MyDetails/SetMyStatusMessageUI service
+Shows a dialog to set the status message for all possible protocols
+Today only works if NAS is installed.
+
+wparam = 0
+lparam = (const char *) protocol name or NULL for all protocols
+returns: -2 if proto can't set this, -1 on protocol not found, else 0
+*/
+#define MS_MYDETAILS_SETMYSTATUSMESSAGEUI "MyDetails/SetMyStatusMessageUI"
+#define MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE 1024
+
+
+/*
+MyDetails/ShowNextProtocol service
+Shows the next protocol in the frame
+
+wparam = 0
+lparam = 0
+returns: -1 on error, 0 on success
+*/
+#define MS_MYDETAILS_SHOWNEXTPROTOCOL "MyDetails/ShowNextProtocol"
+
+
+/*
+MyDetails/ShowPreviousProtocol service
+Shows the previous protocol in the frame
+
+wparam = 0
+lparam = 0
+returns: -1 on error, 0 on success
+*/
+#define MS_MYDETAILS_SHOWPREVIOUSPROTOCOL "MyDetails/ShowPreviousProtocol"
+
+
+/*
+MyDetails/ShowProtocol service
+Shows a protocol given its name in the frame
+
+wparam = 0
+lparam = protocol name
+returns: -1 on error, 0 on success
+*/
+#define MS_MYDETAILS_SHOWPROTOCOL "MyDetails/ShowProtocol"
+
+
+/*
+MyDetails/CicleThroughtProtocols service
+Start/stops the cicling throught protocols
+
+wparam = FALSE to stop, TRUE to start
+lparam = 0
+returns: -1 on error, 0 on success
+*/
+#define MS_MYDETAILS_CYCLE_THROUGH_PROTOCOLS "MyDetails/CicleThroughtProtocols"
+
+
+/*
+MyDetails/ShowFrame service
+Shows the MyDetails frame/window if it is hidden
+
+wparam = 0
+lparam = 0
+returns: 0
+*/
+#define MS_MYDETAILS_SHOWFRAME "MyDetails/ShowFrame"
+
+
+/*
+MyDetails/HideFrame service
+Hides the MyDetails frame/window if it is shown
+
+wparam = 0
+lparam = 0
+returns: 0
+*/
+#define MS_MYDETAILS_HIDEFRAME "MyDetails/HideFrame"
+
+
+/*
+MyDetails/ShowHideMyDetails service
+Shows the MyDetails frame/window if it is hidden or hides the MyDetails frame/window if it is shown
+
+wparam = 0
+lparam = 0
+returns: 0
+*/
+#define MS_MYDETAILS_SHOWHIDEFRAME "MyDetails/ShowHideMyDetails"
+
+
+#endif
diff --git a/plugins/ExternalAPI/m_nconvers.h b/plugins/ExternalAPI/m_nconvers.h new file mode 100644 index 0000000000..873d2368c4 --- /dev/null +++ b/plugins/ExternalAPI/m_nconvers.h @@ -0,0 +1,22 @@ +#ifndef __m_nconvers_h__
+#define __m_nconvers_h__
+
+//replace smiley tags in a rich edit control...
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (NCONVERS_GETICON*) &ncgi;
+//return: TRUE if found, FALSE if not
+
+typedef struct
+{
+ int cbSize; // = sizeof(NCONVERS_GETSMILEY)
+ char* Protocolname; // NULL means 'default'
+ char* SmileySequence; // character string containing the smiley
+ HICON SmileyIcon; // RETURN VALUE: this is filled with the icon handle...
+ // do not destroy!
+ int Smileylength; //l ength of the smiley that is found.
+} NCONVERS_GETICON;
+
+#define MS_NCONVERS_GETSMILEYICON "nConvers/GetSmileyIcon"
+
+
+#endif // __m_nconvers_h__
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_notify.h b/plugins/ExternalAPI/m_notify.h new file mode 100644 index 0000000000..91c9bf4712 --- /dev/null +++ b/plugins/ExternalAPI/m_notify.h @@ -0,0 +1,178 @@ +#ifndef __m_notify_h__
+#define __m_notify_h__
+
+/*** Miranda Notify Dispatcher ************************************************\
+Notify Dispatcher provides common interface to different notification plugins
+like osd, popup, ticker etc.
+\******************************************************************************/
+
+/* Options UI event and service. The same as for miranda options */
+#define ME_NOTIFY_OPT_INITIALISE "Notify/Opt/Initialise"
+#define MS_NOTIFY_OPT_ADDPAGE "Notify/Opt/AddPage"
+
+#define UM_MNOTIFY_CHECK (WM_USER+100)
+
+typedef struct tagMNOTIFYACTIONINFO {
+ HICON icon;
+ char name[MAXMODULELABELLENGTH];
+ char service[MAXMODULELABELLENGTH];
+ DWORD cookie;
+} MNOTIFYACTIONINFO;
+
+// Just like miranda pluginLink... This should work faster then services,
+// we need some reactivity in notifications.
+typedef struct tagMNNOTIFYLINK
+{
+ /* Create a new notification type */
+ HANDLE (*Register)(const char *name, HICON icon);
+
+ // Create a new notification object
+ HANDLE (*Create)(HANDLE type);
+
+ // Check is handle is a valid notification object
+ int (*IsValid)(HANDLE notify);
+
+ // Set/get information about object, or type defaults
+ int (*Set)(HANDLE notifyORtype, const char *name, DBVARIANT val);
+ int (*Get)(HANDLE notifyORtype, const char *name, DBVARIANT *val);
+
+ // Set/get actions
+ int (*AddAction)(HANDLE notifyORtype, HICON icon, const char *name, const char *service, DWORD cookie);
+ int (*GetActions)(HANDLE notifyORtype, MNOTIFYACTIONINFO *actions); // pass NULL to get total number of actions
+
+ // Increment/decrement refer count of notification object. Unreferred objects are destroyed
+ int (*AddRef)(HANDLE notify);
+ int (*Release)(HANDLE notify);
+
+ // Notify user
+ void (*Show)(HANDLE notify);
+ void (*Update)(HANDLE notify);
+ void (*Remove)(HANDLE notify);
+} MNOTIFYLINK;
+
+// Get the MNOTIFYLINK struct
+// result = (LRESULT)(MNOTIFYLINK*)notifyLink
+#define MS_NOTIFY_GETLINK "Notify/GetLink"
+
+// Hook this to process corresponding actions
+#define ME_NOTIFY_SHOW "Notify/Show"
+#define ME_NOTIFY_UPDATE "Notify/Update"
+#define ME_NOTIFY_REMOVE "Notify/Remove"
+
+#if !defined(MNOTIFY_NOEXTERN)
+ extern
+ #ifdef __cpluplus
+ "C"
+ #endif
+ MNOTIFYLINK *notifyLink;
+#endif
+
+#if !defined(MNOTIFY_NOHELPERS) && !defined(MNOTIFY_NOEXTERN)
+ #define MNotifyRegister(a,b) (notifyLink?notifyLink->Register((a),(b)):0)
+ #define MNotifyCreate(a) (notifyLink?notifyLink->Create((a)):0)
+ #define MNotifyIsValid(a) (notifyLink?notifyLink->IsValid((a)):0)
+ #define MNotifySet(a,b,c) (notifyLink?notifyLink->Set((a),(b),(c)):0)
+ #define MNotifyGet(a,b,c) (notifyLink?notifyLink->Get((a),(b),(c)):0)
+ #define MNotifyAddAction(a,b,c) (notifyLink?notifyLink->AddAction((a),(b),(c)):0)
+ #define MNotifyGetActions(a,b) (notifyLink?notifyLink->GetActions((a),(b)):0)
+ #define MNotifyGet(a,b,c) (notifyLink?notifyLink->Get((a),(b),(c)):0)
+ #define MNotifyAddRef(a) (notifyLink?notifyLink->AddRef((a)):0)
+ #define MNotifyRelease(a) (notifyLink?notifyLink->Release((a)):0)
+ #define MNotifyShow(a) (notifyLink?notifyLink->Show(a):0)
+ #define MNotifyUpdate(a) (notifyLink?notifyLink->Update(a):0)
+ #define MNotifyRemove(a) (notifyLink?notifyLink->Remove(a):0)
+
+ static void __inline MNotifyGetLink()
+ {
+ notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK,0,0) : 0;
+ }
+
+ // get helpers
+ static __inline BYTE MNotifyGetByte(HANDLE notifyORtype, const char *name, BYTE defValue)
+ {
+ DBVARIANT dbv;
+ MNotifyGet(notifyORtype, name, &dbv);
+ if (dbv.type != DBVT_BYTE) return defValue;
+ return dbv.bVal;
+ }
+ static __inline WORD MNotifyGetWord(HANDLE notifyORtype, const char *name, WORD defValue)
+ {
+ DBVARIANT dbv;
+ MNotifyGet(notifyORtype, name, &dbv);
+ if (dbv.type != DBVT_WORD) return defValue;
+ return dbv.wVal;
+ }
+ static __inline DWORD MNotifyGetDWord(HANDLE notifyORtype, const char *name, DWORD defValue)
+ {
+ DBVARIANT dbv;
+ MNotifyGet(notifyORtype, name, &dbv);
+ if (dbv.type != DBVT_DWORD) return defValue;
+ return dbv.dVal;
+ }
+ static __inline const char *MNotifyGetString(HANDLE notifyORtype, const char *name, const char *defValue)
+ {
+ DBVARIANT dbv;
+ MNotifyGet(notifyORtype, name, &dbv);
+ if (dbv.type != DBVT_ASCIIZ) return defValue;
+ return dbv.pszVal;
+ }
+ static __inline const WCHAR *MNotifyGetWString(HANDLE notifyORtype, const char *name, const WCHAR *defValue)
+ {
+ DBVARIANT dbv;
+ MNotifyGet(notifyORtype, name, &dbv);
+ if (dbv.type != DBVT_WCHAR) return defValue;
+ return dbv.pwszVal;
+ }
+
+ // set helpers
+ static __inline void MNotifySetByte(HANDLE notifyORtype, const char *name, BYTE value)
+ {
+ DBVARIANT dbv;
+ dbv.type = DBVT_BYTE;
+ dbv.bVal = value;
+ MNotifySet(notifyORtype, name, dbv);
+ }
+ static __inline void MNotifySetWord(HANDLE notifyORtype, const char *name, WORD value)
+ {
+ DBVARIANT dbv;
+ dbv.type = DBVT_WORD;
+ dbv.wVal = value;
+ MNotifySet(notifyORtype, name, dbv);
+ }
+ static __inline void MNotifySetDWord(HANDLE notifyORtype, const char *name, DWORD value)
+ {
+ DBVARIANT dbv;
+ dbv.type = DBVT_DWORD;
+ dbv.dVal = value;
+ MNotifySet(notifyORtype, name, dbv);
+ }
+ static __inline void MNotifySetString(HANDLE notifyORtype, const char *name, const char *value)
+ {
+ DBVARIANT dbv;
+ dbv.type = DBVT_ASCIIZ;
+ dbv.pszVal = (char *)value;
+ MNotifySet(notifyORtype, name, dbv);
+ }
+ static __inline void MNotifySetWString(HANDLE notifyORtype, const char *name, const WCHAR *value)
+ {
+ DBVARIANT dbv;
+ dbv.type = DBVT_WCHAR;
+ dbv.pwszVal = (WCHAR *)value;
+ MNotifySet(notifyORtype, name, dbv);
+ }
+#endif
+
+// Common options for Get/Set actions
+#define NFOPT_TYPENAME "General/TypeName"
+#define NFOPT_ICON "General/Icon"
+#define NFOPT_CONTACT "General/Contact"
+#define NFOPT_EVENT "General/Event"
+#define NFOPT_TEXT "General/Text"
+#define NFOPT_TEXTW "General/TextW"
+#define NFOPT_TITLE "General/Title"
+#define NFOPT_TITLEW "General/TitleW"
+#define NFOPT_BACKCOLOR "General/BackColor"
+#define NFOPT_TEXTCOLOR "General/TextColor"
+#define NFOPT_TIMEOUT "General/Timeout"
+
+#endif // __m_notify_h__
diff --git a/plugins/ExternalAPI/m_notify_popup.h b/plugins/ExternalAPI/m_notify_popup.h new file mode 100644 index 0000000000..88b6633b5b --- /dev/null +++ b/plugins/ExternalAPI/m_notify_popup.h @@ -0,0 +1,29 @@ +#ifndef __m_notify_popup_h__
+#define __m_notify_popup_h__
+
+#define NFOPT_POPUP2_BACKCOLOR "Popup2/BackColor"
+#define NFOPT_POPUP2_TEXTCOLOR "Popup2/TextColor"
+#define NFOPT_POPUP2_TIMEOUT "Popup2/Timeout"
+#define NFOPT_POPUP2_LCLICKSVC "Popup2/LClickSvc"
+#define NFOPT_POPUP2_LCLICKCOOKIE "Popup2/LClickCookie"
+#define NFOPT_POPUP2_RCLICKSVC "Popup2/RClickSvc"
+#define NFOPT_POPUP2_RCLICKCOOKIE "Popup2/RClickCookie"
+#define NFOPT_POPUP2_STATUSMODE "Popup2/StatusMode"
+#define NFOPT_POPUP2_PLUGINDATA "Popup2/PluginData"
+#define NFOPT_POPUP2_WNDPROC "Popup2/WndProc"
+
+#define NFOPT_POPUP2_BACKCOLOR_S "Popup2/BackColor/Save"
+#define NFOPT_POPUP2_TEXTCOLOR_S "Popup2/TextColor/Save"
+#define NFOPT_POPUP2_TIMEOUT_S "Popup2/Timeout/Save"
+
+#define MS_POPUP2_SHOW "Popup2/Show"
+#define MS_POPUP2_UPDATE "Popup2/Update"
+#define MS_POPUP2_REMOVE "Popup2/Remove"
+
+#ifndef POPUP2_NOHELPERS
+ #define MPopup2Show(a) (CallService(MS_POPUP2_SHOW, 0, (LPARAM)(a)))
+ #define MPopup2Update(a) (CallService(MS_POPUP2_UPDATE, 0, (LPARAM)(a)))
+ #define MPopup2Remove(a) (CallService(MS_POPUP2_REMOVE, 0, (LPARAM)(a)))
+#endif
+
+#endif // __m_notify_popup_h__
diff --git a/plugins/ExternalAPI/m_nudge.h b/plugins/ExternalAPI/m_nudge.h new file mode 100644 index 0000000000..e80215e572 --- /dev/null +++ b/plugins/ExternalAPI/m_nudge.h @@ -0,0 +1,10 @@ +#define MS_SHAKE_CLIST "SHAKE/Service/ShakeClist"
+#define MS_SHAKE_CHAT "SHAKE/Service/ShakeChat"
+#define MS_NUDGE_SEND "NUDGE/Send"
+
+// Hide or Show the context menu "send nudge"
+// wParam = char *szProto
+// lParam = BOOL show
+#define MS_NUDGE_SHOWMENU "NudgeShowMenu"
+
+#define MUUID_NUDGE_SEND { 0x9c66a9a, 0x57dc, 0x454d, { 0xa9, 0x30, 0xf8, 0xc0, 0x4f, 0xe2, 0x98, 0x38 } }
diff --git a/plugins/ExternalAPI/m_png.h b/plugins/ExternalAPI/m_png.h new file mode 100644 index 0000000000..46ff96ec2c --- /dev/null +++ b/plugins/ExternalAPI/m_png.h @@ -0,0 +1,64 @@ +/*
+Plugin of Miranda IM for reading/writing PNG images.
+Copyright (c) 2004-6 George Hazan (ghazan@postman.ru)
+
+Portions of this code are gotten from the libpng codebase.
+Copyright 2000, Willem van Schaik. For conditions of distribution and
+use, see the copyright/license/disclaimer notice in png.h
+
+Miranda IM: the free icq client for MS Windows
+Copyright (C) 2000-2002 Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+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.
+
+File name : $Source: /cvsroot/miranda/miranda/plugins/png2dib/m_png.h,v $
+Revision : $Revision: 3502 $
+Last change on : $Date: 2006-08-15 23:21:49 +0200 (Di, 15 Aug 2006) $
+Last change by : $Author: ghazan $
+
+*/
+
+/* Image/Dib2Png
+Converts a Device Independent Bitmap to a png stored in memory
+ wParam=0
+ lParam=(WPARAM)(DIB2PNG*)descr
+*/
+
+typedef struct
+{
+ BITMAPINFO* pbmi;
+ BYTE* pDiData;
+ BYTE* pResult;
+ long* pResultLen;
+}
+ DIB2PNG;
+
+#define MS_DIB2PNG "Image/Dib2Png"
+
+/* Image/Png2Dib
+Converts a png stored in memory to a Device Independent Bitmap
+ wParam=0
+ lParam=(WPARAM)(PNG2DIB*)descr
+*/
+
+typedef struct
+{
+ BYTE* pSource;
+ DWORD cbSourceSize;
+ BITMAPINFOHEADER** pResult;
+}
+ PNG2DIB;
+
+#define MS_PNG2DIB "Image/Png2Dib"
diff --git a/plugins/ExternalAPI/m_popup2.h b/plugins/ExternalAPI/m_popup2.h new file mode 100644 index 0000000000..cec5abb395 --- /dev/null +++ b/plugins/ExternalAPI/m_popup2.h @@ -0,0 +1,457 @@ +/*
+===============================================================================
+ PopUp plugin
+Plugin Name: PopUp
+Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
+ Victor Pavlychko (nullbie@gmail.com)
+===============================================================================
+The purpose of this plugin is to give developers a common "platform/interface"
+to show PopUps. It is born from the source code of NewStatusNotify, another
+plugin I've made.
+
+Remember that users *must* have this plugin enabled, or they won't get any
+popup. Write this in the requirements, do whatever you wish ;-)... but tell
+them!
+===============================================================================
+*/
+
+#ifndef __m_popup2_h__
+#define __m_popup2_h__
+
+#ifndef POPUP_VERSION
+#define POPUP_VERSION 0x02010003
+#endif
+
+#define MAX_ACTIONTITLE 64
+
+// Popup Action flags
+#define PAF_ENABLED 0x01 // Actions is enabled. You may store one global
+ // action set and toggle some items depending on
+ // popup you are requesting
+
+// ANSI Popup Action
+typedef struct
+{
+ int cbSize; // sizeof(POPUPACTION)
+ HICON lchIcon; // Action Icon
+ // Action title text. Please use module name as prefix
+ // (e.g. "Popup Plus/Dismiss Popup") and don't translate
+ // This is translates by popup. So no unicode.
+ char lpzTitle[MAX_ACTIONTITLE];
+ DWORD flags; // set of PAF_* flags
+ WPARAM wParam; // wParam for UM_POPUPACTION message
+ LPARAM lParam; // lParam for UM_POPUPACTION message
+} POPUPACTION, *LPPOPUPACTION;
+
+///////////////////////////////////////////////////////////////
+// Few notes about new popup api
+// ------------------------------
+// When you call any ADD service, Popup Plus creates local
+// copy of POPUPDATA2 to store the data. Each time you call
+// CHANGE service this data is updated. You can use the
+// MS_POPUP_GETDATA2 service to retrieve Popups's copy of
+// this data, however you MUST NOT chahge that.
+
+// unicode or ansi mode
+#define PU2_ANSI 0x00
+#define PU2_UNICODE 0x01
+#if defined(UNICODE) || defined(_UNICODE)
+ #define PU2_TCHAR PU2_UNICODE
+#else
+ #define PU2_TCHAR PU2_ANSI
+#endif
+
+#define PU2_CUSTOM_POPUP 0x02
+
+typedef struct
+{
+ // general
+ int cbSize;
+ DWORD flags;
+
+ // miranda bindings
+ HANDLE lchContact;
+ HANDLE lchEvent;
+
+ // style
+ COLORREF colorBack;
+ COLORREF colorText;
+ HICON lchIcon;
+ HBITMAP hbmAvatar;
+ union
+ {
+ char *lpzTitle;
+ WCHAR *lpwzTitle;
+ TCHAR *lptzTitle;
+ };
+ union
+ {
+ char *lpzText;
+ WCHAR *lpwzText;
+ TCHAR *lptzText;
+ };
+ char *lpzSkin;
+
+ // time and timeout
+ int iSeconds;
+ DWORD dwTimestamp;
+
+ // plugin bindings
+ WNDPROC PluginWindowProc;
+ void *PluginData;
+
+ // popup actions
+ int actionCount;
+ POPUPACTION *lpActions;
+
+ HANDLE lchNotification;
+} POPUPDATA2, *LPPOPUPDATA2;
+
+// Creates new popup
+// wParam = (WPARAM)(LPPOPUPDATA2)&ppd2
+// lParam = (LPARAM)(combination of APF_* flags)
+// returns: window handle (if requested) of NULL on success, -1 on failure.
+#define MS_POPUP_ADDPOPUP2 "Popup/AddPopup2"
+
+// Update an popup
+// wParam = (WPARAM)(HWND)hwndPopup
+// lParam = (LPARAM)(LPPOPUPDATA2)&ppd2
+// returns: zero on success, -1 on failure.
+#define MS_POPUP_CHANGEPOPUP2 "Popup/ChangePopup2"
+
+// deprecatet !!! (only for compatibility) use new POPUPDATA2 struct for extended popup
+// Extended popup data V2 (ansi version)
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ char lptzContactName[MAX_CONTACTNAME];
+ char lpzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ char lptzText[MAX_SECONDLINE];
+ char lpzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds; // Custom delay time in seconds. -1 means "forever", 0 means "default time".
+ // +2.1.0.3
+ // you *MUST* pass APF_NEWDATA flag for services to take care of this data
+ HANDLE hNotification; // Reserved. Must be NULL
+ int actionCount; // Amount of passed actions
+ LPPOPUPACTION lpActions; // Popup Actions
+ int cbSize; // struct size for future
+} POPUPDATAEX_V2, *LPPOPUPDATAEX_V2;
+
+// deprecatet !!! (only for compatibility) use new POPUPDATA2 struct for extended popup
+// Unicode version of POPUPDATAEX_V2
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ WCHAR lptzContactName[MAX_CONTACTNAME];
+ WCHAR lpwzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ WCHAR lptzText[MAX_SECONDLINE];
+ WCHAR lpwzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds;
+ // +2.1.0.3
+ // you *MUST* pass APF_NEWDATA flag for services to take care of this data
+ HANDLE hNotification;
+ int actionCount;
+ LPPOPUPACTION lpActions;
+ int cbSize;
+} POPUPDATAW_V2, *LPPOPUPDATAW_V2;
+
+// deprecatet !!! (only for compatibility) use new POPUPDATA2 struct for extended popup
+#if defined(_UNICODE) || defined(UNICODE)
+ typedef POPUPDATAW_V2 POPUPDATAT_V2;
+ typedef LPPOPUPDATAW_V2 LPPOPUPDATAT_V2;
+#else
+ typedef POPUPDATAEX_V2 POPUPDATAT_V2;
+ typedef LPPOPUPDATAEX_V2 LPPOPUPDATAT_V2;
+#endif
+
+/* PopUp/AddPopup
+Creates, adds and shows a popup, given a (valid) POPUPDATA structure pointer.
+
+wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
+lParam = 0
+
+Returns: > 0 on success, 0 if creation went bad, -1 if the PopUpData contained unacceptable values.
+NOTE: it returns -1 if the PopUpData was not valid, if there were already too many popups, if the module was disabled.
+Otherwise, it can return anything else...
+
+Popup Plus 2.0.4.0+
+You may pass additional creation flags via lParam:
+/* core define see miranda\include\m_popup.h
+ APF_RETURN_HWND ....... function returns handle to newly created popup window (however this calls are a bit slower)
+ APF_CUSTOM_POPUP ...... new popup is created in hidden state and doesn't obey to popup queue rules.
+ you may control it via UM_* messages and custom window procedure (not yet implemented)
+additional APF_ flags */
+#define APF_NO_HISTORY 0x04 //do not log this popup in popup history (useful for previews)
+#define APF_NO_POPUP 0x08 //do not show popup. this is useful if you want popup yo be stored in history only
+#define APF_NEWDATA 0x10 //deprecatet!! only for use with old POPUPDATAEX_V2/POPUPDATAW_V2 structs
+
+//overload function for POPUPDATAEX_V2/POPUPDATAW_V2
+static INT_PTR __inline PUAddPopUpEx(POPUPDATAEX_V2* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
+}
+
+static INT_PTR __inline PUAddPopUpW(POPUPDATAW_V2* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp,0);
+}
+
+static int __inline PUChange(HWND hWndPopUp, POPUPDATAEX_V2 *newData) {
+ return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+#define MS_POPUP_CHANGEW "PopUp/ChangeW"
+static int __inline PUChangeW(HWND hWndPopUp, POPUPDATAW_V2 *newData) {
+ return (int)CallService(MS_POPUP_CHANGEW, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+/* UM_CHANGEPOPUP
+This message is triggered by Change/ChangeText services. You also may post it directly, but make
+sure you allocate memory via miranda mmi, because popup will mir_free() them!
+
+wParam = Modification type
+lParam = value of type defined by wParam
+
+/* core define see miranda\include\m_popup.h
+#define CPT_TEXT 1 // lParam = (char *)text
+#define CPT_TEXTW 2 // lParam = (WCHAR *)text
+#define CPT_TITLE 3 // lParam = (char *)title
+#define CPT_TITLEW 4 // lParam = (WCHAR *)title
+#define CPT_DATA 5 // lParam = (POPUPDATA *)data
+#define CPT_DATAEX 6 // lParam = (POPUPDATAEX *) or (POPUPDATAEX_V2 *)data see CPT_DATA2
+#define CPT_DATAW 7 // lParam = (POPUPDATAW *) or (POPUPDATAW_V2 *)data see CPT_DATA2
+additional CPT_ flag*/
+#define CPT_DATA2 8 // lParam = (POPUPDATA2 *)data -- see m_popup2.h for details
+
+/* UM_POPUPACTION
+Popup Action notification
+
+wParam and lParam are specified bu plugin.
+wParam = 0 is used buy popup plus internally!
+*/
+
+#define UM_POPUPACTION (WM_USER + 0x0204)
+
+/* UM_POPUPMODIFYACTIONICON
+Modify Popup Action Icon
+
+wParam = (WPARAM)(LPPOPUPACTIONID)&actionId
+lParam = (LPARAM)(HICON)hIcon
+*/
+
+typedef struct
+{
+ WPARAM wParam;
+ LPARAM lParam;
+} POPUPACTIONID, *LPPOPUPACTIONID;
+
+#define UM_POPUPMODIFYACTIONICON (WM_USER + 0x0205)
+static int __inline PUModifyActionIcon(HWND hWndPopUp, WPARAM wParam, LPARAM lParam, HICON hIcon) {
+ POPUPACTIONID actionId = { wParam, lParam };
+ return (int)SendMessage(hWndPopUp, UM_POPUPMODIFYACTIONICON, (WPARAM)&actionId, (LPARAM)hIcon);
+}
+
+/* UM_POPUPSHOW
+Show popup at position
+
+wParam = x
+lParam = y
+*/
+#define UM_POPUPSHOW (WM_USER + 0x0206)
+
+/* PopUp/RegisterActions
+Registers your action in popup action list
+
+wParam = (WPARAM)(LPPOPUPACTION)actions
+lParam = (LPARAM)actionCount
+
+Returns: 0 if the popup was shown, -1 in case of failure.
+*/
+#define MS_POPUP_REGISTERACTIONS "PopUp/RegisterActions"
+
+static int __inline PURegisterActions(LPPOPUPACTION actions, int count) {
+ return (int)CallService(MS_POPUP_REGISTERACTIONS, (WPARAM)actions,(LPARAM)count);
+}
+
+/* PopUp/RegisterNotification
+Registers your action in popup action list
+
+wParam = (WPARAM)(LPPOPUPNOTIFICATION)info
+lParam = 0
+
+Returns: handle of registered notification or sero on failure
+*/
+#define MS_POPUP_REGISTERNOTIFICATION "PopUp/RegisterNotification"
+
+#define PNAF_CALLBACK 0x01
+
+#define POPUP_ACTION_NOTHING "Do nothing"
+#define POPUP_ACTION_DISMISS "Dismiss popup"
+
+typedef struct
+{
+ char lpzTitle[64];
+ DWORD dwFlags;
+ union
+ {
+ struct
+ {
+ char lpzLModule[MAXMODULELABELLENGTH];
+ char lpzLSetting[MAXMODULELABELLENGTH];
+ DBVARIANT dbvLData;
+ char lpzRModule[MAXMODULELABELLENGTH];
+ char lpzRSetting[MAXMODULELABELLENGTH];
+ DBVARIANT dbvRData;
+ };
+ struct
+ {
+ DWORD dwCookie;
+ void (*pfnCallback)(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, DWORD cookie);
+ };
+ };
+} POPUPNOTIFYACTION, *LPPOPUPNOTIFYACTION;
+
+#define PNF_CONTACT 0x01
+
+typedef struct
+{
+ int cbSize;
+ DWORD dwFlags; // set of PNF_* flags
+ char lpzGroup[MAXMODULELABELLENGTH];
+ char lpzName[MAXMODULELABELLENGTH];
+ HICON lchIcon; // this will be registered in icolib
+ COLORREF colorBack; // this will be registered in fontservice
+ COLORREF colorText; // this will be registered in fontservice
+ int iSeconds; // default timeout
+ int actionCount; // for unified action comboboxes
+ LPPOPUPNOTIFYACTION lpActions;
+ char *lpzLAction;
+ char *lpzRAction;
+ char *pszReserved1; // reserved for future use
+ DLGPROC pfnReserved2; // reserved for future use
+} POPUPNOTIFICATION, *LPPOPUPNOTIFICATION;
+
+static HANDLE __inline PURegisterNotification(LPPOPUPNOTIFICATION notification) {
+ return (HANDLE)CallService(MS_POPUP_REGISTERNOTIFICATION, (WPARAM)notification, (LPARAM)0);
+}
+
+/* PopUp/UnhookEventAsync
+Using of "UnhookEvent" inside PluginWindowProc in conjunction with HookEventMessage
+may cause deadlocks. Use this service instead. It will queue event unhook into main
+thread and notify you when everything has finished.
+
+Deadlock scenario:
+ 1. Event is fired with NotifyEventHooks in the main thread
+ 2. Miranda core calls EnterCriticalSection(csHooks) and starts notifications
+ 3. You decide to unhook event, therefore call UnhookEvent
+ 4. Miranda core *INSIDE YOUR THREAD* calls EnterCriticalSection(csHooks) and
+ waits for main thread to finish processing
+ 5. Main thread calls SendMessage(hwnd, ...) to notify your window
+ 6. Your window's thread is busy waiting for main thread to leave critical section
+ 7. deadlock....
+
+wParam = (WPARAM)(HWND)hwndPopup
+lParam = (LPARAM)(HANDLE)hEvent
+
+Returns: 0 if everything gone ok. -1 if service was not found (and unsafe unhook was performed)
+*/
+
+#define MS_POPUP_UNHOOKEVENTASYNC "PopUp/UnhookEventAsync"
+
+/* UM_POPUPUNHOOKCOMPLETE
+Modify Popup Action Icon
+
+wParam = 0
+lParam = (LPARAM)(HANDLE)hEventUnhooked
+*/
+#define UM_POPUPUNHOOKCOMPLETE (WM_USER + 0x0206)
+
+static int __inline PUUnhookEventAsync(HWND hwndPopup, HANDLE hEvent) {
+ if (ServiceExists(MS_POPUP_UNHOOKEVENTASYNC))
+ return (int)CallService(MS_POPUP_UNHOOKEVENTASYNC, (WPARAM)hwndPopup,(LPARAM)hEvent);
+
+ // old popup plugins: unhook service not found
+ UnhookEvent(hEvent);
+ PostMessage(hwndPopup, UM_POPUPUNHOOKCOMPLETE, 0, (LPARAM)hEvent);
+ return 0;
+}
+
+/* PopUp/GetStatus
+Returns 1 when popups are showen and 0 when not
+wParam = 0
+lParam = 0
+*/
+#define MS_POPUP_GETSTATUS "PopUp/GetStatus"
+
+#ifdef __cplusplus
+/* PopUp/RegisterVfx
+Register new animation (fade in/out) effect
+wParam = 0
+lParam = (LPARAM)(char *)vfx_name
+*/
+
+#define MS_POPUP_REGISTERVFX "PopUp/RegisterVfx"
+
+/* PopUp/Vfx/<vfx_name>
+Define this service to create vfx instance
+wParam = 0
+lParam = 0
+return = (int)(IPopupPlusEffect *)vfx
+*/
+
+#define MS_POPUP_CREATEVFX "PopUp/Vfx/"
+
+class IPopupPlusEffect
+{
+public:
+ virtual void beginEffect(int w, int h, int alpha0, int alpha1, int frameCount) = 0;
+ virtual void beginFrame(int frame) = 0;
+ virtual int getPixelAlpha(int x, int y) = 0;
+ virtual void endFrame() = 0;
+ virtual void endEffect() = 0;
+ virtual void destroy() = 0;
+};
+#endif // __cplusplus
+
+
+/* PopUp/ShowMessage
+This is mainly for developers.
+Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal
+window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
+
+wParam = (char *)lpzMessage
+lParam = 0;
+
+Returns: 0 if the popup was shown, -1 in case of failure.
+
+/* core define see miranda\include\m_popup.h
+#define SM_WARNING 0x01 //Triangle icon.
+#define SM_NOTIFY 0x02 //Exclamation mark icon.
+additional SM_ flags */
+#define SM_ERROR 0x03 //Cross icon.
+#ifndef MS_POPUP_SHOWMESSAGE
+#define MS_POPUP_SHOWMESSAGE "PopUp/ShowMessage"
+#define MS_POPUP_SHOWMESSAGEW "PopUp/ShowMessageW"
+#endif
+
+#endif // __m_popup2_h__
diff --git a/plugins/ExternalAPI/m_proto_listeningto.h b/plugins/ExternalAPI/m_proto_listeningto.h new file mode 100644 index 0000000000..66d3b77f20 --- /dev/null +++ b/plugins/ExternalAPI/m_proto_listeningto.h @@ -0,0 +1,143 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2006 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+*/
+
+//this module was created in v0.6.0.0
+
+#ifndef M_PROTO_LISTENINGTO_H__
+#define M_PROTO_LISTENINGTO_H__ 1
+
+
+// Protocol Services /////////////////////////////////////////////////////////////////
+
+// This is the services a protocol have to support to support listening info
+
+typedef struct {
+ int cbSize;
+
+ union {
+ char* pszType; // Media type: Music, Video, etc...
+ TCHAR* ptszType;
+ };
+ union {
+ char* pszArtist; // Artist name
+ TCHAR* ptszArtist;
+ };
+ union {
+ char* pszAlbum; // Album name
+ TCHAR* ptszAlbum;
+ };
+ union {
+ char* pszTitle; // Song name
+ TCHAR* ptszTitle;
+ };
+ union {
+ char* pszTrack; // Track number
+ TCHAR* ptszTrack;
+ };
+ union {
+ char* pszYear; // Song year
+ TCHAR* ptszYear;
+ };
+ union {
+ char* pszGenre; // Song genre
+ TCHAR* ptszGenre;
+ };
+ union {
+ char* pszLength; // Song length
+ TCHAR* ptszLength;
+ };
+ union {
+ char* pszPlayer; // Player name
+ TCHAR* ptszPlayer;
+ };
+
+ DWORD dwFlags;
+
+} LISTENINGTOINFO;
+
+#define LTI_UNICODE 1
+
+#ifdef UNICODE
+ #define LTI_TCHAR LTI_UNICODE
+#else
+ #define LTI_TCHAR 0
+#endif
+
+// Set the listening info for the protocol.
+// Pass NULL to remove it.
+// wParam = NULL
+// lParam = LISTENINGTOINFO *
+#define PS_SET_LISTENINGTO "/SetListeningTo"
+
+// Get the listening info for the protocol
+// wParam = NULL
+// lParam = LISTENINGTOINFO *
+// The strings inside the struct need to be free using miranda free.
+#define PS_GET_LISTENINGTO "/GetListeningTo"
+
+// Also the protocol have to save a string with the text the other user is (probabily)
+// seeing under the main db key: <protocol>/ListeningTo
+
+// For a contact, the protocol should store the listening info as an string inside
+// the contact db key: <protocol>/ListeningTo
+
+
+// ListeningTo configuration plugin //////////////////////////////////////////////////
+
+// One plugin can be used to set some options relative to the listening to information.
+// But protocols should not assume this plugin exists. If it does not exist, protocols
+// have to decide what default to use.
+// This plugin have to support the following services:
+
+// Get the text format the user wants him / his contacts to see. Some strings represents
+// the text information:
+// %artist%, %album%, %title%, %track%, %year%, %genre%, %length%, %player%, %type%
+// This service is optional
+// wParam = TCHAR* - default text for this protocol
+// lParam = 0
+// Returns a TCHAR* containg the user setting. This need to be free using miranda free.
+#define MS_LISTENINGTO_GETTEXTFORMAT "ListeningTo/GetTextFormat"
+
+// Get the text the user wants him / his contacts to see, parsed with the info sent to
+// this service. Uses the same variables as the above service to the default text.
+// wParam = TCHAR* - default text for this protocol
+// lParam = LISTENINGTOINFO *
+// Returns a TCHAR* containg the parsed text. This need to be free using miranda free.
+#define MS_LISTENINGTO_GETPARSEDTEXT "ListeningTo/GetParsedText"
+
+// Get if the contact options about how to show the music info should be overriten or
+// not.
+// wParam = NULL
+// lParam = hContact
+// Returns a BOOL
+#define MS_LISTENINGTO_OVERRIDECONTACTOPTION "ListeningTo/OverrideContactOption"
+
+// Get the text to show if some info of the contact is empty.
+// wParam = NULL
+// lParam = NULL
+// Returns a TCHAR *. Don't free
+#define MS_LISTENINGTO_GETUNKNOWNTEXT "ListeningTo/GetUnknownText"
+
+
+#endif // M_PROTO_LISTENINGTO_H__
+
diff --git a/plugins/ExternalAPI/m_protoplugin.h b/plugins/ExternalAPI/m_protoplugin.h new file mode 100644 index 0000000000..ae5dd0f5ab --- /dev/null +++ b/plugins/ExternalAPI/m_protoplugin.h @@ -0,0 +1,389 @@ +#ifndef __M_PROTOPLUGIN_H
+#define __M_PROTOPLUGIN_H
+
+#include <windows.h>
+#include "m_account.h" //for account import functions
+#include "m_mails.h" //for mail import functions
+
+//
+//================================== OTHER DEFINITIONS ========================================
+//
+
+//structure is used to give parameters to Check, Synchro or Timeout function
+struct CheckParam
+{
+//Your plugin should use this definition
+#define YAMN_CHECKVERSION 2
+//Version of this structure. Please verify your version in your plugin
+ DWORD Ver;
+//Event that new Check thread must set to signal calling thread that "I've copied all parameters from stack"
+//IMPORTANT!!!: Although version #defined in your plugin is not the same, your plugin MUST signal this event
+//in any way. YAMN is waiting for this event. If you do not signal it, YAMN is blocked.
+ HANDLE ThreadRunningEV;
+//ActualAccount- the only parameter used in Check function and should contain all needed information I think :)
+ HACCOUNT AccountParam;
+
+//I thought it, but this is needed, too
+#define YAMN_NORMALCHECK 0
+#define YAMN_FORCECHECK 1
+ DWORD Flags;
+
+//YAMN writes here some informations that are needed to pass to mail browser function (or bad connection)
+ void *BrowserParam;
+//Calling thread (protocol plugin) can write here its own parameters. Usefull when protocol calls its own check function. YAMN always sets this parameter to NULL
+ void *CustomParam;
+};
+
+//structure is used to give parameters to DeleteMails function
+struct DeleteParam
+{
+//Your plugin should use this definition
+#define YAMN_DELETEVERSION 1
+//Version of this structure. Please verify your version in your plugin
+ DWORD Ver;
+//Event that new Delete thread must set to signal calling thread that it copied all parameters from stack
+//IMPORTANT!!!: Although version #defined in your plugin is not the same, your plugin MUST signal this event
+//in any way. YAMN is waiting for this event. If you do not signal it, YAMN is blocked.
+ HANDLE ThreadRunningEV;
+//ActualAccount- which account to delete
+ HACCOUNT AccountParam;
+//YAMN writes here some informations that are needed to pass to mail browser function (or bad connection or no new mail)
+ void *BrowserParam;
+//Calling thread can write here its own parameter. Usefull when protocol calls its own delete function. YAMN always sets this parameter to NULL
+ void *CustomParam;
+};
+
+//
+//================================== IMPORTED FUNCTIONS ==================================
+//
+
+#ifndef YAMN_STANDARDFCN
+typedef DWORD (WINAPI *YAMN_STANDARDFCN)(LPVOID);
+#endif
+typedef struct CYAMNVariables *(WINAPI *YAMN_GETVARIABLESFCN)(DWORD);
+typedef HACCOUNT (WINAPI *YAMN_NEWACCOUNTFCN)(struct CYAMNProtoPlugin *,DWORD);
+typedef void (WINAPI *YAMN_STOPACCOUNTFCN)(HACCOUNT);
+typedef void (WINAPI *YAMN_DELETEACCOUNTFCN)(HACCOUNT);
+typedef DWORD (WINAPI *YAMN_WRITEPLUGINOPTS)(HANDLE File,HACCOUNT);
+typedef DWORD (WINAPI *YAMN_READPLUGINOPTS)(HACCOUNT,TCHAR **,TCHAR *);
+typedef DWORD (WINAPI *YAMN_CHECKFCN)(struct CheckParam *);
+typedef DWORD (WINAPI *YAMN_DELETEFCN)(struct DeleteParam *);
+typedef WCHAR* (WINAPI *YAMN_GETERRORSTRINGWFCN)(DWORD);
+typedef char* (WINAPI *YAMN_GETERRORSTRINGAFCN)(DWORD);
+typedef void (WINAPI *YAMN_DELETEERRORSTRINGFCN)(LPVOID);
+typedef DWORD (WINAPI *YAMN_WRITEACCOUNTSFCN)();
+
+typedef struct CAccountImportFcn
+{
+//If changes are made in this structure, version is changed.
+//So then YAMN does not initialize your structure, if version does not match.
+#define YAMN_PROTOIMPORTFCNVERSION 3
+
+//Note: not all of these functions are needed to be implemented in your protocol plugin. Those
+//functions, which are not implemented, you have to set to NULL.
+
+//Function is called to construct protocol defined account
+//This is VERY IMPORTANT for YAMN and plugin to cooperate:
+//Imagine following situation. YAMN wants to add new account (it is possible e.g.
+//when loading accounts from file), so it has to call protocol constructor.
+//It calls NewAccount function and plugin creates new account and returns
+//its handle (pointer in fact). That means new account is created with plugin features
+//(it is created inherited account, not base class).
+ YAMN_NEWACCOUNTFCN NewAccountFcnPtr;
+
+//Function is called to delete protocol defined variables to inherited CAccount structure
+ YAMN_DELETEACCOUNTFCN DeleteAccountFcnPtr;
+
+//Function is called when user requests not tu run account longer. (E.g. when closing Miranda)
+ YAMN_STOPACCOUNTFCN StopAccountFcnPtr;
+
+//Function is called when plugin should write its own info into book file
+ YAMN_WRITEPLUGINOPTS WritePluginOptsFcnPtr;
+
+//Function is called when plugin should read its own info from book file
+ YAMN_READPLUGINOPTS ReadPluginOptsFcnPtr;
+
+//Function is called to synchronise account (delete old mails and get the new ones)
+ YAMN_CHECKFCN SynchroFcnPtr;
+
+//Function is called when timer timed out- it can be the same as SynchroFcnPtr
+ YAMN_CHECKFCN TimeoutFcnPtr;
+
+//Function is called when forced checking- it can be the same as SynchroFcnPtr
+ YAMN_CHECKFCN ForceCheckFcnPtr;
+
+//Function is called when user wants to delete mails
+ YAMN_DELETEFCN DeleteMailsFcnPtr;
+
+//Function is called when YAMN wants to get error description. Note the parameter given in
+//this function is in fact the same as your CheckFcnPtr, DeleteMailsFcnPtr etc. returns to YAMN.
+//If you want, you may return pointer to some structure, which includes more information about
+//error than only one DWORD. And then, you can in your function create Unicode string containing
+//all your error code. YAMN copies this string into its own buffer. Your error code and pointer
+//can be deleted in DeleteErrorStringFcnPtr, which is called by YAMN
+ YAMN_GETERRORSTRINGWFCN GetErrorStringWFcnPtr;
+
+//This is the same as previous one, but plugin returns normal string (not Unicode). YAMN first
+//looks, if your plugin has implemented GetErrorStringWFcnPtr. If not, it looks for this function
+//So as you (of course) wait, you implemnt only one of these functions or no one of them.
+ YAMN_GETERRORSTRINGAFCN GetErrorStringAFcnPtr;
+
+//Deletes error string that was allocated in your GetErrorStringXFcnPtr. Parameter to this fcn is
+//Unicode or normal string. Therefore parameter is defined as LPVOID, but your plugin knows if it is
+//Unicode or not...
+//If NULL, YAMN does nothing with string
+ YAMN_DELETEERRORSTRINGFCN DeleteErrorStringFcnPtr;
+
+//Function is called to notify plugin, that it is quite good to store account status (and mails)
+ YAMN_WRITEACCOUNTSFCN WriteAccountsFcnPtr;
+
+//Function is called when user wants to view mails
+//not used now, in the future
+ YAMN_STANDARDFCN ViewMailsFcnPtr;
+
+//Function is called when application exits. Plugin should unload
+ YAMN_STANDARDFCN UnLoadFcn;
+} YAMN_PROTOIMPORTFCN, *PYAMN_PROTOIMPORTFCN;
+
+typedef HYAMNMAIL (WINAPI *YAMN_NEWMAILFCN)(HACCOUNT,DWORD);
+typedef void (WINAPI *YAMN_DELETEMAILFCN)(HYAMNMAIL);
+typedef DWORD (WINAPI *YAMN_WRITEMAILOPTS)(HANDLE File,HYAMNMAIL);
+typedef DWORD (WINAPI *YAMN_READMAILOPTS)(HYAMNMAIL,TCHAR **,TCHAR *);
+
+typedef struct CMailImportFcn
+{
+//If changes are made in this structure, version is changed.
+//So then YAMN does not initialize your structure, if version does not match.
+#define YAMN_MAILIMPORTFCNVERSION 1
+
+//Note: not all of these functions are needed to be implemented in your protocol plugin. Those
+//functions, which are not implemented, you have to set to NULL.
+
+//Function is called to construct protocol defined account
+//This is VERY IMPORTANT for YAMN and plugin to cooperate:
+//Imagine following situation. YAMN wants to add new account (it is possible e.g.
+//when loading accounts from file), so it has to call protocol constructor.
+//It calls NewAccount function and plugin creates new account and returns
+//its handle (pointer in fact). That means new account is created with plugin features
+//(it is created inherited account, not base class).
+ YAMN_NEWMAILFCN NewMailFcnPtr;
+
+//Function is called to delete protocol defined variables to inherited CAccount structure
+ YAMN_DELETEMAILFCN DeleteMailFcnPtr;
+
+//Function is called when plugin should write its own info into book file
+ YAMN_WRITEMAILOPTS WriteMailOptsFcnPtr;
+
+//Function is called when plugin should read its own info from book file
+ YAMN_READMAILOPTS ReadMailOptsFcnPtr;
+} YAMN_MAILIMPORTFCN, *PYAMN_MAILIMPORTFCN;
+
+//
+//================================== PROTOCOL PLUGIN REGISTRATION STRUCTURES ==================================
+//
+
+typedef struct CProtoPluginRegistration
+{
+#define YAMN_PROTOREGISTRATIONVERSION 1
+//Name of plugin
+//this member CANNOT be NULL. Just write here description, i.e. "Yahoo Mail 1.2"
+ char *Name;
+
+//The version of plugin. CANNOT be NULL.
+ char *Ver;
+
+//Plugin copyright
+//Write here your copyright if you want (or NULL)
+ char *Copyright;
+
+//Plugin description. Can be NULL.
+ char *Description;
+
+//Your contact (email). Can be NULL.
+ char *Email;
+
+//The web page. Can be NULL.
+ char *WWW;
+
+} YAMN_PROTOREGISTRATION, *PYAMN_PROTOREGISTRATION;
+
+typedef struct CYAMNProtoPlugin
+{
+//Pointer to first protocol plugin account
+ HACCOUNT FirstAccount;
+
+//We prevent browsing through accounts (chained list) from deleting or adding any account
+//If we want to delete or add, we must have "write" access to AccountBrowserSO
+//Note that accounts can be changed during AccountBrowser is in "read" mode, because we do not add or delete account.
+ PSWMRG AccountBrowserSO;
+
+//All needed other info from plugin
+ PYAMN_PROTOREGISTRATION PluginInfo;
+
+//Imported functions
+ PYAMN_PROTOIMPORTFCN Fcn;
+ PYAMN_MAILIMPORTFCN MailFcn;
+} YAMN_PROTOPLUGIN, *PYAMN_PROTOPLUGIN, *HYAMNPROTOPLUGIN;
+
+typedef struct CProtoPluginQueue
+{
+ HYAMNPROTOPLUGIN Plugin;
+ struct CProtoPluginQueue *Next;
+} YAMN_PROTOPLUGINQUEUE,*PYAMN_PROTOPLUGINQUEUE;
+
+//
+//================================== YAMN SERVICES FOR PROTOCOL PLUGIN ==================================
+//
+
+//RegisterProtoPlugin Service
+//Your plugin can call this service to "connect to YAMN"- it means, that you
+//give some parameters to YAMN and YAMN can then cooperate with your protocol plugins
+//WPARAM- pointer to YAMN_PROTOREGISTRATION structure. Plugin must not delete this structure from memory.
+//LPARAM- version of YAMN_PROTOREGISTRATION structure (use YAMN_PROTOREGISTRATIONVERSION definition)
+//returns handle to plugin (HYAMNPROTOPLUGIN), if registration failed (plugin not registered) returns NULL
+//Note, that your plugin should store returned plugin handle, because it will be usefull in next services.
+//You need next to call SetProtocolPluginFcnImportFcn to have your plugin cooperated with YAMN.
+#define MS_YAMN_REGISTERPROTOPLUGIN "YAMN/Service/RegisterProtocolPlugin"
+
+//UnregisterProtoPlugin Service
+//Removes plugin from YAMN and deltes its structures
+//WPARAM- (HYAMNPROTOPLUGIN) handle of protocol plugin
+//LPARAM- any value
+//returns nonzero if success
+#define MS_YAMN_UNREGISTERPROTOPLUGIN "YAMN/Service/UnregisterProtocolPlugin"
+
+//CreateAccount Service
+//Your plugin should call this to create new account for your plugin.
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- CAccount version (use YAMN_ACCOUNTVERSION definition)
+//returns pointer to (HACCOUNT) or pointer to your structure returned from imported NewAccountFcnPtr, if implemented
+#define MS_YAMN_CREATEPLUGINACCOUNT "YAMN/Service/CreateAccount"
+
+//DeletePluginAccount Service
+//Deletes plugin's account from memory. You probably won't use this service, because it deletes only account
+//without any synchronization. Use MS_YAMN_DELETEACCOUNT instead.
+//WPARAM- (HACCOUNT) to delete
+//LPARAM- any value
+//returns zero if failed, otherwise returns nonzero
+#define MS_YAMN_DELETEPLUGINACCOUNT "YAMN/Service/DeletePluginAccount"
+
+//FindAccountByName Service
+//Searches accounts queue for first account that belongs to plugin
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- (TCHAR *)string, name of account to find
+//returns found HACCOUNT handle or NULL if not found
+#define MS_YAMN_FINDACCOUNTBYNAME "YAMN/Service/FindAccountByName"
+
+//GetNextFreeAccount Service
+//Creates new account for plugin and adds it to plugin account queue.
+//Note!!! you have to use AccountBrowserSO in your plugin before and after calling this service, because it is not synchronized
+//So the normal way is like this:
+// WaitToWriteSO(MyPlugin->AccountBrowserSO);
+// CallService(MS_YAMN_GETNEXTFREEACCOUNT,MyPlugin,YAMN_ACCOUNTVERSION);
+// WriteDoneSO(MyPlugin->AccountBrowserSO);
+//
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- CAccount version (use YAMN_ACCOUNTVERSION definition)
+//returns new HACCOUNT handle or NULL if not found
+#define MS_YAMN_GETNEXTFREEACCOUNT "YAMN/Service/GetNextFreeAccount"
+
+//DeleteAccount Service
+//Deletes account from plugin account queue. It also deletes it, but in background (when needed).
+//This deleting is full synchronized and safe. It is recommended for plugins to use this service.
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- (HACCOUNT) Account to delete
+#define MS_YAMN_DELETEACCOUNT "YAMN/Service/DeleteAccount"
+
+//ReadAccountsA Service
+//Reads standard accounts to file. Standard account means standard YAMN book format.
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- (char *)filename string. Put here your own desired filename.
+//return value is one of the ones written in "account.h" file
+#define MS_YAMN_READACCOUNTSA "YAMN/Service/ReadAccountsA"
+
+//ReadAccountsW Service
+//Same as ReadAccountsA service, but difference is in WPARAM
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- (WCHAR *)filename string. Use MS_YAMN_GETFILENAMEW service to retrieve your filename, or
+// just put your own desired filename
+#define MS_YAMN_READACCOUNTSW "YAMN/Service/ReadAccountsW"
+
+//WriteAccountsA Service
+//Writes standard accounts to file. Standard account means standard YAMN book format. It does not
+//store special protocol features. It stores Account settings from CAccount struct and stores MIME mails
+//from CMimeMsgQueue. If your Mails pointer does not point to CMimeMsgQueue structure,
+//do not use this function. You are then forced to write your own function
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- (char *)filename string. Put here your own desired filename.
+//return value is one of the ones written in "account.h" file
+#define MS_YAMN_WRITEACCOUNTSA "YAMN/Service/WriteAccountsA"
+
+//WriteAccountsW Service
+//Writes standard accounts to file. Standard account means standard YAMN book format.
+//WPARAM- (HYAMNPLUGIN) Plugin handle
+//LPARAM- (WCHAR *)filename string. Use MS_YAMN_GETFILENAMEW service to retrieve your filename, or
+// just put your own desired filename
+//return value is one of the ones written in "account.h" file
+#define MS_YAMN_WRITEACCOUNTSW "YAMN/Service/WriteAccountsW"
+
+//GetFileNameA Service
+//Function makes original filename, when you add your protocol string
+//From "yahoo" makes "yamn-accounts.yahoo.xxxxx.book" filename
+//It is good to use this fcn to have similar filenames...
+//WPARAM- (char *) plugin string
+//LPARAM- any value
+//returns NULL when failed, otherwise returns (WCHAR *)string (!!! not char *) to filename!!!
+//You can use MS_YAMN_DELETEFILENAME service to release allocated filename from memory
+#define MS_YAMN_GETFILENAMEA "YAMN/Service/GetFileNameA"
+
+//GetFileNameW Service
+//Same as GetFileNameA service, but difference is in WPARAM
+//WPARAM- (WCHAR *) plugin string
+//LPARAM- any value
+#define MS_YAMN_GETFILENAMEW "YAMN/Service/GetFileNameW"
+
+//DeleteFileName Service
+//deletes unicode string from memory
+//WPARAM- (WCHAR *) pointer to unicode string
+//LPARAM- any value
+#define MS_YAMN_DELETEFILENAME "YAMN/Service/DeleteFileName"
+
+//
+//================================== FUNCTIONS DEFINITIONS ========================================
+//
+
+typedef int (WINAPI *YAMN_SETPROTOCOLPLUGINFCNIMPORTFCN)(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPORTFCN YAMNFcn,DWORD YAMNFcnVer,PYAMN_MAILIMPORTFCN YAMNMailFcn,DWORD YAMNMailFcnVer);
+
+//
+//================================== QUICK FUNCTION CALL DEFINITIONS ========================================
+//
+
+//These are defininitions for YAMN exported functions. Your plugin can use them.
+//pYAMNFcn is global variable, it is pointer to your structure containing YAMN functions.
+//It is something similar like pluginLink variable in Miranda plugin. If you use
+//this name of variable, you have already defined these functions and you can use them.
+//It's similar to Miranda's CreateService function.
+
+//How to use YAMN functions:
+//Create a structure containing pointer to functions you want to use in your plugin
+//This structure can look something like this:
+//
+// struct
+// {
+// YAMN_SETPROTOCOLPLUGINFCNIMPORTFCN SetProtocolPluginFcnImportFcn;
+// } *pYAMNFcn;
+//
+//then you have to fill this structure with pointers...
+//
+// pYAMNFcn->SetProtocolPluginFcnImportFcn=(YAMN_SETPROTOCOLPLUGINFCNIMPORTFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SETPROTOCOLPLUGINFCNIMPORTID,(LPARAM)0);
+//
+//and in your plugin just simply use e.g.:
+//
+// SetProtocolPluginFcnImport(...);
+//
+
+#define YAMN_SETPROTOCOLPLUGINFCNIMPORTID "YAMN/SetProtocolPluginFcnImport"
+
+#define SetProtocolPluginFcnImport(a,b,c,d,e) pYAMNFcn->SetProtocolPluginFcnImportFcn(a,b,c,d,e)
+
+#endif
diff --git a/plugins/ExternalAPI/m_radio.h b/plugins/ExternalAPI/m_radio.h new file mode 100644 index 0000000000..53381ab524 --- /dev/null +++ b/plugins/ExternalAPI/m_radio.h @@ -0,0 +1,131 @@ +#ifndef M_RADIO
+#define M_RADIO
+
+#ifndef MIID_MRADIO
+#define MIID_MRADIO {0xeebc474c, 0xb0ad, 0x470f, {0x99, 0xa8, 0x9d, 0xd9, 0x21, 0x0c, 0xe2, 0x33}}
+#endif
+
+// command codes
+#define MRC_STOP 0
+#define MRC_PLAY 1 // lParam is radio contact handle
+#define MRC_PAUSE 2
+#define MRC_PREV 3
+#define MRC_NEXT 4
+#define MRC_STATUS 5 // lParam is RD_STATUS_* value (RD_STATUS_GET only now)
+#define MRC_SEEK 6 // lParam is value in sec; -1 mean obtain current position
+#define MRC_RECORD 7 // lParam is 0 - switch; 1 - on; 2 - off
+
+/* RD_STATUS_* constands
+ [C]used as command [E]used as event
+ [-]do not use [+]used as command and event
+*/
+#define RD_STATUS_NOSTATION 0 // [E] no active station found
+#define RD_STATUS_PLAYING 1 // [-] media is playing
+#define RD_STATUS_PAUSED 2 // [E] media is paused
+#define RD_STATUS_STOPPED 3 // [E] media is stopped (only for playlists)
+#define RD_STATUS_CONNECT 4 // [E] plugin try to connect to the station
+#define RD_STATUS_ABORT 5 // [E] plugin want to abort while try to connect
+#define RD_STATUS_GET 6 // [C] to get current status
+// next is for events only +0.0.2.1
+#define RD_STATUS_POSITION 107 // [E] position was changed
+#define RD_STATUS_MUTED 108 // [E] Mute/Unmute command was sent
+#define RD_STATUS_RECORD 109 // [E] "Record" action called
+#define RD_STATUS_NEWTRACK 110 // [E] new track/station
+#define RD_STATUS_NEWTAG 111 // [E] tag data changed
+#define RD_STATUS_NEWSTATION 112 // [E] new station (contact)
+
+/*
+ Open radio Options, if Main Options window not opened
+ wParam: 0
+ lParam: 0
+*/
+#define MS_RADIO_SETTINGS "mRadio/Settings"
+/*
+ Switch 'record' mode
+ +0.0.1.x (deprecatet) !!!
+ wParam: 0 - switch mode; else - get record status
+ lParam: 0
+ +0.0.2.x
+ wParam: not used
+ lParam: 0 - switch mode; else - get record status
+ Return: Current status: 1 - record is ON, 0 - OFF
+*/
+#define MS_RADIO_RECORD "mRadio/REC"
+
+/*
+ Set current radio volume
+ wParam: volume (0-100)
+ lParam: must be 0
+ Return: previous value
+*/
+#define MS_RADIO_SETVOL "mRadio/SetVol"
+
+/*
+ Get current radio volume
+ wParam: 0
+ lParam: 0
+ Return: volime value (negative if muted)
+*/
+#define MS_RADIO_GETVOL "mRadio/GetVol"
+
+/*
+ wParam,lParam = 0
+*/
+#define MS_RADIO_MUTE "mRadio/Mute"
+
+/*
+ Send command to mRadio
+ wParam: command (see MRC_* constant)
+ lParam: value (usually 0)
+ Return: return value (now for status only)
+*/
+#define MS_RADIO_COMMAND "mRadio/Command"
+
+/*
+ Starting or stopping radio station
+ wParam: Radio contact handle (lParam=0) or Station name
+ lParam: 0 - wParam is handle, 1 - ANSI, else - unicode
+*/
+#define MS_RADIO_PLAYSTOP "mRadio/PlayStop"
+
+/* +0.0.1.4
+ wParam: station handle (0 - all)
+ lParam: nil (through dialog, radio.ini by default) or ansi string with filename
+ Return: exported stations amount
+*/
+#define MS_RADIO_EXPORT "mRadio/Export"
+
+/* +0.0.1.4
+ wParam: group to import radio or 0
+ lParam: nil (through dialog, radio.ini by default) or ansi string with filename
+ Return: imported stations amount
+*/
+#define MS_RADIO_IMPORT "mRadio/Import"
+
+/*
+ wParam: 0 - switch; 1 - switch on; -1 - switch off
+ lParam: 0
+ Return: last state (0 - was off, 1 - was on)
+*/
+#define MS_RADIO_EQONOFF "mRadio/EqOnOff"
+
+//////event/////
+
+/* +0.0.1.4 (deprecatet only used in 0.0.1.4+)
+ wParam:
+ MRC_STOP , LParam - 0
+ MRC_PLAY , LParam - url
+ MRC_PAUSE , LParam - 0 (pause) / 1 (play)
+ MRC_SEEK , LParam - lParam is value in sec
+ MRC_RECORD , LParam - 0 (stop) / 1 (record)
+
+ +0.0.2.1 new event constants !!
+ wParam: RD_STATUS_* (see constants)
+ RD_STATUS_NEWSTATION , lParam: contact handle
+ RD_STATUS_NEWTRACK , lParam: URL (unicode)
+ RD_STATUS_PAUSED , lParam: 1 - pause, 0 - continued
+ RD_STATUS_RECORD , lParam: 0 - off, 1 - on
+*/
+#define ME_RADIO_STATUS "mRadio/Status"
+
+#endif
diff --git a/plugins/ExternalAPI/m_script.h b/plugins/ExternalAPI/m_script.h new file mode 100644 index 0000000000..957333af7e --- /dev/null +++ b/plugins/ExternalAPI/m_script.h @@ -0,0 +1,143 @@ +/*
+
+Miranda Scripting Plugin for Miranda-IM
+Copyright 2004-2006 Piotr Pawluczuk (www.pawluczuk.info)
+
+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.
+
+*/
+/*
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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_SCRIPT_H__
+#define M_SCRIPT_H__ 1
+
+#define MBOT_GETCPARAM(cp) ((void*)((unsigned char*)cp + 24))
+
+typedef enum {MBOT_NUMBER=0,MBOT_STRING=1,MBOT_VOID=2}MBOT_TYPE;
+
+#ifndef _LIBPHP_H__
+enum SVAR_TYPE{SV_NULL,SV_LONG=1,SV_WORD=2,SV_DOUBLE=3,
+ SV_STRING=4,SV_LPOINTER=5,SV_ARRAY=11};
+#endif
+
+typedef struct{
+ int cbSize; //Set to sizeof();
+ char* pszOutput;
+ char* pszResult;
+}MBOT_RESULT;
+
+struct MBOT_VPARAM{
+ void* data;
+ long length; /*length of data, used for strings, and binary strings*/
+ long type;
+};
+
+/*
+MBOT function prototypes;
+*/
+typedef int (*MBOT_RegisterFunction)(const char* name,void* fptr,long lp,
+ MBOT_TYPE rval,MBOT_TYPE p1,MBOT_TYPE p2,MBOT_TYPE p3,MBOT_TYPE p4);
+typedef int (*MBOT_UnregisterFunction)(const char* name);
+
+typedef void* (*MBOT_Malloc)(long amount);
+typedef char* (*MBOT_Strdup)(const char* str);
+typedef void (*MBOT_Free)(void* ptr);
+typedef void (*MBOT_FreeResult)(MBOT_RESULT* ptr);
+
+typedef int (*MBOT_GetVar)(const char* name,void** value,SVAR_TYPE* cType);//returns TRUE if var exists;
+typedef int (*MBOT_DelVar)(const char* name);
+typedef int (*MBOT_SetVar)(const char* name,void* value,SVAR_TYPE cType);
+typedef int (*MBOT_NewVar)(const char* name,void* value,SVAR_TYPE cType,char locked);
+
+/*******************************************************************
+ * PARAMETERS:
+ pszScript - source code of the script; ***DO NOT USE PHP TAGS*** <?php ?>
+ pResult - if set, you'll get the struct filled with the result;
+ NOTE! Remember to release the struct with "fp_freeresult"!;
+ pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer;
+ nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too
+
+ *EXAMPLE:
+ fpExecuteFile("mbot/scripts/my.php","fct1",&mbr,"parameter",
+ MBOT_STRING,"suf","hello",100,25.6);
+ *******************************************************************/
+typedef int (*MBOT_ExecuteScript)(const char* pszScript,MBOT_RESULT* pResult,
+ void* pCParam,MBOT_TYPE nCPType);
+
+/*******************************************************************
+ * PARAMETERS:
+ pszPathname - relative or absolute path of the php file;
+ pszFcnName - function name can be NULL (whole file will be executed then);
+ pResult - if set, you'll get the struct filled with the result;
+ NOTE! Remember to release the struct with "fp_freeresult"!;
+ pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer;
+ nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too
+ pszPTypes - a string containing pformats s-string,u-long,l-long,d-long,q-double,f-float,x-hex long, v - MBOT_VPARAM*
+ ... - values;
+
+ *EXAMPLE:
+ fpExecuteScript("mbot/scripts/my.php","fct1",&mbr,"parameter",
+ MBOT_STRING,"suf","hello",100,25.6);
+ *******************************************************************/
+typedef int (*MBOT_ExecuteFile)(const char* pszPathname,const char* pszFcnName,MBOT_RESULT* pResult,
+ void* pCParam,MBOT_TYPE nCPType,const char* pszPTypes,...);
+
+typedef struct{
+ int cbSize; //sizeof(MBOT_LPHP);
+ const char* pszMBotVersion;
+ //execution
+ MBOT_ExecuteScript fpExecuteScript;
+ MBOT_ExecuteFile fpExecuteFile;
+ //functions
+ MBOT_RegisterFunction fpRegister;
+ MBOT_UnregisterFunction fpUnregister;
+ //variables
+ MBOT_NewVar fpNewVar;
+ MBOT_SetVar fpSetVar;
+ MBOT_GetVar fpGetVar;
+ MBOT_DelVar fpDelVar;
+ //memory
+ MBOT_Strdup fp_strdup;
+ MBOT_Malloc fp_malloc;
+ MBOT_Free fp_free;
+ MBOT_FreeResult fp_freeresult;
+}MBOT_FUNCTIONS;
+
+/*MS_MBOT_GET_FUNCTIONS
+lParam = wParam = 0;
+returns a pointer to const MBOT_FUNCTIONS structure;
+*/
+#define MS_MBOT_GET_FCN_TABLE "MBot/GetFcnTable"
+#endif //M_SCRIPT_H__
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_sessions.h b/plugins/ExternalAPI/m_sessions.h new file mode 100644 index 0000000000..531a3315f5 --- /dev/null +++ b/plugins/ExternalAPI/m_sessions.h @@ -0,0 +1,62 @@ +/*
+Sessions Management plugin for Miranda IM
+
+Copyright (C) 2007-2008 Danil Mozhar
+
+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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef M_SESSIONS_H__
+#define M_SESSIONS_H__
+
+//////////////////////////////////////////////////////////////////////////
+// Services
+//
+//////////////////////////////////////////////////////////////////////////
+// Opens session load dialog
+//
+// wParam = 0
+// lParam = 0
+#define MS_SESSIONS_OPENMANAGER "Sessions/Service/OpenManager"
+
+//////////////////////////////////////////////////////////////////////////
+// Loads last session
+//
+// wParam = 0
+// lParam = 0
+#define MS_SESSIONS_RESTORELASTSESSION "Sessions/Service/OpenLastSession"
+
+//////////////////////////////////////////////////////////////////////////
+// Opens current/user-defined session save dialog
+//
+// wParam = 0
+// lParam = 0
+#define MS_SESSIONS_SAVEUSERSESSION "Sessions/Service/SaveUserSession"
+
+//////////////////////////////////////////////////////////////////////////
+// Closes current opened session
+//
+// wParam = 0
+// lParam = 0
+#define MS_SESSIONS_CLOSESESSION "Sessions/Service/CloseSession"
+
+//////////////////////////////////////////////////////////////////////////
+// Builds Favorite Sessions menu
+//
+// wParam = 0
+// lParam = 0
+#define MS_SESSIONS_SHOWFAVORITESMENU "Sessions/Service/ShowFavMenu"
+
+
+#endif //M_SESSIONS_H__
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_simpleaway.h b/plugins/ExternalAPI/m_simpleaway.h new file mode 100644 index 0000000000..e451c93f32 --- /dev/null +++ b/plugins/ExternalAPI/m_simpleaway.h @@ -0,0 +1,84 @@ +/*
+
+SimpleAway plugin for Miranda-IM
+
+Copyright © 2005 Harven, © 2006-2008 Dezeath
+
+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_SIMPLEAWAY_H__
+#define M_SIMPLEAWAY_H__ 1
+
+// Represents status that a protocol(s) is/are currently in
+#define ID_STATUS_CURRENT 40082
+
+// Force a change of global status mode/message
+// wParam = (int)new status, from statusmodes.h or ID_STATUS_CURRENT
+// lParam = (char *)status message
+#define MS_SA_SETSTATUSMODE "SimpleAway/SetStatusMode"
+#define MS_AWAYSYS_SETSTATUSMODE MS_SA_SETSTATUSMODE // for compatibility with some plugins
+
+// Brings up the status message dialog
+// wParam = 0
+// lParam = (char *)protocol name, NULL if for all protocols
+#define MS_SA_SHOWSTATUSMSGDIALOG "SimpleAway/ShowStatusMessageDialog"
+
+// Similar to the service above, for internal use only
+#define MS_SA_TTCHANGESTATUSMSG "SimpleAway/TTChangeStatusMessage"
+
+// Force a change of status mode/message. The status message dialog will appear,
+// depending on the configuration of the user
+// wParam = (int)new status, from statusmodes.h
+// lParam = (char *)protocol name, NULL if for all protocols
+// Returns 1 when changed without showing the status message dialog
+#define MS_SA_CHANGESTATUSMSG "SimpleAway/ChangeStatusMessage"
+
+// For checking if SimpleAway is running
+// wParam = lParam = 0
+// Always returns 1
+#define MS_SA_ISSARUNNING "SimpleAway/IsSARunning"
+
+// Copy the away/na/etc message of a contact
+// wParam = (WPARAM)(HANDLE)hContact
+// lParam = 0
+// Returns 0 on success or nonzero on failure
+// Returns immediately, without waiting for the message to retrieve
+#define MS_SA_COPYAWAYMSG "SimpleAway/CopyAwayMsg"
+
+// Returns the default status message for a status in specified protocol module
+// or the current status message for the specified protocol if ID_STATUS_CURRENT is used
+// wParam = (int)status, from statusmodes.h or ID_STATUS_CURRENT
+// lParam = (char *)protocol name, NULL if for all protocols
+// Returns status msg. Remember to free the return value
+#ifndef MS_AWAYMSG_GETSTATUSMSG
+#define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage"
+#endif
+
+// Force a change to specified global status mode/message
+// (calls MS_SA_CHANGESTATUSMSG with proper parameters)
+// wParam = lParam = 0
+#define MS_SA_SETOFFLINESTATUS "SimpleAway/SetOfflineStatus"
+#define MS_SA_SETONLINESTATUS "SimpleAway/SetOnlineStatus"
+#define MS_SA_SETAWAYSTATUS "SimpleAway/SetAwayStatus"
+#define MS_SA_SETDNDSTATUS "SimpleAway/SetDNDStatus"
+#define MS_SA_SETNASTATUS "SimpleAway/SetNAStatus"
+#define MS_SA_SETOCCUPIEDSTATUS "SimpleAway/SetOccupiedStatus"
+#define MS_SA_SETFREECHATSTATUS "SimpleAway/SetFreeChatStatus"
+#define MS_SA_SETINVISIBLESTATUS "SimpleAway/SetInvisibleStatus"
+#define MS_SA_SETONTHEPHONESTATUS "SimpleAway/SetOnThePhoneStatus"
+#define MS_SA_SETOUTTOLUNCHSTATUS "SimpleAway/SetOutToLunchStatus"
+
+#endif // M_SIMPLEAWAY_H__
diff --git a/plugins/ExternalAPI/m_skin_eng.h b/plugins/ExternalAPI/m_skin_eng.h new file mode 100644 index 0000000000..c099a28be7 --- /dev/null +++ b/plugins/ExternalAPI/m_skin_eng.h @@ -0,0 +1,435 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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_ske_H_INC
+#define M_ske_H_INC
+
+
+
+/*defaults*/
+#define DEFAULT_FIT_MODE FM_STRETCH
+#define DEFAULT_STYLE ST_BRUSH
+#define DEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
+#define DEFAULT_SELBKCOLOUR GetSysColor(COLOR_HIGHLIGHT)
+#define SIZING_MARGIN 3
+
+/* Fit mode */
+#define FM_STRETCH 0
+#define FM_TILE_HORZ 1
+#define FM_TILE_VERT 2
+#define FM_TILE_BOTH 3
+
+/*Object types*/
+#define OT_ANY 0
+#define OT_GLYPHOBJECT 1
+#define OT_FONTOBJECT 2
+
+/*STYLE INDEXEX*/
+#define ST_SKIP 0
+#define ST_PARENT 1
+#define ST_BRUSH 2
+#define ST_IMAGE 3
+#define ST_SOLARIZE 4 //Not used yet.
+#define ST_FRAGMENT 5
+#define ST_GRADIENT 6
+
+//formats:
+#define ADT_TOP 0x00000000
+#define ADT_LEFT 0x00000000
+#define ADT_HCENTER 0x00000001
+#define ADT_RIGHT 0x00000002
+#define ADT_VCENTER 0x00000004
+#define ADT_BOTTOM 0x00000008
+//#define ADT_ECLIPSE 64
+
+
+/*SERVICES*/
+
+//toggle the 'hide offline contacts' flag and call CLUI
+//wParam=0
+//lParam=0
+#define MS_CLIST_TOGGLEHIDEOFFLINE "CList/ToggleHideOffline"
+
+#define MS_CLIST_TOGGLEGROUPS "CList/ToggleGroups"
+
+#define MS_CLIST_TOGGLESOUNDS "CList/ToggleSounds"
+
+// Add new object to skin object list.
+// wParam = pointer to SKINOBJECTDESCRIPTOR structure
+// lParam = 0 ( used for internal purposes: pointer to skin object list)
+#define MS_SKIN_REGISTEROBJECT "ModernList/RegisterObject"
+
+// Add new object to skin object list.
+// wParam = pointer to DEF_SKIN_OBJECT_PARAMS structure
+// lParam = 0 ( used for internal purposes: pointer to skin object list)
+#define MS_SKIN_REGISTERDEFOBJECT "ModernList/RegisterDefObject"
+
+typedef struct s_DEF_SKIN_OBJECT_PARAMS
+{
+ char * szObjectID;
+ BYTE defStyle;
+ DWORD defColor;
+ // SKINOBJECTSLIST * Skin;
+} DEF_SKIN_OBJECT_PARAMS;
+
+
+// Request painting glyph object
+// wParam = pointer to SKINDRAWREQUEST structure
+// lParam = 0
+#define MS_SKIN_DRAWGLYPH "ModernList/DrawGlyph"
+
+
+
+/* EVENTS */
+#define ME_SKIN_SERVICESCREATED "ModernList/ServicesCreated"
+
+/* DRAWGLYPH Request structure */
+typedef struct s_SKINDRAWREQUEST
+{
+ char szObjectID[255]; // Unic Object ID (path) to paint
+ RECT rcDestRect; // Rectangle to fit
+ RECT rcClipRect; // Rectangle to paint in.
+ HDC hDC; // Handler to device context to paint in.
+} SKINDRAWREQUEST,*LPSKINDRAWREQUEST;
+
+/* SKINOBJECTDESCRIPTOR opbject descriptor structure */
+typedef struct tagSKINOBJECTDESCRIPTOR
+{
+ BYTE bType; // One of OT_* values.
+ char* szObjectID; // Unic Object ID (path) [255] max
+ LPVOID Data; // Pointer to GLYPHOBJECT strycture if bType==OT_GLYPHOBJECT
+} SKINOBJECTDESCRIPTOR, *LPSKINOBJECTDESCRIPTOR;
+
+/* SKINOBJECTDESCRIPTOR opbject descriptor structure */
+typedef struct s_GLYPHOBJECT
+{
+ BYTE Style; // One of ST_* values
+ HBITMAP hGlyph; // Bitmap handler (for internal use only)
+ DWORD dwTop, dwLeft, dwBottom, dwRight; // Margins
+ char* szFileName; // FileName of image
+ DWORD dwColor; // Fill color
+ BYTE dwAlpha; // Constant alpha-transparency level
+ BYTE FitMode; // One of FM_* values
+ POINT clipArea; // Object image rect on full image
+ SIZE szclipArea; // Object image rect on full image
+ SortedList * plTextList; // List of GLYPHTEXT
+ LONG bmWidth;
+ LONG bmHeight;
+ BYTE bmBitsPixel;
+} GLYPHOBJECT,*LPGLYPHOBJECT;
+
+/* SKINTEXTDESCRIPTOR opbject descriptor structure */
+typedef struct s_GLYPHTEXT
+{
+ char * szGlyphTextID;
+ TCHAR * stText;
+ TCHAR * stValueText;
+ DWORD dwFlags;
+ DWORD dwColor; // Color (InvAA)(RR)(GG)(BB)
+ DWORD dwShadow; //ToDo: Color2/Shaddow
+ int iLeft,iTop,iRight,iBottom;
+ BYTE RelativeFlags;
+ char * szFontID;
+ HFONT hFont;
+ char * szObjectName;
+}GLYPHTEXT,*LPGLYPHTEXT;
+
+/* SKINTEXTDESCRIPTOR opbject descriptor structure */
+typedef struct s_SKINFONT
+{
+ char * szFontID;
+ HFONT hFont;
+}SKINFONT, *LPSKINFONT;
+
+/* HELPER FUNCTIONS */
+
+//Paint ObjectID as parent background for frame hwndIn
+int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT * rcClip, char * objectID)
+{
+ SKINDRAWREQUEST rq;
+ POINT pt={0};
+ RECT rc,r1;
+
+ HWND hwnd=(HWND)CallService(MS_CLUI_GETHWND,0,0);
+ if (!objectID) return 0;
+ GetWindowRect(hwndIn,&r1);
+ pt.x=r1.left;
+ pt.y=r1.top;
+ //ClientToScreen(hwndIn,&pt);
+ GetWindowRect(hwnd,&rc);
+ OffsetRect(&rc,-pt.x ,-pt.y);
+ rq.hDC=hdc;
+ rq.rcDestRect=rc;
+ rq.rcClipRect=*rcClip;
+ strncpy(rq.szObjectID,objectID,sizeof(rq.szObjectID));
+ ///ske_Service_DrawGlyph((WPARAM)&rq,0); //$$$
+ return CallService(MS_SKIN_DRAWGLYPH,(WPARAM)&rq,0);
+}
+
+
+//Paint ObjectID
+int __inline SkinDrawGlyph(HDC hdc, RECT * rcSize, RECT * rcClip, char * objectID);
+
+//Register object with predefined style
+int __inline CreateGlyphedObjectDefStyle(char * ObjID,BYTE defStyle);
+int __inline CreateGlyphedObjectDefColor(char * ObjID,DWORD defColor);
+//Register default object
+int __inline CreateGlyphedObject(char * ObjID);
+
+
+
+//// Creating and registering objects
+//int __inline CreateGlyphedObject(char * ObjID)
+//{
+// DEF_SKIN_OBJECT_PARAMS prm={0};
+// prm.defColor=DEFAULT_BKCOLOUR;
+// prm.defStyle=DEFAULT_STYLE;
+// prm.szObjectID=ObjID;
+// return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0);
+//}
+static BOOL __inline ScreenToClientRect(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;
+}
+
+//int __inline CreateGlyphedObjectDefStyle(char * ObjID,BYTE defStyle)
+//{
+// DEF_SKIN_OBJECT_PARAMS prm={0};
+// prm.defColor=DEFAULT_BKCOLOUR;
+// prm.defStyle=defStyle;
+// prm.szObjectID=ObjID;
+// return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0);
+//}
+//int __inline CreateGlyphedObjectDefColor(char * ObjID,DWORD defColor)
+//{
+// DEF_SKIN_OBJECT_PARAMS prm={0};
+// prm.defColor=defColor;
+// prm.defStyle=ST_BRUSH;
+// prm.szObjectID=ObjID;
+// return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0);
+//}
+static int __inline SkinDrawGlyph(HDC hdc, RECT * rcSize, RECT * rcClip, char * objectID)
+{
+ SKINDRAWREQUEST rq;
+ if (!objectID) return 0;
+ rq.hDC=hdc;
+ rq.rcDestRect=*rcSize;
+ rq.rcClipRect=*rcClip;
+ strncpy(rq.szObjectID,objectID,sizeof(rq.szObjectID));
+ return CallService(MS_SKIN_DRAWGLYPH,(WPARAM)&rq,0);
+}
+//#include "../hdr/modern_skin_selector.h"
+
+//////////////////////////////////////////////
+// //
+// New Painting sequence servises //
+// //
+//////////////////////////////////////////////
+
+typedef struct sPAINT_REQUEST
+{
+ DWORD dStructSize; //size of structure
+ HWND hWnd; //called by window
+ HDC hDC; //context to draw on
+ RECT rcUpdate; //rectangle to be painted in (relative to Top-Left corner of Main window)
+ DWORD dwFlags; //drawing flags
+ void * CallbackData; //Data for passing to callback procedure
+ char Reserved[16]; //reserved for farther usage;
+} sPaintRequest;
+
+// Request to register sub for callback painting frame area
+// wParam = hWnd of called frame
+// lParam = pointer to tPaintCallBackProc (or NULL to remove)
+// return 1 - succes, 0 - failure
+#define MS_SKINENG_REGISTERPAINTSUB "SkinEngine/ske_Service_RegisterFramePaintCallbackProcedure"
+
+// Request to repaint frame or change/drop callback data immeadeately
+// wParam = hWnd of called frame
+// lParam = pointer to sPaintRequest (or NULL to redraw all)
+#define MS_SKINENG_UPTATEFRAMEIMAGE "SkinEngine/ske_Service_UpdateFrameImage"
+
+// Request to repaint frame or change/drop callback data
+// wParam = hWnd of called frame
+// lParam = pointer to sPaintRequest (or NULL to redraw all)
+// return 2 - already queued, data updated, 1-have been queued, 0 - failure
+#define MS_SKINENG_INVALIDATEFRAMEIMAGE "SkinEngine/ske_Service_InvalidateFrameImage"
+
+// Callback proc type
+typedef int (/*__stdcall*/ *tPaintCallbackProc)(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgnUpdate, DWORD dFlags, void * CallBackData);
+//tPaintCallbackProc PaintCallbackProc;
+
+// HELPER TO UPDATEIMAGEFRAME
+
+
+inline BOOL isSkinEngineEnabled()
+{
+ return ServiceExists(MS_SKINENG_REGISTERPAINTSUB) && !DBGetContactSettingByte(NULL, "ModernData", "DisableEngine", FALSE);
+}
+
+
+inline BOOL isLayeredEnabled()
+{
+ return isSkinEngineEnabled() && DBGetContactSettingByte(NULL, "ModernData", "EnableLayering", TRUE);
+}
+
+int __inline SkinEngUpdateImageFrame(HWND hwnd, RECT * rcUpdate, DWORD dwFlags, void * CallBackData)
+{
+ sPaintRequest sr={0};
+ sr.dStructSize=sizeof(sPaintRequest);
+ sr.hWnd=hwnd;
+ if (rcUpdate)
+ sr.rcUpdate=*rcUpdate;
+ sr.dwFlags=dwFlags;
+ sr.CallbackData=CallBackData;
+ return CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM)hwnd,(LPARAM)&sr);
+}
+
+int __inline SkinEngInvalidateImageFrame(HWND hwnd, CONST RECT * rcUpdate, DWORD dwFlags, void * CallBackData)
+{
+ sPaintRequest sr={0};
+ if (hwnd && !isLayeredEnabled()) return InvalidateRect(hwnd,rcUpdate,dwFlags);
+ sr.dStructSize=sizeof(sPaintRequest);
+ sr.hWnd=hwnd;
+ if (rcUpdate)
+ sr.rcUpdate=*rcUpdate;
+ sr.dwFlags=dwFlags;
+ sr.CallbackData=CallBackData;
+ return CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,(LPARAM)&sr);
+}
+
+
+int __inline SkinInvalidateFrame(HWND hWnd, CONST RECT* lpRect,BOOL bErase)
+{
+ return SkinEngInvalidateImageFrame(hWnd,lpRect,0,0);
+}
+// Alpha channel GDI replacements/helpers
+
+//
+// Paints text with correct alpha channel
+// wParam - pointer to AlphaTextOutParams
+#define MS_SKINENG_ALPHATEXTOUT "SkinEngine/ske_AlphaTextOut"
+typedef struct _AlphaTextOutParams
+{
+ HDC hDC;
+ LPCTSTR lpString;
+ int nCount;
+ RECT * lpRect;
+ UINT format;
+ DWORD ARGBcolor;
+ char reserv[16];
+}AlphaTextOutParams;
+
+int __inline AlphaText(HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRect, UINT format, DWORD ARGBcolor)
+{
+ AlphaTextOutParams ap={0};
+ ap.hDC=hDC;
+ ap.lpString=lpString;
+ ap.nCount=nCount;
+ ap.lpRect=lpRect;
+ ap.format=format;
+ ap.ARGBcolor=ARGBcolor;
+ return CallService(MS_SKINENG_ALPHATEXTOUT,(WPARAM)&ap,0);
+}
+
+typedef struct _ImageListFixParam
+{
+ HIMAGELIST himl;
+ int index;
+ HICON hicon;
+}ImageListFixParam;
+
+typedef struct _DrawIconFixParam
+{
+ HDC hdc;
+ int xLeft;
+ int yTop;
+ HICON hIcon;
+ int cxWidth;
+ int cyWidth;
+ UINT istepIfAniCur;
+ HBRUSH hbrFlickerFreeDraw;
+ UINT diFlags;
+} DrawIconFixParam;
+//wParam - pointer to DrawIconFixParam
+#define MS_SKINENG_DRAWICONEXFIX "SkinEngine/DrawIconEx_Fix"
+
+int __inline mod_DrawIconEx_helper(HDC hdc,int xLeft,int yTop,HICON hIcon,int cxWidth,int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
+{
+ DrawIconFixParam p={0};
+ p.hdc=hdc;
+ p.xLeft=xLeft;
+ p.yTop=yTop;
+ p.hIcon=hIcon;
+ p.cxWidth=cxWidth;
+ p.cyWidth=cyWidth;
+ p.istepIfAniCur=istepIfAniCur;
+ p.hbrFlickerFreeDraw=hbrFlickerFreeDraw;
+ p.diFlags=diFlags;
+ return CallService(MS_SKINENG_DRAWICONEXFIX,(WPARAM)&p,0);
+}
+
+
+
+
+// Register of plugin's user
+//
+// wParam = (WPARAM)szSetting - string that describes a user
+// format: Category/ModuleName,
+// eg: "Contact list background/CLUI",
+// "Status bar background/StatusBar"
+// lParam = (LPARAM)dwFlags
+//
+#define MS_BACKGROUNDCONFIG_REGISTER "ModernBkgrCfg/Register"
+
+//
+// Notification about changed background
+// wParam = ModuleName
+// lParam = 0
+#define ME_BACKGROUNDCONFIG_CHANGED "ModernBkgrCfg/Changed"
+
+
+
+#endif
diff --git a/plugins/ExternalAPI/m_skinengine.h b/plugins/ExternalAPI/m_skinengine.h new file mode 100644 index 0000000000..98b3e8843a --- /dev/null +++ b/plugins/ExternalAPI/m_skinengine.h @@ -0,0 +1,55 @@ +struct ISkinBackend;
+struct ISkinElement;
+
+struct SkinRenderParams
+{
+ HDC hdc;
+ RECT rc;
+};
+
+struct ISkinDataSource
+{
+ virtual LPCTSTR GetText(const TCHAR *key) = 0;
+ virtual HICON GetIcon(const TCHAR *key) = 0;
+ virtual HBITMAP GetBitmap(const TCHAR *key) = 0;
+ virtual ISkinBackend *GetObject(const TCHAR *key) = 0;
+};
+
+struct ISkinElement
+{
+ // general manadgement
+ virtual void SetParent(ISkinElement *parent) = 0;
+ virtual void LoadFromXml(HXML hXml) = 0;
+ virtual void SetId(const TCHAR *id) = 0;
+ virtual void SetDataSource(ISkinDataSource *ds) = 0;
+ virtual void Destroy() = 0;
+
+ // rendering and layouting
+ virtual void Measure(SkinRenderParams *params) = 0;
+ virtual void Layout(SkinRenderParams *params) = 0;
+ virtual void Paint(SkinRenderParams *params) = 0;
+
+ // element tree
+ virtual bool IsComplexObject() = 0;
+ virtual ISkinElement *GetParent() = 0;
+ virtual int GetChildCount() = 0;
+ virtual ISkinElement *GetChild(int index) = 0;
+ virtual bool AppendChild(ISkinElement *child) = 0;
+ virtual bool InsertChild(ISkinElement *child, int index) = 0;
+ virtual void RemoveChild(ISkinElement *child) = 0;
+
+ // element properties
+ virtual void SetPropText(const TCHAR *key, const TCHAR *value) = 0;
+ virtual const TCHAR *GetPropText(const TCHAR *key, const TCHAR *value) = 0;
+ virtual void SetPropInt(const TCHAR *key, int value) = 0;
+ virtual void SetPropIntText(const TCHAR *key, const TCHAR *value) = 0;
+ virtual int GetPropInt(const TCHAR *key) = 0;
+};
+
+struct ISkinBackend
+{
+ virtual LPCTSTR GetText(const TCHAR *key) = 0;
+ virtual HICON GetIcon(const TCHAR *key) = 0;
+ virtual HBITMAP GetBitmap(const TCHAR *key) = 0;
+ virtual ISkinBackend *GetObject(const TCHAR *key) = 0;
+};
diff --git a/plugins/ExternalAPI/m_skins.h b/plugins/ExternalAPI/m_skins.h new file mode 100644 index 0000000000..da01064c64 --- /dev/null +++ b/plugins/ExternalAPI/m_skins.h @@ -0,0 +1,142 @@ +/*
+Copyright (C) 2008 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_SKINS_H__
+# define __M_SKINS_H__
+
+#include <windows.h>
+
+#define MIID_SKINS { 0x917db7a4, 0xd0fe, 0x4b1c, { 0x8c, 0xa3, 0x6d, 0xc1, 0x44, 0x80, 0xf5, 0xcc } }
+
+
+typedef void * SKINNED_DIALOG;
+typedef void * SKINNED_FIELD;
+typedef void * SKINNED_DIALOG_STATE;
+typedef void * SKINNED_FIELD_STATE;
+
+typedef void (*SkinOptionsChangedCallback)(void *param, SKINNED_DIALOG dlg);
+
+
+#define SKN_HALIGN_LEFT 1
+#define SKN_HALIGN_CENTER 2
+#define SKN_HALIGN_RIGHT 3
+
+#define SKN_VALIGN_TOP 1
+#define SKN_VALIGN_CENTER 2
+#define SKN_VALIGN_BOTTOM 3
+
+
+/// Some common parameters:
+/// - name : internal name and name used inside skin file
+/// - description : name shown to the user
+/// - module : the module name where the settings will be stored
+/// Do not translate any parameters.
+struct SKIN_INTERFACE
+{
+ int cbSize;
+
+ // Global methods
+ SKINNED_DIALOG (*RegisterDialog)(const char *name, const char *description, const char *module);
+ void (*DeleteDialog)(SKINNED_DIALOG dlg);
+ void (*SetSkinChangedCallback)(SKINNED_DIALOG dlg, SkinOptionsChangedCallback cb, void *param);
+ void (*FinishedConfiguring)(SKINNED_DIALOG dlg);
+
+ // Dialog methods
+ SKINNED_FIELD (*AddTextField)(SKINNED_DIALOG dlg, const char *name, const char *description);
+ SKINNED_FIELD (*AddIconField)(SKINNED_DIALOG dlg, const char *name, const char *description);
+ SKINNED_FIELD (*AddImageField)(SKINNED_DIALOG dlg, const char *name, const char *description);
+ SKINNED_FIELD (*GetField)(SKINNED_DIALOG dlg, const char *name);
+ void (*SetDialogSize)(SKINNED_DIALOG dlg, int width, int height);
+ void (*SetInfoInt)(SKINNED_DIALOG dlg, const char *name, int value);
+ void (*SetInfoDouble)(SKINNED_DIALOG dlg, const char *name, double value);
+ void (*SetInfoBool)(SKINNED_DIALOG dlg, const char *name, BOOL value);
+ void (*SetInfoString)(SKINNED_DIALOG dlg, const char *name, const TCHAR *value);
+ void (*RemoveInfo)(SKINNED_DIALOG dlg, const char *name);
+
+ // Field methods
+ void (*SetEnabled)(SKINNED_FIELD field, BOOL enabled);
+ void (*SetToolTipA)(SKINNED_FIELD field, const char *tooltip);
+ void (*SetToolTipW)(SKINNED_FIELD field, const WCHAR *tooltip);
+
+ // TextField methods
+ void (*SetTextA)(SKINNED_FIELD field, const char *text);
+ void (*SetTextW)(SKINNED_FIELD field, const WCHAR *text);
+
+ // IconField methods
+ void (*SetIcon)(SKINNED_FIELD field, HICON hIcon);
+
+ // ImageField methods
+ void (*SetImage)(SKINNED_FIELD field, HBITMAP hBmp);
+
+ // Run the skin and get an state from it
+ SKINNED_DIALOG_STATE (*Run)(SKINNED_DIALOG dialog);
+
+ // Dialog State methods
+ SKINNED_FIELD_STATE (*GetFieldState)(SKINNED_DIALOG_STATE dlg, const char *name);
+ RECT (*GetDialogBorders)(SKINNED_DIALOG_STATE dlg);
+
+ // Field State methods
+ RECT (*GetRect)(SKINNED_FIELD_STATE field); // With borders
+ RECT (*GetInsideRect)(SKINNED_FIELD_STATE field); // Without borders
+ RECT (*GetRawRect)(SKINNED_FIELD_STATE field); // With borders, without processing to assert inside window
+ RECT (*GetRawInsideRect)(SKINNED_FIELD_STATE field); // Without borders, without processing to assert inside window
+ RECT (*GetBorders)(SKINNED_FIELD_STATE field);
+ BOOL (*IsVisible)(SKINNED_FIELD_STATE field);
+ char * (*GetToolTipA)(SKINNED_FIELD field); // You have to free the result
+ WCHAR * (*GetToolTipW)(SKINNED_FIELD field); // You have to free the result
+ int (*GetHorizontalAlign)(SKINNED_FIELD_STATE field); // one of SKN_HALIGN_*
+ int (*GetVerticalAlign)(SKINNED_FIELD_STATE field); // one of SKN_VALIGN_*
+
+ // TextField State methods
+ char * (*GetTextA)(SKINNED_FIELD_STATE field); // You have to free the result
+ WCHAR * (*GetTextW)(SKINNED_FIELD_STATE field); // You have to free the result
+ HFONT (*GetFont)(SKINNED_FIELD_STATE field);
+ COLORREF (*GetFontColor)(SKINNED_FIELD_STATE field);
+
+ // IconField State methods
+ HICON (*GetIcon)(SKINNED_FIELD_STATE field);
+
+ // ImageField State methods
+ HBITMAP (*GetImage)(SKINNED_FIELD_STATE field);
+};
+
+
+
+/*
+Skins/GetInterface service
+Fill the function pointers for a SKIN_INTERFACE struct
+
+wparam = 0
+lparam = (SKIN_INTERFACE *) struct to be filled
+returns: 0 on success
+*/
+#define MS_SKINS_GETINTERFACE "Skins/GetInterface"
+
+
+
+
+static int mir_skins_getInterface(struct SKIN_INTERFACE *dest)
+{
+ dest->cbSize = sizeof(SKIN_INTERFACE);
+ return CallService(MS_SKINS_GETINTERFACE, 0, (LPARAM) dest);
+}
+
+
+#endif // __M_SKINS_H__
diff --git a/plugins/ExternalAPI/m_skins_cpp.h b/plugins/ExternalAPI/m_skins_cpp.h new file mode 100644 index 0000000000..bdc7337419 --- /dev/null +++ b/plugins/ExternalAPI/m_skins_cpp.h @@ -0,0 +1,210 @@ +/*
+Copyright (C) 2008 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_SKINS_CPP_H__
+# define __M_SKINS_CPP_H__
+
+#include "m_skins.h"
+
+extern struct SKIN_INTERFACE mski;
+
+
+class SkinFieldState
+{
+public:
+ SkinFieldState(SKINNED_FIELD_STATE field) : tooltip(NULL) { this->field = field; }
+ virtual ~SkinFieldState() { if (tooltip != NULL) mir_free(tooltip); }
+
+ bool isValid() { return field != NULL; }
+
+ RECT getRect(bool raw = false) { return raw ? mski.GetRawRect(field) : mski.GetRect(field); }
+ RECT getInsideRect(bool raw = false) { return raw ? mski.GetRawInsideRect(field) : mski.GetInsideRect(field); }
+ RECT getBorders() { return mski.GetBorders(field); }
+ bool isVisible() { return mski.IsVisible(field) != FALSE; }
+ int getHorizontalAlign() { return mski.GetHorizontalAlign(field); } // one of SKN_HALIGN_*
+ int getVerticalAlign() { return mski.GetVerticalAlign(field); } // one of SKN_VALIGN_*
+
+ const TCHAR * getToolTip() {
+ if (tooltip != NULL)
+ mir_free(tooltip);
+
+#ifdef UNICODE
+ tooltip = mski.GetToolTipW(field);
+#else
+ tooltip = mski.GetToolTipA(field);
+#endif
+ return tooltip;
+ }
+
+protected:
+ SKINNED_FIELD_STATE field;
+ TCHAR *tooltip;
+};
+
+class SkinTextFieldState : public SkinFieldState
+{
+public:
+ SkinTextFieldState(SKINNED_FIELD_STATE field) : SkinFieldState(field), text(NULL) {}
+ virtual ~SkinTextFieldState() { if (text != NULL) mir_free(text); }
+
+ const TCHAR * getText() {
+ if (text != NULL)
+ mir_free(text);
+
+#ifdef UNICODE
+ text = mski.GetTextW(field);
+#else
+ text = mski.GetTextA(field);
+#endif
+ return text;
+ }
+
+ HFONT getFont() { return mski.GetFont(field); }
+ COLORREF getFontColor() { return mski.GetFontColor(field); }
+
+private:
+ TCHAR *text;
+};
+
+class SkinIconFieldState : public SkinFieldState
+{
+public:
+ SkinIconFieldState(SKINNED_FIELD_STATE field) : SkinFieldState(field) {}
+
+ HICON getIcon() { return mski.GetIcon(field); }
+};
+
+class SkinImageFieldState : public SkinFieldState
+{
+public:
+ SkinImageFieldState(SKINNED_FIELD_STATE field) : SkinFieldState(field) {}
+
+ HBITMAP getImage() { return mski.GetImage(field); }
+};
+
+
+class SkinDialogState
+{
+public:
+ SkinDialogState(SKINNED_DIALOG_STATE dlg) { this->dlg = dlg; }
+
+ bool isValid() { return dlg != NULL; }
+
+ RECT getBorders() { return mski.GetDialogBorders(dlg); }
+
+ SkinFieldState getField(const char *name) { return SkinFieldState( mski.GetFieldState(dlg, name) ); }
+ SkinTextFieldState getTextField(const char *name) { return SkinTextFieldState( mski.GetFieldState(dlg, name) ); }
+ SkinIconFieldState getIconField(const char *name) { return SkinIconFieldState( mski.GetFieldState(dlg, name) ); }
+ SkinImageFieldState getImageField(const char *name) { return SkinImageFieldState( mski.GetFieldState(dlg, name) ); }
+
+private:
+ SKINNED_DIALOG_STATE dlg;
+};
+
+
+class SkinField
+{
+public:
+ SkinField(SKINNED_FIELD field) { this->field = field; }
+
+ bool isValid() { return field != NULL; }
+
+ void setEnabled(bool enabled) { mski.SetEnabled(field, enabled); }
+
+ void setToolTip(const TCHAR *tooltip) {
+#ifdef UNICODE
+ mski.SetToolTipW(field, tooltip);
+#else
+ mski.SetToolTipA(field, tooltip);
+#endif
+ }
+
+protected:
+ SKINNED_FIELD field;
+};
+
+class SkinTextField : public SkinField
+{
+public:
+ SkinTextField(SKINNED_FIELD field) : SkinField(field) {}
+
+ void setText(const TCHAR *text) {
+#ifdef UNICODE
+ mski.SetTextW(field, text);
+#else
+ mski.SetTextA(field, text);
+#endif
+ }
+};
+
+class SkinIconField : public SkinField
+{
+public:
+ SkinIconField(SKINNED_FIELD field) : SkinField(field) {}
+
+ void setIcon(HICON hIcon) { mski.SetIcon(field, hIcon); }
+};
+
+class SkinImageField : public SkinField
+{
+public:
+ SkinImageField(SKINNED_FIELD field) : SkinField(field) {}
+
+ void setImage(HBITMAP hBmp) { mski.SetImage(field, hBmp); }
+};
+
+
+class SkinDialog
+{
+public:
+ SkinDialog(const char *name, const char *description, const char *module) { dlg = mski.RegisterDialog(name, description, module); }
+ ~SkinDialog() { mski.DeleteDialog(dlg); dlg = NULL; }
+
+ bool isValid() { return dlg != NULL; }
+
+ void setSkinChangedCallback(SkinOptionsChangedCallback cb, void *param) { mski.SetSkinChangedCallback(dlg, cb, param); }
+
+ void finishedConfiguring() { mski.FinishedConfiguring(dlg); }
+
+ void setSize(int width, int height) { mski.SetDialogSize(dlg, width, height); }
+
+ SkinTextField addTextField(const char *name, const char *description) { return SkinTextField( mski.AddTextField(dlg, name, description) ); }
+ SkinIconField addIconField(const char *name, const char *description) { return SkinIconField( mski.AddIconField(dlg, name, description) ); }
+ SkinImageField addImageField(const char *name, const char *description) { return SkinImageField( mski.AddImageField(dlg, name, description) ); }
+
+ SkinField getField(const char *name) { return SkinField( mski.GetField(dlg, name) ); }
+ SkinTextField getTextField(const char *name) { return SkinTextField( mski.GetField(dlg, name) ); }
+ SkinIconField getIconField(const char *name) { return SkinIconField( mski.GetField(dlg, name) ); }
+ SkinImageField getImageField(const char *name) { return SkinImageField( mski.GetField(dlg, name) ); }
+
+ void setInfoInt(const char *name, int value) { mski.SetInfoInt(dlg, name, value); }
+ void setInfoDouble(const char *name, double value) { mski.SetInfoDouble(dlg, name, value); }
+ void setInfoBool(const char *name, bool value) { mski.SetInfoBool(dlg, name, value); }
+ void setInfoString(const char *name, const TCHAR *value) { mski.SetInfoString(dlg, name, value); }
+ void removeInfo(const char *name) { mski.RemoveInfo(dlg, name); }
+
+ SkinDialogState run() { return SkinDialogState( mski.Run(dlg) ); }
+
+private:
+ SKINNED_DIALOG dlg;
+};
+
+
+#endif // __M_SKINS_CPP_H__
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_smcnotify.h b/plugins/ExternalAPI/m_smcnotify.h new file mode 100644 index 0000000000..88a0c184b7 --- /dev/null +++ b/plugins/ExternalAPI/m_smcnotify.h @@ -0,0 +1,59 @@ +/*
+Status Message Change Notify plugin for Miranda IM.
+
+Copyright © 2004-2005 NoName
+Copyright © 2005-2007 Daniel Vijge, Tomasz S³otwiñski, Ricardo Pescuma Domenecci
+
+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 __SMCNOTIFY_M_SMCNOTIFY_H
+#define __SMCNOTIFY_M_SMCNOTIFY_H
+
+
+#define EVENTTYPE_STATUSMESSAGE_CHANGE 9002
+
+/*
+Enable/Disable status message change notification
+
+wParam=
+0 - used internaly, toggle popups, lParam is ignored
+1 - enable/disable popups from within other plugins, see lParam
+lParam=0
+0 - disable popups
+1 - enable popups
+*/
+#define MS_SMCNOTIFY_POPUPS "SMCNotify/Popups"
+
+
+/*
+Show List with all the contact that have a status message set
+
+wParam=lParam=ignored
+*/
+#define MS_SMCNOTIFY_LIST "SMCNotify/ShowList"
+
+
+/*
+Go To URL in Status Message
+used just internaly for now
+
+wParam=lParam=ignored
+*/
+#define MS_SMCNOTIFY_GOTOURL "SMCNotify/GoToURL"
+
+
+
+#endif // __SMCNOTIFY_M_SMCNOTIFY_H
diff --git a/plugins/ExternalAPI/m_smileyadd.h b/plugins/ExternalAPI/m_smileyadd.h new file mode 100644 index 0000000000..6b367509f8 --- /dev/null +++ b/plugins/ExternalAPI/m_smileyadd.h @@ -0,0 +1,252 @@ +/*
+Miranda SmileyAdd Plugin
+Copyright (C) 2005 - 2010 Boris Krasnovskiy
+Copyright (C) 2003 - 2004 Rein-Peter de Boer
+
+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 version 2
+of the License.
+
+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, see <http://www.gnu.org/licenses/>.
+*/
+#include <richedit.h>
+
+#define SAFLRE_INSERTEMF 2 // insert smiley as EMF into RichEdit, otherwise bitmap inserted
+ // this flag allows "true" transparency
+#define SAFLRE_OUTGOING 4 // Parsing outgoing message
+#define SAFLRE_NOCUSTOM 8 // Do not use custom smileys
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ HWND hwndRichEditControl; //handle to the rich edit control
+ CHARRANGE* rangeToReplace; //same meaning as for normal Richedit use (NULL = replaceall)
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. SmileyAdd will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL, "Standard" will be used
+ unsigned flags; //Flags (SAFLRE_*) that define the behaivior
+ BOOL disableRedraw; //Parameter have been depricated, have no effect on operation
+ HANDLE hContact; //Contact handle
+} SMADD_RICHEDIT3;
+
+//Replace smileys in a rich edit control...
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_RICHEDIT3*) &smre; //pointer to SMADD_RICHEDIT3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_REPLACESMILEYS "SmileyAdd/ReplaceSmileys"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; //protocol to use... if you have defined a protocol, you can
+ //use your own protocol name. Smiley add will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ int xPosition; //Postition to place the selectwindow
+ int yPosition; // "
+ int Direction; //Direction (i.e. size upwards/downwards/etc) of the window 0, 1, 2, 3
+
+ HWND hwndTarget; //Window, where to send the message when smiley is selected.
+ UINT targetMessage; //Target message, to be sent.
+ LPARAM targetWParam; //Target WParam to be sent (LParam will be char* to select smiley)
+ //see the example file.
+ HWND hwndParent; //Parent window for smiley dialog
+ HANDLE hContact; //Contact handle
+} SMADD_SHOWSEL3;
+
+//Show smiley selection window
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_SHOWSEL3*) &smre; //pointer to SMADD_SHOWSEL3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_SHOWSELECTION "SmileyAdd/ShowSmileySelection"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; // " "
+ HICON ButtonIcon; //RETURN VALUE: this is filled with the icon handle
+ //of the smiley that can be used on the button
+ //if used with GETINFO2 handle must be destroyed by user!
+ //NULL if the buttonicon is not defined...
+ int NumberOfVisibleSmileys; //Number of visible smileys defined.
+ int NumberOfSmileys; //Number of total smileys defined
+ HANDLE hContact; //Contact handle
+} SMADD_INFO2;
+
+//get button smiley icon
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_INFO2*) &smgi; //pointer to SMADD_INFO2
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_GETINFO2 "SmileyAdd/GetInfo2"
+
+// Event notifies that SmileyAdd options have changed
+// Message dialogs usually need to redraw it's content on reception of this event
+//wParam = Contact handle which options have changed, NULL if global options changed
+//lParam = (LPARAM) 0; not used
+#define ME_SMILEYADD_OPTIONSCHANGED "SmileyAdd/OptionsChanged"
+
+#define SAFL_PATH 1 // provide smiley file path, icon otherwise
+#define SAFL_UNICODE 2 // string fields in OPTIONSDIALOGPAGE are WCHAR*
+#define SAFL_OUTGOING 4 // Parsing outgoing message
+#define SAFL_NOCUSTOM 8 // Do not use custom smileys
+
+#if defined _UNICODE || defined UNICODE
+ #define SAFL_TCHAR SAFL_UNICODE
+#else
+ #define SAFL_TCHAR 0
+#endif
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. Smiley add wil automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ union {
+ TCHAR* str; //String to parse
+ char* astr;
+ wchar_t* wstr;
+ };
+ unsigned flag; //One of the SAFL_ flags specifies parsing requirements
+ //This parameter should be filled by the user
+
+ unsigned numSmileys; //Number of Smileys found, this parameter filled by SmileyAdd
+ unsigned oflag; //One of the SAFL_ flags specifies content of the parse results
+ //this parameter filled by SmileyAdd
+ HANDLE hContact; //Contact handle
+} SMADD_BATCHPARSE2;
+
+typedef struct
+{
+ unsigned startChar; //Starting smiley character
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ unsigned size; //Number of characters in smiley (0 if not found)
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ union {
+ const TCHAR* filepath;
+ const char* afilepath;
+ const wchar_t* wfilepath;
+ HICON hIcon; //User responsible for destroying icon handle
+ };
+} SMADD_BATCHPARSERES;
+
+//find all smileys in text, API parses the provided text and returns all smileys found
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSE2*) &smgp; //pointer to SMADD_BATCHPARSE2
+//function returns pointer to array SMADD_BATCHPARSERES records for each smiley found
+//if no smileys found NULL is returned
+//if non NULL value returned pointer must be freed with MS_SMILEYADD_BATCHFREE API
+#define MS_SMILEYADD_BATCHPARSE "SmileyAdd/BatchParse"
+
+//Free memory allocated by MS_SMILEYADD_BATCHPARSE
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSERES*) &smgp; //pointer to SMADD_BATCHPARSERES
+#define MS_SMILEYADD_BATCHFREE "SmileyAdd/BatchFree"
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* name; //smiley category name for reference
+ char* dispname; //smiley category name for display
+} SMADD_REGCAT;
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_REGCAT*) &smgp; pointer to SMADD_REGCAT
+#define MS_SMILEYADD_REGISTERCATEGORY "SmileyAdd/RegisterCategory"
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) Pointer to protocol name or NULL for all;
+#define MS_SMILEYADD_RELOAD "SmileyAdd/Reload"
+
+#ifndef MIID_SMILEY
+// {E03C71B2-6DEE-467e-A4F0-DD516745876A}
+#define MIID_SMILEY { 0xe03c71b2, 0x6dee, 0x467e, { 0xa4, 0xf0, 0xdd, 0x51, 0x67, 0x45, 0x87, 0x6a } }
+#endif
+
+/**
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+
+*/
+
+// Type of Event one of
+#define FVCN_PREFIRE 1
+#define FVCN_POSTFIRE 2
+
+// Action of event are going to be done
+#define FVCA_NONE 0
+#define FVCA_DRAW 1 // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+#define FVCA_CUSTOMDRAW 2
+//#define FVCA_INVALIDATE 3 (not supported)
+//#define FVCA_SENDVIEWCHANGE 4 (not supported)
+#define FVCA_SKIPDRAW 5
+
+// Extended NMHDR structure for WM_NOTIFY
+typedef struct
+{
+ //NMHDR structure
+ HWND hwndFrom; // Window of smiley host
+ UINT idFrom; // ignored
+ UINT code; // NM_FIREVIEWCHANGE
+
+ size_t cbSize;
+ BYTE bEvent; // FVCN_ value - pre- or post- painting
+ BYTE bAction; // FVCA_ keys
+ HDC hDC; // Canvas to draw on
+ RECT rcRect; // Valid/should be in case of FVCA_DRAW
+ COLORREF clrBackground; // color to fill background if fTransparent is not set
+ BOOL fTransparent; // if need to fill back color (not supported)
+ LPARAM lParam; // used by host window PreFire and PostFire event
+} FVCNDATA_NMHDR;
+
+// Code of WM_NOTIFY message (code)
+#define NM_FIREVIEWCHANGE NM_FIRST+1;
+
+typedef struct
+{
+ unsigned cbSize; // size of the structure
+ HANDLE hContact;
+ int type; // 0 - directory, 1 - file;
+ TCHAR* path; // smiley category name for reference
+} SMADD_CONT;
+
+//Loads all smileys for the contact
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_CONT*) &dir; // pointer to directory to load smiley from
+#define MS_SMILEYADD_LOADCONTACTSMILEYS "SmileyAdd/LoadContactSmileys"
diff --git a/plugins/ExternalAPI/m_smileyadd_deprecated.h b/plugins/ExternalAPI/m_smileyadd_deprecated.h new file mode 100644 index 0000000000..ff9feb93ce --- /dev/null +++ b/plugins/ExternalAPI/m_smileyadd_deprecated.h @@ -0,0 +1,108 @@ +/*
+Miranda SmileyAdd Plugin
+Copyright (C) 2005 - 2009 Boris Krasnovskiy
+Copyright (C) 2003 - 2004 Rein-Peter de Boer
+
+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 version 2
+of the License.
+
+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, see <http://www.gnu.org/licenses/>.
+*/
+
+
+
+
+//find smileys in unicode text
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_PARSEW*) &smgp; //pointer to SMADD_PARSEW
+typedef struct
+{
+ int cbSize; //size of the structure
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. Smiley add wil automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ wchar_t* str; //String to parse
+ HICON SmileyIcon; //RETURN VALUE: the Icon handle is responsibility of the reciever
+ //it must be destroyed with DestroyIcon when not needed.
+ unsigned startChar; //Starting smiley character
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ unsigned size; //Number of characters in smiley (0 if not found)
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+} SMADD_PARSEW;
+
+#define MS_SMILEYADD_PARSEW "SmileyAdd/ParseW"
+
+
+//find smiley in text, API could be called iterativly, on each iteration the remainder
+//of the string after last smiley processed
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_PARSE*) &smgp; //pointer to SMADD_PARSE
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+typedef struct
+{
+ int cbSize; //size of the structure
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. Smiley add wil automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ char* str; //String to parse
+ HICON SmileyIcon; //RETURN VALUE: the Icon handle is responsibility of the reciever
+ //it must be destroyed with DestroyIcon when not needed.
+ unsigned startChar; //Starting smiley character
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ unsigned size; //Number of characters in smiley (0 if not found)
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+} SMADD_PARSE;
+
+#define MS_SMILEYADD_PARSE "SmileyAdd/Parse"
+
+
+//get button smiley icon
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_INFO*) &smgi; //pointer to SMADD_INFO
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_GETINFO "SmileyAdd/GetInfo"
+
+
+//find smiley, this API have been supreceeded with MS_SMILEYADD_PARSE[W]
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_GETICON*) &smgi; //pointer to SMADD_GETICON
+//return: TRUE if SmileySequence starts with a smiley, FALSE if not
+typedef struct
+{
+ int cbSize; //size of the structure
+ char* Protocolname; // " "
+ char* SmileySequence; //character string containing the smiley
+ HICON SmileyIcon; //RETURN VALUE: this is filled with the icon handle...
+ //do not destroy!
+ int Smileylength; //length of the smiley that is found.
+} SMADD_GETICON;
+
+#define MS_SMILEYADD_GETSMILEYICON "SmileyAdd/GetSmileyIcon"
+
+#define SMADD_SHOWSEL_SIZE_V1 32
+#define SMADD_SHOWSEL_SIZE_V2 36
+
+#define SMADD_RICHEDIT_SIZE_V1 16
+#define SMADD_RICHEDIT_SIZE_V2 24
+
+#define SMADD_INFO_SIZE_V1 20
+
+#define SMADD_BATCHPARSE_SIZE_V1 24
diff --git a/plugins/ExternalAPI/m_spellchecker.h b/plugins/ExternalAPI/m_spellchecker.h new file mode 100644 index 0000000000..c7b5d3c922 --- /dev/null +++ b/plugins/ExternalAPI/m_spellchecker.h @@ -0,0 +1,77 @@ +/*
+Copyright (C) 2006-2010 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_SPELLCHECKER_H__
+# define __M_SPELLCHECKER_H__
+
+
+#define MIID_SPELLCHECKER { 0x26eed12a, 0x7016, 0x4d0f, { 0x9b, 0x4a, 0xc, 0xaa, 0x7e, 0x22, 0x29, 0xf3 } }
+
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact; // The contact to get the settings from, or NULL
+ HWND hwnd; // The hwnd of the richedit
+ char *window_name; // A name for this richedit
+} SPELLCHECKER_ITEM;
+
+typedef struct {
+ int cbSize;
+ HWND hwnd; // The hwnd of the richedit
+ HMENU hMenu; // The handle to the menu
+ POINT pt; // The point, in screen coords
+ HWND hwndOwner; // The hwnd of owner of the popup menu. If it is null, hwnd is used
+} SPELLCHECKER_POPUPMENU;
+
+
+/*
+Adds a richedit control for the spell checker to check
+
+wParam: SPELLCHECKER_ITEM *
+lParam: ignored
+return: 0 on success
+*/
+#define MS_SPELLCHECKER_ADD_RICHEDIT "SpellChecker/AddRichedit"
+
+
+/*
+Removes a richedit control for the spell checker to check
+
+wParam: HWND
+lParam: ignored
+return: 0 on success
+*/
+#define MS_SPELLCHECKER_REMOVE_RICHEDIT "SpellChecker/RemoveRichedit"
+
+
+/*
+Show context menu
+
+wParam: SPELLCHECKER_POPUPMENU
+lParam: ignored
+return: the control id selected by the user, 0 if no one was selected, < 0 on error
+*/
+#define MS_SPELLCHECKER_SHOW_POPUP_MENU "SpellChecker/ShowPopupMenu"
+
+
+
+
+#endif // __M_SPELLCHECKER_H__
diff --git a/plugins/ExternalAPI/m_splash.h b/plugins/ExternalAPI/m_splash.h new file mode 100644 index 0000000000..3652e6a72b --- /dev/null +++ b/plugins/ExternalAPI/m_splash.h @@ -0,0 +1,6 @@ +// Shows splash image
+// wParam = (char *) image filename, either relative to Miranda dir or absolute
+// lParam = (int) time to display in milliseconds, 0 - infinite (hangs on screen until clicked)
+// returns: 1 if success and 0 if failed
+
+#define MS_SHOWSPLASH "SplashScreen/Show"
diff --git a/plugins/ExternalAPI/m_statusplugins.h b/plugins/ExternalAPI/m_statusplugins.h new file mode 100644 index 0000000000..5139673c6a --- /dev/null +++ b/plugins/ExternalAPI/m_statusplugins.h @@ -0,0 +1,154 @@ +/*
+ AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org)
+ KeepStatus Plugin for Miranda-IM (www.miranda-im.org)
+ StartupStatus Plugin for Miranda-IM (www.miranda-im.org)
+ Copyright 2003-2006 P. Boon
+
+ 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_STATUSPLUGINS
+#define __M_STATUSPLUGINS
+
+// -- common status -- (all three plugins)
+typedef struct {
+ int cbSize;
+ char *szName; // pointer to protocol modulename
+ char *szMsg; // pointer to the status message (may be NULL)
+ WORD status; // the status
+ WORD lastStatus;// last status
+ TCHAR *tszAccName;
+} PROTOCOLSETTINGEX;
+
+// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
+// lParam = 0
+// returns 0 on success
+#define MS_CS_SETSTATUSEX "CommonStatus/SetStatusEx"
+
+// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
+// lParam = timeout
+// returns hwnd
+#define MS_CS_SHOWCONFIRMDLGEX "CommonStatus/ShowConfirmDialogEx"
+
+// wParam = 0
+// lParam = 0
+// returns the number of protocols registerd
+#define MS_CS_GETPROTOCOUNT "CommonStatus/GetProtocolCount" // added dec '04
+
+// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
+// lParam = 0
+#define ME_CS_STATUSCHANGEEX "CommonStatus/StatusChangeEx"
+
+// -- startup status --
+// wParam = profile number (set to -1 to get default profile)
+// lParam = PROTOCOLSETTINGEX*** (keep for... )(memory must be allocated protoCount*PROTOCOLSETTINGEX* and protoCount*PROTOCOLSETTINGEX)
+// szMsg member does not have to be freed
+// returns 0 on success
+#define MS_SS_GETPROFILE "StartupStatus/GetProfile" // don't use this > jan '05, internal use only
+
+// wParam = profile number
+// lParam = 0
+// return 0 on success
+#define MS_SS_LOADANDSETPROFILE "StartupStatus/LoadAndSetProfile" // you can use this
+
+// wParam = int*, maybe NULL sets this int to the default profile number
+// lParam = 0
+// returns profile count
+#define MS_SS_GETPROFILECOUNT "StartupStatus/GetProfileCount"
+
+// wParam = profile number
+// lParam = char* (must be allocated, size = 128)
+// returns 0 on success
+#define MS_SS_GETPROFILENAME "StartupStatus/GetProfileName"
+
+// -- AdvancedAutoAway --
+typedef enum {
+ ACTIVE, // user is active
+ STATUS1_SET, // first status change happened
+ STATUS2_SET, // second status change happened
+ SET_ORGSTATUS, // user was active again, original status will be restored
+ HIDDEN_ACTIVE // user is active, but this is not shown to the outside world
+} STATES;
+
+typedef struct {
+ PROTOCOLSETTINGEX* protocolSetting;
+ int originalStatusMode; // this is set only when going from ACTIVE to STATUS1_SET (or to STATUS2_SET)
+ // (note: this is therefore not always valid)
+ STATES
+ oldState, // state before the call
+ curState; // current state
+ BOOL bStatusChanged; // the status of the protocol will actually be changed
+ // (note: unlike the name suggests, the status is changed AFTER this hook is called)
+ BOOL bManual; // state changed becuase status was changed manually
+} AUTOAWAYSETTING;
+// wParam = 0;
+// lParam = AUTOAWAYSETTING*
+// Called when a protocol's state in AAA is changed this does NOT necessary means the status was changed
+// note: this hook is called for each protocol seperately
+#define ME_AAA_STATECHANGED "AdvancedAutoAway/StateChanged"
+
+
+// -- KeepStatus --
+#define KS_CONN_STATE_LOST 1 // lParam = protocol
+#define KS_CONN_STATE_OTHERLOCATION 2 // lParam = protocol
+#define KS_CONN_STATE_RETRY 3 // lParam = nth retry
+#define KS_CONN_STATE_STOPPEDCHECKING 4 // lParam = TRUE if success, FALSE if failed
+#define KS_CONN_STATE_LOGINERROR 5 // lParam = protocol, only if selected in options
+#define KS_CONN_STATE_RETRYNOCONN 6 // lParam = nth try, a connection attempt will not be made
+// wParam = one of above
+// lParam depends on wParam
+#define ME_KS_CONNECTIONEVENT "KeepStatus/ConnectionEvent"
+
+// wParam = 0
+// lParam = 0
+// returns 0 on succes, nonzero on failure, probably keepstatus wasn't reconnecting
+#define MS_KS_STOPRECONNECTING "KeepStatus/StopReconnecting"
+
+// wParam = TRUE to enable checking a protocol, FALSE to disable checking a protocol
+// lParam = protocol
+// return 0 on success, nonzero on failure, probably the protocol is 'hard' disabled or not found
+// note: you cannot enable a protocol that is disabled in the options screen, you can disable a protocol
+// if it's enabled in the option screen.
+#define MS_KS_ENABLEPROTOCOL "KeepStatus/EnableProtocol"
+
+// wParam = 0
+// lParam = protocol
+// returns TRUE if protocol is enabled for checked, FALSE otherwise
+#define MS_KS_ISPROTOCOLENABLED "KeepStatus/IsProtocolEnabled"
+
+// Indicate the status will be changed which will not be regarded as a connection failure.
+// wParam = 0
+// lParam = PROTOCOLSETTINGEX* of the new situation
+// returns 0
+#define MS_KS_ANNOUNCESTATUSCHANGE "KeepStatus/AnnounceStatusChange"
+
+__inline static int announce_status_change(char *szProto, int newstatus, char *szMsg) {
+
+ PROTOCOLSETTINGEX ps;
+
+ ZeroMemory(&ps, sizeof(PROTOCOLSETTINGEX));
+ ps.cbSize = sizeof(PROTOCOLSETTINGEX);
+ if (szProto != NULL) {
+ ps.lastStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ } else {
+ ps.lastStatus = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
+ }
+ ps.status = newstatus;
+ ps.szMsg = szMsg;
+ ps.szName = szProto;
+
+ return CallService(MS_KS_ANNOUNCESTATUSCHANGE, 0, (LPARAM)&ps);
+}
+
+#endif // __M_STATUSPLUGINS
diff --git a/plugins/ExternalAPI/m_stopspam.h b/plugins/ExternalAPI/m_stopspam.h new file mode 100644 index 0000000000..ff3ae058fd --- /dev/null +++ b/plugins/ExternalAPI/m_stopspam.h @@ -0,0 +1,40 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2004-009 Roman Miklashevsky, A. Petkevich, Kosh&chka, persei
+
+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_STOPSPAM_H__
+#define M_STOPSPAM_H__
+
+#define CS_NOTPASSED 0
+#define CS_PASSED 1
+
+//check is contact pass the stopspam
+//wParam=(HANDLE)hContact
+//lParam=0
+//returns a "Contact Stae" flag
+#define MS_STOPSPAM_CONTACTPASSED "StopSpam/IsContactPassed"
+
+//remove all temporary contacts from db
+//wParam=0
+//lParam=0
+//returns 0
+#define MS_STOPSPAM_REMTEMPCONTACTS "StopSpam/RemoveTempContacts"
+
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_svc_dbepp.h b/plugins/ExternalAPI/m_svc_dbepp.h new file mode 100644 index 0000000000..d4afd1c7d0 --- /dev/null +++ b/plugins/ExternalAPI/m_svc_dbepp.h @@ -0,0 +1,62 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2003-2011 Bio, Jonathan Gordon
+
+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_DBEDITOR
+#define M_DBEDITOR
+
+/*
+Register single module as 'known'
+wParam=(char*)Module name
+lParam=0
+always returns 0
+Note: must be used after or in ME_SYSTEM_MODULESLOADED
+*/
+#define MS_DBEDIT_REGISTERSINGLEMODULE "DBEditorpp/RegisterSingleModule"
+
+/*
+Register modules as 'known'
+wParam=(char**)array with module names
+lParam=(int)count of module names
+always returns 0
+Note: must be used after or in ME_SYSTEM_MODULESLOADED
+Example:
+ char * mods[3] = {"Module1", "Module2", "Module3"};
+ CallService(MS_DBEDIT_REGISTERMODULE, (WPARAM)mods, (LPARAM)3);
+*/
+#define MS_DBEDIT_REGISTERMODULE "DBEditorpp/RegisterModule"
+
+/*
+Open user tree in DBE++
+wParam=(HANDLE)hContact
+lParam=0
+always returns 0
+*/
+#define MS_DBEDIT_MENUCOMMAND "DBEditorpp/MenuCommand"
+
+/*
+Import settings\contacts from file
+wParam=(HANDLE)hContact
+lParam=(char*)FilePath
+always returns 0
+*/
+#define MS_DBEDIT_IMPORT "DBEditorpp/Import"
+
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_synchro.h b/plugins/ExternalAPI/m_synchro.h new file mode 100644 index 0000000000..ff3e601ed9 --- /dev/null +++ b/plugins/ExternalAPI/m_synchro.h @@ -0,0 +1,160 @@ +#ifndef __SYNCHRO_H
+#define __SYNCHRO_H
+
+#include <windows.h>
+
+//
+//================================== OTHER DEFINITIONS ========================================
+//
+
+#define WAIT_FINISH WAIT_OBJECT_0+1
+
+// This structure is used to get semaphore-like synchronization:
+// Includes incrementing, decrementing DWORD value and if DWORD is zero, sets event
+typedef struct SynchronisedCounter
+{
+// Stores number value
+ HANDLE Event;
+ DWORD Number;
+
+// These methods are deleted due to external plugins. Use SCGetNumber,SCInc and SCDec instead
+// DWORD GetNumber();
+// DWORD Inc();
+// DWORD Dec();
+
+// Yes, some code is defined here. But it is not so problematic, because it uses only Win32 API calls and Win32 structures,
+ SynchronisedCounter(): Number(0)
+ {
+ InitializeCriticalSection(&CounterCS);
+ Event=CreateEvent(NULL,FALSE,TRUE,NULL);
+ SetEvent(Event);
+ }
+
+ SynchronisedCounter(HANDLE InitializedEvent): Number(0)
+ {
+ InitializeCriticalSection(&CounterCS);
+ Event=InitializedEvent;
+ SetEvent(Event);
+ }
+
+ ~SynchronisedCounter()
+ {
+ DeleteCriticalSection(&CounterCS);
+ CloseHandle(Event);
+ }
+
+//private: //it is not private as other functions (not methods) use these members
+ CRITICAL_SECTION CounterCS;
+} SCOUNTER, *PSCOUNTER;
+
+// The single-writer/multiple-reader guard
+// compound synchronization object (SO)
+// Notices: Copyright (c) 1995-1997 Jeffrey Richter
+// Changes: majvan, only one process implementation,
+// hFinishEV event added- signals when we do not want to use this SO anymore
+typedef struct SingleWriterMultiReaderGuard
+{
+// This event guards access to the other objects
+// managed by this data structure and also indicates
+// whether any writer threads are writing.
+ HANDLE hEventNoWriter;
+
+// This manual-reset event is signaled when
+// no reader threads are reading.
+ HANDLE hEventNoReaders;
+
+// This value is used simply as a counter.
+// (the count is the number of reader threads)
+ HANDLE hSemNumReaders;
+
+// The request is for not to enter critical section
+// for writing or reading due to going to delete guard
+ HANDLE hFinishEV;
+} SWMRG, *PSWMRG;
+
+//
+//================================== FUNCTIONS DEFINITIONS ========================================
+//
+
+typedef DWORD (WINAPI *YAMN_WAITTOWRITEFCN)(PSWMRG,PSCOUNTER);
+typedef void (WINAPI *YAMN_WRITEDONEFCN)(PSWMRG,PSCOUNTER);
+typedef DWORD (WINAPI *YAMN_WAITTOREADFCN)(PSWMRG);
+typedef void (WINAPI *YAMN_READDONEFCN)(PSWMRG);
+typedef DWORD (WINAPI *YAMN_SCMANAGEFCN)(PSCOUNTER);
+
+//
+//================================== QUICK FUNCTION CALL DEFINITIONS ========================================
+//
+
+//These are defininitions for YAMN exported functions. Your plugin can use them.
+//pYAMNFcn is global variable, it is pointer to your structure containing YAMN functions.
+//It is something similar like pluginLink variable in Miranda plugin. If you use
+//this name of variable, you have already defined these functions and you can use them.
+//It's similar to Miranda's CreateService function.
+//These functions are used to synchronize accounts. YAMN could create service for these
+//functions and you could call them then e.g. CallService(MS_YAMNWAITTOWRITE,WPARAM,LPARAM),
+//but I think this solution is better, because these functions are much used. It is more
+//"normal" if you call function for example like:
+//WaitToWrite(ActualAccount) than CallService(MS_YAMNWAITTOWRITE,ActualAccount,NULL))
+
+//How to use YAMN functions:
+//Create a structure containing pointer to functions you want to use in your plugin
+//This structure can look something like this:
+//
+// struct
+// {
+// YAMN_WAITTOWRITEFCN WaitToWriteFcn;
+// YAMN_WRITEDONEFCN WriteDoneFcn;
+// } *pYAMNFcn;
+//
+//then you have to fill this structure with pointers...
+//you have to use YAMN service to get pointer, like this (I wrote here all functions you may need,
+//you can copy to your sources only those you need):
+//
+// pYAMNFcn->WaitToWriteFcn=(YAMN_WAITTOWRITEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_WAITTOWRITEID,(LPARAM)0);
+// pYAMNFcn->WriteDoneFcn=(YAMN_WRITEDONEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_WRITEDONEID,(LPARAM)0);
+// pYAMNFcn->WaitToReadFcn=(YAMN_WAITTOREADFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_WAITTOREADID,(LPARAM)0);
+// pYAMNFcn->ReadDoneFcn=(YAMN_READDONEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_READDONEID,(LPARAM)0);
+// pYAMNFcn->SCGetNumberFcn=(YAMN_SCMANAGEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SCGETNUMBERID,(LPARAM)0);
+// pYAMNFcn->SCIncFcn=(YAMN_SCMANAGEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SCINCID,(LPARAM)0);
+// pYAMNFcn->SCDecFcn=(YAMN_SCMANAGEFCN)CallService(MS_YAMN_GETFCNPTR,(WPARAM)YAMN_SCDECID,(LPARAM)0);
+//
+//and in your plugin just simply use e.g.:
+//
+// MsgsWriteDone(ActualAccount); //this command leaves write access to account mails
+//
+
+#define YAMN_WAITTOWRITEID "YAMN/WaitToWrite"
+#define YAMN_WRITEDONEID "YAMN/WriteDone"
+#define YAMN_WAITTOREADID "YAMN/WaitToRead"
+#define YAMN_READDONEID "YAMN/ReadDone"
+#define YAMN_SCGETNUMBERID "YAMN/SCGetNumber"
+#define YAMN_SCINCID "YAMN/SCInc"
+#define YAMN_SCDECID "YAMN/SCDec"
+
+#define WaitToWrite(x) pYAMNFcn->WaitToWriteFcn(x->AccountAccessSO,0)
+#define WaitToWriteEx(x,y) pYAMNFcn->WaitToWriteFcn(x->AccountAccessSO,y)
+#define WriteDone(x) pYAMNFcn->WriteDoneFcn(x->AccountAccessSO,0)
+#define WaitToRead(x) pYAMNFcn->WaitToReadFcn(x->AccountAccessSO)
+#define WaitToReadEx(x,y) pYAMNFcn->WaitToReadFcn(x->AccountAccessSO,y)
+#define ReadDone(x) pYAMNFcn->ReadDoneFcn(x->AccountAccessSO)
+
+#define MsgsWaitToWrite(x) pYAMNFcn->WaitToWriteFcn(x->MessagesAccessSO,0)
+#define MsgsWaitToWriteEx(x,y) pYAMNFcn->WaitToWriteFcn(x->MessagesAccessSO,y)
+#define MsgsWriteDone(x) pYAMNFcn->WriteDoneFcn(x->MessagesAccessSO,0)
+#define MsgsWaitToRead(x) pYAMNFcn->WaitToReadFcn(x->MessagesAccessSO)
+#define MsgsWaitToReadEx(x) pYAMNFcn->WaitToReadFcn(x->MessagesAccessSO,y)
+#define MsgsReadDone(x) pYAMNFcn->ReadDoneFcn(x->MessagesAccessSO)
+
+#define WaitToWriteSO(x) pYAMNFcn->WaitToWriteFcn(x,0)
+#define WaitToWriteSOEx(x,y) pYAMNFcn->WaitToWriteFcn(x,y)
+#define WriteDoneSO(x) pYAMNFcn->WriteDoneFcn(x,0)
+#define WaitToReadSO(x) pYAMNFcn->WaitToReadFcn(x)
+#define WaitToReadSOEx(x,y) pYAMNFcn->WaitToReadFcn(x,y)
+#define ReadDoneSO(x) pYAMNFcn->ReadDoneFcn(x)
+
+#define SCGetNumber(x) pYAMNFcn->SCGetNumberFcn(x)
+#define SCInc(x) pYAMNFcn->SCIncFcn(x)
+#define SCDec(x) pYAMNFcn->SCDecFcn(x)
+
+#endif
diff --git a/plugins/ExternalAPI/m_text.h b/plugins/ExternalAPI/m_text.h new file mode 100644 index 0000000000..be1b3e4a0e --- /dev/null +++ b/plugins/ExternalAPI/m_text.h @@ -0,0 +1,370 @@ +#ifndef __mtext_h__
+#define __mtext_h__
+
+// NEW mtextcontrol interface:
+//
+// obtain the full mtextcontrol interface from the library. it is much faster as use of
+// miranda core CallService to access to mtextcontrol (no core traffic).
+// This interface provides full access to mtextcontrol internal functions,
+// thus enabling devs to fully utilize the mtextcontrol API.
+// All functions will be exported as miranda services for compatibility.
+//
+// the interface is populated during the Load(PLUGINLINK *link) handler, so you can assume it is ready when Miranda
+// throw the ME_SYSTEM_MODULESLOADED event and you can generate a warning in your ModulesLoaded() when
+// it depends on the mtextcontrol interface and the mtextcontrol plugin is missing.
+//
+// example:
+//
+// MTEXT_INTERFACE MText = {0};
+//
+// mir_getMTI(&MText);
+//
+// all interface function designed as old mtextcontrol helper functions.
+// therefore it is easy to convert your old plugin code to new interface.
+//
+// example:
+//
+// old code: MTextCreate (...
+// new code: MText.Create(...
+
+// Text control
+#define MTEXTCONTROLCLASS "MTextControl"
+#define MTM_SETUSER WM_USER
+#define MTM_UPDATE WM_USER+1
+
+#if defined(_WIN32) || defined(__WIN32__)
+ #define DLL_CALLCONV __stdcall
+#endif
+
+typedef struct _tagMTEXT_interface {
+ size_t cbSize;
+ DWORD version;
+ HANDLE (DLL_CALLCONV *Register) (const char *userTitle, DWORD options);
+ HANDLE (DLL_CALLCONV *Create) (HANDLE userHandle, char *text);
+ HANDLE (DLL_CALLCONV *CreateW) (HANDLE userHandle, WCHAR *text);
+ #if defined(UNICODE) || defined (_UNICODE)
+ HANDLE (DLL_CALLCONV *CreateT) (HANDLE userHandle, WCHAR *text);
+ #else
+ HANDLE (DLL_CALLCONV *CreateT) (HANDLE userHandle, char *text);
+ #endif
+ HANDLE (DLL_CALLCONV *CreateEx) (HANDLE userHandle, HANDLE hContact, void *text, DWORD flags);
+ int (DLL_CALLCONV *Measure) (HDC dc, SIZE *sz, HANDLE text);
+ int (DLL_CALLCONV *Display) (HDC dc, POINT pos, SIZE sz, HANDLE text);
+ int (DLL_CALLCONV *SetParent) (HANDLE text, HWND hwnd, RECT rect);
+ int (DLL_CALLCONV *SendMsg) (HWND hwnd, HANDLE text, UINT msg, WPARAM wParam, LPARAM lParam);
+ HWND (DLL_CALLCONV *CreateProxy) (HANDLE text);
+ int (DLL_CALLCONV *Destroy) (HANDLE text);
+} MTEXT_INTERFACE;
+
+// get access to the interface
+// wParam = 0
+// lParam = (LPARAM)(MTEXT_INTERFACE*)Mtext
+// dont vorget to set cbSize before call service
+#define MS_TEXT_GETINTERFACE "MText/GetInterface"
+
+__forceinline INT_PTR mir_getMTI( MTEXT_INTERFACE* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ INT_PTR result = CallService( MS_TEXT_GETINTERFACE, 0, (LPARAM)dest );
+ #if defined(UNICODE) || defined (_UNICODE)
+ dest->CreateT = dest->CreateW;
+ #else
+ dest->CreateT = dest->Create;
+ #endif
+ return result;
+}
+
+enum
+{
+ // visual text options, used in MS_TEXT_REGISTER
+ MTEXT_FANCY_SMILEYS = 0x00000010, // SmileyAdd smileys
+ MTEXT_FANCY_BBCODES = 0x00000020, // [b], [u], [i]
+ MTEXT_FANCY_MATHMOD = 0x00000040, // enable math module formula parsing
+ MTEXT_FANCY_URLS = 0x00000080, // underline urls
+ MTEXT_FANCY_BBCODES2 = 0x00000100, // [color], [img], [url], not implemented yet
+ MTEXT_FANCY_SIMPLEFMT = 0x00000200, // simple formatting ("_", "/" and "*")
+ MTEXT_FANCY_MASK = 0x00007fff,
+ MTEXT_FANCY_DEFAULT = 0x00008000, // Use default options
+
+ // text options, used in MS_TEXT_REGISTER
+ MTEXT_SYSTEM_HICONS = 0x00010000, // [$handle=i<HICON as dword>$]
+ MTEXT_SYSTEM_HBITMAPS = 0x00010000, // [$handle=b<HBITMAP as dword>$], not implemented yet
+ MTEXT_SYSTEM_ESCAPED = 0x00020000, // passed text is escaped with slashes, not implemented yet
+ MTEXT_SYSTEM_MASK = 0x7fff0000,
+ MTEXT_SYSTEM_DEFAULT = 0x80000000, // Use default option -- just nothing system is used :)
+
+ // text object flags
+ MTEXT_FLG_CHAR = 0x00000000,
+ MTEXT_FLG_WCHAR = 0x00000001,
+ MTEXT_FLG_BIDI_RTL = 0x00000002
+};
+
+#if defined(UNICODE) || defined (_UNICODE)
+ #define MTEXT_FLG_TCHAR MTEXT_FLG_WCHAR
+#else
+ #define MTEXT_FLG_TCHAR MTEXT_FLG_CHAR
+#endif
+
+// used in MS_TEXT_CREATEEX
+typedef struct tagMTEXTCREATE
+{
+ DWORD cbSize;
+ HANDLE hContact;
+ void *text; // this is 'char *' or 'WCHAR *'
+ DWORD flags;
+
+ #ifdef __cplusplus
+ tagMTEXTCREATE():
+ text(0), hContact(0), flags(0)
+ {
+ cbSize = sizeof(*this);
+ }
+ #endif
+} MTEXTCREATE, *LPMTEXTCREATE;
+
+// used in MS_TEXT_MEASURE and MS_TEXT_DISPLAY
+typedef struct tagMTEXTDISPLAY
+{
+ DWORD cbSize;
+ HDC dc;
+ POINT pos;
+ SIZE sz;
+ HANDLE text;
+
+ #ifdef __cplusplus
+ tagMTEXTDISPLAY():
+ dc(0), text(0)
+ {
+ cbSize = sizeof(*this);
+ pos.x = pos.y = 0;
+ sz.cx = sz.cy = 0;
+ }
+ #endif
+} MTEXTDISPLAY, *LPMTEXTDISPLAY;
+
+// used in MS_TEXT_SETPARENT
+typedef struct tagMTEXTSETPARENT
+{
+ HANDLE text;
+ HWND hwnd;
+ RECT rc;
+
+ #ifdef __cplusplus
+ tagMTEXTSETPARENT():
+ hwnd(0), text(0)
+ {
+ }
+ #endif
+} MTEXTSETPARENT, *LPMTEXTSETPARENT;
+
+// used in MS_TEXT_SENDMESSAGE
+typedef struct tagMTEXTMESSAGE
+{
+ HWND hwnd;
+ HANDLE text;
+ UINT msg;
+ WPARAM wParam;
+ LPARAM lParam;
+
+ #ifdef __cplusplus
+ tagMTEXTMESSAGE():
+ hwnd(0), text(0), msg(0), wParam(0), lParam(0)
+ {
+ }
+ #endif
+} MTEXTMESSAGE, *LPMTEXTMESSAGE;
+
+//---------------------------------------------------------------------------
+// deprecatet service and helper functions
+// replaced by new mtext interface !!!!!!!
+//---------------------------------------------------------------------------
+#if defined(NOHELPERS) || defined(MIRANDA_NOHELPERS)
+ #define MTEXT_NOHELPERS
+#endif
+
+// subscribe to MText services
+// wParam = (WPARAM)(DOWRD)defaultOptions
+// lParam = (LPARAM)(char *)userTitle
+// result = (LRESULT)(HANDLE)userHandle
+#define MS_TEXT_REGISTER "MText/Register"
+
+#ifndef MTEXT_NOHELPERS
+__inline HANDLE MTextRegister(const char *userTitle, DWORD options)
+{
+ return (HANDLE)CallService(MS_TEXT_REGISTER, (WPARAM)options, (LPARAM)userTitle);
+}
+#endif // MTEXT_NOHELPERS
+
+// allocate text object
+// wParam = (WPARAM)(HANDLE)userHandle
+// lParam = (LPARAM)(char *)text
+// result = (LRESULT)(HANDLE)textHandle
+#define MS_TEXT_CREATE "MText/Create"
+
+#ifndef MTEXT_NOHELPERS
+__inline HANDLE MTextCreate(HANDLE userHandle, char *text)
+{
+ return (HANDLE)CallService(MS_TEXT_CREATE, (WPARAM)userHandle, (LPARAM)text);
+}
+#endif // MTEXT_NOHELPERS
+
+// allocate text object (unicode)
+// wParam = (WPARAM)(HANDLE)userHandle
+// lParam = (LPARAM)(WCHAR *)text
+// result = (LRESULT)(HANDLE)textHandle
+#define MS_TEXT_CREATEW "MText/CreateW"
+
+#ifndef MTEXT_NOHELPERS
+__inline HANDLE MTextCreateW(HANDLE userHandle, WCHAR *text)
+{
+ return (HANDLE)CallService(MS_TEXT_CREATEW, (WPARAM)userHandle, (LPARAM)text);
+}
+#endif // MTEXT_NOHELPERS
+
+// allocate text object (advanced)
+// wParam = (WPARAM)(HANDLE)userHandle
+// lParam = (LPARAM)(LPMTEXTCREATE)createInfo
+// result = (LRESULT)(HANDLE)textHandle
+#define MS_TEXT_CREATEEX "MText/CreateEx"
+
+#ifndef MTEXT_NOHELPERS
+__inline HANDLE MTextCreateEx(HANDLE userHandle, HANDLE hContact, void *text, DWORD flags)
+{
+ #ifdef __cplusplus
+ MTEXTCREATE textCreate;
+ #else
+ MTEXTCREATE textCreate = {0};
+ textCreate.cbSize = sizeof(textCreate);
+ #endif
+ textCreate.hContact = hContact;
+ textCreate.text = text;
+ textCreate.flags = flags;
+ return (HANDLE)CallService(MS_TEXT_CREATEEX, (WPARAM)userHandle, (LPARAM)&textCreate);
+}
+#endif // MTEXT_NOHELPERS
+
+// measure text object
+// wParam = (LPARAM)(LPMTEXTDISPLAY)displayInfo
+// result = 1 (success), 0 (failure)
+// displayInfo->size.cx is interpreted as maximum width allowed.
+// wrapped text size is stored in displayInfo->size, text
+#define MS_TEXT_MEASURE "MText/Measure"
+
+#ifndef MTEXT_NOHELPERS
+__inline int MTextMeasure(HDC dc, SIZE *sz, HANDLE text)
+{
+ #ifdef __cplusplus
+ MTEXTDISPLAY displayInfo;
+ #else
+ MTEXTDISPLAY displayInfo = {0};
+ displayInfo.cbSize = sizeof(displayInfo);
+ #endif
+ displayInfo.dc = dc;
+ displayInfo.pos.x = displayInfo.pos.y = 0;
+ displayInfo.sz = *sz;
+ displayInfo.text = text;
+ int result = (int)CallService(MS_TEXT_MEASURE, (WPARAM)&displayInfo, (LPARAM)0);
+ *sz = displayInfo.sz;
+ return result;
+}
+#endif // MTEXT_NOHELPERS
+
+// display text object
+// wParam = (LPARAM)(LPMTEXTDISPLAY)displayInfo
+// result = 1 (success), 0 (failure)
+#define MS_TEXT_DISPLAY "MText/Display"
+
+#ifndef MTEXT_NOHELPERS
+__inline int MTextDisplay(HDC dc, POINT pos, SIZE sz, HANDLE text)
+{
+ #ifdef __cplusplus
+ MTEXTDISPLAY displayInfo;
+ #else
+ MTEXTDISPLAY displayInfo = {0};
+ displayInfo.cbSize = sizeof(displayInfo);
+ #endif
+ displayInfo.dc = dc;
+ displayInfo.pos = pos;
+ displayInfo.sz = sz;
+ displayInfo.text = text;
+ return (int)CallService(MS_TEXT_DISPLAY, (WPARAM)&displayInfo, (LPARAM)0);
+}
+#endif // MTEXT_NOHELPERS
+
+// set parent window for text object (this is required for mouse handling, etc)
+// wParam = (WPARAM)(LPMTEXTSETPARENT)info
+// result = message result
+#define MS_TEXT_SETPARENT "MText/SetParent"
+
+#ifndef MTEXT_NOHELPERS
+__inline int MTextSetParent(HANDLE text, HWND hwnd, RECT rect)
+{
+ MTEXTSETPARENT info;
+ info.text = text;
+ info.hwnd = hwnd;
+ info.rc = rect;
+ return (int)CallService(MS_TEXT_SETPARENT, (WPARAM)&info, (LPARAM)0);
+}
+#endif // MTEXT_NOHELPERS
+
+// send message to an object
+// wParam = (WPARAM)(LPMTEXTMESSAGE)message
+// result = message result
+#define MS_TEXT_SENDMESSAGE "MText/SendMessage"
+
+#ifndef MTEXT_NOHELPERS
+__inline int MTextSendMessage(HWND hwnd, HANDLE text, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ #ifdef __cplusplus
+ MTEXTMESSAGE message;
+ #else
+ MTEXTMESSAGE message = {0};
+ #endif
+ message.hwnd = hwnd;
+ message.text = text;
+ message.msg = msg;
+ message.wParam = wParam;
+ message.lParam = lParam;
+ return (int)CallService(MS_TEXT_SENDMESSAGE, (WPARAM)&message, (LPARAM)0);
+}
+#endif // MTEXT_NOHELPERS
+
+// create a proxy window
+// wParam = (LPARAM)(HANDLE)textHandle
+#define MS_TEXT_CREATEPROXY "MText/CreateProxy"
+
+#ifndef MTEXT_NOHELPERS
+__inline HWND MTextCreateProxy(HANDLE text)
+{
+ return (HWND)CallService(MS_TEXT_CREATEPROXY, (WPARAM)text, (LPARAM)0);
+}
+#endif // MTEXT_NOHELPERS
+
+// destroy text object
+// wParam = (LPARAM)(HANDLE)textHandle
+#define MS_TEXT_DESTROY "MText/Destroy"
+
+#ifndef MTEXT_NOHELPERS
+__inline int MTextDestroy(HANDLE text)
+{
+ return (int)CallService(MS_TEXT_DESTROY, (WPARAM)text, (LPARAM)0);
+}
+#endif // MTEXT_NOHELPERS
+
+//#define MS_TEXT_QDISPLAY "MText/QDisplay"
+//#define MS_TEXT_QDISPLAYW "MText/QDisplayW"
+
+// T-definitions for unicode
+#if defined(UNICODE) || defined (_UNICODE)
+ #define MS_TEXT_CREATET MS_TEXT_CREATEW
+ #ifndef MTEXT_NOHELPERS
+ #define MTextCreateT MTextCreateW
+ #endif
+#else
+ #define MS_TEXT_CREATET MS_TEXT_CREATE
+ #ifndef MTEXT_NOHELPERS
+ #define MTextCreateT MTextCreate
+ #endif
+#endif
+
+#endif // __mtext_h__
diff --git a/plugins/ExternalAPI/m_ticker.h b/plugins/ExternalAPI/m_ticker.h new file mode 100644 index 0000000000..ff4d8a7915 --- /dev/null +++ b/plugins/ExternalAPI/m_ticker.h @@ -0,0 +1,50 @@ +#ifndef M_TICKER_H
+#define M_TICKER_H
+
+
+/* TICKER_ADD_STRING
+wParam = (WPARAM)(*TICKERDATA)TickerDataAddress (see below)
+lParam = 0... not used..
+returns (int)TickerID on success or 0 if it fails
+*/
+#define TICKER_ADD_STRING "Ticker/AddString"
+
+/* TICKER_ADD_SIMPLESTRING
+wParam = (char*) szMessage // the text to display
+lParam = (char*) szTooltip // the Items tooltip (can be NULL)
+this service function will use default values for the rest of the TICKERDATA values
+returns (int)TickerID on success or 0 if it fails
+*/
+#define TICKER_ADD_SIMPLESTRING "Ticker/AddSimpleString"
+
+/* TICKER_ADD_FROMPOPUPPLUGIN
+This should only be called from the popup plugin before (or after.. makes no difference)
+the popup is created and the user wants to display the ticker
+wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
+lParam = 0
+returns (int)TickerID on success or 0 if it fails
+*/
+#define TICKER_ADD_FROMPOPUPPLUGIN "Ticker/AddFromPopupPlugin"
+
+
+typedef struct {
+ char* szMessage; // the message you want to display, will be copied to another mem address by me, so u can free your copy
+ char* szTooltip; // a message to display in the items tooltip, can be NULL will be copied to another mem address by me, so u can free your copy
+ COLORREF crForeground; // the foreground colour.. can be NULL
+ COLORREF crBackground; // the background colour.. can be NULL
+ WNDPROC PluginWindowProc; // for the window proc.. can be NULL -->- these are more for popup compatability but someone might find it usefull
+ HANDLE hContact; // can be NULL -/
+ void * PluginData; // other plugins might want this... -/
+} TICKERDATA, *LPTICKERDATA;
+
+
+
+
+
+
+
+
+
+
+
+#endif
diff --git a/plugins/ExternalAPI/m_tipper.h b/plugins/ExternalAPI/m_tipper.h new file mode 100644 index 0000000000..21b6df7cef --- /dev/null +++ b/plugins/ExternalAPI/m_tipper.h @@ -0,0 +1,45 @@ +/*
+Copyright (C) 2006-07 Scott Ellis
+Copyright (C) 2007-09 Jan Holub
+
+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.
+*/
+
+
+// Tipper API
+// note: Tipper is internally unicode and requires unicows.dll to function correctly on 95/98/ME
+// so you'll find a lot of wchar_t stuff in here
+
+// translation function type
+// use hContact, module and setting to read your db value(s) and put the resulting string into buff
+// return buff if the translation was successful, or return 0 for failure
+typedef TCHAR *(TranslateFunc)(HANDLE hContact, const char *module, const char *setting_or_prefix, TCHAR *buff, int bufflen);
+
+typedef struct {
+ TranslateFunc *transFunc; // address of your translation function (see typedef above)
+ const TCHAR *swzName; // make sure this is unique, and DO NOT translate it
+ DWORD id; // will be overwritten by Tipper - do not use
+} DBVTranslation;
+
+// add a translation to tipper
+// wParam not used
+// lParam = (DBVTranslation *)translation
+#define MS_TIPPER_ADDTRANSLATION "Tipper/AddTranslation"
+
+// unicode extension to the basic functionality
+// wParam - optional (wchar_t *)text for text-only tips
+// lParam - (CLCINFOTIP *)infoTip
+#define MS_TIPPER_SHOWTIPW "mToolTip/ShowTipW"
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_toolbar.h b/plugins/ExternalAPI/m_toolbar.h new file mode 100644 index 0000000000..fc417cf873 --- /dev/null +++ b/plugins/ExternalAPI/m_toolbar.h @@ -0,0 +1,88 @@ +#ifndef M_TOOLBAR_H
+#define M_TOOLBAR_H
+
+#define TOOLBARBUTTON_ICONIDPREFIX "MTB_"
+#define TOOLBARBUTTON_ICONIDPRIMARYSUFFIX "_Primary"
+#define TOOLBARBUTTON_ICONIDSECONDARYSUFFIX "_Secondary"
+#define TOOLBARBUTTON_ICONNAMEPRESSEDSUFFIX "Pressed"
+
+//button flags
+#define TBBF_DISABLED (1<<0)
+#define TBBF_VISIBLE (1<<1)
+#define TBBF_PUSHED (1<<2)
+#define TBBF_SHOWTOOLTIP (1<<3)
+#define TBBF_ISSEPARATOR (1<<5)
+#define TBBF_ISLBUTTON (1<<6)
+#define TBBF_FLEXSIZESEPARATOR (TBBF_ISSEPARATOR|TBBF_PUSHED)
+typedef struct _tagTBButton
+{
+ int cbSize; // size of structure
+ char * pszButtonID; // char id of button used to store button info in DB and know about icon
+ char * pszButtonName; // name of button (not translated)
+ char * pszServiceName; // service name to be executed
+ LPARAM lParam; // param of service to be called
+ char * pszTooltipUp, *pszTooltipDn;
+ DWORD defPos; // default order pos of button (less values are nearer to edge).. please use values greater that 100. the default buttons has pos: 10,20..90
+ DWORD tbbFlags; // combine of TBBF_ flags above
+ void (*ParamDestructor)(void *); //will be called on parameters deletion
+ HANDLE hPrimaryIconHandle;
+ HANDLE hSecondaryIconHandle;
+}TBButton;
+
+//////////////////////////////////////////////////////////////////////////
+// Events
+// Only after this event module subscribers should register their buttons
+// wparam=lparam=0
+// don't forget to return 0 to continue processing
+#define ME_TB_MODULELOADED "ToolBar/ModuleLoaded"
+
+//////////////////////////////////////////////////////////////////////////
+// Services
+//
+//////////////////////////////////////////////////////////////////////////
+// Adding a button
+// WPARAM = 0
+// LPARAM = (TBButton *) &description
+// LRESULT = (HANDLE) hButton
+// in order to correctly process default icons via iconlib it should be
+// registered icolib icon with id named:
+// 'TBButton_'+pszButtonID+ 'Up' or +'Down' for Push (2-state) buttons
+#define MS_TB_ADDBUTTON "ToolBar/AddButton"
+
+//////////////////////////////////////////////////////////////////////////
+// Remove button
+// WPARAM = (HANDLE) hButton;
+// LPARAM = 0;
+#define MS_TB_REMOVEBUTTON "ToolBar/RemoveButton"
+
+//////////////////////////////////////////////////////////////////////////
+// SetState
+// WPARAM = (HANDLE) hButton;
+// LPARAM = one of below TBST_ states
+// LRESULT= old state
+#define TBST_PUSHED 1
+#define TBST_RELEASED 0
+#define MS_TB_SETBUTTONSTATE "ToolBar/SetButtonState"
+
+//////////////////////////////////////////////////////////////////////////
+// SetStatebyId
+// WPARAM = (char *) szButtonID;
+// LPARAM = one of below TBST_ states
+// LRESULT= old state
+#define MS_TB_SETBUTTONSTATEBYID "ToolBar/SetButtonStateId"
+//////////////////////////////////////////////////////////////////////////
+// GetState
+// WPARAM = (HANLDE) hButton;
+// LPARAM = 0
+// LRESULT= current state
+#define MS_TB_GETBUTTONSTATE "ToolBar/GetButtonState"
+
+//////////////////////////////////////////////////////////////////////////
+// GetState
+// WPARAM = (char *) szButtonID;;
+// LPARAM = 0
+// LRESULT= current state
+#define MS_TB_GETBUTTONSTATEBYID "ToolBar/GetButtonStateId"
+
+
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h new file mode 100644 index 0000000000..5628f68de8 --- /dev/null +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -0,0 +1,125 @@ +
+#ifndef M_TOPTOOLBAR_H
+#define M_TOPTOOLBAR_H
+
+//button flags
+#define TTBBF_DISABLED 1
+#define TTBBF_VISIBLE 2
+#define TTBBF_PUSHED 4
+#define TTBBF_SHOWTOOLTIP 8
+#define TTBBF_DRAWBORDER 16//draw border for bitmap,bitmap must be WxH 16x12
+#define TTBBF_ISSEPARATOR 32
+
+//for internal launch buttons
+#define TTBBF_ISLBUTTON 64
+
+typedef struct {
+ int cbSize;
+ HBITMAP hbBitmapUp;
+ HBITMAP hbBitmapDown;
+ char *pszServiceUp;
+ char *pszServiceDown;
+ DWORD dwFlags;
+ LPARAM lParamUp;
+ WPARAM wParamUp;
+ LPARAM lParamDown;
+ WPARAM wParamDown;
+ char *name;
+
+} TTBButton, * lpTTBButton;
+
+typedef struct {
+ int cbSize;
+ HBITMAP hbBitmapUp;
+ HBITMAP hbBitmapDown;
+ char *pszServiceUp;
+ char *pszServiceDown;
+ DWORD dwFlags;
+ LPARAM lParamUp;
+ WPARAM wParamUp;
+ LPARAM lParamDown;
+ WPARAM wParamDown;
+ char *name;
+ HICON hIconUp,hIconDn;
+ char *tooltipUp;
+ char *tooltipDn;
+
+} TTBButtonV2, * lpTTBButtonV2;
+
+//=== EVENTS ===
+/*
+toptoolbar/moduleloaded event
+wParam = lParam = 0
+Called when the toolbar services are available
+
+!!!Warning you may work with TTB services only in this event or later.
+
+*/
+#define ME_TTB_MODULELOADED "TopToolBar/ModuleLoaded"
+
+
+
+//=== SERVICES ===
+/*
+toptoolbar/addbutton service
+wparam = (TTBButton*)lpTTBButton
+lparam = 0
+returns: hTTBButton - handle of added button on success, -1 on failure.
+*/
+#define MS_TTB_ADDBUTTON "TopToolBar/AddButton"
+
+/*
+toptoolbar/removebutton service
+wparam = (HANDLE)hTTButton
+lparam = 0
+returns: 0 on success, -1 on failure.
+*/
+#define MS_TTB_REMOVEBUTTON "TopToolBar/RemoveButton"
+
+/*
+toptoolbar/setstate service
+wparam = (HANDLE)hTTButton
+lparam = (LPARAM) state
+returns: 0 on success, -1 on failure.
+*/
+#define TTBST_PUSHED 1
+#define TTBST_RELEASED 2
+
+#define MS_TTB_SETBUTTONSTATE "TopToolBar/SetState"
+
+/*
+toptoolbar/getstate service
+wparam = (HANDLE)hTTButton
+lparam = 0
+returns: state on success, -1 on failure.
+*/
+#define MS_TTB_GETBUTTONSTATE "TopToolBar/GetState"
+
+/*
+toptoolbar/getoptions service
+(HIWORD)wparam = (HANDLE)hTTButton
+(LOWORD)wparam = TTBO_FLAG
+lparam = 0,or lparam=lpTTBButton if flag=TTBO_ALLDATA
+returns: value on success, -1 on failure.
+*/
+#define TTBO_FLAGS 0 //get/set all flags
+#define TTBO_POS 1 //position
+#define TTBO_WIDTH 2 //not impemented
+#define TTBO_HEIGHT 3 //not impemented
+#define TTBO_TIPNAME 4 //tool tip name
+#define TTBO_ALLDATA 5 //change all data via lparam=lpTTBButton
+
+
+#define MS_TTB_GETBUTTONOPTIONS "TopToolBar/GetOptions"
+
+/*
+toptoolbar/setoptions service
+(HIWORD)wparam = (HANDLE)hTTButton
+(LOWORD)wparam = TTBO_FLAG
+lparam = value
+returns: 1 on success, -1 on failure.
+*/
+#define MS_TTB_SETBUTTONOPTIONS "TopToolBar/SetOptions"
+
+
+#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_trigger.h b/plugins/ExternalAPI/m_trigger.h new file mode 100644 index 0000000000..e51294b83e --- /dev/null +++ b/plugins/ExternalAPI/m_trigger.h @@ -0,0 +1,1024 @@ +#ifndef __M_TRIGGER_H__
+#define __M_TRIGGER_H__
+
+#if !defined(_TCHAR_DEFINED)
+#include <tchar.h>
+#endif
+#include <m_utils.h>
+
+// --------------------------------------------------------------------------
+// Triggers
+// --------------------------------------------------------------------------
+
+// This section explains how to create your own trigger. A trigger can be seen
+// as an event which can result in a set of actions that will be performed.
+// Implementing a trigger consists of two parts. First, you register a trigger
+// with MS_TRIGGER_REGISTERTRIGGER to allow a user to configure it in the
+// options dialog. Second, when the event occurs belonging to your registered
+// trigger, you inform the trigger plugin with MS_TRIGGER_REPORTEVENT. You can
+// send a 'payload' together with this notification. This payload, called
+// 'TriggerData', can consist of a certain contact, protocol, status and/or a
+// piece of text.
+
+// --------------------------------------------------------------------------
+// Triggers: Register a trigger
+// --------------------------------------------------------------------------
+
+#define MS_TRIGGER_REGISTERTRIGGER "/TriggerPlugin/RegisterTrigger"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(TRIGGERREGISTER *)&tr
+// Pointer to a structure describing the trigger to add (see below).
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nozero otherwise. Registering an already existing
+// trigger will replace this previously registered trigger.
+
+typedef struct {
+ int cbSize; // Set to sizeof(TRIGGERREGISTER).
+ char *pszName; // Used as identifier and shown in the options dialog, must
+ // be unique.
+ HINSTANCE hInstance; // Only needed when options screen is available.
+ DLGPROC pfnDlgProc; // Optional, the callback procedure for the options page.
+ char *pszTemplate; // Optional, template for the options page; must be
+ // WS_CHILD.
+ int flags; // Flags, see below.
+ int dFlags; // Specify the default DF_* flags which your trigger can send
+ // (see below).
+} TRIGGERREGISTER;
+
+// Flags
+#define TRF_NOEXPORT 0x01 // This trigger cannot be exported. Set this flag
+ // in case you stored settings not using the helper
+ // functions at the end of this header. On export,
+ // TriggerPlugin will search for these settings
+ // and export them automatically. Contact-specific
+ // settings are never exported.
+
+// Please specify the dFlags to indicate what kind of data your trigger is
+// able to send as TriggerData. Please specify the maximum set, if your trigger
+// does not always send a certain data, please specify it anyway.
+
+#define DF_CONTACT 0x01 // The trigger might send a contact handle with the
+ // TriggerData.
+#define DF_PROTO 0x02 // The trigger might send a protocol ID with the
+ // TriggerData.
+#define DF_STATUS 0x04 // The trigger might send a status code with the
+ // TriggerData.
+#define DF_TEXT 0x08 // The trigger might send a string with the
+ // TriggerData.
+#define DF_LPARAM 0x10 // The trigger might send a custom parameter with the
+ // TriggerData.
+#define DF_UNICODE 0x20 // The trigger processes WCHAR strings.
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define DF_TCHAR DF_UNICODE // Strings in structure are TCHAR*.
+#else
+#define DF_TCHAR 0
+#endif
+
+// Dialog Messages
+// The following message should be processed by your options dialog procedure,
+// if available. You can create an options dialog to give the user the
+// possibility to report your event only under certain circumstances. Each
+// trigger is assigned a certain ID. This ID can be used to store the settings
+// for your trigger.
+
+// WM_INITDIALOG
+
+// Parameters:
+// ------------------------
+// lParam = (LPARAM)(DWORD)triggerID
+// The trigger ID for which the options are to be set. This can be a new ID
+// or an ID of a trigger which is being edited. Initialize your options
+// dialog accordingly. There are helper function at the end of this header
+// file to read your settings for a certain trigger ID.
+
+#define TM_ADDTRIGGER WM_APP+10
+
+// TM_ADDTRIGGER
+// 'OK' is pressed and a new trigger will be added. Save your settings using
+// the given trigger ID.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)triggerID
+// The trigger ID for which the settings are to be stored. There are helper
+// function at the end of this header file to store your settings with a
+// certain trigger ID.
+// lParam = 0
+
+#define TM_DELTRIGGER WM_APP+11
+
+// TM_DELTRIGGER
+// The trigger addociated with the given trigger ID will be removed.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)triggerID
+// The trigger ID for which the settings are to be removed. There is a
+// helper service at the end of this header file to easily cleanup settings
+// for a certain trigger ID.
+// lParam = 0
+
+// --------------------------------------------------------------------------
+// Triggers: Report the Event
+// --------------------------------------------------------------------------
+
+// When the event occurs, you report it with MS_TRIGGER_REPORTEVENT. If your
+// trigger is configurable, so it has an options screen, you might want to
+// report your trigger for certain trigger ID's only. Please use the
+// MS_TRIGGER_FINDNEXTTRIGGERID to enumerate over the trigger ID's associated
+// with your trigger in the correct order as specified by the user. It's up
+// to you to found out whether or not the trigger is to be reported for a
+// certain ID.
+
+#define MS_TRIGGER_FINDNEXTTRIGGERID "/TriggerPlugin/FindNextTriggerID"
+
+// Enumerate over the associated trigger ID's for your trigger in the correct
+// order.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)triggerID
+// 0 to retrieve the first trigger ID for your trigger or the previous ID
+// returned by this service to get the next one.
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Returns the next trigger ID given the parameter or 0 if no more trigger IDs
+// are available.
+
+#define MS_TRIGGER_REPORTEVENT "/TriggerPlugin/ReportEvent"
+
+// Report your event for further processing. This can be a general event for
+// which no individual settings exist, or a specific event for a given
+// trigger ID.
+
+// Parameters:
+// ------------------------
+// wParam = 0
+// lParam = (LPARAM)(REPORTINFO *)&ri
+// See below.
+
+// Return Value:
+// ------------------------
+// Returns CRV_TRUE if all conditions specific to this trigger hold and the
+// chain was executed. Returns CRV_FALSE if these conditions did not hold and
+// the chain were not processed.
+
+// The structure below can be used to send TriggerData with your trigger. This
+// can be used by the associated conditions and actions.
+
+typedef struct {
+ int cbSize; // Set to sizeof(TRIGGERDATA)
+ int dFlags; // Indicate which members are valid using the DF_* flags (see
+ // above).
+ HANDLE hContact; // Associate a contact handle to this event.
+ char *szProto; // Associate a protocol ID to this event.
+ int status; // Associcate a status code to this event.
+ union {
+ char *szText; // Associate a string to this event.
+ TCHAR *tszText;
+ WCHAR *wszText;
+ };
+ LPARAM lParam; // Associate custom data to this trigger.
+} TRIGGERDATA;
+
+typedef struct {
+ int cbSize; // Set to sizeof(REPORTINFO).
+ DWORD triggerID; // The trigger ID of the event to trigger or 0 if this does
+ // not apply.
+ char *pszName; // The name of the trigger (this may be NULL if triggerID is
+ // not 0).
+ int flags; // On of the TRG_* flags, see below.
+ TRIGGERDATA *td; // Optional, the associated TriggerData, see above.
+} REPORTINFO;
+
+#define TRG_PERFORM 0x01 // Indicates the event for this trigger actually
+ // occured and needs to be processed accordingly.
+#define TRG_CLEANUP 0x02 // Indicates the trigger instructs to remove the
+ // itself and all associated information. This can
+ // be used for "one time triggers". Remove your own
+ // settings by yourself.
+
+// --------------------------------------------------------------------------
+// Actions
+// --------------------------------------------------------------------------
+
+// An actions might be performed as a reaction to a reported event by a
+// trigger. You first register your action so it can be associated to a
+// trigger in the options screen. Next, your provided service or function
+// will be called when necessary.
+
+#define MS_TRIGGER_REGISTERACTION "/TriggerPlugin/RegisterAction"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(ACTIONREGISTER *)&ar
+// Pointer to a structure describing the action to add (see below).
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nozero otherwise. Registering an already existing
+// action will replace this previously registered action.
+
+typedef int (* ACTIONFUNCTION)(DWORD actionID, REPORTINFO* ri);
+
+typedef struct {
+ int cbSize; // Set to sizeof(ACTIONREGISTER).
+ char *pszName; // The name of this action, it must be a unique string.
+ union {
+ char *pszService; // A service (called with wParam =
+ // (WPARAM)(DWORD)actionID, lParam =
+ // (LPARAM)(REPORTINFO *)&ri) or function to be called
+ // when the action has to be performed.
+ ACTIONFUNCTION actionFunction;
+ };
+ HINSTANCE hInstance; // Only needed when an options screen is available.
+ DLGPROC pfnDlgProc; // Optional, the callback procedure for the options
+ // dialog.
+ char *pszTemplate; // Optional, template for the options dialog, must be
+ // WS_CHILD.
+ int flags; // One of the ARF_* flags, see below.
+} ACTIONREGISTER;
+
+#define ARF_UNICODE 0x01 // This action processes unicode strings.
+#define ARF_FUNCTION 0x02 // The actionFunction will be called instead of
+ // the service.
+#define ARF_NOEXPORT 0x04 // This action cannot be exported. Set this flag in
+ // case you stored settings not using the helper
+ // functions at the end of this header. On export,
+ // TriggerPlugin will search for these settings
+ // and export them automatically. Contact-specific
+ // settings are never exported.
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define ARF_TCHAR ARF_UNICODE
+#else
+#define ARF_TCHAR 0
+#endif
+
+// The service or actionFunction will be called with a pointer to a REPORTINFO
+// struct, containing information about the trigger event. If you can use
+// TriggerData from this struct, always check the ri->td->dFlags before using
+// it. It's up to you to deal with an action in case the expected TriggerData
+// is not available. It's recommened though, to cancel your action. The
+// ri->flags is a combination of the ACT_* flags, indicating how to process the
+// call, see below.
+
+#define ACT_PERFORM 0x01 // Your action is to be performed.
+#define ACT_CLEANUP 0x02 // The settings associated to this action should be
+ // removed.
+
+// Dialog Messages
+// The following messages are to be processed by the options dialog, if there
+// is one.
+
+// WM_INITDIALOG
+
+// Parameters:
+// ------------------------
+// lParam = (LPARAM)(DWORD)actionID
+// The action ID for which the options are to be set. This can be a new ID
+// or an ID of an action which is being edited. Initialize your options
+// dialog accordingly. There are helper function at the end of this header
+// file to read your settings for a certain action ID.
+
+#define TM_ADDACTION WM_APP+12
+
+// TM_ADDACTION
+// 'OK' is pressed and a new action will be added. Save your settings using
+// the given action ID. Helper functions can be found at the end of this
+// header file.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)actionID
+// The action ID for which the settings are to be saved. There are helper
+// functions at the end of this header file to store settings with a certain
+// action ID.
+// lParam = 0
+
+// Dialog Messages
+// You can send the following messages to the parent window of your dialog.
+// When initalizing your dialog, you might be interested in the TriggerData
+// the associated trigger is able to provide, you can do so by sending the
+// folowing message to the parent of your dialog.
+
+#define TM_GETTRIGGERINFO WM_APP+13
+
+// Parameters:
+// ------------------------
+// wParam = 0
+// lParam = (LPARAM)(TRIGGERINFO *)&ti
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, the struct given will be filled with the requested
+// information. Returns any other value on error.
+
+typedef struct {
+ int cbSize; // (in) Set to sizeof(TRIGGERINFO).
+ int dFlags; // (out) The default DF_* flags used by the trigger (as indicated
+ // by its TRIGGERREGISTER).
+} TRIGGERINFO;
+
+// --------------------------------------------------------------------------
+// Conditions
+// --------------------------------------------------------------------------
+
+// Depending on the configuration of the user, a condition may need to hold
+// for an action to be performed. A condition function is called and its
+// return value specifies whether or not the condition holds. A condition
+// needs to be registered. After its registered, the condition function might
+// be called to check whether or not the condition holds.
+
+#define MS_TRIGGER_REGISTERCONDITION "/TriggerPlugin/RegisterCondition"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(CONDITIONREGISTER *)&cr
+// Pointer to a structure describing the condition to add (see below).
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nozero otherwise. Registering an already existing
+// condition will replace this previously registered condition.
+
+typedef int (* CONDITIONFUNCTION)(DWORD conditionID, REPORTINFO *ri);
+
+typedef struct {
+ int cbSize; // Set to sizeof(CONDITIONREGISTER).
+ char *pszName; // The name identifying this condition, must be unique.
+ union {
+ char *pszService; // The service (wParam = (WPARAM)(DWORD)conditionID,
+ // lParam = (LPARAM)(REPORTINFO *)&ri) or function which
+ // is called to see whether the condition holds. Must
+ // return CRV_TRUE if the condition holds, CRV_FALSE
+ // otherwise.
+ CONDITIONFUNCTION conditionFunction;
+ };
+ HINSTANCE hInstance; // Only needed when an options dialog is available.
+ DLGPROC pfnDlgProc; // Optional, the dialog procedure for the options
+ // dialog.
+ char *pszTemplate; // Optional, template for the options dialog, must be
+ // WS_CHILD.
+ int flags; // CRF_* flags, see below.
+} CONDITIONREGISTER;
+
+// The flags that can be used to register the condition.
+
+#define CRF_UNICODE 0x01 // The condition function or service processes
+ // unicode strings.
+#define CRF_FUNCTION 0x02 // The conditionFunction will be called instead of
+ // the service.
+#define CRF_NOEXPORT 0x04 // This condition cannot be exported. Set this flag
+ // in case you stored settings not using the helper
+ // functions at the end of this header. On export,
+ // TriggerPlugin will search for these settings
+ // and export them automatically. Contact-specific
+ // settings are never exported.
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define CRF_TCHAR CRF_UNICODE
+#else
+#define CRF_TCHAR 0
+#endif
+
+// The service or conditionFunction will be called with a pointer to a
+// REPORTINFO struct, containing information about the trigger event. If you
+// can use TriggerData from this struct, always check the ri->td->dFlags before
+// using it. It's up to you to deal with an condition in case the expected
+// TriggerData is not available. It's recommened though, to return CRV_FALSE in
+// those cases. The ri->flags is a combination of the CND_* flags, indicating
+// how to process the call, see below.
+
+// Return values for the condition function or service. The condition service
+// or function is expected to return one of the following.
+
+#define CRV_FALSE 0 // The condition does not hold.
+#define CRV_TRUE 1 // The condition does hold.
+
+// REPORTINFO flags, received by the condition function or service. These
+// indicate how to process the call.
+
+#define CND_PERFORM 0x01 // Perform your condition and return either
+ // CRV_TRUE or CRV_FALSE to indicate whether or not
+ // your condition holds at this moment.
+#define CND_CLEANUP 0x02 // The condition is deleted. Remove your settings
+ // from the DB. There is a helper service below to
+ // easily remove settings given a condition ID.
+
+// Dialog Messages
+// The following messages are to be processed by the options dialog, if there
+// is one.
+
+// WM_INITDIALOG
+
+// Parameters:
+// ------------------------
+// lParam = (LPARAM)(DWORD)conditionID
+// The condition ID for which the options are to be set. This can be a new ID
+// or an ID of a condition which is being edited. Initialize your options
+// dialog accordingly. There are helper function at the end of this header
+// file to read your settings for a certain condition ID.
+
+#define TM_ADDCONDITION WM_APP+14
+
+// TM_ADDCONDITION
+// 'OK' is pressed and a new condition will be added. Save your settings using
+// the given condition ID. Helper functions can be found at the end of this
+// header file.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)conditionID
+// The condition ID for which the settings are to be saved. There are helper
+// functions at the end of this header file to store settings with a certain
+// condition ID.
+// lParam = 0
+
+// When initalizing your dialog, you might be interested in the TriggerData the
+// associated trigger is able to provide, you can find out by sending a
+// TM_GETTRIGGERINFO message to the parent of your dialog. See the section on
+// dialog messages for actions for more information (above).
+
+// --------------------------------------------------------------------------
+// Misc. Services
+// --------------------------------------------------------------------------
+
+#define MS_TRIGGER_ENABLETRIGGER "/TriggerPlugin/EnableTrigger"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)triggerID
+// The triggerID to set or get the state from or 0 for the global state.
+// lParam = (LPARAM)(int)type
+// One of ETT_* (see below).
+
+// Return Value:
+// ------------------------
+// Returns the state (0=disabled) if ETT_GETSTATE is given as lParam.
+// Otherwise, it returns 0 if setting the state was succesful or any other on
+// failure. The global state must be enabled if a single state is to be
+// changed.
+
+#define ETT_DISABLE 0 // Disable the trigger(s).
+#define ETT_ENABLE 1 // Enable the trigger(s).
+#define ETT_TOGGLE 2 // Toggle the state of the trigger(s).
+#define ETT_GETSTATE 3 // Retrieve the state of the trigger (0=disabled).
+
+#define ME_TRIGGER_TRIGGERENABLED "/TriggerPlugin/TriggerEnabled"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(DWORD)triggerID
+// The triggerID to set or get the state from or 0 for the global state.
+// lParam = (LPARAM)(int)type
+// Either ETT_DISABLE or ETT_ENABLE describing the new state.
+
+// This event is fired when one or all of the triggers enabled state is
+// changed. This can be used to (de)initialize internal variables. For
+// example if your trigger reads the triggers from the DB in memory during
+// an initialization fase. It is recommended to do this when this event is
+// fired with wParam = 0 and lParam = ETT_ENABLE (remember triggers can be
+// imported, without calling your options screen callback). This event is
+// fired upon startup and shutdown in case the module is enabled.
+
+// --------------------------------------------------------------------------
+// Database Helper Services
+// --------------------------------------------------------------------------
+
+// The rest of this header file defines helper services and functions to easily
+// store and retrieve settings for a certain trigger, action or condition.
+
+#define MS_TRIGGER_REMOVESETTINGS "/TriggerPlugin/RemoveSettings"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(REMOVETRIGGERSETTINGS *)&rts
+// Pointer to a structure describing the settings to remove (see below).
+
+// Return Value:
+// ------------------------
+// Returns the number of settings removed from the database.
+
+// This service helps you remove all settings you have written with the DB
+// helper functions, defined at the end of this header file.
+
+typedef struct {
+ int cbSize; // Set to sizeof(REMOVETRIGGERSETTINGS).
+ char *prefix; // A string indicating what kind of setting are to be removed,
+ // see below.
+ DWORD id; // The ID of the set of settings to be removed.
+ char *szModule; // The module where the settings are stored.
+ HANDLE hContact; // The contact for which the setting are to be removed. Can
+ // be INVALID_HANDLE_VALUE to remove the settings for all
+ // contacts and NULL.
+} REMOVETRIGGERSETTINGS;
+
+// The following prefixes indicate what kind of settings are to be removed from
+// the database.
+
+#define PREFIX_ACTIONID "aid" // The prefix for a DB setting associated to
+ // an action.
+#define PREFIX_TRIGGERID "tid" // The prefix for a DB setting associated to
+ // a trigger.
+#define PREFIX_CONDITIONID "cid" // The prefix for a DB setting associated
+ // to a condition.
+
+#ifndef TRIGGER_NOHELPER
+
+// Helper #1: RemoveAllTriggerSettings
+// ------------------------
+// Remove all settings from the DB given the triggerID and module.
+
+static __inline int RemoveAllTriggerSettings(DWORD triggerID, char *szModule) {
+
+ REMOVETRIGGERSETTINGS rts;
+
+ rts.cbSize = sizeof(REMOVETRIGGERSETTINGS);
+ rts.prefix = PREFIX_TRIGGERID;
+ rts.id = triggerID;
+ rts.szModule = szModule;
+ rts.hContact = INVALID_HANDLE_VALUE;
+
+ return CallService(MS_TRIGGER_REMOVESETTINGS, 0, (LPARAM)&rts);
+}
+
+// Helper #2: RemoveAllActionSettings
+// ------------------------
+// Remove all settings from the DB given the actionID and module.
+
+static __inline int RemoveAllActionSettings(DWORD actionID, char *szModule) {
+
+ REMOVETRIGGERSETTINGS rts;
+
+ rts.cbSize = sizeof(REMOVETRIGGERSETTINGS);
+ rts.prefix = PREFIX_ACTIONID;
+ rts.id = actionID;
+ rts.szModule = szModule;
+ rts.hContact = INVALID_HANDLE_VALUE;
+
+ return CallService(MS_TRIGGER_REMOVESETTINGS, 0, (LPARAM)&rts);
+}
+
+// Helper #1: RemoveAllConditionSettings
+// ------------------------
+// Remove all settings from the DB given the conditionID and module.
+
+static __inline int RemoveAllConditionSettings(DWORD conditionID, char *szModule) {
+
+ REMOVETRIGGERSETTINGS rts;
+
+ rts.cbSize = sizeof(REMOVETRIGGERSETTINGS);
+ rts.prefix = PREFIX_CONDITIONID;
+ rts.id = conditionID;
+ rts.szModule = szModule;
+ rts.hContact = INVALID_HANDLE_VALUE;
+
+ return CallService(MS_TRIGGER_REMOVESETTINGS, 0, (LPARAM)&rts);
+}
+
+// --------------------------------------------------------------------------
+// Database Helper Functions
+// --------------------------------------------------------------------------
+
+// Basically, these function work the same as Miranda's helper functions for
+// getting/setting DB settings. There is one extra parameter, the ID for the
+// trigger/action/condition. The settings are named as follows:
+
+// DBWriteTriggerSetting*(DWORD triggerID, ...) to write a setting given a
+// trigger ID.
+// DBGetTriggerSetting*(DWORD triggerID, ...) to read a setting given a
+// trigger ID.
+// DBWriteActionSetting*(DWORD actionID, ...) to write a setting given an
+// action ID.
+// DBGetActionSetting*(DWORD actionID, ...) to read a setting given an
+// action ID.
+// DBWriteConditionSetting*(DWORD conditionID, ...) to write a setting given a
+// condition ID.
+// DBGetConditionSetting*(DWORD conditionID, ...) to read a setting given a
+// condition ID.
+
+#define MAX_SETTING_LEN 255 // Max. length of a DB setting including the
+ // prefix and ID.
+
+// --------------------------------------------------------------------------
+// Database Helper Functions: Triggers
+// --------------------------------------------------------------------------
+
+static int __inline DBWriteTriggerSettingByte(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingByte(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteTriggerSettingWord(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingWord(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteTriggerSettingDword(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingDword(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteTriggerSettingString(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteTriggerSettingTString(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,const TCHAR *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingTString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteTriggerSettingWString(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingWString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteTriggerSettingStringUtf(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBWriteContactSettingStringUtf(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBGetTriggerSettingByte(DWORD triggerID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingByte(hContact, szModule, dbSetting, errorValue);
+}
+
+static WORD __inline DBGetTriggerSettingWord(DWORD triggerID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingWord(hContact, szModule, dbSetting, errorValue);
+}
+
+static DWORD __inline DBGetTriggerSettingDword(DWORD triggerID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingDword(hContact, szModule, dbSetting, errorValue);
+}
+
+static int __inline DBGetTriggerSetting(DWORD triggerID, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSetting(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetTriggerSettingW(DWORD triggerID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingW(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetTriggerSettingTString(DWORD triggerID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingTString(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetTriggerSettingWString(DWORD triggerID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingWString(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetTriggerSettingStringUtf(DWORD triggerID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBGetContactSettingStringUtf(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBDeleteTriggerSetting(DWORD triggerID, HANDLE hContact,const char *szModule,const char *szSetting) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_TRIGGERID, triggerID, szSetting);
+ return DBDeleteContactSetting(hContact, szModule, dbSetting);
+}
+
+// --------------------------------------------------------------------------
+// Database Helper Functions: Actions
+// --------------------------------------------------------------------------
+
+static int __inline DBWriteActionSettingByte(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingByte(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteActionSettingWord(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingWord(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteActionSettingDword(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingDword(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteActionSettingString(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteActionSettingTString(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,const TCHAR *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingTString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteActionSettingWString(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingWString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteActionSettingStringUtf(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBWriteContactSettingStringUtf(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBGetActionSettingByte(DWORD actionID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingByte(hContact, szModule, dbSetting, errorValue);
+}
+
+static WORD __inline DBGetActionSettingWord(DWORD actionID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingWord(hContact, szModule, dbSetting, errorValue);
+}
+
+static DWORD __inline DBGetActionSettingDword(DWORD actionID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingDword(hContact, szModule, dbSetting, errorValue);
+}
+
+static int __inline DBGetActionSetting(DWORD actionID, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSetting(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetActionSettingW(DWORD actionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingW(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetActionSettingTString(DWORD actionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingTString(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetActionSettingWString(DWORD actionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingWString(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetActionSettingStringUtf(DWORD actionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBGetContactSettingStringUtf(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBDeleteActionSetting(DWORD actionID, HANDLE hContact,const char *szModule,const char *szSetting) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ACTIONID, actionID, szSetting);
+ return DBDeleteContactSetting(hContact, szModule, dbSetting);
+}
+
+// --------------------------------------------------------------------------
+// Database Helper Functions: Conditions
+// --------------------------------------------------------------------------
+
+static int __inline DBWriteConditionSettingByte(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingByte(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteConditionSettingWord(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingWord(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteConditionSettingDword(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingDword(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteConditionSettingString(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteConditionSettingTString(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,const TCHAR *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingTString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteConditionSettingWString(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingWString(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBWriteConditionSettingStringUtf(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBWriteContactSettingStringUtf(hContact, szModule, dbSetting, val);
+}
+
+static int __inline DBGetConditionSettingByte(DWORD conditionID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingByte(hContact, szModule, dbSetting, errorValue);
+}
+
+static WORD __inline DBGetConditionSettingWord(DWORD conditionID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingWord(hContact, szModule, dbSetting, errorValue);
+}
+
+static DWORD __inline DBGetConditionSettingDword(DWORD conditionID, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingDword(hContact, szModule, dbSetting, errorValue);
+}
+
+static int __inline DBGetConditionSetting(DWORD conditionID, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
+
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSetting(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetConditionSettingW(DWORD conditionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingW(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetConditionSettingTString(DWORD conditionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingTString(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetConditionSettingWString(DWORD conditionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingWString(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBGetConditionSettingStringUtf(DWORD conditionID, HANDLE hContact,const char *szModule, const char *szSetting,DBVARIANT *dbv) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBGetContactSettingStringUtf(hContact, szModule, dbSetting, dbv);
+}
+
+static int __inline DBDeleteConditionSetting(DWORD conditionID, HANDLE hContact,const char *szModule,const char *szSetting) {
+
+ char dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBDeleteContactSetting(hContact, szModule, dbSetting);
+}
+
+#endif // nohelper
+#endif // m_trigger
diff --git a/plugins/ExternalAPI/m_uninstaller.h b/plugins/ExternalAPI/m_uninstaller.h new file mode 100644 index 0000000000..e26f55c6be --- /dev/null +++ b/plugins/ExternalAPI/m_uninstaller.h @@ -0,0 +1,700 @@ +/*
+
+ PluginUninstaller 1.1.2.1 for Miranda IM 0.3.3a and +
+ ------------------------------------------------------------------------
+ Developers - C/C++ Header File
+
+ Plugin Info: ----------------------------
+ | Version: 1.1.2.1
+ | Filename: uninstaller.dll
+ | Author: H. Herkenrath (hrathh@users.sourceforge.net)
+ | Description: Extends the plugin options and offers the possibility
+ | to directly remove plugins and delete all associated
+ | settings and files.
+
+ Contents: -------------------------------
+ | > General Info:
+ | - Uninstall Example/Template
+ | - Changing displayed icon
+ | - Changing displayed docs
+ | - Message boxes on uninstall
+ | - Service Accesibility
+ | - Including this file
+ |
+ | > Structs:
+ | - Uninstall Params (PLUGINUNINSTALLPARAMS)
+ |
+ | > Helpers:
+ | - Macro: Run service while uninstalling (PUICallService)
+ | - Function: Remove some files in directory (PUIRemoveFilesInDirectory)
+ |
+ | > Events:
+ | - Allow to uninstall a plugin (ME_PLUGINUNINSTALLER_OKTOUNINSTALL)
+ | - Plugin gets uninstalled (ME_PLUGINUNINSTALLER_UNINSTALL)
+ |
+ | > Services:
+ | - Remove database module (MS_PLUGINUNINSTALLER_REMOVEDBMODULE)
+ | - Remove a setting globally (MS_PLUGINUNINSTALLER_REMOVEDBSETTINGGLOBALLY)
+ | - Remove skinned sound (MS_PLUGINUNINSTALLER_REMOVESKINSOUND)
+ | - Uninstall a plugin (MS_PLUGINUNISTALLER_UNISTALLPLUGIN)
+ | - Getting handles (MS_PLUGINUNINSTALLER_GETHANDLE)
+ |
+
+
+ This file is only thought for plugin developers.
+ If you only want to use "PluginUninstaller" and don't want to develop a plugin
+ or something with it you don't need this file.
+
+ If there are any problems or bugs with or in this file or something else
+ please mail me. My e-mail address is: hrathh@users.sourceforge.net
+ For more documentation you can use this address, too. :-)
+
+ If you have any whishes on some plugin uninstalling for your
+ plugin you can mail me, too. :-)
+
+*/
+#ifndef M_UNINSTALLER_H
+#define M_UNINSTALLER_H
+
+#ifndef CallService
+ #pragma message("Mistake Alert!: "m_uninstaller.h" needs to be included after "newpluginapi.h"!\n The following errors are resulting of this mistake.\n")
+#endif
+
+
+// | General Info
+// -----------------------------
+
+// Uninstall Example/Template
+// ---------------------------
+// Making your plugin uninstallable is very easy.
+// Just add the following "Uninstall" function near the "Unload" function
+// in your plugin.
+// A template plugin is available in the source code package.
+
+// Old:
+// int __declspec(dllexport) Uninstall(BOOL bIsMirandaRunning, BOOL bDoDeleteSettings, char* pszPluginPath);
+
+// New:
+//int __declspec(dllexport) UninstallEx(PLUGINUNINSTALLPARAMS* ppup)
+//{
+ // Available Variables:
+ // -----------------------------
+ // ppup->bIsMirandaRunning:
+ // Contains if Miranda is running
+ // (Currently this is always TRUE).
+
+ // ppup->bDoDeleteSettings:
+ // Contains if the users selected
+ // that he wants all settings be deleted.
+
+ // ppup->pszPluginsPath:
+ // Contains the plugins directory name.
+
+
+ // Notes:
+ // -----------------------------
+
+ // Run before "Unload" function:
+ // -> IMPORTANT: Be careful not to write to the database or to files in "Unload" again!!!
+ // -> Perhaps create a global BOOL variable which is set to TRUE when your plugin gets uninstalled
+ // or check of a database setting "IsInstalled" in Unload() or sth. like that
+
+ // All Miranda is still loaded
+
+ // Here you can do:
+ // - Delete settings group in database
+ // - Delete registry items
+ // - Delete ini-files and other settings files
+ // - Delete other files
+
+ // Your plugin dll gets automatically deleted
+
+ // Services to remove are offered:
+ // MS_PLUGINUNINSTALLER_REMOVEDBMODULE
+ // MS_PLUGINUNINSTALLER_REMOVEDBSETTINGGLOBALLY
+ // MS_PLUGINUNINSTALLER_REMOVESKINSOUND
+
+
+ // Getting other useful paths:
+ // -----------------------------
+
+ // System directory:
+
+ //char szSysPath[MAX_PATH];
+ //GetSystemDirectory(szSysPath, MAX_PATH);
+
+
+ // Windows directory:
+
+ //char szWinPath[MAX_PATH];
+ //GetWindowsDirectory(szWinPath, MAX_PATH);
+
+
+ // Other directories:
+
+ // char szPath[MAX_PATH];
+ // SHGetSpecialFolderPath(NULL, szPath, CSIDL_* , FALSE);
+
+ // Some available dirs:
+ // CSIDL_APPDATA CSIDL_SENDTO CSIDL_FAVORITES
+ // CSIDL_STARTUP CSIDL_PROFILE CSIDL_DESKTOPDIRECTORY
+
+
+ // Delete Files
+ //const char* apszFiles[] = {"MyPlugin_Readme.txt", "MyPlugin_License.txt", "MyPlugin_Developer.txt", "MyPlugin_Translation.txt"};
+ //PUIRemoveFilesInPath(ppup->pszPluginsPath, apszFiles);
+
+ // Delete Settings
+ //if(ppup->bDoDeleteSettings == TRUE)
+ //{
+ //if (ppup->bIsMirandaRunning == TRUE) // Check if it is possible to access services
+ //{
+ // Remove plugin's module
+ //PUIRemoveDbModule("MyPlugin");
+
+ // Remove plugin's sounds
+ //PUIRemoveSkinSound("MySoundSetting1");
+ //PUIRemoveSkinSound("MySoundSetting2");
+ //}
+ //}
+
+ // Remember:
+ // Do not forget to remove your (eventually) created registry items here, too.
+
+
+ // The plugin's dll file gets deleted after returning.
+
+ // Remember:
+ // If your DLL file is additionally in use by another application (eg. Windows)
+ // you need to free the DLL *here* completely. Otherwise it can't be deleted.
+
+// return 0;
+//}
+
+
+
+// Changing displayed icon
+// ---------------------------
+// The icon that gets displayed on the options page is always the "first"
+// icon in your DLL file.
+// An icon in your DLL file is the first icon when it has the lowest recource ID.
+// If you would like to have an other icon shown in the options please change your
+// icon resource IDs so that the icon you would like to have has the lowest one.
+// For example if you use MS Visual C++, open "resource.h" and change the resource define
+// of your prefered icon to the lowest icon number.
+
+
+// Changing displayed docs
+// ---------------------------
+// The items "License" and "More Information" on the plugin details page
+// are created when the a license and/or a readme file for the plugin exists.
+// The files get detected automatically and need a special name
+// so that they get detected.
+// The text files need to be either placed in the "Plugins" directory or
+// in the "Docs" directory. Whereof the last one is the better one :-)
+//
+// For the license file the following file name formatings are possible:
+// PluginName-License.txt (I personally think that this is the best naming solution... :-) )
+// PluginName_License.txt,
+//
+// For the readme file the following ones are possible:
+// PluginName-Readme.txt (Again...I like this one :-D ),
+// PluginName_Readme.txt,
+
+// Message boxes on uninstall
+// ---------------------------
+// If you would like to ask the user for something to remove/uninstall
+// please hook the event ME_PLUGINUNINSTALLER_UNINSTALL and show your
+// message box there. Save the action the user chose in a
+// global BOOL variable and do the chosen action in "UninstallEx".
+// You can get the plugins options window handle with MS_PLUGINUNINSTALLER_GETHANDLE.
+
+
+// Service Accessibility
+// ---------------------------
+// Remember that you only can use these functions after the event ME_SYSTEM_MODULESLOADED
+// or later because "PluginUninstaller" needs to be loaded first.
+// Normally you only use them in your "UninstallEx" function.
+//
+// IMPORTANT!:
+// Please make sure that you always use the macro PUICallService
+// in the "UninstallEx" function instead of the CallService function.
+
+
+// Including this file
+// ---------------------------
+// To use some of the uninstalling functionality you have to include this file
+// into your project.
+//
+// IMPORTANT!:
+// Please make sure that you include the file "newpluginapi.h" before this one.
+// If this isn't the case there may some compile errors come up.
+
+ // -> Example:
+ // If your plugin is in the directory "Plugins/MyPlugin/" and
+ // this include file is in the directory "Plugins/PluginUninstaller"
+ // you can use the following:
+
+ //#include "../PluginUninstaller/m_uninstaller.h"
+
+ // If your plugin is in an directory that is different to that one just
+ // change the include path to the one you want.
+
+
+
+
+
+// | Structs
+// -----------------------------
+
+// ---------------------------------------------
+// -- Struct: Uninstall Params -----------------
+// ---------------------------------------------
+
+// Struct: PLUGINUNINSTALLPARAMS
+// (Gets passed to "UninstallEx" function)
+
+typedef int (*HELPERPROC)(const char*, WPARAM, LPARAM); // Used internally (for pHelperProcAddress)
+
+typedef struct {
+ BOOL bIsMirandaRunning; // Is TRUE when Miranda is loaded and services are available (Please use PUICallService instead of CallService)
+ BOOL bDoDeleteSettings; // Is TRUE when user wants to delete settings (If this is FALSE, please only delete your files)
+ char* pszPluginsPath; // Contains the plugin directory path
+ char* pszDocsPath; // Contains the document directory for plugins documentation (Added in version 1.1.1.0)
+ char* pszIconsPath; // Contains the icon directory for icon dlls (Added in version 1.1.2.0)
+ HELPERPROC pHelperProcAddress; // Used internally (Contains proc address for PUICallService)
+} PLUGINUNINSTALLPARAMS;
+
+
+
+
+
+// | Helper
+// -----------------------------
+
+
+// ---------------------------------------------
+// -- Macro: Run service while uninstalling ----
+// ---------------------------------------------
+
+// Macro: PUICallService
+
+#define PUICallService(service, wParam, lParam) (ppup->pHelperProcAddress) (service, wParam, lParam);
+
+// Description:
+// -------------
+// This service provides the possibility to call a Miranda
+// service in the "UninstallEx" function.
+// Important!: Use this macro always instead of "CallService",
+// because else a crash occurs when the plugin was decativated
+// and gets uninstalled
+
+// Parameters:
+// -------------
+// Same parameters as CallService of Miranda Core.
+
+// Return Values:
+// --------------
+// Return values are the same as the CallService function of Miranda Core.
+// Additionaly returns CALLSERVICE_NOTFOUND if Miranda is not loaded
+// which means the services are not accessable.
+
+
+ // Example:
+ // ----------------------------------
+
+ //if ( (bIsMirandaRunning == TRUE) && (bDoDeleteSettings == TRUE) )
+ //{
+ // Remove plugin's module
+ //PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBMODULE, (WPARAM)"MyPlugin", 0);
+ //}
+
+
+
+
+// ---------------------------------------------
+// -- Function: Remove some files in directory -
+// ---------------------------------------------
+
+// Function: PUIRemoveFilesInDirectory
+
+static BOOL __inline PUIRemoveFilesInDirectory(char* pszPath, const char* apszFiles[]);
+
+// Description:
+// -------------
+// This helper provides the possibility to easily
+// remove specified files in a specified directory.
+
+// Note: The last version of this helper (PUIRemoveFilesInPath)
+// did not work correctly.
+// Please do now always append a NULL slot to the end of your array.
+
+// Parameters:
+// -------------
+// char* pszPath = Path to the files in array
+// const LPCSTR apszFiles[] = NULL-terminated array of files to be deleted.
+
+// Return Values:
+// --------------
+// Returns TRUE if the files could be deleted.
+// FALSE if the files could not be deleted or did not exist.
+
+
+static BOOL __inline PUIRemoveFilesInDirectory(char* pszPath, const char* apszFiles[])
+{
+ char szFile[MAX_PATH];
+ BOOL bReturn = FALSE;
+ int iFile = 0;
+
+ while (apszFiles[iFile] != NULL)
+ {
+ strncpy(szFile, pszPath, sizeof(szFile));
+ strncat(szFile, apszFiles[iFile], sizeof(szFile)-strlen(szFile));
+
+ if ((BOOL)DeleteFile(szFile) == TRUE) bReturn = TRUE;
+ iFile++;
+ }
+
+ return bReturn;
+}
+
+ // Example:
+ // ----------------------------------
+
+ //const char* apszFiles[] = {"File1.txt", "File2.txt", "File3.txt", NULL};
+ //PUIRemoveFilesInDirectory(ppup->pszPluginsPath, apszFiles);
+
+
+
+
+// | Events
+// -----------------------------
+
+
+// ---------------------------------------------
+// -- Event: Allow to uninstall a plugin -------
+// ---------------------------------------------
+
+// Event: ME_PLUGINUNINSTALLER_OKTOUNINSTALL
+
+#define ME_PLUGINUNINSTALLER_OKTOUNINSTALL "PluginUninstaller/OkToUninstall"
+
+// Submitted Values:
+// -----------------
+// wParam = pszPluginName (String containing the translated plugin name)
+// lParam = pszPluginFile (String containing the plugin dll file name in lower case)
+
+// Return Values:
+// -----------------
+// Returning 1 on this event causes the "Remove Plugin" button to be disabled.
+
+
+
+// ---------------------------------------------
+// -- Event: Plugin gets uninstalled -----------
+// ---------------------------------------------
+
+// Event: ME_PLUGINUNINSTALLER_UNINSTALL
+
+#define ME_PLUGINUNINSTALLER_UNINSTALL "PluginUninstaller/Uninstall"
+
+// Submitted Values:
+// -----------------
+// wParam = pszPluginName (String containing the translated plugin name)
+// lParam = pszPluginFile (String containing the plugin dll file name in lower case)
+
+// Return Values:
+// -----------------
+// Returning 1 on this event causes the uninstall process to be canceled.
+
+// Notice:
+// Hook this event if you would like to ask the user for something to remove/uninstall
+// and show your message box on this event. Save the action the user chose in a
+// global BOOL variable and do the chosen action in "UninstallEx".
+// You can get the plugins options window handle with MS_PLUGINUNINSTALLER_GETHANDLE.
+
+// Other plugins can use this event to be noticed that another plugin isn't installed anylonger.
+
+
+
+
+// | Services
+// -----------------------------
+
+
+// ---------------------------------------------
+// -- Service: Remove database module ----------
+// ---------------------------------------------
+
+// Service: MS_PLUGINUNINSTALLER_REMOVEDBMODULE
+
+#define MS_PLUGINUNINSTALLER_REMOVEDBMODULE "PluginUninstaller/RemoveDbModule"
+
+// Description:
+// -------------
+// This service provides the possibility to delete all database modules
+// associated to your plugin.
+// The specified database module will be removed in all contacts
+// including the NULL contact.
+// Remember to call it always with PUICallService in "UninstallEx" function.
+
+// Parameters:
+// -------------
+// wParam = (char*)pszModule // Pointer to a string containd module name. Can't be NULL
+// lParam = (const char*)apszIgnoreSettings // NULL terminated array of strings. Can be 0 if no settings should be ignored.
+ // See example 3 for more details
+
+// Return Values:
+// --------------
+// Returns 0 on success.
+// Nonzero if the module was not present in database.
+
+
+#ifndef UNINSTALLER_NOHELPERS
+
+// Can only be used in "UninstallEx" function
+#define PUIRemoveDbModule(pszModule) PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBMODULE, (WPARAM)pszModule, 0);
+
+#endif
+
+
+ // Example 1:
+ // ----------------------------------
+
+ //PUIRemoveDbModule("MyPlugin");
+
+
+ // Example 2:
+ // ----------------------------------
+
+ //char szModule[] = "MyModule";
+ //PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBMODULE, (WPARAM)szModule, 0);
+
+
+ // Example 3:
+ // ----------------------------------
+
+ // This deletes all settings in the specified module exept
+ // the specified settings: "Setting1",..."Setting4"
+
+ // char szModule[] = "MyModule";
+ // const char* apszIgnoreSettings[] = {"Setting1", "Setting2", "Setting3", "Setting4", NULL};
+ // PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBMODULE, (WPARAM)szModule, (LPARAM)&apszIgnoreSettings);
+
+
+
+// ---------------------------------------------
+// -- Service: Remove a setting globally -------
+// ---------------------------------------------
+
+// Service: MS_PLUGINUNINSTALLER_REMOVEDBSETTINGGLOBALLY
+
+#define MS_PLUGINUNINSTALLER_REMOVEDBSETTINGGLOBALLY "PluginUninstaller/RemoveDbSettingGlobally"
+
+// Description:
+// -------------
+// This service provides the possibility to delete a specific
+// setting in database in all contacts including the NULL contact.
+// Remember to call it always with PUICallService in "UninstallEx" function.
+
+// Parameters:
+// -------------
+// wParam = (char*)pszModule
+// lParam = (char*)pszSetting
+
+// Return Values:
+// --------------
+// Returns 0 on success.
+// Nonzero if the setting was not present in database.
+
+
+#ifndef UNINSTALLER_NOHELPERS
+
+// Can only be used in "UninstallEx" function
+#define PUIRemoveDbSettingGlobally(pszModule, pszSetting) PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBSETTINGGLOBALLY, (WPARAM)pszModule, (LPARAM)pszSetting);
+
+
+#endif
+
+
+ // Example 1:
+ // ----------------------------------
+
+ //PUIRemoveDbSettingGlobally("MyPlugin", "MySetting");
+
+
+ // Example 2:
+ // ----------------------------------
+
+ //szModule[] = "MyPlugin";
+ //szSetting[] = "MySetting";
+ //PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBSETTINGGLOBALLY, (WPARAM)szModule, (LPARAM)szSetting);
+
+
+
+
+
+
+// ---------------------------------------------
+// -- Service: Remove skinned sound ------------
+// ---------------------------------------------
+
+// Service: MS_PLUGINUNINSTALLER_REMOVESKINSOUND
+
+#define MS_PLUGINUNINSTALLER_REMOVESKINSOUND "PluginUninstaller/RemoveSkinSound"
+
+// Description:
+// -------------
+// This service provides the possibility to delete all your sound settings
+// associated to your plugin.
+// The specified sound will be be removed.
+// Remember to call it always with PUICallService in "UninstallEx" function.
+
+// Parameters:
+// -------------
+// wParam = (char*)pszSoundSetting
+// lParam = 0
+
+// Return Values:
+// --------------
+// Returns 0 on success.
+// Nonzero if the sound was not present in database.
+
+
+#ifndef UNINSTALLER_NOHELPERS
+
+// Can only be used in "UninstallEx" function
+#define PUIRemoveSkinSound(pszSoundSetting) PUICallService(MS_PLUGINUNINSTALLER_REMOVESKINSOUND, (WPARAM)pszSoundSetting, 0);
+
+#endif
+
+
+ // Example 1:
+ // ----------------------------------
+
+ //PUIRemoveSkinSound("MySoundSetting");
+
+
+ // Example 2:
+ // ----------------------------------
+
+ //szSoundModule[] = "MySoundSetting";
+ //PUICallService(MS_PLUGINUNINSTALLER_REMOVEDBMODULE, (WPARAM)szSoundSetting, 0);
+
+
+
+
+
+// ---------------------------------------------
+// -- Service: Uninstall a plugin --------------
+// ---------------------------------------------
+
+// Service: MS_PLUGINUNINSTALLER_UNINSTALLPLUGIN
+
+#define MS_PLUGINUNINSTALLER_UNINSTALLPLUGIN "PluginUninstaller/UninstallPlugin"
+
+// Description:
+// -------------
+// This service marks a plugin to be uninstalled at next restart of Miranda IM.
+// It uses the default value for "Delete all settings".
+// You can use this service for example when you want that your sub-plugin gets
+// also removed when your main-plugin is uninstalled.
+// Note: This service is not needed for the normal uninstalling functionality.
+
+// Parameters:
+// -------------
+// wParam = (char*)pszPluginName // do not translate this!
+// lParam = (char*)pszPluginFile // without path, only file name!
+
+// Return Values:
+// --------------
+// Returns always 0.
+
+
+#ifndef UNINSTALLER_NOHELPERS
+
+int __inline PUIUninstallPlugin(char* pszPluginName, char* pszPluginFile)
+{
+ return CallService(MS_PLUGINUNINSTALLER_UNINSTALLPLUGIN, (WPARAM)pszPluginName, (LPARAM)pszPluginFile);
+}
+
+#endif
+
+
+ // Example 1:
+ // ----------------------------------
+
+ //PUIUninstallPlugin("PluginName", "plugin.dll");
+
+
+ // Example 2:
+ // ----------------------------------
+
+ // hInst => Handle of a specific (your?) plugin
+ // char szPluginName[] = "YourPluginName";
+
+ //char* pFileName;
+ //char szPath[MAX_PATH];
+
+ //GetModuleFileName(hInst, szPath, sizeof(szPath));
+ //pFileName = strrchr(szPath, '\\');
+ //pFileName = pFileName+1; // Pointer arithmetic
+
+ //CallService(MS_PLUGINUNINSTALLER_UNINSTALLPLUGIN, (WPARAM)szPluginName, (LPARAM)pFileName);
+
+
+
+
+// ---------------------------------------------
+// -- Service: Getting handles -----------------
+// ---------------------------------------------
+
+// Service: MS_PLUGINUNINSTALLER_GETHANDLE
+
+#define MS_PLUGINUNINSTALLER_GETHANDLE "PluginUninstaller/GetHandle"
+
+// Description:
+// -------------
+// This service gets a specified window/instance handle.
+
+// Note: This service must not be used in "UninstallEx" function.
+// It is mainly thought for being used in ME_PLUGINUNINSTALLER_UNINSTALL event
+// to give out a MessageBox or something like that.
+
+// Parameters:
+// -------------
+// wParam = UINT uHandleType;
+// lParam = 0
+
+// Possible values for wParam:
+#define PUIHT_HINST_PLUGIN_INSTANCE 0 // HINSTANCE of the PluginUninstaller plugin
+#define PUIHT_HWND_PLUGIN_OPTIONS 1 // HWND of the plugin options dialog (if it is loaded; else NULL)
+
+// Return Values:
+// --------------
+// Returns the specified handle value.
+// If no handle type is specified it returns NULL.
+// The handle doesn't need to be destroyed.
+
+
+#ifndef UNINSTALLER_NOHELPERS
+
+HANDLE __inline PUIGetHandle(UINT uHandleType)
+{
+ return (HANDLE)CallService(MS_PLUGINUNINSTALLER_GETHANDLE, uHandleType, 0);
+}
+
+#endif
+
+
+ // Example
+ // ----------------------------------
+
+ //HWND hwndDlg;
+ //hwndDlg = (HWND)PUIGetHandle(PUIHT_HWND_PLUGIN_OPTIONS);
+
+
+
+
+
+#endif // M_UNINSTALLER_H
diff --git a/plugins/ExternalAPI/m_updater.h b/plugins/ExternalAPI/m_updater.h new file mode 100644 index 0000000000..488d3722ce --- /dev/null +++ b/plugins/ExternalAPI/m_updater.h @@ -0,0 +1,150 @@ +#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);
+}
+
+__inline static char *CreateVersionStringPluginEx(PLUGININFOEX *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/ExternalAPI/m_userinfoex.h b/plugins/ExternalAPI/m_userinfoex.h new file mode 100644 index 0000000000..53db892c00 --- /dev/null +++ b/plugins/ExternalAPI/m_userinfoex.h @@ -0,0 +1,382 @@ +/*
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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_USERINFOEX_H_
+#define _M_USERINFOEX_H_
+/*************************************************************
+ * Interfaces Module
+ */
+
+// {9C23A24B-E6AA-43c6-B0B8-D6C36D2F7B57}
+#define MIID_UIUSERINFOEX { 0x9c23a24b, 0xe6aa, 0x43c6, { 0xb0, 0xb8, 0xd6, 0xc3, 0x6d, 0x2f, 0x7b, 0x57 } }
+// {17DBD7C9-450E-4000-BFB4-908A7EF4CE72}
+#define MIID_CONTACTINFO { 0x17dbd7c9, 0x450e, 0x4000, { 0xbf, 0xb4, 0x90, 0x8a, 0x7e, 0xf4, 0xce, 0x72 } }
+// {02E890BD-278D-4890-918D-AB2CF5DC50BD}
+#define MIID_REMINDER { 0x2e890bd, 0x278d, 0x4890, { 0x91, 0x8d, 0xab, 0x2c, 0xf5, 0xdc, 0x50, 0xbd } }
+
+
+/*************************************************************
+ * PropertySheetPage Module
+ */
+
+/* UserInfo/AddPage v0.1.0.0+
+If the hIcon member of te optiondialogpage is valid, the tree show it for nicer look.
+Otherwise the default icon is displayed for this treeitem.
+*/
+#ifndef ODPF_UNICODE
+ #define ODPF_UNICODE 8 // string fields in OPTIONSDIALOGPAGE are WCHAR*
+#endif
+#define ODPF_ICON 64 // the hIcon member of the option dialog page is valid
+
+/* Handling notifications v0.1.0.4+
+A dialogbox should call SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSP_CHANGED) on a PSN_INFOCHANGED notification if
+there are unsafed changes and apply button should keep enabled. Otherwise the changed status
+of the dialogbox is resetted as well as the changed status of the details dialog box itself if no page
+called this message. Because UserinfoEx now looks for changes in the settings of a user to keep the
+shown inforamtion up to date.
+*/
+#define PSP_CHANGED 2
+#define PSN_ICONCHANGED 2000
+
+/* PSM_GETBOLDFONT v0.1.0.3+
+wParam=NULL
+lParam=(HFONT*)&hFont
+get bold dialog font. wParam is pointer to a handle that retrieves the boldfont.
+You can also call GetWindowLong(hDlg, DWLP_MSGRESULT) to get the font.
+This function returns TRUE on success or FALSE otherwise.
+*/
+#ifndef PSM_GETBOLDFONT
+ #define PSM_GETBOLDFONT (WM_USER+102)
+#endif
+
+/* PSM_ISLOCKED v0.1.0.4+
+Returns state of propertysheet. If it is locked, The PSM_CHANGED messages sent by a propertysheetpage does not
+have any effect. To aVOID editcontrols, ... to check for changes on redrawing at a load of settings from database or
+if another propertysheetpage is selected, a plugin should check this state and skip those checks to reduce stressing
+the database if such a test if control's content changed does so.
+wParam=NULL
+lParam=NULL
+You can also call GetWindowLong(hDlg, DWLP_MSGRESULT) to get the handle.
+This function returns TRUE if the PropertySheet is locked or FALSE otherwise.
+*/
+#define PSM_ISLOCKED (WM_USER+901)
+
+/* PSM_GETCONTACT v0.1.0.4+
+You can get the handle to the contact the propertysheet is associated with by calling PSM_GETCONTACT
+to the parent of your propertysheetpage - the propertysheet.
+wParam=index or -1 for current item
+lParam=(HANDLE*)&hContact
+You can also call GetWindowLong(hDlg, DWLP_MSGRESULT) to get the handle.
+This function returns TRUE on success or FALSE otherwise.
+*/
+#define PSM_GETCONTACT (WM_USER+903)
+
+/* PSM_GETBASEPROTO v0.1.0.4+
+You can get a pointer to the basic protocol module by sending PSM_GETBASEPROTO to the parent of your propertysheetpage.
+wParam=index or -1 for current item
+lParam=(LPCSTR*)&pszProto
+The propertysheet loads the basic contact protocol on creation for a better handling
+of owners (ICQ) protocol used for changing details on the server. Should also reduce database traffic.
+You can also call GetWindowLong(hDlg, DWLP_MSGRESULT) to get the protocol.
+This function returns TRUE on success or FALSE otherwise.
+*/
+#define PSM_GETBASEPROTO (WM_USER+905)
+
+#define INDEX_CURPAGE (-1)
+/* short helper macros
+*/
+#define PSGetBoldFont(hPsp, hFont) SNDMSG(GetParent((HWND)hPsp), PSM_GETBOLDFONT, (WPARAM)INDEX_CURPAGE, (LPARAM)(HFONT*)&hFont)
+#define PSGetContact(hPsp, hContact) SNDMSG(GetParent((HWND)hPsp), PSM_GETCONTACT, (WPARAM)INDEX_CURPAGE, (LPARAM)(HANDLE*)&hContact)
+#define PSGetBaseProto(hPsp, pszProto) SNDMSG(GetParent((HWND)hPsp), PSM_GETBASEPROTO, (WPARAM)INDEX_CURPAGE, (LPARAM)(LPCSTR*)&pszProto)
+
+/* PspIsLocked v0.1.1.0+
+Changed function a bit, because sometimes SNDMSG does not return the right value.
+Don't know why. But this works fine.
+*/
+static FORCEINLINE BOOLEAN PspIsLocked(HWND hPsp)
+{
+ HWND hPs = GetParent(hPsp);
+ return ((BOOLEAN)SendMessage((hPs), PSM_ISLOCKED, 0, 0) || GetWindowLongPtr((hPs), DWLP_MSGRESULT) != 0);
+}
+
+/* PSM_GETPAGEHWND v0.1.1.1+
+retrieve the windowhandle for a propertysheetpage identified by its id
+wParam=idDlg
+lParam=hInstance
+*/
+#define PSM_GETPAGEHWND (WM_USER+906)
+
+#define PSGetPageHandle(hPsp, idDlg, hInst) SNDMSG(GetParent((HWND)hPsp), PSM_GETPAGEHWND, (WPARAM)idDlg, (LPARAM)hInst)
+
+/* PSM_DLGMESSAGE v0.1.1.1+
+Send a message to a specified propertypage of the details dialog.
+This enables communication between propertypages without the need to know
+the window handles of each page.
+*/
+typedef struct TDlgCommand {
+ HINSTANCE hInst;
+ WORD idDlg;
+ WORD idDlgItem;
+ UINT uMsg;
+ WPARAM wParam;
+ LPARAM lParam;
+} DLGCOMMAND, *LPDLGCOMMAND;
+
+#define PSM_DLGMESSAGE (WM_USER+907)
+
+#define PSSendDlgMessage(hPsp, pDlgCmd) SNDMSG(GetParent((HWND)hPsp), PSM_DLGMESSAGE, NULL, (LPARAM)(LPDLGCOMMAND)pDlgCmd)
+
+
+/* PSM_ISAEROMODE v0.8.2.1+
+This message can be sent to the propertysheet (details dialog) to examine,
+whether the aero adaption mode is enabled or not. This message should be used in
+each propertysheet page's dialog procedure as follows:
+
+ ...
+ switch (msg) {
+ ...
+ case WM_CTLCOLORSTATIC:
+ case WM_CTLCOLORDLG:
+ if (PSIsAeroMode(hDlg))
+ return (INT_PTR)GetStockBrush(WHITE_BRUSH);
+ break;
+ ...
+
+This will draw a propertysheet page with white background, if aero adaption is enabled.
+wParam=not used
+lParam=(BOOL*)&bIsAero
+*/
+#define PSM_ISAEROMODE (WM_USER+908)
+static FORCEINLINE BOOLEAN PSIsAeroMode(HWND hPsp)
+{
+ BOOLEAN bIsAero;
+ SendMessage(GetParent(hPsp), PSM_ISAEROMODE,(WPARAM) NULL, (LPARAM)&bIsAero);
+ return bIsAero;
+}
+
+/*************************************************************
+ * vCard Module
+ */
+
+/* UserInfo/vCardExport v0.1.0.4+
+*/
+#define MS_USERINFO_VCARD_IMPORT "UserInfo/vCard/Import"
+
+#define MS_USERINFO_VCARD_IMPORTALL "UserInfo/vCard/ImportAll"
+/* UserInfo/vCardImport v0.1.0.4+
+*/
+#define MS_USERINFO_VCARD_EXPORT "UserInfo/vCard/Export"
+
+/* UserInfo/vCardImport v0.1.0.4+
+*/
+#define MS_USERINFO_VCARD_EXPORTALL "UserInfo/vCard/ExportAll"
+
+/*************************************************************
+ * time Module
+ */
+
+/* UserInfo/LocalTime v0.1.0.3+
+Computes the local time for the desired contact and writes it to lpst.
+wParam=(WPARAM)hContact
+lParam=(LPSYSTEMTIME)lpst
+The service gets your windows box's local time, reads your timezoneinformation (Windows setting)
+and hContact's timezone from his user details. With these information contact's local time is computed
+considering daylightsaving time.
+Return values are TRUE for success and FALSE if anything went wrong.
+*/
+#define MS_USERINFO_LOCALTIME "UserInfo/LocalTime"
+
+/* UserInfo/LocalTime v0.7.0.1+
+This service provides the timezone information for a given contact
+as known by windows, too. All but the DaylightName and StandardName members
+of the class are filled out and can be used. The values are read
+from the windows registry and therefore keep up to date if the latest
+windows hotfixes are installed. There is no default API in the windows SDK
+to solve this problem.
+wParam=(WPARAM)hContact
+lParam=(TIME_ZONE_INFORMATION*)tzi
+Return values are 0 for success and 1 if no valid timezone is set for the contact.
+*/
+#define MS_USERINFO_TIMEZONEINFO "UserInfo/TimezoneInfo"
+
+/*************************************************************
+ * Reminder module
+ */
+
+/* UserInfo/Reminder/Check v0.1.0.4+
+This service checks if one of your contacts has birthday in the next few days
+wParam = lParam = not used
+*/
+#define MS_USERINFO_REMINDER_CHECK "UserInfo/Reminder/Check"
+
+
+/* UserInfo/Reminder/Check v0.1.1.1+
+This service creates a dialog, that lists all of the anniversaries
+wParam = lParam = not used
+*/
+#define MS_USERINFO_REMINDER_LIST "UserInfo/Reminder/List"
+
+
+/* UserInfo/Reminder/Check v0.1.2.16+
+This service compares birthday date which is set by the protocol module of each contact
+to the first found custom set birthday date. If a difference is detected, the user is asked
+whether to update the custom set birthday by the one of the protocol or not.
+
+If no custom birthday is set yet and the protocol contains a valid birthday, it is copied to
+primary custom module (e.g.: mBirthday or UserInfo).
+wParam = handle to single contact or NULL to backup all
+lParam = not used
+*/
+#define MS_USERINFO_REMINDER_AGGRASIVEBACKUP "UserInfo/Reminder/AggrassiveBackup"
+
+
+/* UserInfo/Refresh v0.7.0.1+
+This service calls PSS_GETINFO for all contacts in the contact list
+wParam = not used
+lParam = not used
+*/
+#define MS_USERINFO_REFRESH "UserInfo/Refresh"
+
+
+/*************************************************************
+ * Uinfobuttonclass module
+ */
+
+// button styles
+#define MBS_DEFBUTTON 0x00001000L // default button
+#define MBS_PUSHBUTTON 0x00002000L // toggle button
+#define MBS_FLAT 0x00004000L // flat button
+#define MBS_DOWNARROW 0x00008000L // has arrow on the right
+
+#define MBF_UNICODE 1
+#ifdef _UNICODE
+ #define MBF_TCHAR MBF_UNICODE
+#else
+ #define MBF_TCHAR 0
+#endif
+
+// BUTTONADDTOOLTIP
+// use lParam=MBF_UNICODE to set unicode tooltips
+// for lParam=0 the string is interpreted as ansi
+
+// message to explicitly translate the buttons text,
+// as it is not done by default translation routine
+// wParam=lParam=NULL
+#define BUTTONTRANSLATE (WM_USER+6)
+
+/* UserInfo/MsgBox v0.1.0.4+
+Slightly modified version of MButtonClass, to draw both text and icon in a button control
+*/
+#define UINFOBUTTONCLASS _T("UInfoButtonClass")
+
+/*************************************************************
+ * contact info module
+ */
+
+// additional information which can be retrieved with this service
+#define CNF_COPHONE 55 // returns company phone (string)
+#define CNF_COFAX 40 // returns company fax (string)
+#define CNF_COCELLULAR 41 // returns company cellular (string)
+#define CNF_COEMAIL 42 // returns company email address (string)
+
+/* CNF_BIRTHDATE v0.1.2.18+
+returns a formated string with the birthdate in it
+wParam - 1 for long dateformat, 0 for short dateformat
+lParam - CONTACTINFO structure as for all other fields, too
+returns 0 on success and 1 on failure
+*/
+#define CNF_BIRTHDATE 43 // returns date of birth (string)
+
+
+/*************************************************************
+ * extended integration module
+ */
+
+/* UserInfo/Homepage/OpenURL v0.1.2.19+
+This service reads the contact's homepage from UserInfo module or contact's protocol module
+and opens the default browser to show it.
+wParam=hContact - handle to contact whose homepage is to show
+lParam=not used
+*/
+#define MS_USERINFO_HOMEPAGE_OPENURL "UserInfo/Homepage/OpenURL"
+
+/*************************************************************
+ * extended database module
+ */
+
+/* DB/Contact/GetSettingStrEx v0.7.0.1+
+This service function reads a database setting from USERINFO module.
+If the setting does not exist, it is looked up in 'pszProto'.
+If 'hContact' points to a MetaContact, the setting is recursivly
+searched in all sub contacts, too, starting with the default contact,
+if the MetaContact does not directly provide the setting.
+This service can directly replace the default MS_DB_CONTACT_GETSETTING_STR
+for reading contact information from the database.
+There will be no difference for the user but the possible source of information.
+
+This service can be used to retrieve all kinds of settings!
+Some versions of the default MS_DB_CONTACT_GETSETTING_STR service return
+an error for BYTE, WORD and DWORD values if cgs.pValue->type is not 0.
+
+wParam = (WPARAM)(HANDLE)hContact
+lParam = (LPARAM)(DBCONTACTGETSETTING*)&cgs
+
+This service returns one of the results of MS_DB_CONTACT_GETSETTING_STR!
+*/
+#define MS_DB_CONTACT_GETSETTING_STR_EX "DB/Contact/GetSettingStrEx"
+
+static FORCEINLINE INT_PTR
+ DBGetContactSettingEx_Helper(
+ HANDLE hContact,
+ const char* pszProto,
+ const char* pszSetting,
+ DBVARIANT *dbv,
+ BYTE nType
+ )
+{
+ INT_PTR rc;
+ DBCONTACTGETSETTING cgs;
+
+ cgs.szModule = pszProto;
+ cgs.szSetting = pszSetting;
+ cgs.pValue = dbv;
+ dbv->type = nType;
+
+ rc = CallService(MS_DB_CONTACT_GETSETTING_STR_EX, (WPARAM)hContact, (LPARAM)&cgs);
+ if (rc == CALLSERVICE_NOTFOUND)
+ {
+ rc = CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&cgs);
+ }
+ return rc;
+}
+
+#define DBGetContactSettingStringEx(c,p,s,v) DBGetContactSettingEx_Helper(c,p,s,v,DBVT_ASCIIZ)
+#define DBGetContactSettingWStringEx(c,p,s,v) DBGetContactSettingEx_Helper(c,p,s,v,DBVT_WCHAR)
+#define DBGetContactSettingUTF8StringEx(c,p,s,v) DBGetContactSettingEx_Helper(c,p,s,v,DBVT_UTF8)
+
+#ifdef _UNICODE
+#define DBGetContactSettingTStringEx DBGetContactSettingWStringEx
+#else
+#define DBGetContactSettingTStringEx DBGetContactSettingStringEx
+#endif
+
+/*************************************************************/
+#endif /* _M_USERINFOEX_H_ */
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_variables.h b/plugins/ExternalAPI/m_variables.h new file mode 100644 index 0000000000..0cba5216ce --- /dev/null +++ b/plugins/ExternalAPI/m_variables.h @@ -0,0 +1,719 @@ +/*
+ Variables Plugin for Miranda-IM (www.miranda-im.org)
+ Copyright 2003-2006 P. Boon
+
+ 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_VARS
+#define __M_VARS
+
+#if !defined(_TCHAR_DEFINED)
+#include <tchar.h>
+#endif
+
+#ifndef VARIABLES_NOHELPER
+#include <m_button.h>
+#endif
+
+#ifndef SIZEOF
+#include <win2k.h>
+#endif
+
+// --------------------------------------------------------------------------
+// Memory management
+// --------------------------------------------------------------------------
+
+// Release memory that was allocated by the Variables plugin, e.g. returned
+// strings.
+
+#define MS_VARS_FREEMEMORY "Vars/FreeMemory"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(void *)pntr
+// Pointer to memory that was allocated by the Variables plugin (e.g. a
+// returned string) (can be NULL).
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Does return 0 on success, nozero otherwise.
+
+// Note: Do only use this service to free memory that was *explicitliy*
+// stated that it should be free with this service.
+
+
+
+#define MS_VARS_GET_MMI "Vars/GetMMI"
+
+// Get Variable's RTL/CRT function poiners to malloc(), free() and
+// realloc().
+
+// Parameters:
+// ------------------------
+// wParam = 0
+// lParam = (LPARAM) &MM_INTERFACE
+// Pointer to a memory manager interface struct (see m_system.h).
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nozero otherwise
+
+// Note: Works exactly the same as the MS_SYSTEM_GET_MMI service
+// service of m_system.h.
+
+// Helper function for easy using:
+#ifndef VARIABLES_NOHELPER
+__inline static void variables_free(void *pntr) {
+
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)pntr, 0);
+}
+#endif
+
+
+
+// --------------------------------------------------------------------------
+// String formatting
+// --------------------------------------------------------------------------
+
+#define MS_VARS_FORMATSTRING "Vars/FormatString"
+
+// This service can be used to parse tokens in a text. The tokens will be
+// replaced by their resolved values. A token can either be a field or a
+// function. A field takes no arguments and is represented between
+// %-characters, e.g. "%winampsong%". A function can take any number of
+// arguments and is represented by a ? or !-character followed by the name
+// of the function and a list of arguments, e.g. "?add(1,2)".
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(FORMATINFO *)&fi
+// See below.
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Returns a pointer to the resolved string or NULL in case of an error.
+
+// Note: The returned pointer needs to be freed using MS_VARS_FREEMEMORY.
+
+typedef struct {
+ int cbSize; // Set this to sizeof(FORMATINFO).
+ int flags; // Flags to use (see FIF_* below).
+ union {
+ char *szFormat; // Text in which the tokens will be replaced (can't be
+ // NULL).
+ WCHAR *wszFormat;
+ TCHAR *tszFormat;
+ };
+ union {
+ char *szExtraText; // Extra, context-specific string (can be NULL) ->
+ // The field "extratext" will be replaced by this
+ // string. (Previously szSource).
+ WCHAR *wszExtraText;
+ TCHAR *tszExtraText;
+ };
+ HANDLE hContact; // Handle to contact (can be NULL) -> The field "subject"
+ // represents this contact.
+ int pCount; // (output) Number of succesful parsed tokens, needs to be set
+ // to 0 before the call
+ int eCount; // (output) Number of failed tokens, needs to be set to 0
+ // before the call
+ union {
+ char **szaTemporaryVars; // Temporary variables valid only in the duration of the format call
+ TCHAR **tszaTemporaryVars; // By pos: [i] is var name, [i + 1] is var value
+ WCHAR **wszaTemporaryVars;
+ };
+ int cbTemporaryVarsSize; // Number of elements in szaTemporaryVars array
+
+} FORMATINFO;
+
+#define FORMATINFOV2_SIZE (sizeof(int)*4+sizeof(void*)*2 + sizeof(HANDLE))
+
+// Possible flags:
+#define FIF_UNICODE 0x01 // Expects and returns unicode text (WCHAR*).
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define FIF_TCHAR FIF_UNICODE // Strings in structure are TCHAR*.
+#else
+#define FIF_TCHAR 0
+#endif
+
+// Helper functions for easy using:
+
+// Helper #1: variables_parse
+// ------------------------
+// The returned string needs to be freed using MS_VARS_FREEMEMORY.
+
+#ifndef VARIABLES_NOHELPER
+__inline static TCHAR *variables_parse(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact) {
+
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+
+ return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+}
+#endif
+
+__inline static TCHAR *variables_parse_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
+ TCHAR **tszaTemporaryVars, int cbTemporaryVarsSize) {
+
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+ fi.tszaTemporaryVars = tszaTemporaryVars;
+ fi.cbTemporaryVarsSize = cbTemporaryVarsSize;
+
+ return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+}
+// Helper #2: variables_parsedup
+// ------------------------
+// Returns a _strdup()'ed copy of the unparsed string when Variables is not
+// installed, returns a strdup()'ed copy of the parsed result otherwise.
+
+// Note: The returned pointer needs to be released using your own free().
+
+#ifndef VARIABLES_NOHELPER
+__inline static TCHAR *variables_parsedup(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact) {
+
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
+ FORMATINFO fi;
+ TCHAR *tszParsed, *tszResult;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags |= FIF_TCHAR;
+ tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (tszParsed) {
+ tszResult = _tcsdup(tszParsed);
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)tszParsed, 0);
+ return tszResult;
+ }
+ }
+ return tszFormat?_tcsdup(tszFormat):tszFormat;
+}
+
+__inline static TCHAR *variables_parsedup_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
+ TCHAR **tszaTemporaryVars, int cbTemporaryVarsSize) {
+
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
+ FORMATINFO fi;
+ TCHAR *tszParsed, *tszResult;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags |= FIF_TCHAR;
+ fi.tszaTemporaryVars = tszaTemporaryVars;
+ fi.cbTemporaryVarsSize = cbTemporaryVarsSize;
+ tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (tszParsed) {
+ tszResult = _tcsdup(tszParsed);
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)tszParsed, 0);
+ return tszResult;
+ }
+ }
+ return tszFormat?_tcsdup(tszFormat):tszFormat;
+}
+#endif
+
+
+
+// --------------------------------------------------------------------------
+// Register tokens
+// --------------------------------------------------------------------------
+
+// Plugins can define tokens which will be parsed by the Variables plugin.
+
+#define MS_VARS_REGISTERTOKEN "Vars/RegisterToken"
+
+// With this service you can define your own token. The newly added tokens
+// using this service are taken into account on every call to
+// MS_VARS_FORMATSTRING.
+
+// Parameters:
+// ------------------------
+// wParam = 0
+// lParam = (LPARAM)(TOKENREGISTER*)&tr
+// See below.
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nonzero otherwise. Existing tokens will be
+// 'overwritten' if registered twice.
+
+// Needed for szService and parseFunction:
+typedef struct {
+ int cbSize; // You need to check if this is >=sizeof(ARGUMENTSINFO)
+ // (already filled in).
+ FORMATINFO *fi; // Arguments passed to MS_VARS_FORMATSTRING.
+ unsigned int argc; // Number of elements in the argv array.
+ union {
+ char **argv; // Argv[0] will be the token name, the following elements
+ // are the additional arguments.
+ WCHAR **wargv; // If the registered token was registered as a unicode
+ // token, wargv should be accessed.
+ TCHAR **targv;
+ };
+ int flags; // (output) You can set flags here (initially 0), use the
+ // AIF_* flags (see below).
+} ARGUMENTSINFO;
+
+// Available flags for ARGUMENTSINFO:
+// Set the flags of the ARGUMENTSINFO struct to any of these to influence
+// further parsing.
+#define AIF_DONTPARSE 0x01 // Don't parse the result of this function,
+ // usually the result of a token is parsed
+ // again, if the `?` is used as a function
+ // character.
+#define AIF_FALSE 0x02 // The function returned logical false.
+
+// Definition of parse/cleanup functions:
+typedef char* (*VARPARSEFUNCA)(ARGUMENTSINFO *ai);
+typedef WCHAR* (*VARPARSEFUNCW)(ARGUMENTSINFO *ai);
+typedef void (*VARCLEANUPFUNCA)(char *szReturn);
+typedef void (*VARCLEANUPFUNCW)(WCHAR *wszReturn);
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define VARPARSEFUNC VARPARSEFUNCW
+#define VARCLEANUPFUNC VARCLEANUPFUNCW
+#else
+#define VARPARSEFUNC VARPARSEFUNCA
+#define VARCLEANUPFUNC VARCLEANUPFUNCA
+#endif
+
+typedef struct {
+ int cbSize; // Set this to sizeof(TOKENREGISTER).
+ union {
+ char *szTokenString; // Name of the new token to be created, without %,
+ // ?, ! etc. signs (can't be NULL).
+ WCHAR *wszTokenString;
+ TCHAR *tszTokenString;
+ };
+ union {
+ char *szService; // Name of a service that is used to request the
+ // token's value, if no service is used, a function
+ // and TRF_PARSEFUNC must be used.
+ VARPARSEFUNCA parseFunction; // See above, use with TRF_PARSEFUNC.
+ VARPARSEFUNCW parseFunctionW;
+ VARPARSEFUNC parseFunctionT;
+ };
+ union {
+ char *szCleanupService; // Name of a service to be called when the
+ // memory allocated in szService can be freed
+ // (only used when flag VRF_CLEANUP is set,
+ // else set this to NULL).
+ VARCLEANUPFUNCA cleanupFunction; // See above, use with TRF_CLEANUPFUNC.
+ VARCLEANUPFUNCW cleanupFunctionW;
+ VARCLEANUPFUNC cleanupFunctionT;
+ };
+ char *szHelpText; // Help info shown in help dialog (can be NULL). Has to
+ // be in the following format:
+ // "subject\targuments\tdescription"
+ // (Example: "math\t(x, y ,...)\tx + y + ..."), or:
+ // "subject\tdescription"
+ // (Example: "miranda\tPath to the Miranda-IM
+ // executable").
+ // Note: subject and description are translated by
+ // Variables.
+ int memType; // Describes which method Varibale's plugin needs to use to
+ // free the returned buffer, use one of the VR_MEM_* values
+ // (see below). Only valid if the flag VRF_FREEMEM is set,
+ // use TR_MEM_OWNER otherwise).
+ int flags; // Flags to use (see below), one of TRF_* (see below).
+} TOKENREGISTER;
+
+// Available Memory Storage Types:
+// These values describe which method Variables Plugin will use to free the
+// buffer returned by the parse function or service
+#define TR_MEM_VARIABLES 1 // Memory is allocated using the functions
+ // retrieved by MS_VARS_GET_MMI.
+#define TR_MEM_MIRANDA 2 // Memory is allocated using Miranda's Memory
+ // Manager Interface (using the functions
+ // returned by MS_SYSTEM_GET_MMI), if
+ // VRF_FREEMEM is set, the memory will be
+ // freed by Variables.
+#define TR_MEM_OWNER 3 // Memory is owned by the calling plugin
+ // (can't be freed by Variables Plugin
+ // automatically). This should be used if
+ // VRF_FREEMEM is not specified in the flags.
+
+// Available Flags for TOKENREGISTER:
+#define TRF_FREEMEM 0x01 // Variables Plugin will automatically free the
+ // pointer returned by the parse function or
+ // service (which method it will us is
+ // specified in memType -> see above).
+#define TRF_CLEANUP 0x02 // Call cleanup service or function, notifying
+ // that the returned buffer can be freed.
+ // Normally you should use either TRF_FREEMEM
+ // or TRF_CLEANUP.
+#define TRF_PARSEFUNC 0x40 // parseFunction will be used instead of a
+ // service.
+#define TRF_CLEANUPFUNC 0x80 // cleanupFunction will be used instead of a
+ // service.
+#define TRF_USEFUNCS TRF_PARSEFUNC|TRF_CLEANUPFUNC
+#define TRF_UNPARSEDARGS 0x04 // Provide the arguments for the parse
+ // function in their raw (unparsed) form.
+ // By default, arguments are parsed before
+ // presenting them to the parse function.
+#define TRF_FIELD 0x08 // The token can be used as a %field%.
+#define TRF_FUNCTION 0x10 // The token can be used as a ?function().
+ // Normally you should use either TRF_FIELD or
+ // TRF_FUNCTION.
+#define TRF_UNICODE 0x20 // Strings in structure are unicode (WCHAR*).
+ // In this case, the strings pointing to the
+ // arguments in the ARGUMENTS struct are
+ // unicode also. The returned buffer is
+ // expected to be unicode also, and the
+ // unicode parse and cleanup functions are
+ // called.
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define TRF_TCHAR TRF_UNICODE // Strings in structure are TCHAR*.
+#else
+#define TRF_TCHAR 0
+#endif
+
+// Deprecated:
+#define TRF_CALLSVC TRF_CLEANUP
+
+// Callback Service (szService) / parseFunction:
+// ------------------------
+// Service that is called automatically by the Variable's Plugin to resolve a
+// registered variable.
+
+// Parameters:
+// wParam = 0
+// lParam = (LPARAM)(ARGUMENTSINFO *)&ai
+// see above
+
+// Return Value:
+// Needs to return the pointer to a dynamically allocacated string or NULL.
+// A return value of NULL is regarded as an error (eCount will be increaded).
+// Flags in the ARGUMENTSINFO struct can be set (see above).
+
+// Callback Service (szCallbackService) / cleanupFunction:
+// ------------------------
+// This service is called when the memory that was allocated by the parse
+// function or service can be freed. Note: It will only be called when the
+// flag VRF_CLEANUP of TOKENREGISTER is set.
+
+// Parameters:
+// wParam = 0
+// lParam = (LPARAM)(char *)&res
+// Result from parse function or service (pointer to a string).
+
+// Return Value:
+// Should return 0 on success.
+
+
+
+// --------------------------------------------------------------------------
+// Show the help dialog
+// --------------------------------------------------------------------------
+
+// Plugins can invoke Variables' help dialog which can be used for easy input
+// by users.
+
+#define MS_VARS_SHOWHELPEX "Vars/ShowHelpEx"
+
+// This service can be used to open the help dialog of Variables. This dialog
+// provides easy input for the user and/or information about the available
+// tokens.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(HWND)hwndParent
+// lParam = (LPARAM)(VARHELPINFO)&vhi
+// See below.
+
+// Return Value:
+// ------------------------
+// Returns 0 on succes, any other value on error.
+
+typedef struct {
+ int cbSize; // Set to sizeof(VARHELPINFO).
+ FORMATINFO *fi; // Used for both input and output. If this pointer is not
+ // NULL, the information is used as the initial values for
+ // the dialog.
+ HWND hwndCtrl; // Used for both input and output. The window text of this
+ // window will be read and used as the initial input of the
+ // input dialog. If the user presses the OK button the window
+ // text of this window will be set to the text of the input
+ // field and a EN_CHANGE message via WM_COMMAND is send to
+ // this window. (Can be NULL).
+ char *szSubjectDesc; // The description of the %subject% token will be set
+ // to this text, if not NULL. This is translated
+ // automatically.
+ char *szExtraTextDesc; // The description of the %extratext% token will be
+ // set to this text, if not NULL. This is translated
+ // automatically.
+ int flags; // Flags, see below.
+} VARHELPINFO;
+
+
+// Flags for VARHELPINFO
+#define VHF_TOKENS 0x00000001 // Create a dialog with the list of
+ // tokens
+#define VHF_INPUT 0x00000002 // Create a dialog with an input
+ // field (this contains the list of
+ // tokens as well).
+#define VHF_SUBJECT 0x00000004 // Create a dialog to select a
+ // contact for the %subject% token.
+#define VHF_EXTRATEXT 0x00000008 // Create a dialog to enter a text
+ // for the %extratext% token.
+#define VHF_HELP 0x00000010 // Create a dialog with help info.
+#define VHF_HIDESUBJECTTOKEN 0x00000020 // Hide the %subject% token in the
+ // list of tokens.
+#define VHF_HIDEEXTRATEXTTOKEN 0x00000040 // Hide the %extratext% token in
+ // the list of tokens.
+#define VHF_DONTFILLSTRUCT 0x00000080 // Don't fill the struct with the
+ // new information if OK is pressed
+#define VHF_FULLFILLSTRUCT 0x00000100 // Fill all members of the struct
+ // when OK is pressed. By default
+ // only szFormat is set. With this
+ // flag on, hContact and
+ // szExtraText are also set.
+#define VHF_SETLASTSUBJECT 0x00000200 // Set the last contact that was
+ // used in the %subject% dialog in
+ // case fi.hContact is NULL.
+
+// Predefined flags
+#define VHF_FULLDLG VHF_INPUT|VHF_SUBJECT|VHF_EXTRATEXT|VHF_HELP
+#define VHF_SIMPLEDLG VHF_INPUT|VHF_HELP
+#define VHF_NOINPUTDLG VHF_TOKENS|VHF_HELP
+
+// If the service fills information in the struct for szFormat or szExtraText,
+// these members must be free'd using the free function of Variables.
+// If wParam==NULL, the dialog is created modeless. Only one dialog can be
+// shown at the time.
+// If both hwndCtrl and fi are NULL, the user input will not be retrievable.
+// In this case, the dialog is created with only a "Close" button, instead of
+// the "OK" and "Cancel" buttons.
+// In case of modeless dialog and fi != NULL, please make sure this pointer
+// stays valid while the dialog is open.
+
+// Helper function for easy use in standard case:
+#ifndef VARIABLES_NOHELPER
+__inline static int variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags, char *szSubjectDesc, char *szExtraDesc) {
+
+ VARHELPINFO vhi;
+
+ ZeroMemory(&vhi, sizeof(VARHELPINFO));
+ vhi.cbSize = sizeof(VARHELPINFO);
+ if (flags == 0) {
+ flags = VHF_SIMPLEDLG;
+ }
+ vhi.flags = flags;
+ vhi.hwndCtrl = GetDlgItem(hwndDlg, uIDEdit);
+ vhi.szSubjectDesc = szSubjectDesc;
+ vhi.szExtraTextDesc = szExtraDesc;
+
+ return CallService(MS_VARS_SHOWHELPEX, (WPARAM)hwndDlg, (LPARAM)&vhi);
+}
+#endif
+
+
+#define MS_VARS_GETSKINITEM "Vars/GetSkinItem"
+
+// This service can be used to get the icon you can use for example on the
+// Variables help button in your options screen. You can also get the tooltip
+// text to use with such a button. If icon library is available the icon will
+// be retrieved from icon library manager, otherwise the default is returned.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)0
+// lParam = (LPARAM)VSI_* (see below)
+
+// Return Value:
+// ------------------------
+// Depends on the information to retrieve (see below).
+
+// VSI_ constants
+#define VSI_HELPICON 1 // Can be used on the button accessing the
+ // Variables help dialog. Returns (HICON)hIcon on
+ // success or NULL on failure;
+#define VSI_HELPTIPTEXT 2 // Returns the tooltip text you can use for the
+ // help button. Returns (char *)szTipText, a
+ // static, translated buffer containing the help
+ // text or NULL on error.
+
+// Helper to set the icon on a button accessing the help dialog.
+// Preferably a 16x14 MButtonClass control, but it works on a standard
+// button control as well. If no icon is availble (because of old version of
+// Variables) the string "V" is shown on the button. If Variables is not
+// available, the button will be hidden.
+#ifndef VARIABLES_NOHELPER
+__inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) {
+
+ int res;
+ HICON hIcon;
+ TCHAR tszClass[32];
+
+ hIcon = NULL;
+ res = 0;
+ if (ServiceExists(MS_VARS_GETSKINITEM))
+ hIcon = (HICON)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPICON);
+
+ GetClassName(GetDlgItem(hwndDlg, uIDButton), tszClass, SIZEOF(tszClass));
+ if (!_tcscmp(tszClass, _T("Button"))) {
+ if (hIcon != NULL) {
+ SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)|BS_ICON);
+ SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
+ }
+ else {
+ SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)&~BS_ICON);
+ SetDlgItemText(hwndDlg, uIDButton, _T("V"));
+ }
+ }
+ else if (!_tcscmp(tszClass, MIRANDABUTTONCLASS)) {
+ if (hIcon != NULL) {
+ char *szTipInfo = NULL;
+
+ SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
+ if (ServiceExists(MS_VARS_GETSKINITEM))
+ szTipInfo = (char *)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPTIPTEXT);
+
+ if (szTipInfo == NULL)
+ szTipInfo = Translate("Open String Formatting Help");
+
+ SendMessage(GetDlgItem(hwndDlg, uIDButton), BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0);
+ SendDlgItemMessage(hwndDlg, uIDButton, BUTTONSETASFLATBTN, 0, 0);
+ }
+ else SetDlgItemText(hwndDlg, uIDButton, _T("V"));
+ }
+ else res = -1;
+
+ ShowWindow(GetDlgItem(hwndDlg, uIDButton), ServiceExists(MS_VARS_FORMATSTRING));
+
+ return res;
+}
+#endif
+
+
+#define MS_VARS_SHOWHELP "Vars/ShowHelp"
+
+// WARNING: This service is obsolete, please use MS_VARS_SHOWHELPEX
+
+// Shows a help dialog where all possible tokens are displayed. The tokens
+// are explained on the dialog, too. The user can edit the initial string and
+// insert as many tokens as he likes.
+
+// Parameters:
+// ------------------------
+// wParam = (HWND)hwndEdit
+// Handle to an edit control in which the modified string
+// should be inserted (When the user clicks OK in the dialog the edited
+// string will be set to hwndEdit) (can be NULL).
+// lParam = (char *)pszInitialString
+// String that the user is provided with initially when
+// the dialog gets opened (If this is NULL then the current text in the
+// hwndEdit edit control will be used) (can be NULL).
+
+// Return Value:
+// ------------------------
+// Returns the handle to the help dialog (HWND).
+
+// Note: Only one help dialog can be opened at a time. When the dialog gets
+// closed an EN_CHANGE of the edit controll will be triggered because the
+// contents were updated. (Only when user selected OK).
+
+// Example:
+// CallService(MS_VARS_SHOWHELP, (WPARAM)hwndEdit, (LPARAM)"some initial text");
+
+// --------------------------------------------------------------------------
+// Retrieve a contact's HANDLE given a string
+// --------------------------------------------------------------------------
+
+#define MS_VARS_GETCONTACTFROMSTRING "Vars/GetContactFromString"
+
+// Searching for contacts in the database. You can find contacts in db by
+// searching for their name, e.g first name.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(CONTACTSINFO *)&ci
+// See below.
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Returns number of contacts found matching the given string representation.
+// The hContacts array of CONTACTSINFO struct contains these hContacts after
+// the call.
+
+// Note: The hContacts array needs to be freed after use using
+// MS_VARS_FREEMEMORY.
+
+typedef struct {
+ int cbSize; // Set this to sizeof(CONTACTSINFO).
+ union {
+ char *szContact; // String to search for, e.g. last name (can't be NULL).
+ WCHAR *wszContact;
+ TCHAR *tszContact;
+ };
+ HANDLE *hContacts; // (output) Array of contacts found.
+ DWORD flags; // Contact details that will be matched with the search
+ // string (flags can be combined).
+} CONTACTSINFO;
+
+// Possible flags:
+#define CI_PROTOID 0x00000001 // The contact in the string is encoded
+ // in the format <PROTOID:UNIQUEID>, e.g.
+ // <ICQ:12345678>.
+#define CI_NICK 0x00000002 // Search nick names.
+#define CI_LISTNAME 0x00000004 // Search custom names shown in contact
+ // list.
+#define CI_FIRSTNAME 0x00000008 // Search contact's first names (contact
+ // details).
+#define CI_LASTNAME 0x00000010 // Search contact's last names (contact
+ // details).
+#define CI_EMAIL 0x00000020 // Search contact's email adresses
+ // (contact details).
+#define CI_UNIQUEID 0x00000040 // Search unique ids of the contac, e.g.
+ // UIN.
+#define CI_CNFINFO 0x40000000 // Searches one of the CNF_* flags (set
+ // flags to CI_CNFINFO|CNF_X), only one
+ // CNF_ type possible
+#define CI_UNICODE 0x80000000 // tszContact is a unicode string
+ // (WCHAR*).
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define CI_TCHAR CI_UNICODE // Strings in structure are TCHAR*.
+#else
+#define CI_TCHAR 0
+#endif
+
+
+
+#endif //__M_VARS
diff --git a/plugins/ExternalAPI/m_voice.h b/plugins/ExternalAPI/m_voice.h new file mode 100644 index 0000000000..a81d866754 --- /dev/null +++ b/plugins/ExternalAPI/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/ExternalAPI/m_voiceservice.h b/plugins/ExternalAPI/m_voiceservice.h new file mode 100644 index 0000000000..98c3580aea --- /dev/null +++ b/plugins/ExternalAPI/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__
diff --git a/plugins/ExternalAPI/m_vsramm.h b/plugins/ExternalAPI/m_vsramm.h new file mode 100644 index 0000000000..cff14d8a2e --- /dev/null +++ b/plugins/ExternalAPI/m_vsramm.h @@ -0,0 +1,11 @@ +typedef struct {
+ char *szProto;
+ char *msg;
+ char *uMsg;
+ int statusMode;
+} PROTOMSGINFO;
+
+// wParam = 0
+// lParam = PROTOMSGINFO *
+// returns 0 on success
+#define MS_VSRAMM_SETAWAYMSG "VSRAMM/SetAwayMsg"
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_w7ui.h b/plugins/ExternalAPI/m_w7ui.h new file mode 100644 index 0000000000..6d8ee28b92 --- /dev/null +++ b/plugins/ExternalAPI/m_w7ui.h @@ -0,0 +1,63 @@ +#ifndef m_w7ui_h__
+#define m_w7ui_h__
+
+enum
+{
+ MIS_ICOLIB,
+ MIS_GENERAL,
+ MIS_PROTOCOL,
+};
+
+struct MIRANDAJUMPLISTITEM
+{
+ int iconSource;
+ char *iconName;
+ int iconIdx;
+ WCHAR *szTitle;
+ WCHAR *szPrefix;
+ WCHAR *szArgument;
+};
+
+// Force jumplist rebuild
+#define MS_JUMPLIST_REBUILD "w7/JumpList/Rebuild"
+
+// ---
+#define ME_JUMPLIST_BUILDCATEGORIES "w7/JumpList/BuildCategories"
+
+// lParam = (WCHAR *)category name
+#define ME_JUMPLIST_BUILDITEMS "w7/JumpList/BuildItems"
+
+// lParam = (WCHAR *)category name
+#define MS_JUMPLIST_ADDCATEGORY "w7/JumpList/AddCategory"
+
+// lParam = (MIRANDAJUMPLISTITEM *)item
+#define MS_JUMPLIST_ADDITEM "w7/JumpList/AddItem"
+
+// wParam = prefix
+// lParam = argument
+#define ME_JUMPLIST_PROCESS "w7/JumpList/Process"
+
+static void MJumpList_AddCategory(WCHAR *name)
+{
+ CallService(MS_JUMPLIST_ADDCATEGORY, 0, (LPARAM)name);
+}
+
+static void MJumpList_AddItem(char *mir_icon, WCHAR *title, WCHAR *prefix, WCHAR *argument)
+{
+ MIRANDAJUMPLISTITEM item = { MIS_ICOLIB, mir_icon, 0, title, prefix, argument };
+ CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item);
+}
+
+static void MJumpList_AddItem(int skinicon, WCHAR *title, WCHAR *prefix, WCHAR *argument)
+{
+ MIRANDAJUMPLISTITEM item = { MIS_GENERAL, 0, skinicon, title, prefix, argument };
+ CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item);
+}
+
+static void MJumpList_AddItem(char *proto, int skinicon, WCHAR *title, WCHAR *prefix, WCHAR *argument)
+{
+ MIRANDAJUMPLISTITEM item = { MIS_PROTOCOL, proto, skinicon, title, prefix, argument };
+ CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item);
+}
+
+#endif // m_w7ui_h__
diff --git a/plugins/ExternalAPI/m_weather.h b/plugins/ExternalAPI/m_weather.h new file mode 100644 index 0000000000..dbdd1de298 --- /dev/null +++ b/plugins/ExternalAPI/m_weather.h @@ -0,0 +1,161 @@ +/*
+Weather Protocol plugin for Miranda IM
+Copyright (C) 2005-2009 Boris Krasnovskiy All Rights Reserved
+Copyright (C) 2002-2005 Calvin Che
+
+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; version 2
+of the License.
+
+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, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef M_WEATHER_H__
+#define M_WEATHER_H__ 1
+
+// {6B612A34-DCF2-4e32-85CF-B6FD006B745E}
+#define MIID_WEATHER { 0x6b612a34, 0xdcf2, 0x4e32, { 0x85, 0xcf, 0xb6, 0xfd, 0x0, 0x6b, 0x74, 0x5e } }
+
+//============ CONSTANTS ============
+
+// name
+#define WEATHERPROTONAME "Weather"
+#define WEATHERPROTOTEXT "Weather"
+#define DEFCURRENTWEATHER "WeatherCondition"
+#define WEATHERCONDITION "Current"
+
+// weather conditions
+#define SUNNY ID_STATUS_ONLINE
+#define NA ID_STATUS_OFFLINE
+#define PCLOUDY ID_STATUS_AWAY
+#define CLOUDY ID_STATUS_NA
+#define RAIN ID_STATUS_OCCUPIED
+#define RSHOWER ID_STATUS_DND
+#define SNOW ID_STATUS_FREECHAT
+#define LIGHT ID_STATUS_INVISIBLE
+#define THUNDER ID_STATUS_INVISIBLE
+#define SSHOWER ID_STATUS_ONTHEPHONE
+#define FOG ID_STATUS_OUTTOLUNCH
+#define UNAVAIL 40081
+
+
+//============ WEATHER CONDITION STRUCT ============
+
+// weather conditions (added in v0.1.2.0)
+typedef struct {
+ HANDLE hContact;
+ char id[128];
+ char city[128];
+ char update[64];
+ char cond[128];
+ char temp[16];
+ char low[16];
+ char high[16];
+ char feel[16];
+ char wind[16];
+ char winddir[64];
+ char dewpoint[16];
+ char pressure[16];
+ char humid[16];
+ char vis[16];
+ char sunrise[32];
+ char sunset[32];
+// are the other ones that important!?
+ WORD status;
+} WEATHERINFO;
+
+
+
+// =============== WEATHER SERVICES ================
+
+// Enable or disable weather protocol.
+// WPARAM = FALSE to toggle, TRUE to use the LPARAM
+// LPARAM = TRUE to enable, FALSE to disable
+#define MS_WEATHER_ENABLED "Weather/EnableDisable"
+
+// Update all weather info
+// WPARAM = LPARAM = NULL
+#define MS_WEATHER_UPDATEALL "Weather/UpdateAll"
+
+// Update all weather info + erase the old ones
+// WPARAM = LPARAM = NULL
+#define MS_WEATHER_REFRESHALL "Weather/RefreshAll"
+
+// Below are the service functions for weather contacts
+// The plugin does NOT verify that they are used in weather contact,
+// so bad call on these function may cause crashes.
+
+// Update a single station
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_UPDATE "Weather/Update"
+
+// Update a single station + delete old settings
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_REFRESH "Weather/Refresh"
+
+// View the brief info of a contact
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_BRIEF "Weather/Brief"
+
+// Use default browser to open the complete forecast on web
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_COMPLETE "Weather/CompleteForecast"
+
+// Use default browser to open the weather map defined for the contact
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_MAP "Weather/Map"
+
+// Open the external log of the weather contact
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_LOG "Weather/Log"
+
+// Edit weather contact setting
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+#define MS_WEATHER_EDIT "Weather/Edit"
+
+// parse the string to turn it to weather display
+// WPARAM = (WEATHERINFO*)hContact
+// LPARAM = (char*)display_str
+#define MS_WEATHER_GETDISPLAY "Weather/GetDisplay"
+
+// =============== WEATHER EVENTS ================
+
+/*
+HANDLE hContact = (HANDLE)wParam;
+BOOL Condition_Changed = (BOOL)lParam;
+
+hContact is the handle of updated contact
+If the weather condition is differ from the last update (either temperature/condition,
+or the last update time, depend what the user choose in the options), then
+Condition_Changed is true; otherwise is false.
+*/
+#define ME_WEATHER_UPDATED "Miranda/Weather/Updated"
+
+/*
+Shows a warning message for Weather PopUp.
+wParam = (char*) lpzMessage
+lParam = Type
+Type can either be SM_WARNING, SM_NOTIFY, or SM_WEATHERALERT
+
+This event is used to avoid the error popup to occurs within a thread, so the "Use
+multiply thread" fuction don't have to be enabled for weather popups to work.
+*/
+#define SM_WEATHERALERT 16
+#define ME_WEATHER_ERROR "Miranda/Weather/Error"
+
+
+#endif //M_WEATHER_H__
diff --git a/plugins/ExternalAPI/m_wizard.h b/plugins/ExternalAPI/m_wizard.h new file mode 100644 index 0000000000..4b37c3a4ab --- /dev/null +++ b/plugins/ExternalAPI/m_wizard.h @@ -0,0 +1,90 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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_WIZARD_H__
+#define M_WIZARD_H__ 1
+
+#include "m_options.h"
+
+#define MWF_UNICODE 0x01
+#define MWF_ICOLIB 0x02
+#ifdef _UNICODE
+ #define MWF_TCHAR MWF_UNICODE
+#else
+ #define MWF_TCHAR 0
+#endif
+
+typedef struct
+{
+ DWORD dwFlags;
+ HANDLE hContact;
+ char *pszWizardName;
+ union
+ {
+ HICON hIcon;
+ HANDLE hIcolibItem;
+ };
+ union
+ {
+ char *pszTitle;
+ WCHAR *pwszTitle;
+ TCHAR *ptszTitle;
+ };
+} WIZARDINFO;
+
+//show the User Details dialog box
+//wParam=0
+//lParam=(WPARAM)(WIZARDINFO *)wizardInfo
+#define MS_WIZARD_SHOW "Wizard/Show"
+
+// Predefined wizards
+#define MW_MIRANDA_STARTUP "Miranda/Startup"
+#define MW_MIRANDA_CONFIG "Miranda/Config"
+
+/* Wizard/Initialise
+The user opened a details dialog. Modules should do whatever initialisation
+they need and call wizard/addpage one or more times if they want pages
+displayed in the options dialog
+wParam=addInfo
+lParam=(WIZARDINFO *)wizardInfo
+addInfo should be passed straight to the wParam of wizard/addpage
+*/
+#define ME_WIZARD_INITIALISE "Wizard/Initialise"
+
+/* Wizard/AddPage
+Must only be called during an userinfo/initialise hook
+Adds a page to the details dialog
+wParam=addInfo
+lParam=(LPARAM)(OPTIONSDIALOGPAGE*)odp
+addInfo must have come straight from the wParam of userinfo/initialise
+Pages in the details dialog operate just like pages in property sheets. See the
+Microsoft documentation for info on how they operate.
+When the pages receive WM_INITDIALOG, lParam=(LPARAM)(WIZARDINFO *)wizardInfo
+Strings in the structure can be released as soon as the service returns, but
+icons must be kept around. This is not a problem if you're loading them from a
+resource
+*/
+#define MS_WIZARD_ADDPAGE "Wizard/AddPage"
+
+#endif // M_WIZARD_H__
+
diff --git a/plugins/ExternalAPI/m_yamn.h b/plugins/ExternalAPI/m_yamn.h new file mode 100644 index 0000000000..7eebf757c2 --- /dev/null +++ b/plugins/ExternalAPI/m_yamn.h @@ -0,0 +1,150 @@ +#ifndef __M_YAMN_H
+#define __M_YAMN_H
+
+#include <windows.h>
+
+//
+//================================== VARIABLES STRUCT ========================================
+//
+
+typedef struct CYAMNVariables
+{
+#define YAMN_VARIABLESVERSION 3
+ HINSTANCE hInst;
+ HANDLE MessageWnds;
+ HANDLE NewMailAccountWnd;
+ int Shutdown;
+} YAMN_VARIABLES, *PYAMN_VARIABLES;
+
+//
+//================================== EXPORTED FUNCTIONS STRUCT ===============================
+//
+
+struct CExportedFunctions
+{
+ char* ID;
+ void *Ptr;
+};
+
+struct CExportedServices
+{
+ char* ID;
+ INT_PTR (* Ptr)(WPARAM,LPARAM);
+};
+
+//
+//================================== YAMN EVENTS ==================================
+//
+
+//UninstallPlugin Event
+//Sent when user wants to uninstall YAMN and all its plugins
+#define ME_YAMN_UNINSTALLPLUGINS "YAMN/MirandaEvents/UninstallPlugins"
+
+//NewMail Event
+//Notifies you about new mail
+//no arguments now (Developers, send mail, which params would you like to have, but note there's problem that
+//params are 32b numbers. When it is pointer to some data, these data should persist while every plugin read them and
+//after that they can be removed from memory. So it is problem)
+#define ME_YAMN_NEWMAIL "YAMN/MirandaEvents/NewMail"
+
+//
+//================================== YAMN SERVICES ==================================
+//
+
+//GetFcnPtr Service
+//Your plugin can co-operate with YAMN in 2 ways: with Miranda services and with YAMN exported functions
+//Some commands are written in services, some are functions. The advantage of function calling instead of
+//service calling is, that your code is more clear and it is faster than service calling (smaller, FASTER,
+//easier- it is slogan of Miranda, isn't it ?). Miranda service has only 2 parameters, that can be
+//disadvantage too.
+//In every way, it is discutable which functions should be exported or if they should be implemented as
+//services. And if YAMN should export some functions etc. Functions not used very often are now implemented
+//as Miranda services.
+//
+//This service gets pointer to YAMN function. Then you can use function directly. In m_?????.h files you have
+//definitions of some functions, with definitions of structure variable, so you can use functions very
+//clearly, just look to header file.
+//WPARAM- function ID. It is string representating function you need to get pointer (e.g. YAMN_WRITEWAITID)
+//LPARAM- not used now, but set it to 0
+//returns pointer to YAMN function or NULL when functions does not exist
+#define MS_YAMN_GETFCNPTR "YAMN/Service/GetFcn"
+
+//GetVariables Service
+//Ask YAMN for pointer to CYAMNVariables structure.
+//WPARAM- YAMN_VARIABLESVERSION
+//LPARAM- any value
+//returns pointer to YAMN_VARIABLES or NULL when version of structure does not match
+#define MS_YAMN_GETVARIABLES "YAMN/Service/GetVar"
+
+//ForceCheck Service
+//Check mail on accounts
+//WPARAM- not used
+//LPARAM- not used
+#define MS_YAMN_FORCECHECK "YAMN/Service/ForceCheck"
+
+//AccountCheck Service
+//Check mail on individual account
+//WPARAM- HACCOUNT
+//LPARAM- BOOL: Show Popup on no new mail
+#define MS_YAMN_ACCOUNTCHECK "YAMN/Service/AccountCheck"
+
+//Contact List Context Menu Click
+//wParam=(WPARAM)hContact
+//lParam=0
+//
+//Event is fired when there is a double click on a CList contact,
+//it is upto the caller to check for the protocol & status
+//of the HCONTACT, it's not done for you anymore since it didn't make
+//sense to store all this information in memory, etc.
+#define MS_YAMN_CLISTCONTEXT "YAMN/Service/ClistContactContextMenu"
+
+//Contact List Context Menu Click for application
+//wParam=(WPARAM)hContact
+//lParam=0
+//
+//Event is fired when there is a double click on a CList contact,
+//it is upto the caller to check for the protocol & status
+//of the HCONTACT, it's not done for you anymore since it didn't make
+//sense to store all this information in memory, etc.
+#define MS_YAMN_CLISTCONTEXTAPP "YAMN/Service/ClistContactContextMenuApp"
+
+//Contact List Double Click
+//wParam=(WPARAM)hContact
+//lParam=0
+//
+//Event is fired when there is a double click on a CList contact,
+//it is upto the caller to check for the protocol & status
+//of the HCONTACT, it's not done for you anymore since it didn't make
+//sense to store all this information in memory, etc.
+#define MS_YAMN_CLISTDBLCLICK "YAMN/Service/ClistContactDoubleclicked"
+
+//FilterMail Service
+//Ask YAMN to process mail filtering. YAMN calls filter plugins to mark mail as spam etc... Warning! Leave all
+//read or write access to mail as this function waits for write-access to mail!
+//WPARAM- (HACCOUNT) account to which mail belongs
+//LPARAM- (HYAMNMAIL) mail to filter
+#define MS_YAMN_FILTERMAIL "YAMN/Service/FilterMail"
+
+//MailBrowser Service
+//runs mail browser window (or tray icon only or popups only)
+//WPARAM- pointer to YAMN_MAILBROWSERPARAM structure, data to mailbrowser. You do not need to fill ThreadRunningEV event member.
+//LPARAM- YAMN_MAILBROWSERPARAM structure version param. Use YAMN_MAILBROWSERVERSION definition.
+//returns zero if failed, nonzero if succeed
+#define MS_YAMN_MAILBROWSER "YAMN/Service/RunMailBrowser"
+
+//NoNewMail Service
+//runs no new mail procedure (shows popups e.g.)
+//WPARAM- pointer to YAMN_NONEWMAILPARAM structure, data to no new mail procedure. You do not need to fill ThreadRunningEV event member.
+//LPARAM- YAMN_NONEWMAILPARAM structure version param. Use YAMN_NONEWMAILVERSION definition.
+//returns zero if failed, nonzero if succeed
+#define MS_YAMN_NONEWMAILPROC "YAMN/Service/NoNewMailProc"
+
+//BadConnection Service
+//runs bad connection window
+//WPARAM- pointer to YAMN_BADCONNECTIONPARAM structure, data to mailbrowser. You do not need to fill ThreadRunningEV event member.
+//LPARAM- YAMN_BADCONNECTIONPARAM structure version param. Use YAMN_BADCONNECTIONVERSION definition.
+//returns zero if failed, nonzero if succeed
+#define MS_YAMN_BADCONNECTION "YAMN/Service/BadConnection"
+
+#define MUUID_YAMN_FORCECHECK { 0x7d15e716, 0x6045, 0x40e3, { 0xa2, 0xb5, 0x5f, 0xb, 0xa4, 0x2b, 0xc7, 0x77 } }
+#endif
|