summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-05-15 07:43:27 +0000
committermataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-05-15 07:43:27 +0000
commit3f4b8991fea70f26d296817bc5f8b72a35098440 (patch)
tree60712c32897a49a330b224ce5e8a1c0a1ee287bb
parentd5c649d22b371af230c10bf262e4cd9aef84c586 (diff)
ExternalAPI:
update git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@93 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
-rw-r--r--ExternalAPI/m_NewAwaySys.h119
-rw-r--r--ExternalAPI/m_account.h239
-rw-r--r--ExternalAPI/m_assocmgr.h301
-rw-r--r--ExternalAPI/m_avatarhistory.h51
-rw-r--r--ExternalAPI/m_dos.h22
-rw-r--r--ExternalAPI/m_ersatz.h40
-rw-r--r--ExternalAPI/m_filterplugin.h139
-rw-r--r--ExternalAPI/m_flags.h51
-rw-r--r--ExternalAPI/m_flash.h92
-rw-r--r--ExternalAPI/m_listeningto.h79
-rw-r--r--ExternalAPI/m_mails.h284
-rw-r--r--ExternalAPI/m_messages.h41
-rw-r--r--ExternalAPI/m_msg_buttonsbar.h10
-rw-r--r--ExternalAPI/m_music.h345
-rw-r--r--ExternalAPI/m_png.h64
-rw-r--r--ExternalAPI/m_proto_listeningto.h144
-rw-r--r--ExternalAPI/m_protoplugin.h389
-rw-r--r--ExternalAPI/m_simpleaway.h84
-rw-r--r--ExternalAPI/m_smileyadd.h8
-rw-r--r--ExternalAPI/m_spellchecker.h77
-rw-r--r--ExternalAPI/m_statusplugins.h154
-rw-r--r--ExternalAPI/m_synchro.h160
-rw-r--r--ExternalAPI/m_tipper.h45
-rw-r--r--ExternalAPI/m_trigger.h1024
-rw-r--r--ExternalAPI/m_uninstaller.h700
-rw-r--r--ExternalAPI/m_variables.h30
-rw-r--r--ExternalAPI/m_vsramm.h11
-rw-r--r--ExternalAPI/m_yamn.h154
28 files changed, 4794 insertions, 63 deletions
diff --git a/ExternalAPI/m_NewAwaySys.h b/ExternalAPI/m_NewAwaySys.h
new file mode 100644
index 0000000..4038fad
--- /dev/null
+++ b/ExternalAPI/m_NewAwaySys.h
@@ -0,0 +1,119 @@
+/*
+ New Away System plugin for Miranda IM
+ Copyright (c) 2005-2006 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/ExternalAPI/m_account.h b/ExternalAPI/m_account.h
new file mode 100644
index 0000000..2baadd2
--- /dev/null
+++ b/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/ExternalAPI/m_assocmgr.h b/ExternalAPI/m_assocmgr.h
new file mode 100644
index 0000000..4e15168
--- /dev/null
+++ b/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/ExternalAPI/m_avatarhistory.h b/ExternalAPI/m_avatarhistory.h
new file mode 100644
index 0000000..2613dee
--- /dev/null
+++ b/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/ExternalAPI/m_dos.h b/ExternalAPI/m_dos.h
new file mode 100644
index 0000000..db0aadf
--- /dev/null
+++ b/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/ExternalAPI/m_ersatz.h b/ExternalAPI/m_ersatz.h
new file mode 100644
index 0000000..8136a8b
--- /dev/null
+++ b/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/ExternalAPI/m_filterplugin.h b/ExternalAPI/m_filterplugin.h
new file mode 100644
index 0000000..5c39ac9
--- /dev/null
+++ b/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/ExternalAPI/m_flags.h b/ExternalAPI/m_flags.h
index 5130190..aafa2fb 100644
--- a/ExternalAPI/m_flags.h
+++ b/ExternalAPI/m_flags.h
@@ -34,18 +34,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
/* Load a country flag icon from the skin library. v0.1.0.0+
-The retrieved HICON SHOULDN'T be destroyed, it is managed by IcoLib,
-it should be released using MS_SKIN2_RELEASEICON after use.
+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 HICON)
+ 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.
@@ -56,14 +78,6 @@ or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
*/
#define MS_FLAGS_IPTOCOUNTRY "Flags/IpToCountry"
-/* 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"
-
/* 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.
@@ -77,10 +91,6 @@ 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
-#define CTRY_UNSPECIFIED 0
-#define CTRY_OTHER 9999
-#define CTRY_UNKNOWN 0xFFFF
-
#if !defined(FLAGS_NOSETTINGS) && defined(EXTRA_ICON_ADV2)
#define SETTING_SHOWSTATUSICONFLAG_DEFAULT 1
#define SETTING_SHOWEXTRAIMGFLAG_DEFAULT 1
@@ -89,15 +99,4 @@ or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
#define SETTING_USEIPTOCOUNTRY_DEFAULT 1
#endif
-#ifndef 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
-
#endif // M_FLAGS_H
diff --git a/ExternalAPI/m_flash.h b/ExternalAPI/m_flash.h
new file mode 100644
index 0000000..35184a3
--- /dev/null
+++ b/ExternalAPI/m_flash.h
@@ -0,0 +1,92 @@
+/*
+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"
+
+// tZers macros
+/**
+ WPARAM not used
+ LPARAM not used
+*/
+#define MS_TZERS_SUPPORT "FlashAvatar/tZers"
+#define EVENTTYPE_TZERS 4
+
+// 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"
+
+// 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
+} FLASHAVATAR;
diff --git a/ExternalAPI/m_listeningto.h b/ExternalAPI/m_listeningto.h
new file mode 100644
index 0000000..00cc69e
--- /dev/null
+++ b/ExternalAPI/m_listeningto.h
@@ -0,0 +1,79 @@
+/*
+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_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/ExternalAPI/m_mails.h b/ExternalAPI/m_mails.h
new file mode 100644
index 0000000..06bd9df
--- /dev/null
+++ b/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/ExternalAPI/m_messages.h b/ExternalAPI/m_messages.h
new file mode 100644
index 0000000..7fc0fbe
--- /dev/null
+++ b/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/ExternalAPI/m_msg_buttonsbar.h b/ExternalAPI/m_msg_buttonsbar.h
index 1ab6651..8a55627 100644
--- a/ExternalAPI/m_msg_buttonsbar.h
+++ b/ExternalAPI/m_msg_buttonsbar.h
@@ -14,7 +14,7 @@
//////////////////////////////////////////////////////////////////////////
// Remove button
//
-// wParam = 0
+// wParam = 0
// lParam = (BBButton *) &description, only button ID and ModuleName used
#define MS_BB_REMOVEBUTTON "TabSRMM/ButtonsBar/RemoveButton"
@@ -36,7 +36,7 @@
//
// wParam = hContact
// lParam = (BBButton *) &description , only ModuleName and ID used
-// Returns BBButton struct with BBSF_ bbbFlags:
+// Returns BBButton struct with BBSF_ bbbFlags:
#define MS_BB_GETBUTTONSTATE "TabSRMM/ButtonsBar/GetButtonState"
//////////////////////////////////////////////////////////////////////////
@@ -75,7 +75,7 @@
typedef struct {
int cbSize;
POINT pt; // screen coordinates for menus
- char* pszModule; // button owners name
+ char* pszModule; // button owners name
DWORD dwButtonId; // registered button ID
HWND hwndFrom; // button parents HWND
HANDLE hContact; //
@@ -85,7 +85,7 @@ typedef struct {
//button flags
#define BBBF_DISABLED (1<<0)
-#define BBBF_HIDDEN (1<<1)
+#define BBBF_HIDDEN (1<<1)
#define BBBF_ISPUSHBUTTON (1<<2)
#define BBBF_ISARROWBUTTON (1<<3)
#define BBBF_ISCHATBUTTON (1<<4)
@@ -102,7 +102,7 @@ typedef struct _tagBBButton
{
int cbSize; // size of structure
- DWORD dwButtonID; // your button ID, will be combined with pszModuleName for storing settings, etc...
+ 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{
diff --git a/ExternalAPI/m_music.h b/ExternalAPI/m_music.h
new file mode 100644
index 0000000..4f10475
--- /dev/null
+++ b/ExternalAPI/m_music.h
@@ -0,0 +1,345 @@
+#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
+ int kbps;
+ int khz;
+ int channels;
+ int track;
+ int total; // music length
+ int time; // elapsed time
+ CHAR *wndtext; // window title
+ CHAR *player; // player name
+ int plyver; // player version
+ HANDLE icon; // player icon
+ int fsize; // media file size
+ int vbr;
+ int status; // player status: 0 - stopped; 1 - playing; 2 - paused
+ HWND plwnd; // player window
+ // video part
+ int codec;
+ int width;
+ int height;
+ int fps;
+ __int64 date;
+ CHAR *txtver;
+ CHAR *lyric;
+ CHAR *cover;
+ int volume;
+ CHAR *url;
+} SONGINFOA, *LPSONGINFOA;
+
+typedef struct tSongInfo {
+ WCHAR *artist;
+ WCHAR *title;
+ WCHAR *album;
+ WCHAR *genre;
+ WCHAR *comment;
+ WCHAR *year;
+ WCHAR *mfile; // media file
+ int kbps;
+ int khz;
+ int channels;
+ int track;
+ int total; // music length
+ int time; // elapsed time
+ WCHAR *wndtext; // window title
+ WCHAR *player; // player name
+ int plyver; // player version
+ HANDLE icon; // player icon
+ int fsize; // media file size
+ int vbr;
+ int status; // player status: 0 - stopped; 1 - playing; 2 - paused
+ HWND plwnd; // player window
+ // video part
+ int codec;
+ int width;
+ int height;
+ int fps;
+ __int64 date;
+ WCHAR txtver;
+ // not implemented yet
+ WCHAR *lyric;
+ WCHAR *cover;
+ int volume;
+ WCHAR *url;
+} 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_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"
+
+/*
+ Get user's Music Info
+*/
+#define MS_WAT_GETCONTACTINFO = "WATrack/GetContactInfo"
+
+#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)
+/*
+ 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"
+
+// ------------ Plugin/player status ------------
+
+/*
+ wParam: 1 - switch off plugin
+ 0 - switch on plugin
+ -1 - switch plugin status
+ 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"
+
+#define ME_WAT_MODULELOADED "WATrack/ModuleLoaded"
+
+#define WAT_EVENT_PLAYERSTATUS 1 // 0-normal; 1-no music (possibly stopped); 2-not found
+#define WAT_EVENT_NEWTRACK 2
+#define WAT_EVENT_PLUGINSTATUS 3 // 0-enabled; 1-dis.temporary; 2-dis.permanent
+#define WAT_EVENT_NEWPLAYER 4 //
+#define WAT_EVENT_NEWTEMPLATE 5 // TM_* constant
+
+/*
+ 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 0x0001 // format registered but disabled
+#define WAT_OPT_ONLYONE 0x0002 // format can't be overwriten
+#define WAT_OPT_PLAYERINFO 0x0004 // song info from player
+#define WAT_OPT_WINAMPAPI 0x0008 // Winamp API support
+#define WAT_OPT_CHECKTIME 0x0010 // check file time for changes
+#define WAT_OPT_VIDEO 0x0020 // only for format registering used
+#define WAT_OPT_LAST 0x0040 // (internal)
+#define WAT_OPT_FIRS 0x0080 // (internal)
+#define WAT_OPT_TEMPLATE 0x0100 // (internal)
+#define WAT_OPT_IMPLANTANT 0x0200 // use process implantation
+#define WAT_OPT_HASURL 0x0400 // (player registration) URL field present
+#define WAT_OPT_CHANGES 0x0800 // obtain only chaged values
+ // (volume, status, window text, elapsed time)
+#define WAT_OPT_MULTITHREAD 0x8000 // Use multithread scan
+#define WAT_OPT_KEEPOLD 0x4000 // Keep Old opened file
+
+
+typedef BOOL (__cdecl *LPREADFORMATPROC)(LPSONGINFO Info);
+
+typedef struct tMusicFormat {
+ LPREADFORMATPROC proc;
+ CHAR ext[8];
+ int 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
+*/
+
+#define MS_WAT_WINAMPINFO "WATrack/WinampInfo"
+
+/*
+ wParam: window
+ lParam: LoWord - command; HiWord - value
+*/
+
+#define MS_WAT_WINAMPCOMMAND "WATrack/WinampCommand"
+
+typedef WCHAR (__cdecl *LPNAMEPROC)();
+typedef HWND (__cdecl *LPCHECKPROC)(int flags);
+typedef int (__cdecl *LPINFOPROC)(LPSONGINFO Info, int flags);
+typedef int (__cdecl *LPCOMMANDPROC)(int command, int value);
+
+typedef struct tPlayerCell {
+ CHAR *Desc;
+ int flags;
+ HICON Icon; // can be 0. for registration only
+ LPCHECKPROC Check; // check player
+ 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
+} 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
+*/
+
+#define MS_WAT_PLAYER "WATrack/Player"
+
+// --------- Templates ----------
+
+//templates
+#define TM_MESSAGE 0 // privat message
+#define TM_CHANNEL 1 // chat
+#define TM_STAT_TITLE 2 // xstatus title
+#define TM_STAT_TEXT 3 // [x]status text
+#define TM_POPTITLE 4 // popup title
+#define TM_POPTEXT 5 // popup text
+#define TM_EXPORT 6 // other app
+#define TM_FRAMEINFO 7 // frame
+
+#define TM_SETTEXT 0x100 // only for service
+#define TM_GETTEXT 0 // only for service
+
+/*
+ wParam: not used
+ 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: Template type (TM_* constants).
+ lParam: Template string for template setup, or not used
+ returns: pointer to statically allocated string (DON'T free!)
+ note: Template set if wParam with TM_SETTEXT combined. If used for
+ Protocol-dependent templates, used only for default templates.
+*/
+#define MS_WAT_TEMPLATE = "WATrack/Templates"
+
+#endif
diff --git a/ExternalAPI/m_png.h b/ExternalAPI/m_png.h
new file mode 100644
index 0000000..46ff96e
--- /dev/null
+++ b/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/ExternalAPI/m_proto_listeningto.h b/ExternalAPI/m_proto_listeningto.h
new file mode 100644
index 0000000..53e1184
--- /dev/null
+++ b/ExternalAPI/m_proto_listeningto.h
@@ -0,0 +1,144 @@
+/*
+
+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; // Algum 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/ExternalAPI/m_protoplugin.h b/ExternalAPI/m_protoplugin.h
new file mode 100644
index 0000000..ae5dd0f
--- /dev/null
+++ b/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/ExternalAPI/m_simpleaway.h b/ExternalAPI/m_simpleaway.h
new file mode 100644
index 0000000..e451c93
--- /dev/null
+++ b/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/ExternalAPI/m_smileyadd.h b/ExternalAPI/m_smileyadd.h
index acb14e9..6b36750 100644
--- a/ExternalAPI/m_smileyadd.h
+++ b/ExternalAPI/m_smileyadd.h
@@ -1,6 +1,6 @@
/*
Miranda SmileyAdd Plugin
-Copyright (C) 2005 - 2009 Boris Krasnovskiy
+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
@@ -240,10 +240,10 @@ typedef struct
typedef struct
{
- unsigned cbSize; // size of the structure
+ unsigned cbSize; // size of the structure
HANDLE hContact;
- int type; // 0 - directory, 1 - file;
- TCHAR* path; // smiley category name for reference
+ int type; // 0 - directory, 1 - file;
+ TCHAR* path; // smiley category name for reference
} SMADD_CONT;
//Loads all smileys for the contact
diff --git a/ExternalAPI/m_spellchecker.h b/ExternalAPI/m_spellchecker.h
new file mode 100644
index 0000000..146b40e
--- /dev/null
+++ b/ExternalAPI/m_spellchecker.h
@@ -0,0 +1,77 @@
+/*
+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_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/ExternalAPI/m_statusplugins.h b/ExternalAPI/m_statusplugins.h
new file mode 100644
index 0000000..5139673
--- /dev/null
+++ b/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/ExternalAPI/m_synchro.h b/ExternalAPI/m_synchro.h
new file mode 100644
index 0000000..ff3e601
--- /dev/null
+++ b/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/ExternalAPI/m_tipper.h b/ExternalAPI/m_tipper.h
new file mode 100644
index 0000000..21b6df7
--- /dev/null
+++ b/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/ExternalAPI/m_trigger.h b/ExternalAPI/m_trigger.h
new file mode 100644
index 0000000..e51294b
--- /dev/null
+++ b/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/ExternalAPI/m_uninstaller.h b/ExternalAPI/m_uninstaller.h
new file mode 100644
index 0000000..e26f55c
--- /dev/null
+++ b/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/ExternalAPI/m_variables.h b/ExternalAPI/m_variables.h
index d932d5e..1264643 100644
--- a/ExternalAPI/m_variables.h
+++ b/ExternalAPI/m_variables.h
@@ -25,11 +25,11 @@
#endif
#ifndef VARIABLES_NOHELPER
-#include "m_button.h"
+#include <m_button.h>
#endif
#ifndef SIZEOF
-#include "win2k.h"
+#include <win2k.h>
#endif
// --------------------------------------------------------------------------
@@ -172,32 +172,6 @@ __inline static TCHAR *variables_parse(TCHAR *tszFormat, TCHAR *tszExtraText, HA
return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
}
-
-__inline static char *variables_parse_char(char *szFormat, char *szExtraText, HANDLE hContact)
-{
- FORMATINFO fi = {0};
-
- fi.cbSize = sizeof(fi);
- fi.szFormat = szFormat;
- fi.szExtraText = szExtraText;
- fi.hContact = hContact;
- fi.flags = 0;
-
- return (char *) CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
-}
-__inline static wchar_t *variables_parse_wchar(wchar_t *wszFormat, wchar_t *wszExtraText, HANDLE hContact)
-{
- FORMATINFO fi = {0};
-
- fi.cbSize = sizeof(fi);
- fi.wszFormat = wszFormat;
- fi.wszExtraText = wszExtraText;
- fi.hContact = hContact;
- fi.flags = FIF_UNICODE;
-
- return (wchar_t *) CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
-}
-
#endif
__inline static TCHAR *variables_parse_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
diff --git a/ExternalAPI/m_vsramm.h b/ExternalAPI/m_vsramm.h
new file mode 100644
index 0000000..cff14d8
--- /dev/null
+++ b/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/ExternalAPI/m_yamn.h b/ExternalAPI/m_yamn.h
new file mode 100644
index 0000000..921fcfb
--- /dev/null
+++ b/ExternalAPI/m_yamn.h
@@ -0,0 +1,154 @@
+#ifndef __M_YAMN_H
+#define __M_YAMN_H
+
+#include <windows.h>
+
+//
+//================================== VARIABLES STRUCT ========================================
+//
+
+#ifndef MIRANDASERVICE
+typedef int (*MIRANDASERVICE)(WPARAM,LPARAM);
+#endif
+
+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)(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