diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-09 05:20:49 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-09 05:20:49 +0000 |
commit | faf1e494a31b70203aa67d34602f5256eabe0336 (patch) | |
tree | b222ebe08c9173c1ba2811bcad4f47369d0e4f38 /plugins/ExternalAPI | |
parent | 302209a17a9f5342a377904cda699fd3833bbe9a (diff) |
Test commit:
delphi headers structure as c headers structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1829 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI')
69 files changed, 10108 insertions, 5 deletions
diff --git a/plugins/ExternalAPI/delphi/imgdecoder.pas b/plugins/ExternalAPI/delphi/imgdecoder.pas new file mode 100644 index 0000000000..eea6ec2610 --- /dev/null +++ b/plugins/ExternalAPI/delphi/imgdecoder.pas @@ -0,0 +1,114 @@ +unit ImgDecoder;
+
+interface
+uses Windows;
+
+function IsImgDecoderAvailable:boolean;
+function ImgNewDecoder(var pDecoder:pointer):dword;
+function ImgDeleteDecoder(pDecoder:pointer):dword;
+function ImgNewDIBFromFile(pDecoder:pointer;Filename:PAnsiChar;var pImg:pointer):dword;
+function ImgDeleteDIBSection(pImg:pointer):dword;
+function ImgGetHandle(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword;
+
+implementation
+
+const
+ hModule:THANDLE=0;
+type
+ tImgNewDecoder =function(var pDecoder:pointer):dword; stdcall;
+ tImgDeleteDecoder =function(pDecoder:pointer):dword; stdcall;
+ tImgNewDIBFromFile =function(pDecoder:pointer;Filename:PAnsiChar;var pImg):dword; stdcall;
+ tImgDeleteDIBSection=function(pImg:pointer):dword; stdcall;
+ tImgGetHandle =function(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; stdcall;
+
+const
+ pImgNewDecoder :tImgNewDecoder = nil;
+ pImgDeleteDecoder :tImgDeleteDecoder = nil;
+ pImgNewDIBFromFile :tImgNewDIBFromFile = nil;
+ pImgDeleteDIBSection:tImgDeleteDIBSection = nil;
+ pImgGetHandle :tImgGetHandle = nil;
+
+function IsImgDecoderAvailable:boolean;
+begin
+ result:=hModule<>0;
+end;
+
+function ImgNewDecoder(var pDecoder:pointer):dword;
+begin
+ if @pImgNewDecoder<>nil then
+ result:=pImgNewDecoder(pDecoder)
+ else
+ result:=0;
+end;
+
+function ImgDeleteDecoder(pDecoder:pointer):dword;
+begin
+ if @pImgDeleteDecoder<>nil then
+ result:=pImgDeleteDecoder(pDecoder)
+ else
+ result:=0;
+end;
+
+function ImgNewDIBFromFile(pDecoder:pointer;Filename:PAnsiChar;var pImg:pointer):dword;
+begin
+ if @pImgNewDecoder<>nil then
+ result:=pImgNewDIBFromFile(pDecoder,Filename,pImg)
+ else
+ result:=0;
+end;
+
+function ImgDeleteDIBSection(pImg:pointer):dword;
+begin
+ if @pImgNewDecoder<>nil then
+ result:=pImgDeleteDIBSection(pImg)
+ else
+ result:=0;
+end;
+
+function ImgGetHandle(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword;
+begin
+ if @pImgGetHandle<>nil then
+ result:=pImgGetHandle(pImg,pBitmap,ppDIBBits)
+ else
+ result:=0;
+end;
+
+initialization
+ hModule:=LoadLibrary('imgdecoder.dll');
+ if hModule=0 then
+ hModule:=LoadLibrary('plugins\imgdecoder.dll');
+
+ if hModule<>0 then
+ begin
+ pImgNewDecoder :=GetProcAddress(hModule, 'ImgNewDecoder');
+ pImgDeleteDecoder :=GetProcAddress(hModule, 'ImgDeleteDecoder');
+ pImgNewDIBFromFile :=GetProcAddress(hModule, 'ImgNewDIBFromFile');
+ pImgDeleteDIBSection:=GetProcAddress(hModule, 'ImgDeleteDIBSection');
+ pImgGetHandle :=GetProcAddress(hModule, 'ImgGetHandle');
+ end;
+
+finalization
+ if hModule<>0 then
+ FreeLibrary(hModule);
+end.
+{ Sample of using
+
+var
+ pDecoder:pointer;
+ pImg:pointer;
+ bitmap:HBITMAP;
+ pBits:pointer;
+begin
+ if IsImgDecoderAvailable then
+ begin
+ ImgNewDecoder(pDecoder);
+ if ImgNewDIBFromFile(pDecoder,PAnsiChar(ParamStr(1)),pImg)<>0 then
+ begin
+ ImgGetHandle(pImg,bitmap,pBits);
+// action
+ ImgDeleteDIBSection(pImg);
+ end;
+ ImgDeleteDecoder(pDecoder);
+ end;
+end.
+}
diff --git a/plugins/ExternalAPI/delphi/m_DataAsMessage.inc b/plugins/ExternalAPI/delphi/m_DataAsMessage.inc new file mode 100644 index 0000000000..71bfcc059d --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_DataAsMessage.inc @@ -0,0 +1,155 @@ +{
+ DataAsMessage plugin for Miranda IM
+ Copyright (c) 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_DATAASMESSAGE}
+{$DEFINE M_DATAASMESSAGE}
+
+const
+// DAM_SENDRESULTINFO::iResult values
+ DAM_SR_SUCCESS = 0;
+ DAM_SR_TIMEOUT = 1; // timeout period expired; this value is returned
+ // also if the contact went offline for a time
+ // longer than a timeout period
+ DAM_SR_NOTSUPPORTED = 2; // means this szDataType is not supported by the
+ // remote side
+ DAM_SR_NODAM = 3; // means there is no DataAsMessage plugin on the
+ // remote side; keep in mind that this error may
+ // also appear accidentally because of a bad
+ // connectivity during the handshake (if there
+ // was a timeout when waiting for a response)
+ DAM_SR_CANCELLEDLOCAL = 4; // cancelled from the local(sending) side
+ DAM_SR_CANCELLEDREMOTE = 5; // cancelled from the remote(receiving) side
+ DAM_SR_BADCRC = 6; // bad CRC; we can't do anything with this error. presumably, it will happen rarely, and the most probable cause is the protocol that filters some of characters in our messages OR it may be a bug in DataAsMessage plugin (hopefully not ;) ).
+ DAM_SR_UNKNOWN = 7; // unknown error
+
+// Return values for DAM_SENDRESULTPROC
+ DAM_SRA_RETRY = 1;
+
+type
+// hContact, szDataType and SessionID fields correspond to the fields of the
+// DAM_SENDDATAINFO structure
+ PDAM_SENDRESULTINFO = ^TDAM_SENDRESULTINFO;
+ TDAM_SENDRESULTINFO = record
+ cbSize :int; // sizeof(DAM_SENDRESULTINFO)
+ hContact :THANDLE;
+ szDataType:PAnsiChar;
+ SessionID :dword;
+ iResult :int; // transmission result code
+ end;
+
+type
+ TDAM_SENDRESULTPROC = function(sri:PDAM_SENDRESULTINFO):int; cdecl;
+// this procedure receives the result of the transmission. it's called when the
+// session closes (either the data was sent successfully or there was an error)
+// you can return DAM_SRA_RETRY when iResult is DAM_SR_TIMEOUT if you want to
+// retry sending
+
+const
+// DAM_SENDDATAINFO::Flags constants
+ DAM_SDF_DONTPACK = 1; // don't pack the data (by default all the data is packed)
+ DAM_SDF_NOTIMEOUT = 2; // don't generate a timeout error ever, keep trying to
+ // send the data. If the contact is offline, the data
+ // is saved in the memory until the contact goes online.
+ // Loss of the data occurs only if the sender's miranda
+ // closes (this may change in future to allow fully
+ // functional offline sending that will guarantee the
+ // data to be sent in any case, but of course the
+ // sending starts only when the both contacts are
+ // online). other errors than the timeout error can be
+ // still generated though.
+
+type
+ TDAM_SENDDATAINFO = record
+ cbSize :int; // sizeof(DAM_SENDDATAINFO)
+ hContact :THANDLE;
+ szDataType:PAnsiChar; // zero-terminated string, containing data type,
+ // preferably in format "YourPluginName" or
+ // "YourPluginName/Something" (make sure this string
+ // won't coincide by an accident with someone else's
+ // string!). you can identify your data by this ID later
+ nDataLen :int; // keep in mind that if the length is too big (more than
+ // about 8 KB), it's more preferable to split your data
+ // into several chunks, as you won't be able to "pick
+ // up" your data at the other end until all the data is
+ // transferred
+ cData :PAnsiChar;
+ Flags :int; // combination of the DAM_SDF_ constants
+ SendAfterSessionID:dword; // may be NULL; otherwise it's guaranteed that the
+ // sending starts only after successful completion
+ // of SendAfterSessionID session
+ SendResultProc:TDAM_SENDRESULTPROC; // pointer to a procedure that receives
+ // the result; can be NULL
+ SessionID :dword; // OUT; receives the session ID
+ end;
+
+const
+// MS_DAM_SENDDATA return values
+ DAM_SDA_NOERROR = 0;
+ DAM_SDA_NOTSUPPORTED = -1; // contact's protocol doesn't support sending/
+ // receiving messages
+ DAM_SDA_TOOMANYSESSIONS = -2; // too many sessions
+
+// MS_DAM_SENDDATA
+// sends the data
+// wParam = (WPARAM)(DAM_SENDDATAINFO*)sdi;
+// lParam = 0
+// Returns 0 (DAM_SDA_NOERROR) and fills SessionID if the session was queued for sending successfully; returns one of the DAM_SDA_ values on failure
+ MS_DAM_SENDDATA = 'DataAsMessage/SendData';
+
+function DAMSendData(hContact:THANDLE; szDataType:PAnsiChar; nDataLen:int;
+ cData:PAnsiChar; Flags:int; SendAfterSessionID:dword;
+ SendResultProc:TDAM_SENDRESULTPROC;pSessionID:pdword):int;
+var
+ sdi:TDAM_SENDDATAINFO;
+begin
+ FillChar(sdi,SizeOf(sdi),0);
+ sdi.cbSize :=SizeOf(sdi);
+ sdi.hContact :=hContact;
+ sdi.szDataType:=szDataType;
+ sdi.nDataLen :=nDataLen;
+ sdi.cData :=cData;
+ sdi.Flags :=Flags;
+ sdi.SendAfterSessionID:=SendAfterSessionID;
+ sdi.SendResultProc :=SendResultProc;
+ Result:=CallService(MS_DAM_SENDDATA,dword(@sdi),0);
+ if pSessionID<>nil then
+ pSessionID^:=sdi.SessionID;
+end;
+
+type
+ TDAM_RECVDATAINFO = record
+ cbSize :int; // sizeof(DAM_RECVDATAINFO)
+ hContact :THANDLE;
+ szDataType:PAnsiChar;
+ nDataLen :int;
+ cData :PAnsiChar;
+ end;
+
+const
+// ME_DAM_RECVDATA
+// hook up to this event to check for incoming data
+// make sure rdi->szDataType is yours before doing anything!
+// The important thing here is that your plugin will receive TWO ME_DAM_RECVDATA notifications on every single MS_DAM_SENDDATA call from a remote side:
+// The first notification arrives when the remote side starts to transmit the data. In this case DAM_RECVDATAINFO::cData = NULL (and DAM_RECVDATAINFO::nDataLen = -1) as we didn't receive any data yet. Return 1 to indicate that your plugin recognized the DAM_RECVDATAINFO::szDataType, otherwise return 0. If there are no any plugin that recognized the data, DAM cancels the transfer and there won't be any second notification for it.
+// The second notification is when the data is transmitted successfully. nDataLen contains the usual data size and cData points to the data buffer. cData is guaranteed to be valid only during the ME_DAM_RECVDATA call. You must copy the data to your own plugin's memory if you need it later. again, return 1 to indicate that your plugin recognized the data, otherwise return 0
+// wParam = (WPARAM)(DAM_RECVDATAINFO*)rdi;
+// lParam = 0
+ ME_DAM_RECVDATA = 'DataAsMessage/RecvData';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/m_actman.inc b/plugins/ExternalAPI/delphi/m_actman.inc index 02a84a4470..53344e2990 100644 --- a/plugins/ExternalAPI/m_actman.inc +++ b/plugins/ExternalAPI/delphi/m_actman.inc @@ -5,25 +5,33 @@ //const MIID_ACTMANAGER:MUUID='{9584DA04-FB4F-40c1-9325-E4F9CAAFCB5D}';
const
+ AutoStartName:PWideChar = '#Autostart';
+const
+ DBBranch = 'ActMan';
+const
ACCF_DISABLED = $10000000; // action disabled
ACCF_EXPORT = $08000000; // action to export
ACCF_VOLATILE = $04000000; // don't save in DB
- ACCF_IMPORTED = ACF_EXPORT;
+ ACCF_IMPORTED = ACCF_EXPORT;
ACCF_FLAGS = ACCF_DISABLED or ACCF_EXPORT or ACCF_IMPORTED or ACCF_VOLATILE;
+ ACCF_OVERLOAD = $01000000; // imported action overwrite old
+
ACCF_ID = $02000000; // for MS_ACT_SELECT, lParam is ID (else name)
ACCF_CLEAR = $01000000; // clear other flags, else - set
type
pChain = ^tChain;
- TChain = record
+ tChain = record
descr:pWideChar;
id :dword;
flags:dword; // ACCF_* flags
+ order:dword;
end;
const
{
wParam - 0
lParam - address of destination list variable (address of pointer to tChain)
+ if lParam=0, return just count of elements
Return - count of elements
Notes: first 4 bytes = size of TChain structure (to add new fields in future)
}
@@ -53,10 +61,10 @@ const ACTP_BYNAME = 1;
ACTP_WAIT = 2;
type
- PAct_Param = ^TAct_Param;
- TAct_Param = record
+ pAct_Param = ^tAct_Param;
+ tAct_Param = record
flags :dword; // ACTP_*
- ID :dword; // Id or name
+ Id :uint_ptr; // Id or name
wParam:WPARAM;
lParam:LPARAM;
end;
@@ -112,4 +120,39 @@ const }
ME_ACT_ACTION:PAnsiChar = 'Actions/Action';
+//----- Scheduling part services -----
+
+const
+ {
+ Enable or disable tasks
+ wParam - 1/0 (enable/disable)
+ lParam - unicode task name
+ Note - works for all tasks with same started name
+ }
+ MS_ACT_TASKENABLE:PAnsiChar = 'Actions/TaskEnable';
+
+ {
+ Delete task
+ wParam - 0
+ lParam - unicode task name
+ Note - works for all tasks with same started name
+ }
+ MS_ACT_TASKDELETE:PAnsiChar = 'Actions/TaskDelete';
+
+ {
+ Set task repeat count
+ wParam - repeat count
+ lParam - unicode task name
+ Return - old repeat count value
+ Note - works for all tasks with same started name
+ }
+ MS_ACT_TASKCOUNT:PAnsiChar = 'Actions/TaskCount';
+
+ {
+ Event for task start
+ wParam - counter of call (from 0 to repeat count)
+ lParam - unicode task name
+ }
+ ME_ACT_BELL:PAnsiChar = 'Actions/Bell';
+
{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_anismiley.inc b/plugins/ExternalAPI/delphi/m_anismiley.inc new file mode 100644 index 0000000000..4fcf598208 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_anismiley.inc @@ -0,0 +1,116 @@ +{$IFNDEF M_ANISMILEY}
+{$DEFINE M_ANISMILEY}
+
+const
+ IASF_UNICODE = 1;
+
+type
+ TINSERTANISMILEY = record
+ cbSize :size_t;
+ hWnd :HWND;
+ szFilename :TChar;
+ dwBackColor:COLORREF;
+ nHeight :int;
+ dwFlags :dword;
+ end;
+ tagINSERTANISMILEY = TINSERTANISMILEY;
+
+const
+ MS_INSERTANISMILEY :PAnsiChar = 'mAnimator/InsertSmiley';
+(*
+ function InsertAnimatedSmiley(wnd:HWND;filename:TChar;Back:TCOLORREF;height:int):bool;
+ const
+ bServiceExists:int=-1
+ var
+ ias:TINSERTANISMILEY;
+ begin
+ if bServiceExists=-1 then
+ bServiceExists:=ServiceExists(MS_INSERTANISMILEY);
+ if bServiceExists=0 then
+ result:=false
+ else
+ begin
+ ias.cbSize :=SizeOf(TINSERTANISMILEY);
+ ias.hWnd :=wnd;
+ ias.tcsFilename:=Filename.w;
+ ias.dwFlags :=IASF_UNICODE;
+ ias.nHeight :=Height;
+ ias.dwBackColor:=Back;
+ result:=CallService(MS_INSERTANISMILEY,WPARAM(@ias),0)<>0;
+ end;
+ end;
+
+ BOOL InsertAnimatedSmiley(HWND _hwnd, TCHAR * _szFilename, COLORREF _dwBack, int _nHeight)
+ {
+ static int bServiceExists=-1;
+ ias={0};
+ if (bServiceExists==-1)
+ bServiceExists=ServiceExists(MS_INSERTANISMILEY);
+ if (!bServiceExists) return FALSE;
+ ias.cbSize=sizeof(INSERTANISMILEY);
+ ias.hWnd=_hwnd;
+ ias.tcsFilename=_szFilename;
+ ias.dwFlags=IASF_TCHAR;
+ ias.nHeight=_nHeight;
+ ias.dwBackColor=_dwBack;
+ return (BOOL) CallService(MS_INSERTANISMILEY,(WPARAM)&ias, 0);
+ };
+*)
+
+
+{
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+}
+
+const
+// Type of Event one of
+ FVCN_PREFIRE = 1;
+ FVCN_POSTFIRE = 2;
+
+// Action of event are going to be done
+ FVCA_NONE = 0;
+ FVCA_DRAW = 1; // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+ FVCA_CUSTOMDRAW = 2;
+ FVCA_INVALIDATE = 3;
+ FVCA_SENDVIEWCHANGE = 4;
+ FVCA_SKIPDRAW = 5;
+
+// Extended NMHDR structure for WM_NOTIFY
+type
+ TFVCNDATA_NMHDR = record
+ //NMHDR structure
+ hwndFrom :HWND; // Window of smiley host
+ idFrom :uint_ptr; // ignored
+ code :uint; // NM_FIREVIEWCHANGE
+
+ cbSize :size_t;
+ bEvent :byte; // FVCN_ value - pre- or post- painting
+ bAction :byte; // FVCA_ keys
+ hDC :HDC; // Canvas to draw on
+ rcRect :TRECT; // Valid/should be in case of FVCA_DRAW
+ clrBackground:TCOLORREF; // color to fill background if fTransparent is not set
+ fTransparent :bool; // if need to fill back color
+ lParam :LPARAM; // used by host window PreFire and PostFire event
+ end;
+
+const
+// Code of WM_NOTIFY message (code)
+ NM_FIREVIEWCHANGE = NM_FIRST+1;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_assocmgr.inc b/plugins/ExternalAPI/delphi/m_assocmgr.inc new file mode 100644 index 0000000000..83b835a17a --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_assocmgr.inc @@ -0,0 +1,176 @@ +{
+
+'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}
+{$DEFINE M_ASSOCMGR}
+
+const
+
+{
+ File Association Manager v0.1.0.3
+}
+
+{ interface id }
+ MIID_ASSOCMGR: TGUID = '{A05B56C0-CF7B-4389-A1E9-F13DB9360EF1}';
+
+{ 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 : (PFILETYPEDESC)ftd
+Returns 0 on success, nonzero otherwise.
+}
+ MS_ASSOCMGR_ADDNEWFILETYPE = 'AssocMgr/AddNewFileType';
+
+type
+ PFILETYPEDESC = ^TFILETYPEDESC;
+ TFILETYPEDESC = record
+ cbSize: Integer; // size of this structure, in bytes
+
+ szDescription: TChar; // description for options dialog and in registry.
+ // please Translate().
+
+ hInstance: HINST; // instance where the icon resource is located
+
+ nIconResID: UINT; // 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.
+
+ pszService: PAnsiChar; // 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 nil to pass the file name as
+ // commandline argument to miranda32.exe (db file).
+
+ flags: DWORD; // see FTDF_* flags below
+
+ pszFileExt: PAnsiChar; // file extension, e.g. ".ext"
+ // first character must be a dot, assumed to be all lower case.
+ // may only consist of ascii characters.
+
+ pszMimeType: PAnsiChar; // MIME type of the file, e.g. "application/x-icq"
+ // may only consist of ascii characters.
+
+ szVerbDesc: TChar; // description for the open verb e.g. "&Install".
+ // set this to nil to use the default description "Open".
+ // include an ampersand (&) character for a mnemonic key.
+ // please Translate().
+ end;
+
+const
+ FTDF_UNICODE = $0001; // pszDescription and pszVerbDesc in struct are Unicode.
+ // the specified service is called with Unicode parameters.
+
+ FTDF_DEFAULTDISABLED = $0002; // file type is not registered by default, it needs to be
+ // enabled explicitly on the options page.
+
+ FTDF_BROWSERAUTOOPEN = $0004; // 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.
+
+ FTDF_ISTEXT = $0008; // 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.
+
+ FTDF_ISSHORTCUT = $0010; // file type behaves as shortcut, this means a
+ // small overlay arrow is applied and the extension is never shown
+
+
+{ 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 : (PAnsiChar)pszFileExt
+Returns 0 on success, nonzero otherwise.
+}
+ 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 : (PURLTYPEDESC)utd
+Returns 0 on success, nonzero otherwise.
+}
+ MS_ASSOCMGR_ADDNEWURLTYPE = 'AssocMgr/AddNewUrlType';
+
+type
+ PURLTYPEDESC = ^TURLTYPEDESC;
+ TURLTYPEDESC = record
+ cbSize: Integer; // size of this structure, in bytes
+
+ pszDescription: TChar; // description for options dialog and in registry.
+ // please Translate().
+
+ hInstance: HINST; // instance where the icon resource is located
+
+ nIconResID: UINT; // 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.
+
+ pszService: PAnsiChar; // service to call when a url is opened (can't be nil)
+ // this service will be called with lParam set to
+ // the url being opened including the prefix.
+ // the provided string has already been urldecoded.
+ // return zero on suceess, nonzero on error.
+
+ flags: DWORD; // see UTDF_* flags below
+
+ pszProtoPrefix: PAnsiChar; // protocol prefix, e.g. "http:"
+ // last character must be a colon, assumed to be all lower case.
+ // may only consist of ascii characters.
+ end;
+
+const
+ UTDF_UNICODE = $0001; // pszDescription in struct is Unicode.
+ // the specified service is called with Unicode parameters.
+
+ UTDF_DEFAULTDISABLED = $0002; // url type is not registered by default, it needs to be
+ // enabled explicitly on the options page.
+
+{ 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 : (PAnsiChar)pszProtoPrefix
+Returns 0 on success, nonzero otherwise.
+}
+ MS_ASSOCMGR_REMOVEURLTYPE = 'AssocMgr/RemoveUrlType';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_autoreplacer.inc b/plugins/ExternalAPI/delphi/m_autoreplacer.inc new file mode 100644 index 0000000000..bc1d528463 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_autoreplacer.inc @@ -0,0 +1,39 @@ +{
+ AutoReplacer plugin
+ by Angelo Luiz Tartari
+}
+
+{$IFNDEF M_AUTOREPLACER}
+{$DEFINE M_AUTOREPLACER}
+
+const
+
+{
+ Adds a window handle to AutoReplacer.
+ This handle must belong to any window based on a editbox (editbox, richtext, TMemo, TEdit, TMaskEdit, etc.).
+ After adding a handle, AutoReplacer will automatically work on this window.
+ wParam = 0
+ lParam = (LPARAM)(HWND)hwnd
+ Returns: 0 on success, -1 if hwnd is invalid, 1 on error.
+}
+ MS_AUTOREPLACER_ADDWINHANDLE = 'AutoReplacer/AddWinHandle';
+
+{
+ Removes a window handle from AutoReplacer's list.
+ wParam = 0
+ lParam = (LPARAM)(HWND)hwnd
+ Returns: 0 on success, -1 if hwnd is invalid, 1 if hwnd wasn't found.
+}
+ MS_AUTOREPLACER_REMWINHANDLE = 'AutoReplacer/RemWinHandle';
+
+ function autoreplacer_AddWinHandle(hwnd: HWND): integer;
+ begin
+ Result := CallService(MS_AUTOREPLACER_ADDWINHANDLE, 0, LPARAM(hwnd));
+ end;
+
+ function autoreplacer_RemWinHandle(hwnd: HWND): integer;
+ begin
+ Result := CallService(MS_AUTOREPLACER_REMWINHANDLE, 0, LPARAM(hwnd));
+ end;
+
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_changekeyboardlayout.inc b/plugins/ExternalAPI/delphi/m_changekeyboardlayout.inc new file mode 100644 index 0000000000..b1df7628c1 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_changekeyboardlayout.inc @@ -0,0 +1,31 @@ +{$IFNDEF M_CHANGEKEYBOARDLAYOUT}
+{$DEFINE M_CHANGEKEYBOARDLAYOUT}
+
+const
+// change keyboard layout of text
+// wParam - HWND or NULL for current window
+// lParam must be 0
+// returns 0 on success and returns non-zero (-1) on error.
+ MS_CKL_CHANGELAYOUT 'ChangeKeyboardLayout/ChangeLayout';
+
+//wParam äîëæåí áûòü íîëü.
+//lParam - LPCTSTR òåêñòà, ðàñêëàäêó êîòîðîãî òðåáóåòñÿ îïðåäåëèòü,
+//Âîçâðàùàåò HKL ðàñêëàäêó òåêñòà, èëè NULL â ñëó÷àå îøèáêè.
+//Ïðèìå÷àíèå: Ïðè îïðåäåëåíèè ðàñêëàäêè ó÷èòûâàåòñÿ îïöèÿ "Ðàñêëàäêà òåêñòà - òåêóùàÿ ðàñêëàäêà"
+ MS_CKL_GETLAYOUTOFTEXT = 'ChangeKeyboardLayout/GetLayoutOfText';
+
+type
+ CKLLayouts = record
+ hklFrom:HKL; // layout of the current text
+ hklTo :HKL; // layout of the result text
+ bTwoWay:bool;
+ end;
+
+const
+//wParam - LPCTSTR èñõîäíîãî òåêñòà
+//lParam - óêàçàòåëü íà ñòðóêòóðó CKLLayouts, ñîäåðæàùóþ ðàñêëàäêè äëÿ
+//èçìåíåíèÿ òåêñòà è îïöèþ "äâóíàïðàâëåííîãî ïðåîáðàçîâàíèÿ"
+//Âîçâðàùàåò LPTSTR íà ðåçóëüòèðóþùóþ ñòðîêó
+ MS_CKL_CHANGETEXTLAYOUT = 'ChangeKeyboardLayout/ChangeTextLayout';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_contactdir.inc b/plugins/ExternalAPI/delphi/m_contactdir.inc new file mode 100644 index 0000000000..1b21717753 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_contactdir.inc @@ -0,0 +1,164 @@ +{
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2005 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_CONTACTDIR}
+{$DEFINE M_CONTACTDIR}
+
+{ Contactdir module was created on 2005/05/17, 0.4.0.1
+
+ -- How you use this module as a protocol --
+
+ On Load() Register your protocol with the setting name that stores unique IDs, example:
+
+ if ( ContactDir_SupportExists() ) g_Atom=ContactDir_Register("ICQ", "UIN");
+
+ This will register your protocol and walk the database looking for all contacts on PROTOCOL_NAME which have
+ a "UIN" setting and store it in memory (converting to a string as needed) You of course have to
+ provide fallback if the services don't exist, it's an idea to keep existing code for that.
+
+ -
+
+ When you add a new contact via MS_DB_CONTACT_ADD, you must register it with your protocol atom too, via
+ ContactDir_AddContact(atom, "UIN #", hContact) and when it is deleted ContactDir_RemoveContact(atom, "UIN #")
+
+ -
+
+ To find a contact, use ContactDir_Lookup(atom, "ICQ #") which will return the hContact.
+}
+
+type
+ PCONTACTDIRECTORYDESCRIPTOR = ^TCONTACTDIRECTORYDESCRIPTOR;
+ TCONTACTDIRECTORYDESCRIPTOR = record
+ cbSize :int;
+ szProto :PAnsiChar;
+ szSetting:PAnsiChar;
+ atom :THANDLE; // out arg
+ end;
+
+{
+ wParam: 0
+ lParam: (LPARAM) &CONTACTDIRECTORYDESCRIPTOR;
+ Affect: Register a given protocol and it's setting name which contains the unique key entry. e.g. ("ICQ", "UIN")
+ and return a HANDLE for use with other lookup services.
+ Returns: 0 on success, non zero on failure -- a returned handle is in .atom
+ Note: The directory will convert dword values into string representations but will not do this for bytes or words
+ used as IDs -- the protocol has to convert the IDs itself (:
+ Note: See ContactDir_Register() for a quicker way.
+ *** WARNING ***: This service does not expect the given module name to have registered as a protocol module, it
+ completely bypasses this information.
+ Version: 0.4.0.1 (2005/05/17+)
+}
+const
+ MS_CONTACTDIR_REGISTER = 'ContactDir/Register';
+
+type
+ PCONTACTDIRECTORYLOOKUP = ^TCONTACTDIRECTORYLOOKUP;
+ TCONTACTDIRECTORYLOOKUP = record
+ cbSize :int;
+ atom :THANDLE; // Atom handle from MS_CONTACTDIR_REGISTER
+ szID :PAnsiChar; // in: value you wish to find (makes its own copy if needed)
+ hContact:THANDLE; // out: hContact associated with szID, if any.
+ end;
+
+{
+ wParam: 0
+ lParam: (LPARAM) &CONTACTDIRECTORYLOOKUP;
+ Affect: Given an atom and string ID, will find the associated DB hContact value
+ Returns: 0 on success, non zero on failure
+ Version: 0.4.0.1 (2005/05/17+)
+ Note: ContactDir_Lookup() helper macro might be of use.
+}
+const
+ MS_CONTACTDIR_LOOKUP = 'ContactDir/Lookup';
+
+{
+ wParam: 0
+ lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP;
+ Affect: Add a contact to a protocol atom association.
+ Returns: 0 on success, non zero on failure
+ Version: 0.4.0.1 (2005/05/17+)
+ Note: You must call this when you create a contact with MS_DB_CONTACT_ADD, see ContactDir_AddContact()
+}
+ MS_CONTACTDIR_ADDCONTACT = 'ContactDir/AddContact';
+
+{
+ wParam: 0
+ lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP;
+ Affect: Remove a contact to a protocol atom association.
+ Returns: 0 on success, non zero on failure
+ Version: 0.4.0.1 (2005/05/17+)
+ Note: see ContactDir_RemoveContact()
+}
+ MS_CONTACTDIR_REMOVECONTACT = 'ContactDir/RemoveContact';
+
+(*
+/* -- Helper functions -- */
+
+static int ContactDir_SupportExists(void)
+{
+ return ServiceExists(MS_CONTACTDIR_REGISTER);
+}
+
+// Only take as valid if ContactDir_SupportExists() returns true.
+static HANDLE ContactDir_Register(AnsiChar * szProto, AnsiChar * szSetting)
+{
+ CONTACTDIRECTORYDESCRIPTOR cd;
+ cd.cbSize=sizeof(CONTACTDIRECTORYDESCRIPTOR);
+ cd.szProto=szProto;
+ cd.szSetting=szSetting;
+ cd.atom=NULL;
+ CallService(MS_CONTACTDIR_REGISTER, 0, (LPARAM)&cd);
+ return cd.atom;
+}
+
+static __inline HANDLE ContactDir_Lookup(HANDLE atom, AnsiChar * szID)
+{
+ CONTACTDIRECTORYLOOKUP f;
+ f.cbSize=sizeof(f);
+ f.atom=atom;
+ f.szID=szID;
+ f.hContact=NULL;
+ CallService(MS_CONTACTDIR_LOOKUP, 0, (LPARAM)&f);
+ return f.hContact;
+}
+
+static __inline void ContactDir_AddContact(HANDLE atom, AnsiChar * szID, HANDLE hContact)
+{
+ CONTACTDIRECTORYLOOKUP c = {0};
+ c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
+ c.atom=atom;
+ c.szID=szID;
+ c.hContact=hContact;
+ CallService(MS_CONTACTDIR_ADDCONTACT, 0, (LPARAM)&c);
+}
+
+static __inline void ContactDir_RemoveContact(HANDLE atom, AnsiChar * szID)
+{
+ CONTACTDIRECTORYLOOKUP c = {0};
+ c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
+ c.atom=atom;
+ c.szID=szID;
+ c.hContact=NULL;
+ CallService(MS_CONTACTDIR_REMOVECONTACT, 0, (LPARAM)&c);
+}
+*)
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_contactsex.inc b/plugins/ExternalAPI/delphi/m_contactsex.inc new file mode 100644 index 0000000000..6250720a4e --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_contactsex.inc @@ -0,0 +1,86 @@ +{
+ Miranda IM: the free IM client for Microsoft Windows
+
+ Copyright 2000-2003 Miranda ICQ/IM project,
+ all portions of this codebase are copyrighted to the people
+ listed in contributors.txt.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ aLONG with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_CONTACTSEX}
+{$DEFINE M_CONTACTSEX}
+
+const
+ USERINFO = 'UserInfo';
+
+// new flags that come with userinfoex
+const
+ CNF_TITLE = 18; //returns title (string)
+ CNF_SECONDNAME = 19; // returns second name (string)
+ CNF_PREFIX = 20; // returns name prefix (string)
+ CNF_MYNOTES = 21; // returns notes (string)
+ CNF_LANGUAGE1 = 22; // returns first language (string)
+ CNF_LANGUAGE2 = 23; // returns second language (string)
+ CNF_LANGUAGE3 = 24; // returns third language (string)
+ CNF_TIMEZONE = 25; // returns timezone (WORD)
+ CNF_MARITAL = 26; // returns marital status (string)
+ CNF_PARTNER = 27; // returns partner (string)
+ CNF_ORIGIN_CITY = 28; // returns origin city (string)
+ CNF_ORIGIN_STATE = 29; // returns origin state (string)
+ CNF_ORIGIN_COUNTRY = 30; // returns origin country (string)
+ CNF_STREET = 31; // returns street (string)
+ CNF_POSTAL = 32; // returns postal code (string)
+ CNF_FAX = 34; // returns fax (string)
+ CNF_CELLULAR = 35; // returns cellular (string)
+ CNF_EMAIL2 = 36; // returns second email adress (string)
+ CNF_EMAIL3 = 37; // returns third email adress (string)
+ CNF_COMPANY = 38;
+ CNF_COMPANY_POSITION = 39;
+ CNF_COMPANY_OCCUPATION = 40; // returns occupation (string)
+ CNF_COMPANY_SUPERIOR = 41;
+ CNF_COMPANY_ASSISTENT = 42;
+ CNF_COMPANY_DEPARTMENT = 43;
+ CNF_COMPANY_STREET = 44;
+ CNF_COMPANY_POSTAL = 45;
+ CNF_COMPANY_CITY = 46;
+ CNF_COMPANY_STATE = 47;
+ CNF_COMPANY_COUNTRY = 48;
+ CNF_COMPANY_PHONE = 49;
+ CNF_COMPANY_FAX = 50;
+ CNF_COMPANY_CELLULAR = 51;
+ CNF_COMPANY_EMAIL = 52;
+ CNF_COMPANY_EMAIL2 = 53;
+ CNF_COMPANY_EMAIL3 = 54;
+ CNF_COMPANY_HOMEPAGE = 55;
+
+ { UserInfo/GetContactInfo v0.1.0.4+
+ This is more or less an extended version of MS_UTILS_GETCONTACTINFO. Same syntax and parameters
+ except the dwFlag member of CONTACTINFO. It can also have the values above. CNF_DISPLAY and CNF_DISPLAYNC
+ are ignored.
+ }
+ MS_UINFOEX_GETCONTACTINFO = 'UserInfo/GetContactInfo';
+
+ { UserInfo/FreeContactInfo v0.1.0.4+
+ Strings returned by MS_UINFOEX_GETCONTACTINFO (and btw. MS_UTILS_GETCONTACTINFO too) are pointers to
+ dynamically allocated portions of memory and therefor should be freed after use by miranda's own
+ version of free that can be accessed via MS_SYSTEM_GET_MMI. This function is an alternitive. It does
+ all the mmi stuff for you and cleanly frees the memory. An helper macro (DBFreeContactInfoString) frees
+ an string got by MS_UINFOEX_GETCONTACTINFO or MS_UTILS_GETCONTACTINFO service explicitly.
+ wParam=(LPSTR)pszVal - pointer to a string got by DBGetCustomContactInfoString to delete directly
+ lParam=(CONTACTINFO )ci - pointer to a CONTACTINFO whose string value is to be freed
+ }
+ MS_UINFOEX_FREECONTACTINFO = 'UserInfo/FreeContactInfo';
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_db3xsa.inc b/plugins/ExternalAPI/delphi/m_db3xsa.inc new file mode 100644 index 0000000000..77ac666967 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_db3xsa.inc @@ -0,0 +1,84 @@ +{
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2007 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_DB3XSA}
+{$DEFINE M_DB3XSA}
+
+const
+{ DB/SetPassword v0.5.1.3+
+ This service is used to set, change or clear the password used for encrypting the profile.
+ It opens the password change dialog.
+ wParam=0
+ lParam=0
+}
+ MS_DB_SETPASSWORD = 'DB/SetPassword';
+
+{ DB/Backup v0.5.1.3+
+ This service will make a backup of your current profile. Backups are named
+ <ProfileName> xx.bak where xx is the number of backups. The larger the number, the
+ older the backup.
+ wParam=0
+ lParam=0
+}
+ MS_DB_BACKUP = 'DB/Backup';
+
+{ DB/Backup v0.5.1.3+
+ This service is the trigger action service and does the same as the service above.
+ Only difference is wParam carries flags from trigger plugin.
+ wParam=flags
+ lParam=0
+}
+ MS_DB_BACKUPTRIGGER = 'DB/BackupTriggerAct';
+
+{ DB/GetProfilePath(W) v0.5.1.5+
+ Gets the path of the profile currently being used by the database module. This
+ path does not include the last '\'. It is appended with the profile's name if
+ ProfileSubDir=yes is set in the mirandaboot.ini.
+ wParam=(WPARAM)(int)cbName
+ lParam=(LPARAM)(AnsiChar*)pszName
+ pszName is a pointer to the buffer that receives the path of the profile
+ cbName is the size in bytes of the pszName buffer
+ Returns 0 on success or nonzero otherwise
+}
+ MS_DB_GETPROFILEPATHW = 'DB/GetProfilePathW';
+
+
+{ DB/GetProfilePathBasic(W) v0.5.1.5+
+ Gets the path of the profile currently being used by the database module. This
+ path does not include the last '\'. This is never appended with the profile's name.
+ wParam=(WPARAM)(int)cbName
+ lParam=(LPARAM)(AnsiChar*)pszName
+ pszName is a pointer to the buffer that receives the path of the profile
+ cbName is the size in bytes of the pszName buffer
+ Returns 0 on success or nonzero otherwise
+}
+ MS_DB_GETPROFILEPATH_BASIC = 'DB/GetProfilePathBasic';
+ MS_DB_GETPROFILEPATH_BASICW = 'DB/GetProfilePathBasicW';
+
+ MIRANDAPATH = '%MIRANDAPATH%';
+ MIRANDAPATHW = '%MIRANDAPATH%';
+ PROFILEPATH = '%PROFILEPATH%';
+ PROFILEPATHW = '%PROFILEPATH%';
+ PROFILENAME = '%PROFILENAME%';
+ PROFILENAMEW = '%PROFILENAME%';
+
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_dbeditor.inc b/plugins/ExternalAPI/delphi/m_dbeditor.inc new file mode 100644 index 0000000000..60530a1e61 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_dbeditor.inc @@ -0,0 +1,41 @@ +{$IFNDEF M_DBEDITOR}
+{$DEFINE M_DBEDITOR}
+
+const
+{
+ wParam: Module name
+ lParam: 0
+ Affect: Register single module as 'known'
+ Note: must be used after or in ME_SYSTEM_MODULESLOADED
+}
+ MS_DBEDIT_REGISTERSINGLEMODULE:PAnsiChar = 'DBEditorpp/RegisterSingleModule';
+
+{
+ wParam: array with module names
+ lParam: count of module names
+ Affect: Register modules as 'known'
+ Note: must be used after or in ME_SYSTEM_MODULESLOADED
+ Example:
+ var mods:array [0..2] = ('Module1','Module2','Module3');
+ ...
+ CallService(MS_DBEDIT_REGISTERMODULE,WPARAM(@mods),3);
+
+}
+ MS_DBEDIT_REGISTERMODULE:PAnsiChar = 'DBEditorpp/RegisterModule';
+
+{
+ wParam: hContact
+ lParam: 0
+ Affect: Open user tree in DBE++
+}
+ MS_DBEDIT_MENUCOMMAND:PAnsiChar = 'DBEditorpp/MenuCommand';
+
+{
+ Import settings\contacts from file
+ wParam=(HANDLE)hContact
+ lParam=(char*)FilePath
+ always returns 0
+}
+ MS_DBEDIT_IMPORT:PAnsiChar = 'DBEditorpp/Import';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_ersatz.inc b/plugins/ExternalAPI/delphi/m_ersatz.inc new file mode 100644 index 0000000000..49f5b3170f --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_ersatz.inc @@ -0,0 +1,41 @@ +{
+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}
+{$DEFINE M_ERSATZ}
+
+const
+// Returns the status message for a status
+// wParam=(WORD) 0 for current status or a status
+// lParam=0
+// Returns status msg or NULL if there is none. The protocol have to handle only the current
+// status. Handling messages for other statuses is optional.
+// Remember to mir_free the return value
+ PS_GETMYAWAYMSG = '/GetMyAwayMsg';
+
+// Created if ersatz is installed
+// wParam=0
+// lParam=0
+// returns always 1
+ MS_ERSATZ_ENABLED = 'ERSATZ/Enabled';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_extraicons.inc b/plugins/ExternalAPI/delphi/m_extraicons.inc new file mode 100644 index 0000000000..b6c1a028df --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_extraicons.inc @@ -0,0 +1,87 @@ +{
+ Copyright (C) 2009 Ricardo Pescuma Domenecci
+
+ This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this file; see the file license.txt. If
+ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_EXTRAICONS}
+{$DEFINE M_EXTRAICONS}
+
+const
+ EXTRAICON_TYPE_CALLBACK = 0; // Similar to old clist callbacks, it fires 2 notifications
+ EXTRAICON_TYPE_ICOLIB = 1; // This extra icon will use only icons registered with icolib.
+ // No callbacks needed. Just call MS_EXTRAICON_SET_ICON passing the name of the
+ // extraicon to set one.
+
+type
+ TEXTRAICON_INFO = record
+ cbSize:int;
+ _type :int; // One of EXTRAICON_TYPE_*
+ name :PAnsiChar; // Internal name. More than one plugin can register extra icons
+ // with the same name if both have the same type. In this case,
+ // both will be handled as one. This is usefull for ex for extra
+ // status, where icq and jabber can share the same slot.
+ // If the types are different the second one will be denied.
+ description:PAnsiChar; // [Translated by plugin] Description to be used in GUI
+ descIcon :PAnsiChar; // [Optional] Name of an icon registered with icolib to be used in GUI.
+
+ // If type == EXTRAICON_TYPE_CALLBACK this two must be set
+
+ // Callback to add icons to clist, calling MS_CLIST_EXTRA_ADD_ICON
+ // wParam=lParam=0
+ RebuildIcons:TMIRANDAHOOK;
+
+ // Callback to set the icon to clist, calling MS_CLIST_EXTRA_SET_ICON or MS_EXTRAICON_SET_ICON
+ // wParam = HANDLE hContact
+ // lParam = int slot
+ ApplyIcon:TMIRANDAHOOK;
+
+ // Other optional callbacks
+
+ // [Optional] Callback called when extra icon was clicked
+ // wParam = HANDLE hContact
+ // lParam = int slot
+ // param = onClickParam
+ OnClick:TMIRANDAHOOKPARAM;
+
+ onClickParam:LPARAM;
+ end;
+
+const
+// Register an extra icon
+// wParam = (EXTRAICON_INFO *) Extra icon info
+// lParam = 0
+// Return: (HANDLE) id of extra icon on success, 0 on error
+ MS_EXTRAICON_REGISTER:PAnsiChar = 'ExtraIcon/Register';
+
+type
+ TEXTRAICON = record
+ cbSize :int;
+ hExtraIcon:THANDLE; // Value returned by MS_EXTRAICON_REGISTER
+ hContact :THANDLE; // Contact to set the extra icon
+ // The icon to be set. This depends on the type of the extra icon:
+ case boolean of
+ false:(hImage :THANDLE); // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK)
+ true :(icoName:PAnsiChar); // Name of the icon registered with icolib (if EXTRAICON_TYPE_ICOLIB)
+ end;
+
+const
+// Set an extra icon icon
+// wParam = (EXTRAICON *) Extra icon
+// Return: 0 on success
+ MS_EXTRAICON_SET_ICON:PAnsiChar = 'ExtraIcon/SetIcon';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_fingerprint.inc b/plugins/ExternalAPI/delphi/m_fingerprint.inc new file mode 100644 index 0000000000..293cf78f08 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_fingerprint.inc @@ -0,0 +1,63 @@ +{
+Based on Miranda plugin template, originally by Richard Hughes
+http://miranda-icq.sourceforge.net/
+
+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.
+}
+
+{***********************************************************************
+* Author: Artem Shpynov aka FYR mailto:shpynov@nm.ru
+* icons by Angeli-Ka
+* January 12, 2006
+************************************************************************}
+
+{$IFNDEF M_FINGERPRINT}
+{$DEFINE M_FINGERPRINT}
+// FINGERPRINT PLUGIN SERVICES HEADER
+
+const
+{
+ Service SameClients MS_FP_SAMECLIENTS
+ wParam - TChar first MirVer value
+ lParam - TChar second MirVer value
+ return pointer to AnsiChar string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
+}
+ MS_FP_SAMECLIENTS :PAnsiChar = 'Fingerprint/SameClients';
+ MS_FP_SAMECLIENTSW:PAnsiChar = 'Fingerprint/SameClientsW';
+
+{
+ ServiceGetClientIcon MS_FP_GETCLIENTICON
+ wParam - TChar MirVer value to get client for.
+ lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+}
+ MS_FP_GETCLIENTICON :PAnsiChar = 'Fingerprint/GetClientIcon';
+ MS_FP_GETCLIENTICONW:PAnsiChar = 'Fingerprint/GetClientIconW';
+
+// Plugin UUIDs for New plugin loader
+// req. 0.7.18+ core
+const MIID_FINGERPRINT :MUUID='{FFF4B77A-CE40-11DB-A5CD-06A755D89593}';
+const MIID_FINGERPRINT_MOD :MUUID='{BAC0BBBE-CE40-11DB-A11E-72A655D89593}';
+const MIID_FINGERPRINT_FULL :MUUID='{0AFE5BBB-CE62-11DB-8314-0800200C9A66}';
+const MIID_FINGERPRINT_STANDARD:MUUID='{0AFE5ABC-CE62-11DB-8314-0800200C9A66}';
+const MIID_FINGERPRINT_LITE :MUUID='{0AFE5DEF-CE62-11DB-8314-0800200C9A66}';
+const MIID_FINGERPRINT_CUSTOM :MUUID='{0AFE5BAD-CE62-11DB-8314-0800200C9A66}';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_flags.inc b/plugins/ExternalAPI/delphi/m_flags.inc new file mode 100644 index 0000000000..f9f97ec1ff --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_flags.inc @@ -0,0 +1,74 @@ +{
+Miranda IM Country Flags Plugin
+Copyright (C) 2006-2007 H. Herkenrath
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program (Flags-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_FLAGS}
+{$DEFINE M_FLAGS}
+
+const
+
+{
+ Country Flags Plugin v0.1.0.3
+}
+
+{ interface id }
+ MIID_FLAGS: TGUID = '{88A3B66E-C438-4381-BC17-71D99D225F9C}';
+
+{ Load a country flag icon from the skin library. v0.1.0.0+
+The retrieved icon should be released using MS_SKIN2_RELEASEICON after use.
+The country numbers can be retrieved using MS_UTILS_GETCOUNTRYLIST.
+Another way to get the country numbers are the CTRY_* constants in winnls.h of WinAPI.
+To retrieve the country number from a locale, call GetLocaleInfo().
+with LOCALE_ICOUNTRY.
+ wParam : countryNumber
+ lParam : (BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
+Returns a icon handle (HICON) on success, NULL on error.
+}
+ MS_FLAGS_LOADCOUNTRYFLAGICON = 'Flags/LoadCountryFlagIcon';
+
+{ Create a merged country flag icon. v0.1.0.0+
+The retrieved icon should be released using DestroyIcon() after use.
+ wParam : countryNumberUpper
+ lParam : countryNumberLower
+Returns a icon handle (HICON) on success, NULL on error.
+}
+ MS_FLAGS_CREATEMERGEDFLAGICON = 'Flags/CreateMergedFlagIcon';
+
+{ Get a corresponding country given an (external) IP address. v0.1.0.0+
+The retrieved number can be converted to a normal country name
+using MS_UTILS_GETCOUNTRYBYNUMBER.
+ wParam : dwExternalIP (same format as used Netlib)
+ lParam : 0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+}
+ MS_FLAGS_IPTOCOUNTRY = 'Flags/IpToCountry';
+
+{ Detect the origin country of a contact. v0.1.0.0+
+This uses the contacts's IP first, and falls back on using
+CNF_COUNTRY and CNF_COCOUNTRY of contact details.
+To get the contact's IP it relies on the db setting
+"RealIP" in the proto module.
+ wParam : (WPARAM)(HANDLE)hContact
+ lParam : 0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+}
+ MS_FLAGS_DETECTCONTACTORIGINCOUNTRY = 'Flags/DetectContactOriginCountry';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_flash.inc b/plugins/ExternalAPI/delphi/m_flash.inc new file mode 100644 index 0000000000..8d99547e6a --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_flash.inc @@ -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.
+}
+
+{$IFNDEF M_FLASH}
+{$DEFINE M_FLASH}
+// Service functions
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+}
+ MS_FAVATAR_DESTROY = 'FlashAvatar/Destroy';
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+}
+ MS_FAVATAR_MAKE = 'FlashAvatar/Make';
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM LPRECT
+}
+ MS_FAVATAR_RESIZE = 'FlashAvatar/Resize';
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM LPRECT
+}
+ MS_FAVATAR_SETPOS = 'FlashAvatar/SetPos';
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+}
+ MS_FAVATAR_GETINFO = 'FlashAvatar/GetInfo';
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM BSTR
+}
+ MS_FAVATAR_SETEMOFACE = 'FlashAvatar/SetEmoFace';
+
+{
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM COLORREF
+}
+ MS_FAVATAR_SETBKCOLOR = 'FlashAvatar/SetBkColor';
+
+// Avatar emotion faces
+ AV_SMILE = 'smile';
+ AV_SAD = 'sad';
+ AV_LAUGH = 'laugh';
+ AV_MAD = 'mad';
+ AV_CRY = 'cry';
+ AV_OFFLINE = 'offline';
+ AV_BUSY = 'busy';
+ AV_LOVE = 'love';
+ AV_NORMAL = 'stam';
+
+// Avatar default size
+ FAVATAR_WIDTH = 52;
+ FAVATAR_HEIGHT = 64;
+
+type
+ TFLASHAVATAR = record
+ hContact :THANDLE; // contact who flash avatar belongs to
+ hWindow :HWND; // handle of flash avatar object
+ hParentWindow:HWND; // handle of flash avatar's parent object
+ cUrl :TChar; // url of .swf file
+ id :int; // unique number of plugin which wants to use avatar service
+ cProto :PAnsiChar; // contacts protocol
+ end;
+
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_folders.inc b/plugins/ExternalAPI/delphi/m_folders.inc new file mode 100644 index 0000000000..3cb3cbc294 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_folders.inc @@ -0,0 +1,272 @@ +{
+Custom profile folders plugin for Miranda IM
+
+Copyright © 2005 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_FOLDERS}
+{$DEFINE M_FOLDERS}
+
+const
+ FOLDERS_API = 501; //dunno why it's here but it is :)
+
+ PROFILE_PATH = '%profile_path%';
+ CURRENT_PROFILE = '%current_profile%';
+ MIRANDA_PATH = '%miranda_path%';
+ PLUGINS_PATH = '%miranda_path%\plugins';
+ MIRANDA_USERDATA = '%miranda_userdata%';
+
+ PROFILE_PATHW = '%profile_path%';
+ CURRENT_PROFILEW = '%current_profile%';
+ MIRANDA_PATHW = '%miranda_path%';
+ MIRANDA_USERDATAW = '%miranda_userdata%';
+
+ FOLDER_AVATARS = PROFILE_PATH+'\'+CURRENT_PROFILE+'\avatars';
+ FOLDER_VCARDS = PROFILE_PATH+'\'+CURRENT_PROFILE+'\vcards';
+ FOLDER_LOGS = PROFILE_PATH+'\'+CURRENT_PROFILE+'\logs';
+ FOLDER_RECEIVED_FILES = PROFILE_PATH+'\'+CURRENT_PROFILE+'\received files';
+ FOLDER_DOCS = MIRANDA_PATH+'\'+'docs';
+
+ FOLDER_CONFIG = PLUGINS_PATH+'\config';
+ FOLDER_SCRIPTS = MIRANDA_PATH+'\scripts';
+ FOLDER_UPDATES = MIRANDA_PATH+'\updates';
+
+ FOLDER_CUSTOMIZE = MIRANDA_PATH+'\customize';
+ FOLDER_CUSTOMIZE_SOUNDS = FOLDER_CUSTOMIZE+'\sounds';
+ FOLDER_CUSTOMIZE_ICONS = FOLDER_CUSTOMIZE+'\icons';
+ FOLDER_CUSTOMIZE_SMILEYS = FOLDER_CUSTOMIZE+'\smileys';
+ FOLDER_CUSTOMIZE_SKINS = FOLDER_CUSTOMIZE+'\skins';
+ FOLDER_CUSTOMIZE_THEMES = FOLDER_CUSTOMIZE+'\themes';
+
+ FOLDERS_NAME_MAX_SIZE = 64; //maximum name and section size
+
+ FF_UNICODE = $00000001;
+
+type
+ TFOLDERSDATA = record
+ cbSize:integer; //size of struct
+ //section name, if it doesn't exist it will be created otherwise it will just add this entry to it
+ szSection:array [0..FOLDERS_NAME_MAX_SIZE-1] of AnsiChar;
+ szName :array [0..FOLDERS_NAME_MAX_SIZE-1] of AnsiChar; //entry name - will be shown in options
+ szFormat :TCHAR; // default string format. Fallback string in case
+ // there's no entry in the database for this
+ // folder. This should be the initial value for
+ // the path, users will be able to change it later.
+ flags :DWORD; // FF_* flags
+ end;
+
+const
+{
+ Folders/Register/Path service
+ wParam - not used, must be 0
+ lParam - (LPARAM) (const FOLDERDATA *) - Data structure filled with
+ the necessary information.
+ Returns a handle to the registered path or 0 on error.
+ You need to use this to call the other services.
+}
+ MS_FOLDERS_REGISTER_PATH = 'Folders/Register/Path';
+
+{
+ Folders/Get/PathSize service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (int *) - pointer to the variable that receives the size of the path
+ string (not including the null character). Depending on the flags set when creating the path
+ it will either call strlen() or wcslen() to get the length of the string.
+ Returns the size of the buffer.
+}
+ MS_FOLDERS_GET_SIZE = 'Folders/Get/PathSize';
+
+type
+ TFOLDERSGETDATA = record
+ cbSize:integer;
+ nMaxPathSize:integer; // maximum size of buffer. This represents the number
+ // of characters that can be copied to it (so for
+ // unicode strings you don't send the number of
+ // bytes but the length of the string).
+ szPath:TChar; //pointer to the buffer that receives the path without the last "\\"
+ end;
+
+const
+{
+ Folders/Get/Path service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (FOLDERSGETDATA *) pointer to a FOLDERSGETDATA that has all the relevant fields filled.
+ Should return 0 on success, or nonzero otherwise.
+}
+ MS_FOLDERS_GET_PATH = 'Folders/Get/Path';
+
+type
+ TFOLDERSGETALLOCDATA = record
+ cbSize:integer;
+ szPath:^TCHAR; // address of a string variable where the path should be
+ // stored (the last \ won't be copied).
+ end;
+
+const
+{
+ Folders/GetRelativePath/Alloc service
+ wParam - (WPARAM) (int) - Handle to registered path
+ lParam - (LPARAM) (FOLDERSALLOCDATA *) data
+ This service is the same as MS_FOLDERS_GET_PATH with the difference that this service
+ allocates the needed space for the buffer. It uses miranda's memory functions for that and you need
+ to use those to free the resulting buffer.
+ Should return 0 on success, or nonzero otherwise. Currently it only returns 0.
+}
+ MS_FOLDERS_GET_PATH_ALLOC = 'Folders/Get/Path/Alloc';
+
+{
+ Folders/On/Path/Changed
+ wParam - (WPARAM) 0
+ lParam - (LPARAM) 0
+ Triggered when the folders change, you should reget the paths you registered.
+}
+ ME_FOLDERS_PATH_CHANGED = 'Folders/On/Path/Changed';
+
+(*
+#ifndef FOLDERS_NO_HELPER_FUNCTIONS
+
+#ifndef M_UTILS_H__
+#error The helper functions require that m_utils.h be included in the project. Please include that file if you want to use the helper functions. If you don't want to use the functions just define FOLDERS_NO_HELPER_FUNCTIONS.
+#endif
+
+//#include "../../../include/newpluginapi.h"
+
+__inline static HANDLE FoldersRegisterCustomPath(const AnsiChar *section, const AnsiChar *name, const AnsiChar *defaultPath)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ fd.szFormat = defaultPath;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static HANDLE FoldersRegisterCustomPathW(const AnsiChar *section, const AnsiChar *name, const wchar_t *defaultPathW)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ fd.szFormatW = defaultPathW;
+ fd.flags = FF_UNICODE;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static int FoldersGetCustomPath(HANDLE hFolderEntry, AnsiChar *path, const int size, AnsiChar *notFound)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ AnsiChar buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+
+ return res;
+}
+
+__inline static int FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ return res;
+}
+
+__inline static int FoldersGetCustomPathEx(HANDLE hFolderEntry, AnsiChar *path, const int size, AnsiChar *notFound, AnsiChar *fileName)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ AnsiChar buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+ if (strlen(path) > 0)
+ {
+ strcat(path, "\\");
+ }
+ else{
+ path[0] = '\0';
+ }
+
+ if (fileName)
+ {
+ strcat(path, fileName);
+ }
+
+ return res;
+}
+
+__inline static int FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW, wchar_t *fileNameW)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ if (wcslen(pathW) > 0)
+ {
+ wcscat(pathW, L"\\");
+ }
+ else{
+ pathW[0] = L'\0';
+ }
+
+ if (fileNameW)
+ {
+ wcscat(pathW, fileNameW);
+ }
+
+ return res;
+}
+
+#endif
+*)
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_fortunemsg.inc b/plugins/ExternalAPI/delphi/m_fortunemsg.inc new file mode 100644 index 0000000000..a13a8c3980 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_fortunemsg.inc @@ -0,0 +1,69 @@ +{
+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_FORTUNEMSG}
+{$DEFINE M_FORTUNEMSG}
+
+const
+ MIN_FORTUNEMSG = 10;
+ MAX_FORTUNEMSG = 1024;
+ FORTUNE_BUFSIZE = (MAX_FORTUNEMSG+1);
+
+//returns the fortune message (from a random file)
+//wParam=0
+//lParam=(AnsiChar *)buffer or 0
+//returns (AnsiChar *)status msg (buffer if specified), or 0 on failure
+//If lParam != 0 then the fortune msg is to be stored there, make sure
+//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then
+//the plugin will allocate the memory, but don't forget to free it (the
+//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!)
+ MS_FORTUNEMSG_GETMESSAGE = 'FortuneMsg/GetMessage';
+
+//returns the fortune message for a protocol
+//wParam=(AnsiChar*)szProtoName
+//lParam=(AnsiChar *)buffer or 0
+//returns (AnsiChar *)status msg (buffer if specified), or 0 on failure
+//If lParam != 0 then the fortune msg is to be stored there, make sure
+//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then
+//the plugin will allocate the memory, but don't forget to free it (the
+//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!)
+ MS_FORTUNEMSG_GETPROTOMSG = 'FortuneMsg/GetProtoMessage';
+
+//returns the fortune status message for a status
+//wParam=(int)status
+//lParam=(AnsiChar *)buffer or 0
+//returns (AnsiChar *)status msg (buffer if specified), or 0 on failure
+//If lParam != 0 then the fortune msg is to be stored there, make sure
+//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then
+//the plugin will allocate the memory, but don't forget to free it (the
+//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!)
+ MS_FORTUNEMSG_GETSTATUSMSG = 'FortuneMsg/GetStatusMessage';
+
+//frees the memory allocated by one of the other three services
+//wParam=0
+//lParam=(void *)pointer to the memory to be freed
+//(the returned value from one of the other three services if called with lParam=0)
+//return value: 0 on success, -1 on failure (argument was NULL)
+ MS_FORTUNEMSG_FREEMEMORY = 'FortuneMsg/FreeMemory';
+
+
+//this service was created for being used by Variables plugin
+//wParam=0
+//lParam=(ARGUMENTSINFO *) see m_variables.h for description of the structure
+//returns (AnsiChar *)status msg, or 0 on failure
+ MS_FORTUNEMSG_FROMVARIABLES = 'FortuneMsg/FromVariables';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_fuse.inc b/plugins/ExternalAPI/delphi/m_fuse.inc new file mode 100644 index 0000000000..82b002b5db --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_fuse.inc @@ -0,0 +1,28 @@ +{$IFNDEF M_FUSE}
+{$DEFINE M_FUSE}
+
+const
+ FUSE_INIT = 0; // core started, Param=**FUSE_LINK
+ FUSE_DEINIT = 1; // core stopped
+ FUSE_DEFMOD = 3; // LoadDefaultModules() return code, Param=*int
+ FUSE_DEATH = 4; // DestroyingModularEngine() just got called
+
+type
+ PFUSE_LINK = ^TFUSE_LINK;
+ TFUSE_LINK = record
+ cbSize : longint;
+ CreateHookableEvent : function (para1:PAnsiChar):THANDLE;cdecl;
+ DestroyHookableEvent : function (para1:THANDLE):longint;cdecl;
+ NotifyEventHooks : function (para1:THANDLE; para2:WPARAM; para3:LPARAM):longint;cdecl;
+ HookEvent : function (para1:PAnsiChar; para2:TMIRANDAHOOK):THANDLE;cdecl;
+ HookEventMessage : function (para1:PAnsiChar; para2:HWND; para3:dword):THANDLE;cdecl;
+ UnhookEvent : function (para1:THANDLE):longint;cdecl;
+ CreateServiceFunction : function (para1:PAnsiChar; para2:TMIRANDASERVICE):THANDLE;cdecl;
+ CreateTransientServiceFunction : function (para1:PAnsiChar; para2:TMIRANDASERVICE):THANDLE;cdecl;
+ DestroyServiceFunction : function (para1:THANDLE):longint;cdecl;
+ CallService : function (para1:PAnsiChar; para2:WPARAM; para3:LPARAM):longint;cdecl;
+ ServiceExists : function (para1:PAnsiChar):longint;cdecl; {v0.1.0.1+ }
+ CallServiceSync : function (para1:PAnsiChar; para2:WPARAM; para3:LPARAM):longint;cdecl; {v0.1.2.2+ }
+ end;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_help(plugin).inc b/plugins/ExternalAPI/delphi/m_help(plugin).inc new file mode 100644 index 0000000000..0eb63615d9 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_help(plugin).inc @@ -0,0 +1,76 @@ +{
+Miranda IM Help Plugin
+Copyright (C) 2002 Richard Hughes, 2005-2007 H. Herkenrath
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program (Help-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_HELP}
+{$DEFINE M_HELP}
+
+const
+
+{
+ Help Plugin 0.2.1.2
+ All services in here except MS_HELP_SHOWLANGDIALOG should be thread-safe,
+ you can call them from any thread
+}
+
+{ interface id }
+ MIID_HELP: TGUID = '{302660C5-1BF6-4054-A79F-77B1965D6F48}';
+
+{ Enable/disable the help context menu for a specific control. v0.2.0.0+
+Note: You normally do not need to call this, read below.
+You can can use this to deactivate the appearance of the help context menu
+being shown when the user right clicks on an control.
+You can use this service to disable the context menu.
+
+You do *not* need to use this service when you would like to show
+a context menu by yourself, just handle WM_CONTEXTMENU correctly instead.
+You need to return TRUE in your DlgProc or 0 in your WndProc, indicating 'message handled'.
+
+The context menu is disabled by default on the following controls (looks silly on multi-component controls):
+ListView, TreeView, Statusbar, Toolbar, CLC
+AutoTips are disabled by default for controls stating DLGC_WANTALLKEYS or DLGC_HASSETSEL at
+WM_GETDLGCODE (autotips are annoying on edits).
+ wParam : (HWND)hwndCtl
+ lParam : flags (see below)
+Returns 0 on success or nonzero on failure
+}
+ MS_HELP_SETCONTEXTSTATE = 'Help/SetContextState';
+ HCSF_CONTEXTMENU = $01; // show help context menu for this control
+ HCSF_AUTOTIP = $02; // show automatic help tip on hover for this control
+ // only works for non-editable
+
+{ Show a help tooltip for a specific control or dialog. v0.2.0.0+
+You can call this if you would like to show help at a specific time.
+ wParam : (HWND)hwndCtl
+ lParam : 0
+Returns 0 on success or nonzero on failure.
+The service fails when the help tooltip cannot be instantiated.
+}
+ MS_HELP_SHOWHELP = 'Help/ShowHelp';
+
+{ Show the download language dialog. v0.2.1.0+
+ wParam : 0
+ lParam : 0
+The dialog can't have a parent due to it's asynchronous nature.
+If the language window is already opened it will be
+brought to front instead (returns success).
+Returns 0 on success, nonzero otherwise.
+}
+ MS_HELP_SHOWLANGDIALOG = 'Help/ShowLangDialog';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_historyevents.inc b/plugins/ExternalAPI/delphi/m_historyevents.inc new file mode 100644 index 0000000000..ae582f0eef --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_historyevents.inc @@ -0,0 +1,201 @@ +{
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+
+{$IFNDEF M_HISTORYEVENTS}
+{$DEFINE M_HISTORYEVENTS}
+
+const
+ HISTORYEVENTS_FORMAT_CHAR = 1;
+ HISTORYEVENTS_FORMAT_WCHAR = 2;
+ HISTORYEVENTS_FORMAT_RICH_TEXT = 4;
+ HISTORYEVENTS_FORMAT_HTML = 8;
+
+const
+ HISTORYEVENTS_FLAG_DEFAULT = 1 shl 0; // Is a miranda core event type
+ HISTORYEVENTS_FLAG_SHOW_IM_SRMM = 1 shl 1; // If this event has to be shown in srmm dialog
+ HISTORYEVENTS_FLAG_USE_SENT_FLAG = 1 shl 2; // Means that it can be a sent or received and uses DBEF_SENT to mark that
+ HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE = 1 shl 3; // Means that who is drawing this should draw the contact name before the text
+ HISTORYEVENTS_FLAG_ONLY_LOG_IF_SRMM_OPEN = 1 shl 4; // If this event will be logged only if the message window is open
+ HISTORYEVENTS_FLAG_FLASH_MSG_WINDOW = 1 shl 5; // If this event will trigger the openning/flashing of the message window
+
+ HISTORYEVENTS_REGISTERED_IN_ICOLIB = 9 shl 16; // If the icon is a name already registered in icolib
+
+ HISTORYEVENTS_FLAG_KEEP_ONE_YEAR = 1 shl 8; // By default store in db for 1 year
+ HISTORYEVENTS_FLAG_KEEP_SIX_MONTHS = 2 shl 8; // By default store in db for 6 months
+ HISTORYEVENTS_FLAG_KEEP_ONE_MONTH = 3 shl 8; // By default store in db for 1 month
+ HISTORYEVENTS_FLAG_KEEP_ONE_WEEK = 4 shl 8; // By default store in db for 1 week
+ HISTORYEVENTS_FLAG_KEEP_ONE_DAY = 5 shl 8; // By default store in db for 1 day
+ HISTORYEVENTS_FLAG_KEEP_FOR_SRMM = 6 shl 8; // By default store in db only enought for message log
+ HISTORYEVENTS_FLAG_KEEP_MAX_TEN = 7 shl 8; // By default store in db max 10 entries
+ HISTORYEVENTS_FLAG_KEEP_MAX_HUNDRED = 8 shl 8; // By default store in db for 100 entries
+ HISTORYEVENTS_FLAG_KEEP_DONT = 9 shl 8; // By default don't store in db (aka ignore it)
+
+
+// This function must be implemented by subscribers. It must return a pointer or NULL
+// to say it can't handle the text
+type
+ fGetHistoryEventText = function(hContact:THANDLE; hDbEvent:THANDLE;
+ dbe:PDBEVENTINFO; format:int):pointer; cdecl;
+
+type
+ HISTORY_EVENT_HANDLER = record
+ cbSize :int;
+ module :PAnsiChar;
+ name :PAnsiChar; // Internal event name
+ description:PAnsiChar; // Will be translated. When retrieving it is already translated
+ eventType :word; // The event type it can handle
+ defaultIcon:HICON; // PAnsiChar= icon name if HISTORYEVENTS_REGISTERED_IN_ICOLIB is set.
+ // Always use this one when retrieving
+ supports :int; // What kind of return is supported - or of HISTORYEVENTS_FORMAT_*
+ flags :int; // or of HISTORYEVENTS_FLAG_*
+ pfGetHistoryEventText:fGetHistoryEventText; // NULL to use default get text (similar to message, without extra format)
+
+ // Aditional data if wants to use add to history services
+ templates:^PAnsiChar; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription"
+ numTemplates:int;
+ end;
+const
+{
+ Get the number of registered events
+
+ wParam: ignored
+ lParam: ignored
+ Return: The number of events registered with the plugin
+}
+ MS_HISTORYEVENTS_GET_COUNT:PAnsiChar = 'HistoryEvents/GetCount';
+
+{
+ Get an event by number or by type.
+ To retrieve by number, pass -1 as type. To retrieve by type, pass -1 as number.
+
+ wParam: (int) event number
+ lParam: (int) event type
+ Return: (const HISTORY_EVENT_HANDLER *) if the event exists, NULL otherwise. Don't change the
+ returned strunc: it is a pointer to the internall struct.
+}
+ MS_HISTORYEVENTS_GET_EVENT:PAnsiChar = 'HistoryEvents/GetEvent';
+
+{
+ Register a plugin that can handle an event type. This must be called during the call to the
+ Load function of the plugin. In ModulesLoaded callback all plugins have to be already
+ registered, so srmm and history modules can query then.
+
+ wParam: HISTORY_EVENT_HANDLER *
+ lParam: ignored
+ Return: 0 for success
+}
+ MS_HISTORYEVENTS_REGISTER:PAnsiChar = 'HistoryEvents/Register';
+
+
+type
+ HISTORY_EVENT_PARAM = record
+ cbSize :int;
+ hDbEvent:THANDLE;
+ dbe :PDBEVENTINFO; // Optional
+ format :int; // one of HISTORYEVENTS_FORMAT_*
+ end;
+
+const
+{
+ Check if an event can be handled by any subscribers
+
+ wParam: WORD - event type
+ lParam: ignored
+ Return: BOOL
+}
+ MS_HISTORYEVENTS_CAN_HANDLE:PAnsiChar = 'HistoryEvents/CanHandle';
+
+{
+ Get the icon for a history event type
+
+ wParam: WORD - event type
+ lParam: ignored
+ Return: HICON - after use free with MS_HISTORYEVENTS_RELEASE_ICON
+}
+ MS_HISTORYEVENTS_GET_ICON:PAnsiChar = 'HistoryEvents/GetIcon';
+
+{
+ Get the flags for a history event type
+
+ wParam: WORD - event type
+ lParam: ignored
+ Return: int - or of HISTORYEVENTS_FLAG_* or -1 if error
+}
+ MS_HISTORYEVENTS_GET_FLAGS:PAnsiChar = 'HistoryEvents/GetFlags';
+
+{
+ Release the icon for a history event type. This is really just a forward to icolib
+
+ wParam: HICON
+ lParam: ignored
+}
+ MS_HISTORYEVENTS_RELEASE_ICON:PAnsiChar = 'Skin2/Icons/ReleaseIcon';
+
+{
+ Get the text for a history event type
+
+ wParam: HISTORY_EVENT_PARAM *
+ lParam: ignored
+ Return: char * or wchar * depending on sent flags. Free with mir_free or MS_HISTORYEVENTS_RELEASE_TEXT
+}
+ MS_HISTORYEVENTS_GET_TEXT:PAnsiChar = 'HistoryEvents/GetText';
+
+{
+ Release the text for a history event type. Internally is just a call to mir_free
+
+ wParam: char * or wchar *
+ lParam: ignored
+}
+ MS_HISTORYEVENTS_RELEASE_TEXT:PAnsiChar = 'HistoryEvents/ReleaseText';
+
+
+type
+ HISTORY_EVENT_ADD = record
+ cbSize :int;
+ hContact :THANDLE;
+ eventType :word;
+ templateNum :int;
+ variables :^PTCHAR; // TCHAR **variables
+ numVariables :int;
+ additionalData :pbyte;
+ additionalDataSize:int;
+ flags :int; // Flags for the event type
+ end;
+
+const
+{
+ Add an registered event to the history. This is a helper service
+
+ wParam: HISTORY_EVENT_ADD
+ lParam: ignored
+ Return: HANDLE to the db event
+}
+ MS_HISTORYEVENTS_ADD_TO_HISTORY:PAnsiChar = 'HistoryEvents/AddToHistory';
+
+{
+ Check if a template is enabled
+
+ wParam: event type
+ lParam: template num
+ Return: TRUE or FALSE
+}
+ MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE:PAnsiChar = 'HistoryEvents/IsEnabledTemplate';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_historypp.inc b/plugins/ExternalAPI/delphi/m_historypp.inc new file mode 100644 index 0000000000..a0ff7e82d7 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_historypp.inc @@ -0,0 +1,191 @@ +{
+ History++ plugin for Miranda IM: the free IM client for Microsoft* Windows*
+
+ Copyright (‘) 2006-2007 theMIROn, 2003-2006 Art Fedorov.
+ History+ parts (C) 2001 Christian Kastner
+
+ 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
+}
+
+{-----------------------------------------------------------------------------
+ m_historypp (historypp project)
+
+ Version: 1.5
+ Created: 06.08.2004
+ Author: Oxygen
+
+ [ Description ]
+
+ Header with History++ services declaration
+
+ [ History ]
+
+ 1.5 (05.08.2004)
+ First version
+
+ [ Modifications ]
+ none
+
+ [ Known Issues ]
+ none
+
+ Contributors: theMIROn, Art Fedorov
+-----------------------------------------------------------------------------}
+
+{$IFNDEF M_HISTORYPP}
+{$DEFINE M_HISTORYPP}
+
+const
+ //** VALUES FOR TItemRenderDetails.dwHistoryWindow
+ //** Used in ME_HPP_RICHEDIT_ITEMPROCESS event
+ //** This is one of the following params,
+ //** saying what kind of history window displays
+ //** processed item.
+
+ // IRDHW_CONTACTHISTORY. The window is ordinary
+ // contact history.
+ IRDHW_CONTACTHISTORY = $0001;
+ // IRDHW_GLOBALHISTORY. The window is global
+ // history (system history). Invokes by
+ // Menu -> System History
+ IRDHW_GLOBALHISTORY = $0002;
+ // IRDHW_GLOBALSEARCH. The window is search
+ // window and the processed item is the
+ // result of the global search.
+ IRDHW_GLOBALSEARCH = $0003;
+ // IRDHW_EXTERNAL. The window is external window
+ IRDHW_EXTERNALGRID = $0004;
+
+ //** VALUES FOR TItemRenderDetails.dwFlags
+ //** Used in ME_HPP_RICHEDIT_ITEMPROCESS event
+ //** These flags inform you about what you are
+ //** processing. Like saying that the item is
+ //** selected or it's inline or such stuff
+
+ // IRDF_SELECTED. The processed item is selected.
+ // The background color will always be clHighlight
+ // even if you change it (i will change it back).
+ // Though, I will not touch font or font color.
+ IRDF_SELECTED = $0001;
+ // IRDF_INLINE. The RichEdit provided is not one
+ // that is used for drawing a cell, but the one
+ // used for "inline editing".
+ IRDF_INLINE = $0002;
+ // IRDF_EVENT. The RichEdit provided is from "Open Event"
+ // window. It's the window which opens when you right-click
+ // item in contact's history and select "Open"
+ IRDF_EVENT = $0004;
+
+type
+ TItemRenderDetails = record
+ cbSize :DWord; // size of the structure in bytes
+ hContact :THandle; // handle to the contact for which the event is processed
+ hDBEvent :THandle; // handle to the event which is processed
+ dwEventTime :DWord; // timestamp of the event
+ wEventType :Word; // Event's flags (see m_database, EVENTTYPE_*; m_icq, ICQEVENTTYPE_*)
+ IsEventSent :ByteBool; // Outgoing event. True if DBEF_SENT event flag is present (see m_database)
+ dwFlags :DWord; // Any reasonable combination of IRDF_* flags.
+ bHistoryWindow:Byte; // What kind of window history. See IRDHW_* values
+ pProto :PAnsiChar; // Proto of the event, if available
+ pModule :PAnsiChar; // Module of the event, if available
+ pText :PWideChar; // Text of the event, not used now
+ pExtended :PAnsiChar; // Extended text, used for storing urls, paths and so on
+ end;
+
+ PItemRenderDetails = ^TItemRenderDetails;
+
+const
+ // ME_HPP_RICHEDIT_ITEMPROCESS
+ // (supported from 1.5.0)
+ // Called when next RichEdit history item
+ // is rendered. Third-party plugins can alter it
+ // like adding smileys, changing color and so on.
+ // wParam - RichEdit control handle
+ // lParam - pointer to TItemRenderDetails structure, information
+ // about processed item, see TItemRenderDetails for details
+ //
+ // Note: Changing richedit background color will change the background
+ // color of the whole cell! Additionally, the background color
+ // of the *selected* cell and richedit is ALWAYS clHighlight,
+ // no matter what you do. But font is untouched, so if your
+ // plugin changes font color, you may need to handle selected
+ // cells differently (use IF_SELECTED flag).
+ //
+ // Warn: Remeber about changing fonts. You CAN NOT have *different* fonts
+ // for the *same* item, depening on your wish. For example, the
+ // first time event is fired you set font for Item1 'Arial 10',
+ // and the next time you set font for the same Item1 'Arial 12'.
+ // Because height is calculated only once, and you may have
+ // problems with text painting (when you change font text can
+ // become too large and be cut or override another cell)
+ //
+ // See: hpp_itemprocess_samples.pas for some sample event handlers
+ // like SmileyAdd and TextFormat support and special handler
+ // kinda of conversation separation
+ ME_HPP_RICHEDIT_ITEMPROCESS = 'History++/RichEdit/ItemProcessEvent';
+
+ // MS_HPP_SHOWGLOBALSEARCH
+ // (supported from 1.5.0)
+ // Show Global history search window
+ // If already opened, bring it to front
+ // wParam - zero
+ // lParam - zero
+ MS_HPP_SHOWGLOBALSEARCH = 'History++/ShowGlobalSearch';
+
+type
+ TOpenEventParams = record
+ cbSize : DWord;
+ hContact : THandle;
+ hDBEvent : THandle;
+ pPassword: PAnsiChar;
+ end;
+
+ POpenEventParams = ^TOpenEventParams;
+
+const
+
+ // MS_HPP_OPENHISTORYEVENT
+ // (supported from 1.5.0)
+ // (changed in 1.5.110)
+ //
+ // Opens contact's history and selects
+ // provided event
+ // wParam - pointer to TOpenEventParams structure
+ // lParam - zero
+ // Return - BOOL, True if contact opened, False if password
+ // field opened
+ // Note: if you just want to show contact's history,
+ // use system service MS_HISTORY_SHOWCONTACTHISTORY
+ MS_HPP_OPENHISTORYEVENT = 'History++/OpenHistoryEvent2';
+
+ // MS_HPP_GETVERSION
+ // (supported from 1.5.0)
+ // Get current History++ version
+ // Third-party plugins can use it to know if installed
+ // version of History++ supports particular feature
+ // wParam - zero
+ // lParam - zero
+ // Return - current version, via PLUGIN_MAKE_VERSION macro
+ MS_HPP_GETVERSION = 'History++/GetVersion';
+
+ // MS_HPP_EMPTYHISTORY
+ // (supported from 1.5.0.118)
+ // Erases contact's history
+ // wParam - hContact
+ // lParam - zero
+ // Notes - hContact can be NULL(0) to empty system history
+ MS_HPP_EMPTYHISTORY = 'History++/EmptyHistory';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_historystats.inc b/plugins/ExternalAPI/delphi/m_historystats.inc new file mode 100644 index 0000000000..03955de447 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_historystats.inc @@ -0,0 +1,41 @@ +{$IFNDEF M_HISTORYSTATS}
+{$DEFINE M_HISTORYSTATS}
+
+const
+(**
+ * The unique plugin interface ID provided by HistoryStats.
+ *
+ * @version 0.1.5.1+
+ *)
+ MIID_HISTORYSTATS:TGUD:= '$AF0DAD8E-$0695-$414B-$B306-$F4C7B7B41DA0';
+
+(**
+ * Checks if a specified contact is set to be excluded from the statistics generated
+ * by HistoryStats. If you check this for a MetaContact or for subcontacts of a
+ * MetaContact you might want to check the subcontacts and the MetaContact itself, too.
+ *
+ * @version 0.1.5.1+
+ * @param wParam (WPARAM)(HANDLE) of the contact you'd like to query. NULL is not a
+ * valid value for this parameter.
+ * @param lParam Must be set to 0.
+ * @return Returns 1 if the specified contact is set to be excluded and 0 otherwise.
+ *)
+ MS_HISTORYSTATS_ISEXCLUDED = 'HistoryStats/IsExcluded';
+
+(**
+ * Sets if a specified contact should be included in or excluded from the statistics
+ * generated by HistoryStats. Setting this on a MetaContact or on a subcontact of a
+ * MetaContact might have no effect, depending on the users configuration. Setting
+ * this for a MetaContact and all its subcontacts at once should always produce the
+ * expected result.
+ *
+ * @version 0.1.5.1+
+ * @param wParam (WPARAM)(HANDLE) of the contact you'd like to manipulate. NULL is
+ * not a valid value for this parameter.
+ * @param lParam (LPARAM)(int) of 1 if you want to exclude the specified contact or
+ * 0 if you no longer want to exclude the specified contact.
+ * @return Always returns 0.
+ *)
+ MS_HISTORYSTATS_SETEXCLUDE = 'HistoryStats/SetExclude';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_httpserver.inc b/plugins/ExternalAPI/delphi/m_httpserver.inc new file mode 100644 index 0000000000..1e0f0895e3 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_httpserver.inc @@ -0,0 +1,103 @@ +{
+This file is part of HTTPServer a Miranda IM plugin
+Copyright (C)2002 Kennet Nielsen
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+}
+
+{$IFNDEF M_HTTP_SERVER}
+{$DEFINE M_HTTP_SERVER}
+
+const
+ OPT_SEND_LINK = 1;
+
+typedef struct
+ PSTFileShareInfo = ^TSTFileShareInfo;
+ TSTFileShareInfo = record
+ lStructSize :dword; // Set to sizeof(STFileShareInfo)
+ pszSrvPath :PAnsiChar; // Server path
+ dwMaxSrvPath :dword; // Buffer allocated for Server path only used when information
+ // is requested from HTTP server.
+ pszRealPath :PAnsiChar; // Real path can be relative or complete
+ dwMaxRealPath:dword; // Buffer allocated for Real path only used when information is
+ // requested from HTTP server.
+ dwAllowedIP :dword; // The IP address which is allowed to access this share
+ dwAllowedMask:dword; // A mask which is applied to IP address to allow other IP addresses
+ nMaxDownloads:int; // The maximum number of download which can be made on this share.
+ dwOptions :dword; // Use OPT_SEND_LINK to open a message window with the link to file
+ end;
+
+// dwMaxSrvPath Specifies the size, in chars, of the buffer pointed to by pszSrvPath.
+// The buffer must be large enough to store the path and file name string,
+// including the terminating null character.
+
+/////////////////////////////////////////////
+/// Service MS_HTTP_ADD_CHANGE_REMOVE ///
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)0
+// lParam = (LPARAM)LPSTFileShareInfo;
+// Server path is the key when working with FileShareInfo.
+// Two files can not be shared with the same "Server path" in the HTTP server.
+// If the server path does not exists it will be added.
+// If it does exists the action depends on what real path is.
+// If real path is empty the entity will be removed else it
+// will just be updated with the new settings.
+//
+// returns 0 on success, nonzero on failure
+ MS_HTTP_ADD_CHANGE_REMOVE = 'HTTPServer/AddChangeRemove';
+
+/////////////////////////////////////////////
+////// Service MS_HTTP_GET_SHARE //////
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)0;
+// lParam = (LPARAM)LPSTFileShareInfo;
+// Returns the information for a share
+// Server path must be set the the share you wish information for.
+//
+// returns 0 on success, nonzero on failure
+
+ MS_HTTP_GET_SHARE = 'HTTPServer/GetShare';
+
+/////////////////////////////////////////////
+/// Service MS_HTTP_ACCEPT_CONNECTIONS ///
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)boolean(true/false);
+// lParam = (LPARAM)0;
+// Toggles the HTTP server state if wParam is FALSE
+// Force enable HTTP server if wParam is TRUE
+//
+// returns 0 on success, nonzero on failure
+
+ MS_HTTP_ACCEPT_CONNECTIONS = 'HTTPServer/AcceptConnections';
+
+/////////////////////////////////////////////
+//// Service MS_HTTP_GET_ALL_SHARES /////
+/////////////////////////////////////////////
+//
+// wParam = (WPARAM)0;
+// lParam = (LPARAM)&LPSTFileShareInfo;
+// Returns an array of all currently shared files in the HTTP Server
+// LPSTFileShareInfo points to the first share.
+// You must free the memory returned by using the miranda MS_SYSTEM_GET_MMI
+// and calling MM_INTERFACE->free( LPSTFileShareInfo )
+//
+// returns the count of shares in the buffer pointed to by LPSTFileShareInfo
+
+ MS_HTTP_GET_ALL_SHARES = 'HTTPServer/GetAllShares';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_ieview.inc b/plugins/ExternalAPI/delphi/m_ieview.inc new file mode 100644 index 0000000000..2881ef5c8c --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_ieview.inc @@ -0,0 +1,217 @@ +{
+ IEView Plugin for Miranda IM
+ Copyright (C) 2005 Piotr Piastucki
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_IEVIEW}
+{$DEFINE M_IEVIEW}
+
+const
+ MS_IEVIEW_WINDOW = 'IEVIEW/NewWindow';
+ MS_IEVIEW_EVENT = 'IEVIEW/Event';
+ MS_IEVIEW_NAVIGATE = 'IEVIEW/Navigate';
+
+ ME_IEVIEW_OPTIONSCHANGED = 'IEVIEW/OptionsChanged';
+(*
+ MS_IEVIEW_UTILS = 'IEVIEW/Utils';
+ MS_IEVIEW_SHOWSMILEYSELECTION = 'IEVIEW/ShowSmileySelection';
+ ME_IEVIEW_NOTIFICATION = 'IEVIEW/Notification';
+*)
+ IEW_CREATE = 1; // create new window (control)
+ IEW_DESTROY = 2; // destroy control
+ IEW_SETPOS = 3; // set window position and size
+ IEW_SCROLLBOTTOM = 4; // scroll text to bottom
+
+ IEWM_SRMM = 0; // regular SRMM
+ IEWM_TABSRMM = 1; // TabSRMM-compatible HTML builder
+ IEWM_HTML = 2; // HTML
+ IEWM_SCRIVER = 3; // HTML
+ IEWM_MUCC = 4; // MUCC group chats GUI
+ IEWM_CHAT = 5; // chat.dll group chats GUI
+ IEWM_HISTORY = 6; // history viewer
+ IEWM_BROWSER = 256; // empty browser window
+
+type
+ PIEVIEWWINDOW = ^TIEVIEWWINDOW;
+ TIEVIEWWINDOW = record
+ cbSize : int; // size of the strusture
+ iType : int; // one of IEW_* values
+ dwMode : DWORD; // compatibility mode - one of IEWM_* values
+ dwFlags: DWORD; // flags, one of IEWF_* values
+ parent : HWND; // parent window HWND
+ hwnd : HWND; // IEW_CREATE returns WebBrowser control's HWND here
+ x : int; // IE control horizontal position
+ y : int; // IE control vertical position
+ cx : int; // IE control horizontal size
+ cy : int; // IE control vertical size
+ end;
+
+const
+ IEEDF_UNICODE = 1; // if set pszText is a pointer to wchar_t string instead of AnsiChar string
+ IEEDF_UNICODE_TEXT = 1; // if set pszText is a pointer to wchar_t string instead of AnsiChar string
+ IEEDF_UNICODE_NICK = 2; // if set pszNick is a pointer to wchar_t string instead of AnsiChar string
+ IEEDF_UNICODE_TEXT2 = 4; // if set pszText2 is a pointer to wchar_t string instead of AnsiChar string
+// The following flags are valid only for message events (IEED_EVENT_MESSAGE)
+ IEEDF_FORMAT_FONT = $00000100; // if set pszFont (font name) is valid and should be used
+ IEEDF_FORMAT_SIZE = $00000200; // if set fontSize is valid and should be used
+ IEEDF_FORMAT_COLOR = $00000400; // if set color is valid and should be used
+ IEEDF_FORMAT_STYLE = $00000800; // if set fontSize is valid and should be used
+
+ IEEDF_READ = $00001000; // if set
+ IEEDF_SENT = $00002000; // if set
+ IEEDF_RTL = $00004000; // if set
+
+ IEED_EVENT_MESSAGE = $0001; // message
+ IEED_EVENT_STATUSCHANGE = $0002; // status change
+ IEED_EVENT_FILE = $0003; // file
+ IEED_EVENT_URL = $0004; // url
+ IEED_EVENT_ERRMSG = $0005; // error message
+ IEED_EVENT_SYSTEM = $0006; // system event
+
+ IEED_MUCC_EVENT_MESSAGE = $0001; // message
+ IEED_MUCC_EVENT_TOPIC = $0002; // topic change
+ IEED_MUCC_EVENT_JOINED = $0003; // user joined
+ IEED_MUCC_EVENT_LEFT = $0004; // user left
+ IEED_MUCC_EVENT_ERROR = $0005; // error
+
+// MUCC-related dwData bit flags
+ IEEDD_MUCC_SHOW_NICK = $00000001;
+ IEEDD_MUCC_MSG_ON_NEW_LINE = $00000002;
+ IEEDD_MUCC_SHOW_DATE = $00000010;
+ IEEDD_MUCC_SHOW_TIME = $00000020;
+ IEEDD_MUCC_SECONDS = $00000040;
+ IEEDD_MUCC_LONG_DATE = $00000080;
+
+ IEED_GC_EVENT_HIGHLIGHT = $8000;
+ IEED_GC_EVENT_MESSAGE = $0001;
+ IEED_GC_EVENT_TOPIC = $0002;
+ IEED_GC_EVENT_JOIN = $0003;
+ IEED_GC_EVENT_PART = $0004;
+ IEED_GC_EVENT_QUIT = $0006;
+ IEED_GC_EVENT_NICK = $0007;
+ IEED_GC_EVENT_ACTION = $0008;
+ IEED_GC_EVENT_KICK = $0009;
+ IEED_GC_EVENT_NOTICE = $000A;
+ IEED_GC_EVENT_INFORMATION = $000B;
+ IEED_GC_EVENT_ADDSTATUS = $000C;
+ IEED_GC_EVENT_REMOVESTATUS = $000D;
+
+// GC-related dwData bit flags
+ IEEDD_GC_SHOW_NICK = $00000001;
+ IEEDD_GC_SHOW_TIME = $00000002;
+ IEEDD_GC_SHOW_ICON = $00000004;
+ IEEDD_GC_MSG_ON_NEW_LINE = $00001000;
+
+ IE_FONT_BOLD = $000100; // Bold font flag
+ IE_FONT_ITALIC = $000200; // Italic font flag
+ IE_FONT_UNDERLINE = $000400; // Underlined font flags
+
+type
+ PtagIEVIEWEVENTDATA = ^TtagIEVIEWEVENTDATA;
+ TtagIEVIEWEVENTDATA = record
+ cbSize :int;
+ iType :int; // Event type, one of MUCC_EVENT_* values
+ dwFlags :dword; // Event flags - IEEF_*
+ fontName :PAnsiChar; // Text font name
+ fontSize :int; // Text font size (in pixels)
+ fontStyle:int; // Text font style (combination of IE_FONT_* flags)
+ color :TCOLORREF; // Text color
+ Nick :TChar; // Nick, usage depends on type of event
+ Text :TChar; // Text, usage depends on type of event
+ dwData :dword; // DWORD data e.g. status
+ bIsMe :BOOL; // TRUE if the event is related to the user
+ time :dword; // Time of the event
+ next :PtagIEVIEWEVENTDATA;
+ Text2 :TChar; // Text, usage depends on type of event
+ end;
+ PIEVIEWEVENTDATA = PtagIEVIEWEVENTDATA;
+ TIEVIEWEVENTDATA = TtagIEVIEWEVENTDATA;
+
+const
+ IEE_LOG_DB_EVENTS = 1; // log specified number of DB events
+ IEE_CLEAR_LOG = 2; // clear log
+ IEE_GET_SELECTION = 3; // get selected text
+ IEE_SAVE_DOCUMENT = 4; // save current document
+ IEE_LOG_MEM_EVENTS = 5; // log specified number of IEView events
+
+ IEEF_RTL = 1; // turn on RTL support
+ IEEF_NO_UNICODE = 2; // disable Unicode support
+ IEEF_NO_SCROLLING = 4; // do not scroll logs to bottom
+
+const
+ IEVIEWEVENT_SIZE_V1 = 28;
+ IEVIEWEVENT_SIZE_V2 = 32;
+ IEVIEWEVENT_SIZE_V3 = 36;
+
+type
+ tagIEVIEWEVENT = record
+ case byte of
+ 0: (hDbEventFirst: THANDLE);
+ 1: (eventData :PIEVIEWEVENTDATA);
+ end;
+
+ PIEVIEWEVENT = ^TIEVIEWEVENT;
+ TIEVIEWEVENT = record
+ cbSize :int; // size of the strusture
+ iType :int; // one of IEE_* values
+ dwFlags :DWORD; // one of IEEF_* values
+ hwnd :HWND; // HWND returned by IEW_CREATE
+ hContact :THANDLE; // contact
+ Event :tagIEVIEWEVENT; // first event to log, when IEE_LOG_EVENTS
+ // returns it will contain the last event
+ // actually logged or NULL if no event was logged
+ count :int; // number of events to log
+ codepage :int; // ANSI codepage
+ pszProto :PAnsiChar;
+ end;
+(*
+type
+ PIEVIEWSHOWSMILEYSEL = ^TIEVIEWSHOWSMILEYSEL;
+ TIEVIEWSHOWSMILEYSEL = record
+ cbSize : int; // size of the structure
+ Protocolname : PAnsiChar; // protocol to use... if you have defined a protocol,
+ // u can use your own protocol name. Smiley add will
+ // automatically select the smileypack that is
+ // defined for your protocol. Or, use "Standard" for
+ // standard smiley set. Or "ICQ", "MSN" if you
+ // prefer those icons. If not found or NULL:
+ // "Standard" will be used
+ xPosition : int; // Postition to place the selectwindow
+ yPosition : int;
+ Direction : int; // Direction (i.e. size upwards/downwards/etc) of
+ // the window 0, 1, 2, 3
+ hwndTarget : HWND; // Window, where to send the message when smiley is
+ // selected.
+ targetMessage: DWORD; // Target message, to be sent.
+ targetWParam : LPARAM; // Target WParam to be sent (LParam will be AnsiChar*
+ // to select smiley) see the example file.
+ end;
+*)
+const
+ IEN_NAVIGATE = 1; // navigate to the given destination
+ IENF_UNICODE = 1; // if set urlW is used instead of urlW
+
+type
+ IEVIEWNAVIGATE = record
+ cbSize :int; // size of the strusture
+ iType :int; // one of IEN_* values
+ dwFlags:dword; // one of IEEF_* values
+ hwnd :HWND; // HWND returned by IEW_CREATE
+ url :TChar; // Text, usage depends on type of event
+end;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_ircscript.inc b/plugins/ExternalAPI/delphi/m_ircscript.inc new file mode 100644 index 0000000000..0157443e30 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_ircscript.inc @@ -0,0 +1,125 @@ +{
+ This file is a description of the interface between the Miranda Scripting
+ Plugin (MSP) and IRC. It is mainly an internal draft.
+
+ The MSP is a powerful PHP based scripting engine
+ which can automate many tasks in Miranda IM. With the implementation of
+ this interface IRC can also benefit from the advantages MSP brings. The
+ interface has been constructed by the respective authors of IRC and MSP.
+
+ The idea is that MSP and IRC should communicate via the interface outlined herein,
+ but MSP should "package" the data in attractive functions that can be easily
+ used by eager scripters.
+
+ Note that m_chat.h should be #included as the events defined therein is used in this interface
+
+ The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are
+ illustrated by the following matrix (MSP has 4 services and IRC 4 services):
+
+ --------------------------------------------------
+ | | |
+ | Incoming raw data | Data going |
+ | from server | to GUI |
+ | (before processing) | (after processing) |
+ | | |
+ --------------------------------------------------
+ | | |
+ | Outgoing raw data | Data going |
+ | to server | from GUI |
+ | (after processing) | (before processing) |
+ | | |
+ --------------------------------------------------
+
+ (processing refers to the IRC plugin reacting to different commands)
+}
+
+{$IFNDEF M_IRCSCRIPT}
+{$DEFINE M_IRCSCRIPT}
+
+//------------------------- HANDLING RAW MESSAGES ------------------------
+{
+ The two leftmost boxes are related to data sent to and from the server in RAW form.
+ (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS")
+
+ It is very useful for scripters to be able to manipulate and add RAW streams of data.
+
+ The below structure is used when RAW data is generated and IRC must trigger an
+ event in MSP so the scripts can do their magic.
+
+ If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to
+ allocate from the same heap. Do not free the data.
+
+ wParam= Module name
+ lParam= (LPARAM)(AnsiChar *)pszRaw
+ returns nonzero if the message should be dropped
+}
+
+{
+ NOTE! IRC will implement two services which also uses the same parameters:
+
+ "<Module Name>/InsertRawIn" //used for inserting a "fake" incoming RAW event
+ "<Module Name>/InsertRawOut" //used for inserting a "fake" outgoing RAW event
+}
+
+const
+ MS_MBOT_IRC_RAW_IN = 'MBot/IrcRawIn';
+ MS_MBOT_IRC_RAW_OUT = 'MBot/IrcRawOut';
+
+//------------------------- HANDLING GUI MESSAGES 1 ------------------------
+{
+ The top rightmost box is related to data sent to the gui
+ (currently chat.dll) in the form of GCEVENT's. (see m_chat.h)
+
+ While maybe not as useful to the scripter, it can be useful to be able to
+ "tap into" messages to the GUI from the IRC plugin.
+
+ If the data is modified make sure to realloc() or similar.
+
+ wParam= (WPARAM) (WPARAM_GUI_IN) &wgi
+ lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h
+ returns nonzero if the message should be dropped
+}
+
+{
+ NOTE! IRC will implement a service which also uses the same parameters:
+
+ "<Module Name>/InsertGuiIn" //used for inserting a "fake" event to the GUI
+}
+type
+ PWPARAM_GUI_IN = ^WPARAM_GUI_IN;
+ WPARAM_GUI_IN = record
+ pszModule:PAnsiChar;
+ wParam:WPARAM;
+ end;
+ PMBOT_GUI_WPARAM_IN_STRUCT = PWPARAM_GUI_IN;
+ TMBOT_GUI_WPARAM_IN_STRUCT = WPARAM_GUI_IN;
+
+const
+ MS_MBOT_IRC_GUI_IN = 'MBot/IrcGuiIn';
+
+//------------------------- HANDLING GUI MESSAGES 2 ------------------------
+{
+ The bottom rightmost box is related to data sent from the gui
+ (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook,
+ but for MSP this is done via a service instead.
+
+ It can be useful for scripters to simulate user actions, like entering text, closing the window etc
+
+ If the data is modified make sure to realloc() or similar.
+
+ wParam= Module name
+ lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h
+ returns nonzero if the message should be dropped
+}
+
+{
+ NOTE! IRC will implement a service which also uses the same parameters:
+
+ "<Module Name>/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI
+}
+
+ MS_MBOT_IRC_GUI_OUT = 'MBot/IrcGuiOut';
+
+ MS_MBOT_REGISTERIRC = 'MBot/RegisterIRCModule';
+
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_kbdnotify.inc b/plugins/ExternalAPI/delphi/m_kbdnotify.inc new file mode 100644 index 0000000000..b6967ecead --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_kbdnotify.inc @@ -0,0 +1,59 @@ +{
+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_KBDNOTIFY}
+{$DEFINE M_KBDNOTIFY}
+
+const
+//Enables all notifications (for use by BossKey)
+//wParam=0
+//lParam=0
+//returns 0
+ MS_KBDNOTIFY_ENABLE = 'KeyboardNotify/Enable';
+
+//Disables all notifications (for use by BossKey)
+//wParam=0
+//lParam=0
+//returns 0
+ MS_KBDNOTIFY_DISABLE = 'KeyboardNotify/Disable';
+
+//Makes the flashing begin
+//wParam=(unsigned int)eventCount
+//lParam=(AnsiChar *)szFlashingSequence or NULL if you want the plugin to use current settings
+//returns 0
+ MS_KBDNOTIFY_STARTBLINK = 'KeyboardNotify/StartBlinking';
+
+//Receives the number of events that were opened (usuful for the 'until events opened' setting)
+//wParam=(unsigned int)eventCount
+//lParam=0
+//returns 0
+ MS_KBDNOTIFY_EVENTSOPENED = 'KeyboardNotify/EventsWereOpened';
+
+
+//Informs if the flashing is active
+//wParam=0
+//lParam=0
+//returns 0 if the flashing is inactive or a pointer to the string representing the sequence being used
+ MS_KBDNOTIFY_FLASHINGACTIVE = 'KeyboardNotify/IsFlashingActive';
+
+
+//Normalizes the flashing sequence informed
+//wParam=0
+//lParam=(AnsiChar *)szFlashingSequence <- it is rewritten
+//returns a pointer to the string representing the sequence normalized (which is in fact lParam)
+ MS_KBDNOTIFY_NORMALSEQUENCE = 'KeyboardNotify/NormalizeSequence';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_keybindings.inc b/plugins/ExternalAPI/delphi/m_keybindings.inc new file mode 100644 index 0000000000..e0c31c31e5 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_keybindings.inc @@ -0,0 +1,58 @@ +{
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2007 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_KEYBINDINGS}
+
+const
+ KB_CTRL_FLAG = $10000;
+ KB_SHIFT_FLAG = $20000;
+ KB_ALT_FLAG = $40000;
+
+ KBDF_UNICODE = 1;
+
+type
+ TKEYBINDINGDESC = record
+ cbSize :int; //size of the structure
+ szSection :TChar; // section name used to display key bindings in the tree view [TRANSLATED-BY-CORE]
+ pszActionName :TChar; // action name used to display key bindings in the tree view [TRANSLATED-BY-CORE]
+ pszActionGroup:PAnsiChar; // action group name used to group unique shortcuts, shortcuts cannot be duplicated within a group
+ key :array [0..4] of dword; // virtual key + KB_* flags, up to 5 different shortcuts may be defined for each action
+ flags :dword; // flags (KBDF_*)
+ action :int; // id of the action
+ end;
+
+{Registers action with default key bindings assigned to it.
+ wParam = (WPARAM) 0; not used
+ lParam = (LPARAM) (KEYBINDINGDESC*)
+ return: 0 on success, error code otherwise
+}
+ MS_KEYBINDINGS_REGISTER :PAnsiChar = 'KeyBindings/Register';
+
+{Gets action assigned to the given key
+ key[0] and pszActionGroup in KEYBINDINGDESC should be set before calling this service
+ wParam = (WPARAM) 0; not used
+ lParam = (LPARAM) (KEYBINDINGDESC*)
+ return: 0 if action assigned to the given key was found, 1 otherwise
+}
+ MS_KEYBINDINGS_GET :PAnsiChar = 'KeyBindings/Get';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_langman.inc b/plugins/ExternalAPI/delphi/m_langman.inc new file mode 100644 index 0000000000..4f0079719d --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_langman.inc @@ -0,0 +1,46 @@ +{
+'Language Pack Manager'-Plugin for
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2005-2007 H. Herkenrath
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program (LangMan-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_LANGMAN}
+{$DEFINE M_LANGMAN}
+
+const
+
+{
+ Language Pack Manager v1.0.2.1
+ If you have any question or extension whishes please let me know:
+ hrathh at users.sourceforge.net
+}
+
+{ interface id }
+ MIID_LANGMAN: TGUID = '{D80370D5-4B1E-46a8-ACA4-1FAAD79B7D1E}';
+
+{ Show the download language dialog. v1.0.1.2+
+ wParam : 0
+ lParam : 0
+The dialog can't have a parent due to it's asynchronous nature.
+If the language window is already opened it will be
+brought to front instead (returns success).
+Returns 0 on success, nonzero otherwise.
+}
+ MS_LANGMAN_SHOWLANGDIALOG = 'LangMan/ShowLangDialog';
+
+{$ENDIF} // M_LANGMAN
diff --git a/plugins/ExternalAPI/delphi/m_listeningto.inc b/plugins/ExternalAPI/delphi/m_listeningto.inc new file mode 100644 index 0000000000..4bb60c4a45 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_listeningto.inc @@ -0,0 +1,63 @@ +{
+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}
+{$DEFINE M_LISTENINGTO}
+
+// To be used by other plugins to send listening info to miranda
+const
+ MIRANDA_WINDOWCLASS = 'Miranda.ListeningTo';
+ MIRANDA_DW_PROTECTION = $8754;
+const
+ LISTENINGTO_ANSI = 1;
+ LISTENINGTO_UNICODE = 2;
+
+{
+Return TRUE if sending listening to is enabled for this protocol
+
+wParam: AnsiChar * - protocol name or NULL for all protocols
+lParam: ignored
+}
+ MS_LISTENINGTO_ENABLED:PAnsiChar = 'ListeningTo/Enabled';
+
+{
+Enable/disable sending listening to this protocol
+
+wParam: AnsiChar * - protocol name or NULL for all protocols
+lParam: BOOL - TRUE to enable, FALSE to disable
+}
+ MS_LISTENINGTO_ENABLE:PAnsiChar = 'ListeningTo/Enable';
+
+{
+Notification fired when enable state changed
+
+wParam: AnsiChar * - protocol name or NULL for all protocols
+lParam: BOOL - enabled
+}
+ ME_LISTENINGTO_ENABLE_STATE_CHANGED:PAnsiChar = '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
+}
+ MS_LISTENINGTO_SET_NEW_SONG:PAnsiChar = 'ListeningTo/SetNewSong';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_magneticWindows.inc b/plugins/ExternalAPI/delphi/m_magneticWindows.inc new file mode 100644 index 0000000000..885760f629 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_magneticWindows.inc @@ -0,0 +1,72 @@ +{$IFNDEF M_MAGNETICWINDOWS}
+{$DEFINE M_MAGNETICWINDOWS}
+
+const
+// For other Plugins to start snapping for their windows
+// wparam: hwnd of window
+// lparam: 0
+// return: 0 on success, 1 on error
+ MS_MW_ADDWINDOW = 'Utils/MagneticWindows/Add';
+
+// For other Plugins to stop snapping for their windows
+// wparam: hwnd of window
+// lparam: 0
+// return: 0 on success, 1 on error
+ MS_MW_REMWINDOW = 'Utils/MagneticWindows/Rem';
+
+//decide where to align on the list:
+ MS_MW_STL_List_Left = $00000001; //Snaps the window to the left border of the list
+ MS_MW_STL_List_Top = $00000002; //Snaps the window to the top border of the list
+ MS_MW_STL_List_Right = $00000004; //Snaps the window to the right border of the list
+ MS_MW_STL_List_Bottom = $00000008; //Snaps the window to the bottom border of the list
+//decide with what side (of the window you want to snap) to snap to the list
+ MS_MW_STL_Wnd_Left = $00000010; //Snaps the window with the left border to the left/right side of the list
+ MS_MW_STL_Wnd_Top = $00000020; //Snaps the window with the top border to the top/bottom side of the list
+ MS_MW_STL_Wnd_Right = $00000040; //Snaps the window with the right border to the left/right side of the list
+ MS_MW_STL_Wnd_Bottom = $00000080; //Snaps the window with the bottom border to the top/bottom side of the list
+
+ MS_MW_STL_Wnd_FullWidth = (MS_MW_STL_Wnd_Left or MS_MW_STL_Wnd_Right);
+ //Snaps to the top/bottom of the list and spans over the full width
+
+ MS_MW_STL_Wnd_FullHeight = (MS_MW_STL_Wnd_Top or MS_MW_STL_Wnd_Bottom);
+ //Snaps to the left/right of the list and spans over the full height
+
+// to place the window in the list combine f.e.
+// MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment*
+
+//For other Plugins to snap a window to the list for other Plugins
+// wparam: hwnd of window
+// lparam: combination of the above constants MS_MW_STL_*
+// return: 0 on success, 1 on error
+ MS_MW_SNAPTOLIST = 'Utils/MagneticWindows/SnapToList';
+
+// Helper functions
+{$IFNDEF MW_NO_HELPPER_FUNCTIONS}
+
+function MagneticWindows_AddWindow(hWnd:HWND):integer;
+begin
+ if ServiceExists(MS_MW_ADDWINDOW)<>0 then
+ result:=CallService(MS_MW_ADDWINDOW,hWnd,0);
+ else
+ result:=-1;
+end;
+
+function MagneticWindows_RemoveWindow(hWnd:HWND):integer;
+begin
+ if ServiceExists(MS_MW_REMWINDOW)<>0 then
+ result:=CallService(MS_MW_REMWINDOW,hWnd,0);
+ else
+ result:=-1;
+end;
+
+function MagneticWindows_SnapWindowToList(hWnd:HWND;MS_MW_STL_Options:integer):integer;
+begin
+ if (ServiceExists(MS_MW_SNAPTOLIST))
+ result:=CallService(MS_MW_SNAPTOLIST,hWnd,MS_MW_STL_Options);
+ else
+ result:=-1;
+end;
+
+{$ENDIF}
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_mathmodule.inc b/plugins/ExternalAPI/delphi/m_mathmodule.inc new file mode 100644 index 0000000000..a4d10edfa6 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_mathmodule.inc @@ -0,0 +1,199 @@ +{$IFNDEF M_MATHMODULE}
+{$DEFINE M_MATHMODULE}
+ {--------------------------------------------------- }
+ {
+ 2
+ x + 2 Pi
+ + R
+ Sin(wt)
+
+ Math-Module
+
+ Miranda Plugin by Stephan Kassemeyer
+ MathModule API - (c) Stephan Kassemeyer
+ 8 May, 2004
+ }
+ { --------- }
+ {
+ Miranda Service-functions defined by MathModule
+ call with the
+ int ( CallService)(const AnsiChar servicename,WPARAM,LPARAM)
+ that you get from miranda when Miranda calls the
+ Load(PLUGINLINK link)
+ of your PlugIn-dll
+ the CallService function then is:
+ link->CallServiceSync(Servicename,wparam,lparam)
+ }
+ { --------- }
+
+const
+ MATH_RTF_REPLACE_FORMULAE = 'Math/RtfReplaceFormulae';
+ { replace all formulas in a RichEdit with bitmaps. }
+ { wParam = 0 }
+ { lParam = *TMathRichedit Info }
+ { return: TRUE if replacement succeeded, FALSE if not (disable by user?). }
+ { handle of richedit. }
+ { NULL: replace all. }
+type
+ PMathRicheditInfo = ^TMathRicheditInfo;
+ TMathRicheditInfo = record
+ hwndRichEditControl : HWND;
+ sel : PCHARRANGE;
+ disableredraw : int;
+ end;
+ { WARNING: !!! }
+ { Strange things happen if you use this function twice on the same CHARRANGE: }
+ { if Math-startDelimiter == Math-endDelimiter, there is the following problem: }
+ { it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter. }
+ { if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up. }
+ { The same problem occours if we have empty formulae, because two succeding delimiters are }
+ { replaced with a single delimiter. }
+
+const
+ MATH_GET_STARTDELIMITER = 'Math/GetStartDelimiter';
+ { returns the delimiter that marks the beginning of a formula }
+ { wparam=0 }
+ { lparam=0 }
+ { result=*AnsiChar Delimiter }
+ { !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER }
+
+ MATH_GETENDDELIMITER = 'Math/GetEndDelimiter';
+ { returns the delimiter that marks the end of a formula }
+ { wparam=0 }
+ { lparam=0 }
+ { result=*AnsiChar Delimiter }
+ { !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER }
+
+ MTH_FREE_MATH_BUFFER = 'Math/FreeRTFBitmapText';
+ { deletes any buffer that MathModule has created. }
+ { wparam=0 }
+ { lparam=(*AnsiChar) buffer }
+ { result=0 }
+
+ MATH_SETBKGCOLOR = 'Math/SetBackGroundColor';
+ { changes the background color of the next formula to be rendered. }
+ { wparam=0 }
+ { lparam=(COLORREF) color }
+ { result=0 }
+
+ MATH_SET_PARAMS = 'Math/SetParams';
+ { sets a parameter (only integer values) encoded in wparam }
+ { wparam=paramcode }
+ { lparam=parametervalue }
+ { paramcodes: }
+const
+ MATH_PARAM_BKGCOLOR = 0; // (COLORREF) std-rgb-color or TRANSPARENT_Color
+ MATH_PARAM_FONTCOLOR = 1; // (COLORREF) std-rgb-color
+ RESIZE_HWND = 2; // (HWND) preview window resizes RESIZE_HWND when
+ // it is being resized.
+ ToolboxEdit_HWND = 3; // (HWND) If this hwnd (of an edit-box) is set,
+ // MathModule can insert Formula-elements from
+ // the Math-Toolbox.
+// you can make the BKGCOLOR Transparent (default) by using this color:
+ TRANSPARENT_Color = $FFFFFFFF-1; // this is default
+
+const
+ MTH_GETBITMAP = 'Math/GetBitmap';
+ {returns Bitmap that represents the formula given in lparam (string-pointer) }
+ {this formula has NO Delimiters. }
+ {wparam=0 }
+ {lparam=(*AnsiChar)Formula }
+ {result=(HBITMAP) bitmap }
+ {!!! the bitmap must be deleted with DeleteObject(hobject) }
+ {example: }
+ {HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula); }
+
+ MTH_GET_RTF_BITMAPTEXT = 'Math/GetRTFBitmapText';
+ { returns rich-text stream that includes bitmaps from text given in lparam }
+ { text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER }
+ { hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula }
+ { wparam=0 }
+ { lparam=*AnsiChar text }
+ { result=*AnsiChar rtfstream }
+ { !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT }
+
+ MTH_FREE_RTF_BITMAPTEXT = 'Math/FreeRTFBitmapText';
+ { deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created. }
+ { wparam=0 }
+ { lparam=(*AnsiChar) buffer }
+ { result=0 }
+
+ { ************************************************************** }
+ { The following is still SRMM - specific. }
+ { I plan to modify it, so that other PlugIns can take advantage of e.g. preview-window.... }
+const
+ MTH_SHOW = 'Math/Show';
+ { shows the preview-window }
+ { wparam=0 }
+ { lparam=0 }
+ { result=0 }
+
+ MTH_HIDE = 'Math/Hide';
+ { hides the preview-window }
+ { wparam=0 }
+ { lparam=0 }
+ { result=0 }
+
+ MTH_RESIZE = 'Math/Resize';
+ { sets the size of the preview-window }
+ { wparam=0 }
+ { lparam=(*TMathWindowInfo) }
+ { result=0 }
+type
+ PTMathWindowInfo = ^TTMathWindowInfo;
+ TTMathWindowInfo = record
+ top : int;
+ left : int;
+ right : int;
+ bottom: int;
+ end;
+
+const
+ MTH_SETFORMULA = 'Math/SetFormula';
+ { sets the text that the preview-window should parse to display formulas found inside }
+ { wparam=0 }
+ { lparam=(*AnsiChar) text }
+ { result=0 }
+
+ MTH_Set_ToolboxEditHwnd = 'Math/SetTBhwnd';
+ { If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. }
+ { wparam=0 }
+ { lparam=handle }
+ {übergibt fenster-Handle des aktuellen Message-Dialogs }
+
+ MTH_Set_Srmm_HWND = 'Math/SetSrmmHWND';
+ { If MathModule knows the handle of a SRMM-based window, following features exist: }
+ { - preview window resizes Math-Srmm when it is being resized. }
+ { wparam=0 }
+ { lparam=handle }
+ { result=0 }
+ { todo: umbenennen in MTH_Set_ResizeWindowHandle, zusaetzlich MTH_Set_ToolboxEditHandle erstellen, dann keine SRMM-Abhaengigkeit mehr. }
+ { damit ResizeWindows selbst entscheiden koennen, was sie tun, kann man auch ein miranda-event "MTH_preview_resized" einrichten. }
+
+ MTH_GET_PREVIEW_HEIGHT = 'Math/getPreviewHeight';
+ { returns the height of the whole preview-window (including system-menu-bar) }
+ { consider this when maximizing a window to that preview-window is hooked on top or bottom }
+ { it returns the height no matter whether preview-window is visible or not }
+ { wparam=0 }
+ { lparam=0 }
+ { result=(int) height }
+
+ MTH_GET_PREVIEW_SHOWN = 'Math/getPreviewShown';
+ { returns 1 if preview window is visible }
+ { returns 0 if preview window is invisible }
+ { result=(int) shown }
+
+ MTH_SUBSTITUTE_DELIMITER = 'Math/SubstituteDelimiter';
+ { replaces Substitute given lparam-structure with internal Math-Delimiter }
+ { wparam=0 }
+ { lparam=(TMathSubstInfo) substInfo }
+ { result=0 }
+
+type
+ PTMathSubstInfo = ^TTMathSubstInfo;
+ TTMathSubstInfo = record
+ EditHandle : HWND;
+ Substitute : PAnsiChar;
+ end;
+{--------------------------------------------------- }
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_metacontacts.inc b/plugins/ExternalAPI/delphi/m_metacontacts.inc new file mode 100644 index 0000000000..5ff5cf9855 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_metacontacts.inc @@ -0,0 +1,168 @@ +{
+ Miranda IM: the free IM client for Microsoft Windows
+
+ Copyright © 2004 Universite Louis PASTEUR, STRASBOURG.
+ Copyright © 2004 Scott Ellis (www.scottellis.com.au mail@scottellis.com.au)
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+{$IFNDEF M_METACONTACTS}
+{$DEFINE M_METACONTACTS}
+
+const
+ { get the handle for a contact's parent metacontact
+ wParam=(HANDLE)hSubContact
+ lParam=0
+ returns a handle to the parent metacontact, or null if this contact is not
+ a subcontact
+ }
+ MS_MC_GETMETACONTACT = 'MetaContacts/GetMeta';
+
+ { gets the handle for the default contact
+ wParam=(HANDLE)hMetaContact
+ lParam=0
+ returns a handle to the default contact, or null on failure }
+ MS_MC_GETDEFAULTCONTACT = 'MetaContacts/GetDefault';
+
+ { gets the contact number for the default contact
+ wParam=(HANDLE)hMetaContact
+ lParam=0
+ returns a DWORD contact number, or -1 on failure }
+ MS_MC_GETDEFAULTCONTACTNUM = 'MetaContacts/GetDefaultNum';
+
+ { gets the handle for the 'most online' contact
+ wParam=(HANDLE)hMetaContact
+ lParam=0
+ returns a handle to the 'most online' contact }
+ MS_MC_GETMOSTONLINECONTACT = 'MetaContacts/GetMostOnline';
+
+ { gets the number of subcontacts for a metacontact
+ wParam=(HANDLE)hMetaContact
+ lParam=0
+ returns a DWORD representing the number of subcontacts for the given metacontact }
+ MS_MC_GETNUMCONTACTS = 'MetaContacts/GetNumContacts';
+
+ { gets the handle of a subcontact, using the subcontact's number
+ wParam=(HANDLE)hMetaContact
+ lParam=(DWORD)contact number
+ returns a handle to the specified subcontact }
+ MS_MC_GETSUBCONTACT = 'MetaContacts/GetSubContact';
+
+ { sets the default contact, using the subcontact's contact number
+ wParam=(HANDLE)hMetaContact
+ lParam=(DWORD)contact number
+ returns 0 on success }
+ MS_MC_SETDEFAULTCONTACTNUM = 'MetaContacts/SetDefault';
+
+ { sets the default contact, using the subcontact's handle
+ wParam=(HANDLE)hMetaContact
+ lParam=(HANDLE)hSubcontact
+ returns 0 on success }
+ MS_MC_SETDEFAULTCONTACT = 'MetaContacts/SetDefaultByHandle';
+
+ { forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+ wParam=(HANDLE)hMetaContact
+ lParam=(DWORD)contact number
+ returns 0 on success }
+ MS_MC_FORCESENDCONTACTNUM = 'MetaContacts/ForceSendContact';
+
+ { forces the metacontact to send using a specific subcontact, using the subcontact's handle
+ wParam=(HANDLE)hMetaContact
+ lParam=(HANDLE)hSubcontact
+ returns 0 on success (will fail if 'force default' is in effect) }
+ MS_MC_FORCESENDCONTACT = 'MetaContacts/ForceSendContactByHandle';
+
+ { 'unforces' the metacontact to send using a specific subcontact
+ wParam=(HANDLE)hMetaContact
+ lParam=0
+ returns 0 on success (will fail if 'force default' is in effect) }
+ MS_MC_UNFORCESENDCONTACT = 'MetaContacts/UnforceSendContact';
+
+ { 'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+ overrides (and clears) 'force send' above, and will even force use of offline contacts
+ will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+ wParam=(HANDLE)hMetaContact
+ lParam=0
+ returns 1(true) or 0(false) representing new state of 'force default' }
+ MS_MC_FORCEDEFAULT = 'MetaContacts/ForceSendDefault';
+
+ { method to get state of 'force' for a metacontact
+ wParam=(HANDLE)hMetaContact
+ lParam= (DWORD)&contact_number or NULL
+ if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+ or if none is in force, the value (DWORD)-1 will be copied
+ (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above) }
+ MS_MC_GETFORCESTATE = 'MetaContacts/GetForceState';
+
+ { fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+ wParam=(HANDLE)hMetaContact
+ lParam=(HANDLE)hDefaultContact }
+ ME_MC_DEFAULTTCHANGED = 'MetaContacts/DefaultChanged';
+
+ { fired when a metacontact's subcontacts change (fired upon creation of
+ metacontact, when contacts are added or removed, and when contacts are
+ reordered) - a signal to re-read metacontact data
+ wParam=(HANDLE)hMetaContact
+ lParam=0 }
+ ME_MC_SUBCONTACTSCHANGED = 'MetaContacts/SubcontactsChanged';
+
+ { fired when a metacontact is forced to send using a specific subcontact
+ wParam=(HANDLE)hMetaContact
+ lParam=(HANDLE)hForceContact }
+ ME_MC_FORCESEND = 'MetaContacts/ForceSend';
+
+ { fired when a metacontact is 'unforced' to send using a specific subcontact
+ wParam=(HANDLE)hMetaContact
+ lParam=0 }
+ ME_MC_UNFORCESEND = 'MetaContacts/UnforceSend';
+
+ { method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+ wParam=lParam=0 }
+ MS_MC_GETPROTOCOLNAME = 'MetaContacts/GetProtoName';
+
+ { added 0.9.5.0 (22/3/05)
+ wParam=(HANDLE)hContact
+ lParam=0
+ convert a given contact into a metacontact
+ }
+ MS_MC_CONVERTTOMETA = 'MetaContacts/ConvertToMetacontact';
+
+ { added 0.9.5.0 (22/3/05)
+ wParam=(HANDLE)hContact
+ lParam=(HANDLE)hMeta
+ add an existing contact to a metacontact
+ }
+ MS_MC_ADDTOMETA = 'MetaContacts/AddToMetacontact';
+
+ { added 0.9.5.0 (22/3/05)
+ wParam=0
+ lParam=(HANDLE)hContact
+ remove a contact from a metacontact
+ }
+ MS_MC_REMOVEFROMMETA = 'MetaContacts/RemoveFromMetacontact';
+
+
+ { added 0.9.13.2 (6/10/05)
+ wParam=(BOOL)disable
+ lParam=0
+ enable/disable the 'hidden group hack' - for clists that support subcontact
+ hiding using 'IsSubcontact' setting. Should be called once in the clist
+ 'onmodulesloaded' event handler (which, since it's loaded after the db, will
+ be called before the metacontact onmodulesloaded handler where the subcontact
+ hiding is usually done)
+ }
+ MS_MC_DISABLEHIDDENGROUP = 'MetaContacts/DisableHiddenGroup';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_motd.inc b/plugins/ExternalAPI/delphi/m_motd.inc new file mode 100644 index 0000000000..3b986bf02e --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_motd.inc @@ -0,0 +1,75 @@ +{
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_MOTD}
+{$DEFINE M_MOTD}
+
+//=== SERVICES ===
+
+{
+MOTD/GetMessage service
+Get a MOTD
+
+wparam = (MOTDMessage*)lpMOTDMessage
+lparam = 0
+returns: 0 on success, -1 on failure. On success, lpMOTDMessage is filled with the MOTD
+}
+type
+ PMOTDMessage = ^TMOTDMessage;
+ TMOTDMessage = record
+ cbSize :int; // sizeof(MOTDMessage)
+ pszMessage :PAnsiChar; // Buffer to store message
+ cbMessageSize:dword; // Size of message buffer (including '\0')
+ pszAuthor :PAnsiChar; // Buffer to store author
+ cbAuthorSize :dword; // Size of author buffer (including '\0')
+ end;
+const
+ MS_MOTD_GETMESSAGE = 'MOTD/GetMessage';
+
+{
+MOTD/AddMessage service
+Add a message to the MOTD list
+
+wparam = (MOTDMessage*)lpMOTDMessage
+lparam = 0
+returns: 0 on success, -1 on failure
+}
+ MS_MOTD_ADDMESSAGE = 'MOTD/AddMessage';
+
+{
+MOTD/ShowMessage service
+Show a popup with a MOTD
+
+wparam = 0
+lparam = 0
+returns: 0
+}
+ MS_MOTD_SHOWMESSAGE ='MOTD/ShowMessage';
+
+{
+MOTD/ShowAddMessage service
+Show a dialog to add a MOTD
+
+wparam = 0
+lparam = 0
+returns: 0
+}
+ MS_MOTD_SHOWADDMESSAGE = 'MOTD/ShowAddMessage';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_music.inc b/plugins/ExternalAPI/delphi/m_music.inc new file mode 100644 index 0000000000..aba0bd27f6 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_music.inc @@ -0,0 +1,419 @@ +{$IFNDEF M_MUSIC}
+{$DEFINE M_MUSIC}
+
+// defined in interfaces.inc
+//const MIID_WATRACK:MUUID='{FC6C81F4-837E-4430-9601-A0AA43177AE3}';
+
+type
+ pSongInfoA = ^tSongInfoA;
+ tSongInfoA = record
+ artist :PAnsiChar;
+ title :PAnsiChar;
+ album :PAnsiChar;
+ genre :PAnsiChar;
+ comment :PAnsiChar;
+ year :PAnsiChar;
+ mfile :PAnsiChar; // media file
+ kbps :dword;
+ khz :dword;
+ channels :dword;
+ track :dword;
+ total :dword; // music length
+ time :dword; // elapsed time
+ wndtext :PAnsiChar; // window title
+ player :PAnsiChar; // player name
+ plyver :dword; // player version
+ icon :THANDLE; // player icon
+ fsize :dword; // media file size
+ vbr :dword;
+ status :integer; // WAT_MES_* const
+ plwnd :HWND; // player window
+ // video part
+ codec :dword;
+ width :dword;
+ height :dword;
+ fps :dword;
+ date :int64;
+ txtver :PAnsiChar;
+ lyric :PAnsiChar;
+ cover :PAnsiChar;
+ volume :dword;
+ url :PAnsiChar; // player homepage
+ winampwnd:HWND;
+ end;
+type
+ pSongInfo=^tSongInfo;
+ tSongInfo = record
+ artist :pWideChar;
+ title :pWideChar;
+ album :pWideChar;
+ genre :pWideChar;
+ comment :pWideChar;
+ year :pWideChar;
+ mfile :pWideChar; // media file
+ kbps :dword;
+ khz :dword;
+ channels :dword;
+ track :dword;
+ total :dword; // music length
+ time :dword; // elapsed time
+ wndtext :pWideChar; // window title
+ player :pWideChar; // player name
+ plyver :dword; // player version
+ icon :THANDLE; // player icon
+ fsize :dword; // media file size
+ vbr :dword;
+ status :integer; // WAT_MES_* const
+ plwnd :HWND; // player window
+ // video part
+ codec :dword;
+ width :dword;
+ height :dword;
+ fps :dword;
+ date :int64;
+ txtver :pWideChar;
+ lyric :pWideChar;
+ cover :pWideChar; // cover path
+ volume :dword;
+ url :PWideChar; // player homepage
+ winampwnd:HWND;
+ end;
+ pSongInfoW = pSongInfo;
+ tSongInfoW = tSongInfo;
+
+const
+ // result codes
+ WAT_RES_UNKNOWN = -2;
+ WAT_RES_NOTFOUND = -1;
+ WAT_RES_ERROR = WAT_RES_NOTFOUND;
+ WAT_RES_OK = 0;
+ WAT_RES_ENABLED = WAT_RES_OK;
+ WAT_RES_DISABLED = 1;
+ // internal
+ WAT_RES_NEWFILE = 3;
+ WAT_RES_NEWPLAYER = 4;
+
+// result for MS_WAT_GETMUSICINFO service
+const
+ WAT_PLS_NORMAL = WAT_RES_OK;
+ WAT_PLS_NOMUSIC = WAT_RES_DISABLED;
+ WAT_PLS_NOTFOUND = WAT_RES_NOTFOUND;
+
+const
+ WAT_INF_UNICODE = 0;
+ WAT_INF_ANSI = 1;
+ WAT_INF_UTF8 = 2;
+ WAT_INF_CHANGES = $100;
+
+const
+ MS_WAT_INSERT:PAnsiChar = 'WATrack/Insert';
+ MS_WAT_EXPORT:PAnsiChar = 'WATrack/Export';
+
+const
+{
+ wParam : WAT_INF_* constant
+ lParam : pointer to pSongInfo (Unicode) or pSongInfoA (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:
+ var p:pSongInfo;
+ CallService(MS_WAT_GETMUSICINFO,0,dword(@p));
+}
+ MS_WAT_GETMUSICINFO:PAnsiChar = '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 mir_free
+}
+ MS_WAT_GETFILEINFO:PAnsiChar = 'WATrack/GetFileInfo';
+
+{
+ wParam: encoding (WAT_INF_* consts, 0 = WAT_INF_UNICODE)
+ lParam: codepage (0 = ANSI)
+ Returns Global unicode SongInfo pointer or tranlated to Ansi/UTF8 structure
+}
+ MS_WAT_RETURNGLOBAL:PAnsiChar = 'WATrack/GetMainStructure';
+
+//!! DON'T CHANGE THESE VALUES!
+const
+ WAT_CTRL_FIRST = 1;
+
+ WAT_CTRL_PREV = 1;
+ WAT_CTRL_PLAY = 2;
+ WAT_CTRL_PAUSE = 3;
+ WAT_CTRL_STOP = 4;
+ WAT_CTRL_NEXT = 5;
+ WAT_CTRL_VOLDN = 6;
+ WAT_CTRL_VOLUP = 7;
+ WAT_CTRL_SEEK = 8; // lParam is new position (sec)
+
+ WAT_CTRL_LAST = 8;
+
+{
+ wParam: button code (WAT_CTRL_* const)
+ lParam: 0, or value (see WAT_CTRL_* const comments)
+ Affects: emulate player button pressing
+ returns: 0 if unsuccesful
+}
+ MS_WAT_PRESSBUTTON:PAnsiChar = 'WATrack/PressButton';
+
+{
+ Get user's Music Info
+}
+ MS_WAT_GETCONTACTINFO:PAnsiChar = 'WATrack/GetContactInfo';
+
+// ------------ Plugin/player status ------------
+
+{
+ wParam: 1 - switch off plugin
+ 0 - switch on plugin
+ -1 - switch plugin status
+ 2 - get plugin version
+ other - get plugin status
+ lParam: 0
+ Affects: Switch plugin status to enabled or disabled
+ returns: version, old plugin status, 0, if was enabled
+}
+ MS_WAT_PLUGINSTATUS:PAnsiChar = 'WATrack/PluginStatus';
+
+ ME_WAT_MODULELOADED:PAnsiChar = 'WATrack/ModuleLoaded';
+
+const
+ WAT_EVENT_PLAYERSTATUS = 1; // WAT_PLS_* in loword, WAT_MES_* in hiword
+ WAT_EVENT_NEWTRACK = 2; // SongInfo ptr
+ WAT_EVENT_PLUGINSTATUS = 3; // 0-enabled; 1-dis.temporary; 2-dis.permanent
+ WAT_EVENT_NEWPLAYER = 4; //
+ WAT_EVENT_NEWTEMPLATE = 5; // TM_* constant
+
+{
+ Plugin or player status changed:
+ wParam: type of event (see above)
+ lParam: value
+}
+ ME_WAT_NEWSTATUS:PAnsiChar = '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
+}
+ MS_WAT_SHOWMUSICINFO:PAnsiChar = 'WATrack/ShowMusicInfo';
+
+// --------- Statistic (report) module -------------
+
+{
+ wParam: pointer to log file name or NIL
+ lParam: pointer to report file name or NIL
+ Affects: Create report from log and run it (if option is set)
+ returns: 0 if unsuccesful
+ note: if wParam or lParam is a NIL then file names from options are used
+}
+ MS_WAT_MAKEREPORT :PAnsiChar = 'WATrack/MakeReport';
+// MS_WAT_MAKEREPORTW:PAnsiChar = 'WATrack/MakeReportW';
+
+{
+ wParam, lParam - not used
+ Affects: pack statistic file
+}
+ MS_WAT_PACKLOG:PAnsiChar = 'WATrack/PackLog';
+
+{
+ wParam: not used
+ lParam: pointer to SongInfo
+}
+ MS_WAT_ADDTOLOG:PAnsiChar = 'WATrack/AddToLog';
+
+// ----------- Formats and players -----------
+
+// media file status
+
+const
+ WAT_MES_STOPPED = 0;
+ WAT_MES_PLAYING = 1;
+ WAT_MES_PAUSED = 2;
+ WAT_MES_UNKNOWN = -1;
+
+const
+ WAT_ACT_REGISTER = 1;
+ WAT_ACT_UNREGISTER = 2;
+ WAT_ACT_DISABLE = 3;
+ WAT_ACT_ENABLE = 4;
+ WAT_ACT_GETSTATUS = 5; // not found/enabled/disabled
+ WAT_ACT_SETACTIVE = 6;
+ WAT_ACT_REPLACE = $10000; // can be combined with WAT_REGISTERFORMAT
+
+const
+ // flags
+ WAT_OPT_DISABLED = $00000001; // [formats,players,options] registered but disabled
+ WAT_OPT_ONLYONE = $00000002; // [formats,players] code can't be overwriten
+ WAT_OPT_PLAYERINFO = $00000004; // [players] song info from player
+ WAT_OPT_WINAMPAPI = $00000008; // [players] Winamp API support
+ WAT_OPT_CHECKTIME = $00000010; // [options] check file time for changes
+ WAT_OPT_VIDEO = $00000020; // [formats,options] format is video
+ WAT_OPT_LAST = $00000040; // (internal-Winamp Clone) put to the end of queue
+ WAT_OPT_FIRST = $00000080; // (internal)
+ WAT_OPT_TEMPLATE = $00000100; // (internal)
+ WAT_OPT_IMPLANTANT = $00000200; // [options] use process implantation
+ WAT_OPT_HASURL = $00000400; // [players] URL field present
+ WAT_OPT_CHANGES = $00000800; // (internal) obtain only chaged values
+ // (volume, status, window text, elapsed time)
+ WAT_OPT_APPCOMMAND = $00001000; // [options] Special (multimedia) key support
+ WAT_OPT_CHECKALL = $00002000; // [options] Check all players
+ WAT_OPT_KEEPOLD = $00004000; // [options] Keep Old opened file
+ WAT_OPT_MULTITHREAD = $00008000; // [options] Use multithread scan
+ WAT_OPT_SINGLEINST = $00010000; // [players] Single player instance
+ WAT_OPT_PLAYERDATA = $00020000; // (internal) to obtain player data
+ WAT_OPT_CONTAINER = $00040000; // [formats] format is container (need to check full)
+
+type
+ tReadFormatProc = function(var Info:tSongInfo):boolean; cdecl;
+ pMusicFormat = ^tMusicFormat;
+ tMusicFormat = record
+ proc :tReadFormatProc;
+ ext :array [0..7] of AnsiChar;
+ flags:cardinal;
+ end;
+
+const
+{
+ wParam: action
+ lParam: pointer to tMusicFormat if wParam = WAT_ACT_REGISTER,
+ else - pointer to extension string (ANSI)
+ returns: see result codes
+}
+ MS_WAT_FORMAT:PAnsiChar = 'WATrack/Format';
+
+{
+ wParam: pointer to SongInfo structure (plwind field must be initialized)
+ lParam: flags
+ Affects: trying to fill SongInfo using Winamp API
+}
+ MS_WAT_WINAMPINFO:PAnsiChar = 'WATrack/WinampInfo';
+
+{
+ wParam: window
+ lParam: LoWord - command; HiWord - value
+}
+ MS_WAT_WINAMPCOMMAND:PAnsiChar = 'WATrack/WinampCommand';
+
+type
+ tInitProc = function():integer;cdecl;
+ tDeInitProc = function():integer;cdecl;
+ tStatusProc = function(wnd:HWND):integer;cdecl;
+ tNameProc = function(wnd:HWND;flags:integer):pWideChar;cdecl;
+ tCheckProc = function(wnd:HWND;flags:integer):HWND;cdecl;
+ tInfoProc = function(var SongInfo:tSongInfo;flags:integer):integer;cdecl;
+ tCommandProc = function(wnd:HWND;command:integer;value:integer):integer;cdecl;
+
+ pPlayerCell = ^tPlayerCell;
+ tPlayerCell = record
+ Desc :PAnsiChar; // Short player name
+ flags :cardinal;
+ Icon :HICON; // can be 0. for registration only
+ Init :pointer; // tInitProc; can be NIL. initialize any data
+ DeInit :pointer; // tDeInitProc; can be NIL. finalize player processing
+ Check :pointer; // tCheckProc; check player
+ GetStatus:pointer; // tStatusProc; can be NIL. get player status
+ GetName :pointer; // tNameProc; can be NIL. get media filename
+ GetInfo :pointer; // tInfoProc; can be NIL. get info from player
+ Command :pointer; // tCommandProc; can be NIL. send command to player
+ URL :PAnsiChar; // only if WAT_OPT_HASURL flag present
+ Notes :PWideChar; // any tips, notes etc for this player
+ end;
+
+const
+{
+ wParam: action
+ lParam: pointer to tPlayerCell if wParam = WAT_ACT_REGISTER,
+ else - pointer to player description string (ANSI)
+ returns: player window handle or value>0 if found
+ note: If you use GetName or GetInfo field, please, do not return empty
+ filename even when mediafile is remote!
+}
+ MS_WAT_PLAYER:PAnsiChar = 'WATrack/Player';
+
+// --------- MyShows.ru ---------
+
+{
+ Toggle MyShows scrobbling status
+ wParam,lParam=0
+ Returns: previous state
+}
+const
+ MS_WAT_MYSHOWS:pAnsiChar = 'WATrack/MyShows';
+
+
+const
+ MS_WAT_MYSHOWSINFO:pAnsiChar = 'WATrack/MyShowsInfo';
+
+// --------- Last FM ---------
+
+{
+ Toggle LastFM scrobbling status
+ wParam,lParam=0
+ Returns: previous state
+}
+const
+ MS_WAT_LASTFM:pAnsiChar = 'WATrack/LastFM';
+
+{
+ Get Info based on currently played song
+ wParam: pLastFMInfo
+ lParam: int language (first 2 bytes - 2-letters language code)
+}
+type
+ pLastFMInfo = ^tLastFMInfo;
+ tLastFMInfo = record
+ request:cardinal; // 0 - artist, 1 - album, 2 - track
+ artist :pWideChar; // artist
+ album :pWideChar; // album or similar artists for Artist info request
+ title :pWideChar; // track title
+ tags :pWideChar; // tags
+ info :pWideChar; // artist bio or wiki article
+ image :pAnsiChar; // photo/cover link
+ similar:pWideChar;
+ release:pWideChar;
+ trknum :cardinal;
+ end;
+const
+ MS_WAT_LASTFMINFO:pAnsiChar = 'WATrack/LastFMInfo';
+
+// --------- Templates ----------
+
+const
+{
+ wParam: 0 (standard Info) or pSongInfo
+ lParam: Unicode template
+ returns: New Unicode (replaced) string
+}
+ MS_WAT_REPLACETEXT:PAnsiChar = 'WATrack/ReplaceText';
+
+{
+ event types for History
+ Blob structure for EVENTTYPE_WAT_ANSWER:
+ Uniciode artist#0title#0album#0answer
+}
+const
+ EVENTTYPE_WAT_REQUEST = 9601;
+ EVENTTYPE_WAT_ANSWER = 9602;
+ EVENTTYPE_WAT_ERROR = 9603;
+ EVENTTYPE_WAT_MESSAGE = 9604;
+
+const
+{
+ wParam: 0 or parent window
+ lParam: 0
+ note: Shows Macro help window with edit aliases ability
+}
+ MS_WAT_MACROHELP:pAnsiChar = 'WATrack/MacroHelp';
+
+{$ENDIF M_MUSIC}
diff --git a/plugins/ExternalAPI/delphi/m_mydetails.inc b/plugins/ExternalAPI/delphi/m_mydetails.inc new file mode 100644 index 0000000000..c908849a7b --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_mydetails.inc @@ -0,0 +1,174 @@ +{
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$FINDEF M_MYDETAILS}
+{$DEFINE M_MYDETAILS}
+
+const
+
+{
+ MyDetails/SetMyNickname service
+ Set the nickname for all possible protocols
+
+ wparam = (const AnsiChar *) protocol name or NULL for all protocols
+ lparam = (const AnsiChar *) new nickname
+ returns: -2 if proto can't set this, -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_SETMYNICKNAME:PAnsiChar = 'MyDetails/SetMyNickname';
+
+{
+ MyDetails/SetMyNicknameUI service
+ Shows a dialog to set the nickname for all possible protocols
+
+ wparam = 0
+ lparam = (const AnsiChar *) protocol name or NULL for all protocols
+ returns: -2 if proto can't set this, -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_SETMYNICKNAMEUI:PAnsiChar = 'MyDetails/SetMyNicknameUI';
+
+{
+ MyDetails/SetMyAvatar service
+ Set the avatar for all possible protocols
+
+ wparam = (const AnsiChar *) protocol name or NULL for all protocols
+ lparam = (const AnsiChar *) new avatar file name
+ returns: -2 if proto can't set this, -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_SETMYAVATAR:PAnsiChar = 'MyDetails/SetMyAvatar';
+
+{
+ MyDetails/SetMyAvatarUI service
+ Shows a dialog to set the avatar for all possible protocols
+
+ wparam = 0
+ lparam = (const AnsiChar *) protocol name or NULL for all protocols
+ returns: -2 if proto can't set this, -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_SETMYAVATARUI:PAnsiChar = 'MyDetails/SetMyAvatarUI';
+
+{
+ MyDetails/GetMyNickname service
+ Get the nickname
+
+ wparam = (const AnsiChar *) protocol name or NULL for default nick
+ lparam = (AnsiChar *) the buffer to save the nickname. Has to have at least 1024 chars
+ returns: -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_GETMYNICKNAME:PAnsiChar = 'MyDetails/GetMyNickname';
+ MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE = 1024;
+
+{
+ MyDetails/GetMyAvatar service
+ Get the avatar file name
+
+ wparam = (const AnsiChar *) protocol name or NULL for default avatar
+ lparam = (AnsiChar *) the buffer to save the file name. Has to have at least 1024 chars
+ returns: -2 if proto can't get this, -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_GETMYAVATAR:PAnsiChar = 'MyDetails/GetMyAvatar';
+ MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE = 1024;
+
+{
+ MyDetails/SetMyStatusMessageUI service
+ Shows a dialog to set the status message for all possible protocols
+ Today only works if NAS is installed.
+
+ wparam = 0
+ lparam = (const AnsiChar *) protocol name or NULL for all protocols
+ returns: -2 if proto can't set this, -1 on protocol not found, else 0
+}
+ MS_MYDETAILS_SETMYSTATUSMESSAGEUI:PAnsiChar = 'MyDetails/SetMyStatusMessageUI';
+ MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE = 1024;
+
+{
+ MyDetails/ShowNextProtocol service
+ Shows the next protocol in the frame
+
+ wparam = 0
+ lparam = 0
+ returns: -1 on error, 0 on success
+}
+ MS_MYDETAILS_SHOWNEXTPROTOCOL:PAnsiChar = 'MyDetails/ShowNextProtocol';
+
+{
+ MyDetails/ShowPreviousProtocol service
+ Shows the previous protocol in the frame
+
+ wparam = 0
+ lparam = 0
+ returns: -1 on error, 0 on success
+}
+ MS_MYDETAILS_SHOWPREVIOUSPROTOCOL:PAnsiChar = 'MyDetails/ShowPreviousProtocol';
+
+{
+ MyDetails/ShowProtocol service
+ Shows a protocol given its name in the frame
+
+ wparam = 0
+ lparam = protocol name
+ returns: -1 on error, 0 on success
+}
+ MS_MYDETAILS_SHOWPROTOCOL:PAnsiChar = 'MyDetails/ShowProtocol';
+
+{
+ MyDetails/CicleThroughtProtocols service
+ Start/stops the cicling throught protocols
+
+ wparam = FALSE to stop, TRUE to start
+ lparam = 0
+ returns: -1 on error, 0 on success
+}
+ MS_MYDETAILS_CICLE_THROUGHT_PROTOCOLS:PAnsiChar = 'MyDetails/CicleThroughtProtocols';
+
+
+// Since ver.1.9
+
+{
+MyDetails/ShowFrame service
+Shows the MyDetails frame/window if it is hidden
+
+wparam = 0
+lparam = 0
+returns: 0
+}
+ MS_MYDETAILS_SHOWFRAME:PAnsiChar = 'MyDetails/ShowFrame';
+
+
+{
+MyDetails/HideFrame service
+Hides the MyDetails frame/window if it is shown
+
+wparam = 0
+lparam = 0
+returns: 0
+}
+ MS_MYDETAILS_HIDEFRAME:PAnsiChar = 'MyDetails/HideFrame';
+
+
+{
+MyDetails/ShowHideMyDetails service
+Shows the MyDetails frame/window if it is hidden or hides the MyDetails frame/window if it is shown
+
+wparam = 0
+lparam = 0
+returns: 0
+}
+ MS_MYDETAILS_SHOWHIDEFRAME:PAnsiChar = 'MyDetails/ShowHideMyDetails';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_newawaysys.inc b/plugins/ExternalAPI/delphi/m_newawaysys.inc new file mode 100644 index 0000000000..1a12135d0b --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_newawaysys.inc @@ -0,0 +1,108 @@ +{
+ New Away System plugin for Miranda IM
+ Copyright (C) 2005 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}
+{$DEFINE M_NEWAWAYSYS}
+
+const
+// NAS_PROTOINFO::Flags constants
+ 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
+ PIF_NOTTEMPORARY = 2; // usually you should NOT set this flag
+// 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
+// MS_NAS_GETSTATE: NAS ignores any temporary messages and returns only non-temporary ones. this flag affects something only when status == 0
+
+type
+ PNAS_PROTOINFO = ^TNAS_PROTOINFO;
+ TNAS_PROTOINFO = record
+ cbSize : int;
+ szProto: PAnsiChar; // pointer to protocol modulename (NULL means global)
+ Msg : TChar; // pointer to the status message (may be NULL -
+ // means that there's no specific message for this protocol)
+{
+ 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.
+}
+ status : WORD; // 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.
+}
+ Flags : int;
+ end;
+
+const
+// 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
+ MS_NAS_GETSTATEA:PAnsiChar = 'NewAwaySystem/GetStateA';
+ MS_NAS_GETSTATEW:PAnsiChar = 'NewAwaySystem/GetStateW';
+
+// 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 = (NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items.
+// lParam = (LPARAM)(int)protoCount - number of items in pi.
+// returns 0 on success
+ MS_NAS_SETSTATEA:PAnsiChar = 'NewAwaySystem/SetStateA';
+ MS_NAS_SETSTATEW:PAnsiChar = 'NewAwaySystem/SetStateW';
+var
+ MS_NAS_GETSTATE:PAnsiChar absolute MS_NAS_GETSTATEW;
+ MS_NAS_SETSTATE:PAnsiChar absolute MS_NAS_SETSTATEW;
+
+const
+// NAS_ISWINFO::Flags constants
+ ISWF_NOCOUNTDOWN = 1; // don't start the countdown to close the window
+ ISWF_UNICODE = 2; // specifies that NAS_ISWINFO::szMsg is a WCHAR*
+type
+ PNAS_ISWINFO = ^TNAS_ISWINFO;
+ TNAS_ISWINFO = record
+ cbSize :int;
+ szProto :PAnsiChar; // pointer to initial protocol modulename (NULL means
+ // global); ignored when hContact is not NULL.
+ hContact:THANDLE; // NAS will select this contact in the window initially,
+ // if it's not NULL.
+ Msg :TChar; // pointer to an initial status message (may be NULL,
+ // NAS will use the default message then)
+ status :word; // status mode. 0 means current.
+ iFlags :int; // a combination of ISWF_ constants
+ end;
+
+const
+// 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.
+ MS_NAS_INVOKESTATUSWINDOW:PAnsiChar = 'NewAwaySystem/InvokeStatusWindow';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_nickhistory.inc b/plugins/ExternalAPI/delphi/m_nickhistory.inc new file mode 100644 index 0000000000..240fc73b29 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_nickhistory.inc @@ -0,0 +1,50 @@ +{
+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_NICKHISTORY}
+{$DEFINE M_NICKHISTORY}
+
+const
+ EVENTTYPE_NICKNAME_CHANGE = 9001;
+
+{
+Return TRUE is Nick History is enabled for this contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_NICKHISTORY_ENABLED = 'NickHistory/Enabled';
+
+{
+Enable Nick History for a contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_NICKHISTORY_ENABLE = 'NickHistory/Enable';
+
+{
+Disable Nick History for a contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_NICKHISTORY_DISABLE = 'NickHistory/Disable';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_notify.inc b/plugins/ExternalAPI/delphi/m_notify.inc new file mode 100644 index 0000000000..572adc029e --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_notify.inc @@ -0,0 +1,266 @@ +{$IFNDEF M_NOTIFY}
+{$DEFINE M_NOTIFY}
+
+{** Miranda Notify Dispatcher ************************************************
+Notify Dispatcher provides common interface to different notification plugins
+like osd, popup, ticker etc.
+******************************************************************************}
+
+const
+{ Options UI event and service. The same as for miranda options }
+ ME_NOTIFY_OPT_INITIALISE = 'Notify/Opt/Initialise';
+ MS_NOTIFY_OPT_ADDPAGE = 'Notify/Opt/AddPage';
+
+type
+ tagMNOTIFYACTIONINFO = record
+ icon :HICON;
+ name :array [0..MAXMODULELABELLENGTH-1] of AnsiChar;
+ service:array [0..MAXMODULELABELLENGTH-1] of AnsiChar;
+ cookie :DWORD;
+ end;
+ MNOTIFYACTIONINFO = tagMNOTIFYACTIONINFO;
+
+// Just like miranda pluginLink... This should work faster then services,
+// we need some reactivity in notifications.
+type
+ tagMNNOTIFYLINK = record
+ // Create a new notification type
+ function Register(name:PAnsiChar;icon:HICON):THANDLE;cdecl;
+
+ // Create a new notification object
+ function Create(atype:THANDLE):THANDLE;cdecl;
+
+ // Check is handle is a valid notification object
+ function IsValid(notify:THANDLE):integer;cdecl;
+
+ // Set/get information about object, or type defaults
+ function Set(notifyORtype:THANDLE;name:PAnsiChar;val:TDBVARIANT):integer;cdecl;
+ function Get(notifyORtype:THANDLE;name:PAnsiChar;val:PDBVARIANT):integer;cdecl;
+
+ // Set/get actions
+ function AddAction (notifyORtype:THANDLE;icon:HICON;name:PAnsiChar;service:PAnsiChar;cookie:DWORD):integer;cdecl;
+ function GetActions(notifyORtype:THANDLE;actions:PMNOTIFYACTIONINFO):integer;cdecl;
+
+ // Increment/decrement refer count of notification object. Unreferred objects are destroyed
+ function AddRef (notify:THANDLE):integer;cdecl;
+ function Release(notify:THANDLE):integer;cdecl;
+
+ // Notify user
+ procedure Show (notify:THANDLE);cdecl;
+ procedure Update(notify:THANDLE);cdecl;
+ procedure Remove(notify:THANDLE);cdecl;
+ end;
+ PMNOTIFYLINK = ^TMNOTIFYLINK;
+ TMNOTIFYLINK = tagMNOTIFYLINK;
+
+const
+// Get the MNOTIFYLINK struct
+// result = (LRESULT)(MNOTIFYLINK* )notifyLink
+ MS_NOTIFY_GETLINK = 'Notify/GetLink';
+
+// Hook this to process corresponding actions
+ ME_NOTIFY_SHOW = 'Notify/Show';
+ ME_NOTIFY_UPDATE = 'Notify/Update';
+ ME_NOTIFY_REMOVE = 'Notify/Remove';
+
+var
+ notifyLink:PMNOTIFYLINK;
+(*
+function MNotifyRegister(name:PAnsiChar;icon:HICON):THANDLE;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.Register(name,icon)
+ else
+ result:=0;
+end;
+function MNotifyCreate(atype:THANDLE):THANDLE;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.Create(atype)
+ else
+ result:=0;
+end;
+function MNotifyIsValid(notify:THANDLE):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.IsValid(notify)
+ else
+ result:=0;
+end;
+function MNotifySet(notifyORtype:THANDLE,name:PAnsiChar;val:TDBVARIANT):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.Set(notifyORtype,name,val)
+ else
+ result:=0;
+end;
+function MNotifyGet(notifyORtype:THANDLE,name:PAnsiChar;val:PDBVARIANT):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.Get(notifyORtype,name,val)
+ else
+ result:=0;
+end;
+function MNotifyAddAction(notifyORtype:THANDLE;icon:HICON;name:PAnsiChar;service:PAnsiChar=nil;cookie:DWORD=0):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.AddAction(notifyORtype,icon,name)
+ else
+ result:=0;
+end;
+function MNotifyGetActions(notifyORtype:THANDLE;actions:PMNOTIFYACTIONINFO):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.GetActions(notifyORtype,actions)
+ else
+ result:=0;
+end;
+function MNotifyAddRef(notify:THANDLE):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.AddRef(notify)
+ else
+ result:=0;
+end;
+function MNotifyRelease(notify:THANDLE):int;
+begin
+ if notifyLink<>nil then
+ result:=notifyLink^.Release(notify)
+ else
+ result:=0;
+end;
+procedure MNotifyShow(notify:THANDLE);
+begin
+ if notifyLink<>nil then
+ notifyLink^.Show(notify)
+end;
+procedure MNotifyUpdate(notify:THANDLE);
+begin
+ if notifyLink<>nil then
+ notifyLink^.Update(notify)
+end;
+procedure MNotifyRemove(notify:THANDLE);
+begin
+ if notifyLink<>nil then
+ notifyLink^.Remove(notify)
+end;
+
+procedure MNotifyGetLink;
+begin
+ if PluginLink^.ServiceExists(MS_NOTIFY_GETLINK)<>0 then
+ notifyLink:=PMNOTIFYLINK(CallService(MS_NOTIFY_GETLINK,0,0))
+ else
+ notifyLink:=nil;
+end;
+
+// get helpers
+function MNotifyGetByte(notifyORtype:THANDLE;name:PAnsiChar;defValue:byte):byte;
+var
+ dbv:TDBVARIANT;
+begin
+ MNotifyGet(notifyORtype,name,dbv);
+ if dbv._type<>DBVT_BYTE then
+ result:=defValue
+ else
+ result:=dbv.bVal;
+end;
+function MNotifyGetWord(notifyORtype:THANDLE;name:PAnsiChar;defValue:word):word;
+var
+ dbv:TDBVARIANT;
+begin
+ MNotifyGet(notifyORtype,name,dbv);
+ if dbv._type<>DBVT_WORD then
+ result:=defValue
+ else
+ result:=dbv.wVal;
+end;
+function MNotifyGetDWord(notifyORtype:THANDLE;name:PAnsiChar;defValue:dword):dword;
+var
+ dbv:TDBVARIANT;
+begin
+ MNotifyGet(notifyORtype,name,dbv);
+ if dbv._type<>DBVT_DWORD then
+ result:=defValue
+ else
+ result:=dbv.dVal;
+end;
+function MNotifyGetString(notifyORtype:THANDLE;name:PAnsiChar;defValue:PAnsiChar):PAnsiChar;
+var
+ dbv:TDBVARIANT;
+begin
+ MNotifyGet(notifyORtype,name,dbv);
+ if dbv._type<>DBVT_ASCIIZ then
+ result:=defValue
+ else
+ result:=dbv.szVal.a;
+end;
+function MNotifyGetWString(notifyORtype:THANDLE;name:PAnsiChar;defValue:PWideChar):PWideChar;
+var
+ dbv:TDBVARIANT;
+begin
+ MNotifyGet(notifyORtype,name,dbv);
+ if dbv._type<>DBVT_WCHAR then
+ result:=defValue
+ else
+ result:=dbv.szVal.w;
+end;
+
+// set helpers
+procedure MNotifySetByte(notifyORtype:THANDLE;name:PAnsiChar;value:byte);
+var
+ dbv:TDBVARIANT;
+begin
+ dbv._type:=DBVT_BYTE;
+ dbv.bVal :=value;
+ MNotifySet(notifyORtype,name,dbv);
+end;
+procedure MNotifySetWord(notifyORtype:THANDLE;name:PAnsiChar;value:word);
+var
+ dbv:TDBVARIANT;
+begin
+ dbv._type:=DBVT_WORD;
+ dbv.wVal :=value;
+ MNotifySet(notifyORtype,name,dbv);
+end;
+procedure MNotifySetDWord(notifyORtype:THANDLE;name:PAnsiChar;value:dword);
+var
+ dbv:TDBVARIANT;
+begin
+ dbv._type:=DBVT_DWORD;
+ dbv.dVal :=value;
+ MNotifySet(notifyORtype,name,dbv);
+end;
+procedure MNotifySetString(notifyORtype:THANDLE;name:PAnsiChar;value:PAnsiChar);
+var
+ dbv:TDBVARIANT;
+begin
+ dbv._type :=DBVT_ASCIIZ;
+ dbv.szVal.a:=value;
+ MNotifySet(notifyORtype,name,dbv);
+end;
+procedure MNotifySetWString(notifyORtype:THANDLE;name:PAnsiChar;value:PWideChar);
+var
+ dbv:TDBVARIANT;
+begin
+ dbv._type :=DBVT_WCHAR;
+ dbv.szVal.w:=value;
+ MNotifySet(notifyORtype,name,dbv);
+end;
+*)
+
+const
+// Common options for Get/Set actions
+ NFOPT_TYPENAME = 'General/TypeName';
+ NFOPT_ICON = 'General/Icon';
+ NFOPT_CONTACT = 'General/Contact';
+ NFOPT_EVENT = 'General/Event';
+ NFOPT_TEXT = 'General/Text';
+ NFOPT_TEXTW = 'General/TextW';
+ NFOPT_TITLE = 'General/Title';
+ NFOPT_TITLEW = 'General/TitleW';
+ NFOPT_BACKCOLOR = 'General/BackColor';
+ NFOPT_TEXTCOLOR = 'General/TextColor';
+ NFOPT_TIMEOUT = 'General/Timeout';
+// NFOPT_ONDESTROY = 'General/OnDestroy';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_nudge.inc b/plugins/ExternalAPI/delphi/m_nudge.inc new file mode 100644 index 0000000000..6ec9faf64f --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_nudge.inc @@ -0,0 +1,9 @@ +{$INFDEF NUDGE}
+{$DEFINE NUDGE}
+const
+ MS_SHAKE_CLIST = 'SHAKE/Service/ShakeClist';
+ MS_SHAKE_CHAT = 'SHAKE/Service/ShakeChat';
+ MS_SHAKE_CLIST_TRIGGER = 'SHAKE/Service/TriggerShakeClist';
+ MS_SHAKE_CHAT_TRIGGER = 'SHAKE/Service/TirggerShakeChat';
+ MS_NUDGE_SEND = 'NUDGE/Send';
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_png.inc b/plugins/ExternalAPI/delphi/m_png.inc new file mode 100644 index 0000000000..04129f81e8 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_png.inc @@ -0,0 +1,67 @@ +{
+ Plugin of Miranda IM for reading/writing PNG images.
+ Copyright (c) 2004-5 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/include/m_png.h,v $
+ Revision : $Revision: 1.1 $
+ Last change on : $Date: 2005/10/29 17:10:51 $
+ Last change by : $Author: ghazan $
+}
+
+{$IFNDEF M_PNG}
+{$DEFINE M_PNG}
+{ Image/Dib2Png
+ Converts a Device Independent Bitmap to a png stored in memory
+ wParam=0
+ lParam=(WPARAM)(DIB2PNG*)descr
+}
+type
+ PDIB2PNG = ^TDIB2PNG;
+ TDIB2PNG = record
+ pbmi : PBITMAPINFO;
+ pDiData : PBYTE;
+ pResult : PBYTE;
+ pResultLen : Plong;
+ end;
+
+const
+ MS_DIB2PNG:PAnsiChar = 'Image/Dib2Png';
+
+{ Image/Png2Dib
+ Converts a png stored in memory to a Device Independent Bitmap
+ wParam=0
+ lParam=TPNG2DIB(descr)
+}
+type
+ PPNG2DIB = ^TPNG2DIB;
+ TPNG2DIB = record
+ pSource : PBYTE;
+ cbSourceSize : DWORD;
+ pResult : ^PBITMAPINFOHEADER;
+ end;
+
+const
+ MS_PNG2DIB:PAnsiChar = 'Image/Png2Dib';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_proto_listeningto.inc b/plugins/ExternalAPI/delphi/m_proto_listeningto.inc new file mode 100644 index 0000000000..6a48aed325 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_proto_listeningto.inc @@ -0,0 +1,117 @@ +{
+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}
+{$DEFINE M_PROTO_LISTENINGTO}
+
+// Protocol Services /////////////////////////////////////////////////////////////////
+
+// This is the services a protocol have to support to support listening info
+
+type
+ PLISTENINGTOINFO = ^TLISTENINGTOINFO;
+ TLISTENINGTOINFO = record
+ cbSize :int;
+ szType :TCHAR; // Media type: Music, Video, etc...
+ szArtist:TCHAR; // Artist name
+ szAlbum :TCHAR; // Album name
+ szTitle :TCHAR; // Song name
+ szTrack :TCHAR; // Track number
+ szYear :TCHAR; // Song year
+ szGenre :TCHAR; // Song genre
+ szLength:TCHAR; // Song length
+ szPlayer:TCHAR; // Player name
+ dwFlags :DWORD;
+ end;
+
+const
+ LTI_UNICODE = 1;
+
+const
+{
+ Set the listening info for the protocol.
+ Pass NULL to remove it.
+ wParam = NULL
+ lParam = LISTENINGTOINFO *
+}
+ 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.
+}
+ PS_GET_LISTENINGT = '/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.
+}
+ MS_LISTENINGTO_GETTEXTFORMAT:PAnsiChar = '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.
+}
+ MS_LISTENINGTO_GETPARSEDTEXT:PAnsiChar = '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
+}
+ MS_LISTENINGTO_OVERRIDECONTACTOPTION:PAnsiChar = '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
+}
+ MS_LISTENINGTO_GETUNKNOWNTEXT:PAnsiChar = 'ListeningTo/GetUnknownText';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_quickcontacts.inc b/plugins/ExternalAPI/delphi/m_quickcontacts.inc new file mode 100644 index 0000000000..d82d23f5e7 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_quickcontacts.inc @@ -0,0 +1,31 @@ +{
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_QUICKCONTACTS}
+{$DEFINE M_QUICKCONTACTS}
+
+{
+Show the dialog to select the contact
+
+wParam: ignored
+lParam: ignored
+}
+const
+ MS_QC_SHOW_DIALOG = 'QuickContacts/ShowDialog';
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_radio.inc b/plugins/ExternalAPI/delphi/m_radio.inc new file mode 100644 index 0000000000..0d8775723f --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_radio.inc @@ -0,0 +1,126 @@ +{$IFNDEF M_RADIO}
+{$DEFINE M_RADIO}
+{command codes}
+
+// defined in interfaces.inc
+//const MIID_MRADIO:MUUID='{EEBC474C-B0AD-470F-99A8-9DD9210CE233}';
+
+const
+ MRC_STOP = 0;
+ MRC_PLAY = 1; // lParam is radio contact handle
+ MRC_PAUSE = 2;
+ MRC_PREV = 3;
+ MRC_NEXT = 4;
+ MRC_STATUS = 5; // lParam is RD_STATUS_* value (RD_STATUS_GET only now)
+ MRC_SEEK = 6; // lParam is value in sec; -1 mean obtain current position
+ MRC_RECORD = 7; // lParam is 0 - switch; 1 - on; 2 - off
+ MRC_MUTE = 8;
+
+const
+ // Plugin status (result of RD_STATUS_GET)
+ RD_STATUS_NOSTATION = 0; // no active station found
+ RD_STATUS_PLAYING = 1; // media is playing
+ RD_STATUS_PAUSED = 2; // media is paused
+ RD_STATUS_STOPPED = 3; // media is stopped (only for playlists)
+ RD_STATUS_CONNECT = 4; // plugin try to connect to the station
+ RD_STATUS_ABORT = 5; // plugin want to abort while try to connect
+ // next is for events only
+ RD_STATUS_POSITION = 107; // position was changed
+ RD_STATUS_MUTED = 108; // Mute/Unmute command was sent
+ RD_STATUS_RECORD = 109; // "Record" action called
+ RD_STATUS_NEWTRACK = 110; // new track/station
+ RD_STATUS_NEWTAG = 111; // tag data changed
+ RD_STATUS_NEWSTATION = 112; // new station (contact)
+ // next command is for users
+ RD_STATUS_GET = 6; // to get current status
+
+const
+{
+ Open radio Options, if Main Options window not opened
+ wParam: 0
+ lParam: 0
+}
+ MS_RADIO_SETTINGS:PAnsiChar = 'mRadio/Settings';
+{
+ Switch 'record' mode
+ wParam: not used
+ lParam: 0 - switch mode; else - get record status
+ Return: Current status: 1 - record is ON, 0 - OFF
+}
+ MS_RADIO_RECORD:PAnsiChar = 'mRadio/REC';
+
+{
+ Set current radio volume
+ wParam: volume (0-100)
+ lParam: must be 0
+ Return: previous value
+}
+ MS_RADIO_SETVOL:PAnsiChar = 'mRadio/SetVol';
+
+{
+ Get current radio volume
+ wParam: 0
+ lParam: 0
+ Return: volime value (negative if muted)
+}
+ MS_RADIO_GETVOL:PAnsiChar = 'mRadio/GetVol';
+
+{
+ wParam,lParam = 0
+}
+ MS_RADIO_MUTE:PAnsiChar = 'mRadio/Mute';
+
+{
+ Send command to mRadio
+ wParam: command (see MRC_* constant)
+ lParam: value (usually 0)
+ Return: return value (now for status only)
+}
+ MS_RADIO_COMMAND:PAnsiChar = 'mRadio/Command';
+
+{
+ Starting or stopping radio station
+ wParam: Radio contact handle (lParam=0) or Station name
+ lParam: 0 - wParam is handle, 1 - ANSI, else - unicode
+}
+ MS_RADIO_PLAYSTOP:PAnsiChar = 'mRadio/PlayStop';
+
+{
+ wParam: station handle (0 - all)
+ lParam: nil (through dialog, radio.ini by default) or ansi string with filename
+ Return: exported stations amount
+}
+ MS_RADIO_EXPORT:PAnsiChar = 'mRadio/Export';
+
+{
+ wParam: group to import radio or 0
+ lParam: nil (through dialog, radio.ini by default) or ansi string with filename
+ Return: imported stations amount
+}
+ MS_RADIO_IMPORT:PAnsiChar = 'mRadio/Import';
+
+{
+ wParam: RD_STATUS_* constants
+ lParam: argument
+ RD_STATUS_NEWSTATION - contact handle
+ RD_STATUS_NEWTRACK - URL (unicode)
+ RD_STATUS_PAUSED - 1 - pause, 0 - continued
+ RD_STATUS_RECORD -,0 - off, 1 - on
+}
+ ME_RADIO_STATUS:PAnsiChar = 'mRadio/Status';
+
+{
+ wParam: 0 - switch; 1 - switch on; -1 - switch off
+ lParam: 0
+ Return: last state (0 - was off, 1 - was on)
+}
+ MS_RADIO_EQONOFF:PAnsiChar = 'mRadio/EqOnOff';
+
+{
+ wParam: 0
+ lParam: 0
+ Return: 0, if cancelled, 101 - "mute", 102 - "play/pause", 103 - "stop" or station handle
+}
+ MS_RADIO_TRAYMENU:PAnsiChar = 'mRadio/MakeTrayMenu';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_rssnews.inc b/plugins/ExternalAPI/delphi/m_rssnews.inc new file mode 100644 index 0000000000..cfe4fef5b3 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_rssnews.inc @@ -0,0 +1,51 @@ +{
+ RSSNews plugin
+ by Angelo Luiz Tartari
+}
+
+{$IFNDEF M_RSSNEWS}
+{$DEFINE M_RSSNEWS}
+
+const
+
+(*
+ Retrieve news.
+ wParam = (WPARAM)(HANDLE)hContact
+ lParam = 0
+ Returns: 0 on success, -1 on error.
+*)
+ MS_RSSNEWS_GETNEWS = 'RSSNews/GetNews';
+
+(*
+ Retrieve news (all feeds).
+ wParam = 0
+ lParam = 0
+ Returns: 0 on success, -1 on error.
+*)
+ MS_RSSNEWS_GETALLNEWS = 'RSSNews/GetAllNews';
+
+(*
+ Brings up the add new feed dialog.
+ wParam = 0
+ lParam = 0
+ Returns: 0 on success, -1 on error.
+*)
+ MS_RSSNEWS_ADDNEWFEED = 'RSSNews/AddNewFeed';
+
+(*
+ Brings up the import dialog.
+ wParam = 0
+ lParam = 0
+ Returns: 0 on success, -1 on error.
+*)
+ MS_RSSNEWS_IMPORT = 'RSSNews/Import';
+
+(*
+ Brings up the export dialog.
+ wParam = 0
+ lParam = 0
+ Returns: 0 on success, -1 on error.
+*)
+ MS_RSSNEWS_EXPORT = 'RSSNews/Export';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_sessions.inc b/plugins/ExternalAPI/delphi/m_sessions.inc new file mode 100644 index 0000000000..0cc18a0d33 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_sessions.inc @@ -0,0 +1,347 @@ +{
+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_SESSION}
+{$DEFINE M_SESSION}
+
+// Pipe Messages
+
+{
+ szEntity=szUI, szProto (always != NULL)
+ hSession=yes
+
+ A new entity handle is about to be created to bind .szUI for usage by .szProto,
+ note that this handle is not yet in the handle list and the .szProto will
+ get the message first, then the .szUI will.
+
+ .szUI must set up any instance data within the given hSession,
+ this is done with Sion_EntityCookieSet(hSession,SDR_UI,data).
+
+ .szProto may also set up data to associate with the given hSession,
+ this is done with Sion_EntityCookieSet(hSession,SDR_PROTO,data);
+
+ This message is always sent from the main thread (a thread context switch
+ occurs if needed).
+}
+const
+ ENTITY_CREATE = 1;
+ ENTITY_DESTROY = 2;
+
+// Services/Hooks
+
+{ either .dwTo, dwFrom may have an SDR_* type, and SDR_* flag }
+ SDR_ALL = 1;
+ SDR_SION = 2;
+ SDR_PROTO = 3;
+ SDR_UI = 4;
+
+{ you may extend this structure but .cbSize must stay and the reserved data
+at the end of the structure must not be rewritten into }
+type
+ PIPE_DATA = record
+ cbSize :int;
+ szEntity:PAnsiChar; // can be NULL
+ hSession:THANDLE; // ""
+ dwMsg :DWORD;
+ dwTo :DWORD
+ dwFrom :DWORD; // SDR_*, SDR_ALL is not a good thing
+ wParam :WPARAM;
+ lParam :LPARAM;
+ reserved[0..1] of DWORD; // is actually apart of the structure and is used internally
+ end;
+
+{
+wParam=0
+lParam=(LPARAM)&PIPE_DATA
+
+Issue a call to an entity by name, type or to everyone, if you send
+a message to an entity by name, e.g. "ICQ" it will only goto "ICQ" and not
+to anyone else.
+}
+const
+ MS_SION_PIPE = 'Sion/PipeCall';
+
+{
+wParam=0
+lParam=(LPARAM)&PIPE_DATA
+
+Begin your lovely relationship with everyone else who began a relationship
+before you, uh.. fill a pipe data structure and call this service :
+
+struct PIPE_DATA pd;
+pd.cbSize=sizeof(pd);
+pd.dwTo=SDR_PROTO;
+pd.szEntity="ICQ";
+pd.lParam=(MIRANDASERVICE)MyCallback;
+CallService(MS_SION_PIPEHOOK,0,(LPARAM)&pd);
+
+The service returns 0 on success and non zero on failure, once you have registered either as a UI or a protocol
+your MIRANDASERVICE will be called on the event on a pipe message that is
+either directed to your entity name (.szEntity!=NULL) or by SDR_* type.
+
+Note that the entity name may not be yours, but the pipe system may of been
+instructed to issue the call with the caller's entity name given to you, because
+you know what your entity name is already, you should not rely on .szEntity
+being anything, but if it is there, the message is for you only and no one else
+will get it and the value of .szEntity is dependant on the message.
+}
+ MS_SION_PIPEHOOK = 'Sion/PipeHook';
+
+{
+wParam=0
+lParam=(LPARAM)&SION_ENTITY_DESCRIPTOR
+
+Create an entity handle binded to .szUI and for .szProto, this service will
+switch threads if it needs to to send ENTITY_CREATE to both .szUI and .szProto
+}
+type
+ SION_ENTITY_DESCRIPTOR = record
+ cbSize:int;
+ szUI:PAnsiChar;
+ szProto:PAnsiChar;
+ hSession:THANDLE; // returned if successful
+ end;
+
+const
+ MS_SION_ENTITY_CREATE = 'Sion/EntityCreate';
+
+{
+wParam=0
+lParam=(LPARAM)HANDLE
+
+Decrement the given handle reference count by one, this will cause the
+handle to be freed if the reference count reaches zero, if this is the case
+there will be a thread switch to the main thread (if not called from the main thread)
+
+During handle shutdown, ENTITY_DESTROY will be sent to the protocol and then the UI,
+note that you do not need to give .szUI or .szProto because the handle knows
+who it is binded to.
+}
+ MS_SION_ENTITY_RELEASE = 'Sion/EntityRelease';
+
+{
+wParam=0
+lParam=HANDLE
+
+Add one to the reference count of HANDLE.
+}
+ MS_SION_ENTITY_CLONE = 'Sion/EntityClone';
+
+{
+wParam=0
+lParam=&SION_ENTITY_COOKIE
+
+Given a .hSession and a .dwSdr (SDR_*) code get/set a cookie pointer,
+if you pass data=NULL, then the current data stored for (SDR_*) will be
+returned, if you want to wipe that data, set persist=0
+
+Note that this function is now thread safe for SDR_UI, SDR_PROTO, SDR_SION,
+also note that UI's must store their instance data using this method.
+}
+type
+ SION_ENTITY_COOKIE = record
+ cbSize :int;
+ hSession:THANDLE;
+ dwSdr :dword; // SDR_* type to store data against, this can be SDR_UI or SDR_PROTO
+ data :pointer; // can be NULL
+ persist :int; // if TRUE and data is NULL then data will not be wiped
+ end;
+const
+ MS_SION_ENTITY_SETCOOKIE = 'Sion/EntitySetCookie';
+
+{
+wParam=0
+lParam=&SION_ENTITY_COOKIE
+
+Given .data and SDR_code, finds the associated .hSession and returns
+a reference to it, note that .data can not be NULL, .dwSdr is used
+to match the type of cookie.
+}
+ MS_SION_ENTITY_FINDCOOKIE = 'Sion/EntityFindCookie';
+
+(*
+// -- Helper functions --
+
+__inline int Sion_PipeRegister(DWORD dwSdr,AnsiChar *szEntity,MIRANDASERVICE pfnService)
+{
+ struct PIPE_DATA pd;
+ pd.cbSize=sizeof(struct PIPE_DATA);
+ pd.dwTo=dwSdr;
+ pd.szEntity=szEntity;
+ pd.lParam=(LPARAM)pfnService;
+ return CallService(MS_SION_PIPEHOOK,0,(LPARAM)&pd);
+}
+
+__inline HANDLE Sion_EntityCreate(AnsiChar *szProto, AnsiChar *szUI)
+{
+ struct SION_ENTITY_DESCRIPTOR sed;
+ sed.cbSize=sizeof(sed);
+ sed.szProto=szProto;
+ sed.szUI=szUI;
+ sed.hSession=NULL;
+ if (!CallService(MS_SION_ENTITY_CREATE,0,(LPARAM)&sed) && sed.hSession) {
+ return sed.hSession;
+ }
+ return NULL;
+}
+
+__inline int Sion_EntityRelease(HANDLE seh)
+{
+ return CallService(MS_SION_ENTITY_RELEASE,0,(LPARAM)seh);
+}
+
+__inline int Sion_EntityClone(HANDLE seh)
+{
+ return CallService(MS_SION_ENTITY_CLONE,0,(LPARAM)seh);
+}
+
+__inline void* Sion_EntityCookieGet(HANDLE seh, DWORD dwSdr)
+{
+ struct SION_ENTITY_COOKIE sec;
+ sec.cbSize=sizeof(sec);
+ sec.hSession=seh;
+ sec.dwSdr=dwSdr;
+ sec.data=NULL;
+ sec.persist=1;
+ CallService(MS_SION_ENTITY_SETCOOKIE,0,(LPARAM)&sec);
+ return sec.data;
+}
+
+__inline int Sion_EntityCookieSet(HANDLE seh, DWORD dwSdr, void* cookie)
+{
+ struct SION_ENTITY_COOKIE sec;
+ sec.cbSize=sizeof(sec);
+ sec.hSession=seh;
+ sec.dwSdr=dwSdr;
+ sec.data=cookie;
+ sec.persist=0;
+ return CallService(MS_SION_ENTITY_SETCOOKIE,0,(LPARAM)&sec);
+}
+
+__inline HANDLE Sion_EntityCookieFind(DWORD dwSdr, void* cookie)
+{
+ struct SION_ENTITY_COOKIE sec;
+ sec.cbSize=sizeof(sec);
+ sec.hSession=NULL;
+ sec.dwSdr=dwSdr;
+ sec.data=cookie;
+ CallService(MS_SION_ENTITY_FINDCOOKIE,0,(LPARAM)&sec);
+ return sec.hSession;
+}
+
+__inline int Sion_PipeBroadcast(AnsiChar* szEntity, HANDLE hSession, DWORD dwMsg,
+ WPARAM wParam, LPARAM lParam, DWORD dwFrom, DWORD dwTo) {
+ struct PIPE_DATA pd;
+ pd.cbSize=sizeof(struct PIPE_DATA);
+ pd.szEntity=szEntity;
+ pd.hSession=hSession;
+ pd.dwMsg=dwMsg;
+ pd.dwTo=dwTo;
+ pd.dwFrom=dwFrom;
+ pd.wParam=wParam;
+ pd.lParam=lParam;
+ return CallService(MS_SION_PIPE,0,(LPARAM)&pd);
+}
+*)
+
+{
+--Pipe Convos--
+
+The following is the planned pathway message, not all may make
+it to the final draft.
+
+Because of the nature of some protocols, there are some
+messages that some protocols can ignore since they have no meaning.
+
+SION : sends ENTITY_CREATE after creating a temporary entity handle
+PROTO,
+UI : both UI and protocol store structures as cookies within the handle
+ which it can later fetch. At this point the UI is assumed single
+ contact.
+
+SION : sends a message to the protocol to let it know it should allocate transport
+PROTO: the proto can assume this from ENTITY_CREATE, but I'm not sure this a good idea.
+
+PROTO: Protocol needs to send a message to tell the UI about basic channel stuff
+ like if it is multiple contact from the start (IRC style) or open to change
+ (MSN style) or if it is private and restricted in all forms of JOIN, INVITE, etc.
+UI : Can use this message to present information in a 2 person format even if
+ the protocol level is widly different.
+
+
+SION : ATTACH_CHANNEL or ATTACH_CONTACT
+PROTO: will send "JOIN" or "INVITE" to request a join/a contact
+ this maybe on the transport just created above.
+ These two messages will be have a HPROCESS code
+ that must be acknowledged later.
+
+ Note that if the protocol does not require contacts
+ to be attached in this way (invited) then just fake the
+ ATTACHED_* messages.
+
+ The contacts(s) will be shown in the channel at the UI level
+ even if they are not yet within the channel at the protocol
+ level.
+
+PROTO: sends ATTACHED_CHANNEL or ATTACHED_CONTACT with the HPROCESS
+ code given by the ATTACH_* messages, this is to signal
+ that the JOIN was successful or that the invited contact
+ has joined.
+
+ Note that there maybe more than one ATTACHED_* message.
+
+PROTO: sends a CHANNEL_WHOLIST
+UI : is supposed to listen out for this WHOLIST and present
+ a list of people already inside the channel.
+
+ if for a single user, the channel list maybe hidden.
+
+PROTO: sends a CHANNEL_TOPIC
+UI : displays the topic inside the channel, this message is optional and may not be sent
+
+PROTO: sends a CHANNEL_MODE
+UI : displays the modes that the channel is in, the modes still have to be abstracted
+ to Miranda, e.g. IRC mode +M have another Miranda spec flag.
+
+PROTO: sends a CHANNEL_DONE
+UI : the UI is now sure that no more messages are expected.
+
+UI : sends a UI_TEXT message, with optional source HCONTACT and of course the message.
+PROTO: picks up on this message and transmits it, it must return
+ a HPROCESS code that is later acknowledged.
+
+ It is upto the protocol if it processes this message with the protocol
+ send chain.
+
+PROTO: sends a UI_TEXTED with HPROCESS code given above
+UI : the UI may show the message as 'sent' or show nothing to the user.
+
+UI : sends UI_IAMTYPING
+PROTO: the protocol may or may not send this message to the other parties
+ but it must process it, this message is also optional.
+
+PROTO: sends UI_CONTACT_ISTYPING (source HCONTACT)
+UI : an HCONTACT within the session is typing, the UI may elect to show this
+ message in a status bar, or with a visual effect.
+}
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_shutdown.inc b/plugins/ExternalAPI/delphi/m_shutdown.inc new file mode 100644 index 0000000000..2f99ec3def --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_shutdown.inc @@ -0,0 +1,179 @@ +{
+
+'AutoShutdown'-Plugin for
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright (C) 2004-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 (Shutdown-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_SHUTDOWN}
+{$DEFINE M_SHUTDOWN}
+
+const
+ MIID_SHUTDOWN:TGUID = '{142982A8-88CF-4C65-8721-6DE27D5CE7B5}';
+
+//******************************************************************/
+//************************* SERVICES *******************************/
+//******************************************************************/
+
+{ Show settings dialog v1.3.0.0+
+Shows the dialog by which the shutdown watcher can be started.
+If the dialog is already opened this brings it to foreground.
+ wParam=lParam=0
+Returns 0 on success, nonzero otherwise.
+}
+ MS_AUTOSHUTDOWN_SHOWSETTINGSDIALOG:pAnsiChar = 'AutoShutdown/ShowSettingsDialog';
+
+{ Initiate shutdown process v1.3.0.0+
+Initiates the shutdown process for a given shutdown type.
+If another shutdown process is already pending it will return error.
+Associated events: ME_AUTOSHUTDOWN_OKTOSHUTDOWN, ME_AUTOSHUTDOWN_SHUTDOWN
+ wParam=shutdownType
+ lParam=(LPARAM)(BOOL)fShowConfirmDlg (whether to show the warning dialog or not)
+Returns 0 on success, nonzero otherwise.
+}
+ MS_AUTOSHUTDOWN_SHUTDOWN:pAnsiChar = 'AutoShutdown/Shutdown';
+
+//* shutdown types */
+ SDSDT_CLOSEMIRANDA = 1; // close miranda process
+ SDSDT_SETMIRANDAOFFLINE = 2; // set all protocols to offline
+ SDSDT_LOGOFF = 3; // logoff from Windows
+ SDSDT_REBOOT = 4; // reboot computer
+ SDSDT_SHUTDOWN = 5; // shutdown Windows and power off
+ SDSDT_STANDBY = 6; // standby mode
+ SDSDT_HIBERNATE = 7; // hibernate mode
+ SDSDT_LOCKWORKSTATION = 8; // lock the workstation
+ SDSDT_CLOSERASCONNECTIONS = 9; // close all dialup connections
+ SDSDT_MAX = 9;
+
+{ Get shutdown type description v1.4.0.0+
+Gets a textual description of the given shutdown type.
+ wParam=shutdownType
+ lParam=flags (see GSTDF_* below)
+Returns a static buffer of the description of the given shutdown type.
+It does not need to be freed in any way.
+The returned text is already translated.
+Returns a pointer to a string on success, NULL on error.
+}
+ MS_AUTOSHUTDOWN_GETTYPEDESCRIPTION:pAnsiChar = 'AutoShutdown/GetTypeDescription';
+
+ GSTDF_LONGDESC = $0001; // returns a long description
+ GSTDF_UNICODE = $0002; // returns a Unicode string
+ GSTDF_UNTRANSLATED = $0004; // returns an untranslated string
+
+{ Check if shutdown type is enabled v1.4.0.0+
+Tests if a specific shutdown type is activated and its use is possible
+on the system. For example hibernate and stand-by modes are not available on
+older versions of Windows (needs Windows ME/2000+).
+Shutdown might also be prohibited by security restrictions.
+This services checks it all.
+However, there is no need to call this before calling MS_AUTOSHUTDOWN_SHUTDOWN.
+MS_AUTOSHUTDOWN_SHUTDOWN will fail if the given shutdown type is not enabled.
+ wParam=shutdownType
+ lParam=0
+Returns TRUE if the given shutdown type is enabled, FALSE otherwise.
+}
+ MS_AUTOSHUTDOWN_ISTYPEENABLED:pAnsiChar = 'AutoShutdown/IsTypeEnabled';
+
+{ Start shutdown watcher v1.4.0.0+
+Starts the watcher using the last settings specified on the dialog
+shown by MS_AUTOSHUTDOWN_SHOWSETTINGSDIALOG.
+Call MS_AUTOSHUTDOWN_SHOWSETTINGSDIALOG instead to offer
+options about what watcher to use.
+Associated event: ME_AUTOSHUTDOWN_WATCHERCHANGED
+ wParam=lParam=0
+Returns 0 on success, nonzero otherwise.
+}
+ MS_AUTOSHUTDOWN_STARTWATCHER:pAnsiChar = 'AutoShutdown/StartWatcher';
+
+{ Stop shutdown watcher v1.4.0.0+
+Stops the currently running watcher.
+If the watcher is not running, it returns error.
+Associated event: ME_AUTOSHUTDOWN_WATCHERCHANGED
+ wParam=lParam=0
+Returns 0 on success, nonzero otherwise.
+}
+ MS_AUTOSHUTDOWN_STOPWATCHER:pAnsiChar = 'AutoShutdown/StopWatcher';
+
+{ Check if watcher is running v1.4.0.0+
+Checks if the watcher is currently active or not.
+ wParam=lParam=0
+Returns TRUE if the watcher is enabled, FALSE otherwise.
+}/
+ MS_AUTOSHUTDOWN_ISWATCHERENABLED:pAnsiChar = 'AutoShutdown/IsWatcherEnabled';
+
+//******************************************************************/
+//************************** EVENTS ********************************/
+//******************************************************************/
+
+{ Disallow shutdown process (event) v1.3.0.0+
+Gets fired when MS_AUTOSHUTDOWN_SHUTDOWN is called.
+Parmeters are the same as specified at the call to MS_AUTOSHUTDOWN_SHUTDOWN.
+ wParam=shutdownType
+ lParam=(LPARAM)(BOOL)fShowConfirmDlg
+Return 0 to allow shutdown, 1 to disallow.
+}
+ ME_AUTOSHUTDOWN_OKTOSHUTDOWN:pAnsiChar = 'AutoShutdown/OkToShutdown';
+
+{ Shutdown process started (event) v1.3.0.1+
+Gets fired when ME_AUTOSHUTDOWN_OKTOSHUTDOWN was confirmed.
+Parmeters are the same as specified at the call
+to MS_AUTOSHUTDOWN_SHUTDOWN.
+ wParam=shutdownType
+ lParam=(LPARAM)(BOOL)fShowConfirmDlg
+Unused, return always 0 here.
+}
+ ME_AUTOSHUTDOWN_SHUTDOWN:pAnsiChar = 'AutoShutdown/ShutdownEvent';
+
+{ Watcher changed (event) v1.3.0.0+
+Fired when MS_AUTOSHUTDOWN_STARTWATCHER or MS_AUTOSHUTDOWN_STOPWATCHER
+is called.
+ wParam=(WPARAM)(BOOL)fIsStarted (whether whe watcher is running now)
+ lParam=0
+Unused, return always 0 here.
+}
+ ME_AUTOSHUTDOWN_WATCHERCHANGED:pAnsiChar = 'AutoShutdown/Watcher/Changed';
+
+
+ SETTING_REMEMBERONRESTART_DEFAULT = 0; // SDROR_RUNNING
+ SETTING_SHOWCONFIRMDLG_DEFAULT = 1;
+ SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT = 30; // seconds
+ SETTING_WEATHERSHUTDOWN_DEFAULT = 0;
+ SETTING_HDDOVERHEATSHUTDOWN_DEFAULT = 1;
+ SETTING_SMARTOFFLINECHECK_DEFAULT = 1;
+
+ SETTING_SHUTDOWNTYPE_DEFAULT = SDSDT_SHUTDOWN;
+ SETTING_WATCHERFLAGS_DEFAULT = (SDWTF_SPECIFICTIME|SDWTF_ST_COUNTDOWN);
+ SETTING_COUNTDOWN_DEFAULT = 30;
+ SETTING_COUNTDOWNUNIT_DEFAULT = 60; // x times countdown seconds
+ SETTING_TIMESTAMP_DEFAULT = SETTING_COUNTDOWN_DEFAULT*SETTING_COUNTDOWNUNIT_DEFAULT;
+ SETTING_CPUUSAGETHRESHOLD_DEFAULT = 90; // percent
+
+ SDWTF_SPECIFICTIME = $0001;
+ SDWTF_ST_TIME = $0002;
+ SDWTF_ST_COUNTDOWN = $0004;
+ SDWTF_ST_MASK = $0006; // bitmask for SDWTF_ST_* bits
+ SDWTF_MESSAGE = $0008;
+ SDWTF_FILETRANSFER = $0010;
+ SDWTF_IDLE = $0020;
+ SDWTF_STATUS = $0040;
+ SDWTF_CPUUSAGE = $0080;
+ SDWTF_MASK = $00FF; // bitmask for all SDWTF_* bits
+
+ SDROR_RUNNING = 3;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_simpleaway.inc b/plugins/ExternalAPI/delphi/m_simpleaway.inc new file mode 100644 index 0000000000..16bf2328fb --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_simpleaway.inc @@ -0,0 +1,26 @@ +{$IFNDEF M_SIMPLEAWAY}
+{$DEFINE M_SIMPLEAWAY}
+
+const
+// lParam = (AnsiChar *)status message
+// wParam = new status, from statusmodes.h
+ MS_SA_SETSTATUSMODE = 'SimpleAway/SetStatusMode';
+ MS_AWAYSYS_SETSTATUSMODE = MS_SA_SETSTATUSMODE //for compatibility with some plugins
+
+//Internal use only
+ MS_SA_TTCHANGESTATUSMSG = 'SimpleAway/TTChangeStatusMessage';
+
+//wParam=new status, from statusmodes.h
+//lParam=protocol name, NULL if for all protocols (added in v0.3.1alpha)
+ MS_SA_CHANGESTATUSMSG = 'SimpleAway/ChangeStatusMessage'
+
+// wParam = 0
+// lParam = 0
+// allways returns 1
+ MS_SA_ISSARUNNING = 'SimpleAway/IsSARunning';
+
+// wParam = 0
+// lParam = 0
+ MS_SA_COPYAWAYMSG = 'SimpleAway/CopyAwayMsg';
+
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_smh.inc b/plugins/ExternalAPI/delphi/m_smh.inc new file mode 100644 index 0000000000..134b2075e8 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_smh.inc @@ -0,0 +1,50 @@ +{
+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_SMH}
+{$DEFINE M_SMH}
+
+const
+ EVENTTYPE_STATUSMESSAGE_CHANGE = 9002;
+
+{
+Return TRUE is Status Message History is enabled for this contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_SMH_ENABLED = 'SMH/Enabled';
+
+{
+Enable Status Message History for a contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_SMH_ENABLE = 'SMH/Enable';
+
+{
+Disable Status Message History for a contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_SMH_DISABLE = 'SMH/Disable';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_smileyadd.inc b/plugins/ExternalAPI/delphi/m_smileyadd.inc new file mode 100644 index 0000000000..ecb3ebb7d1 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_smileyadd.inc @@ -0,0 +1,252 @@ +{
+ Miranda SmileyAdd Plugin
+ Plugin support header file
+ Copyright (C) 2004 Rein-Peter de Boer (peacow), and followers
+
+ 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_SMILEYADD}
+{$DEFINE M_SMILEYADD}
+const
+ SAFLRE_INSERTEMF = 2; // insert smiley as EMF into RichEdit, otherwise bitmap
+ // inserted this flag allows "true" transparency
+ SAFLRE_OUTGOING = 4; // Parsing outgoing message
+ SAFLRE_NOCUSTOM = 8; // Do not use custom smileys
+ SAFLRE_FIREVIEW = 16; // use NM_FIREVIEWCHANGE messages
+
+type
+ PSMADD_RICHEDIT3 = ^TSMADD_RICHEDIT3;
+ TSMADD_RICHEDIT3 = record
+ cbSize :uint; // size of the structure
+ hwndRichEditControl:HWND; // handle to the rich edit control
+ rangeToReplace :PCHARRANGE; // same meaning as for normal Richedit use (NULL = replaceall)
+ Protocolname :PAnsiChar; // protocol to use... if you have defined a
+ // protocol, u can use your own protocol name. SmileyAdd will
+ // automatically select the smileypack that is defined for your protocol.
+ // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // if you prefer those icons.
+ // If not found or NULL, "Standard" will be used
+ flags :uint; // Flags (SAFLRE_*) that define the behaivior
+ disableRedraw :BOOL; // Parameter have been depricated, have no effect on operation
+ hContact :THANDLE; // Contact handle
+ end;
+
+{
+ Replace smileys in a rich edit control...
+ wParam = (WPARAM) 0; not used
+ lParam = (LPARAM) (SMADD_RICHEDIT3*) &smre; //pointer to SMADD_RICHEDIT3
+ return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+}
+const
+ MS_SMILEYADD_REPLACESMILEYS:PAnsiChar = 'SmileyAdd/ReplaceSmileys';
+
+type
+ PSMADD_SHOWSEL3 = ^TSMADD_SHOWSEL3;
+ TSMADD_SHOWSEL3 = record
+ cbSize : uint; // size of the structure
+ Protocolname : PAnsiChar; // protocol to use... if you have defined a protocol,
+ // you can use your own protocol name. Smiley add will automatically
+ // select the smileypack that is defined for your protocol.
+ // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // if you prefer those icons.
+ // If not found or NULL: "Standard" will be used
+ xPosition : int; // Postition to place the selectwindow
+ yPosition : int;
+ Direction : int; // Direction (i.e. size upwards/downwards/etc) of
+ // the window 0, 1, 2, 3
+ hwndTarget : HWND; // Window, where to send the message when smiley
+ // is selected.
+ targetMessage: uint; // Target message, to be sent.
+ targetWParam : LPARAM; // Target WParam to be sent (LParam will be PAnsiChar to
+ // select smiley) see the example file.
+ hwndParent : HWND; // Parent window for smiley dialog
+ hContact : THANDLE; // Contact handle
+ end;
+
+{
+ Show smiley selection window
+ wParam = (WPARAM) 0; not used
+ lParam = (LPARAM) (SMADD_SHOWSEL3*) &smre; //pointer to SMADD_SHOWSEL3
+ return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+}
+const
+ MS_SMILEYADD_SHOWSELECTION:PAnsiChar = 'SmileyAdd/ShowSmileySelection';
+
+{
+ get smiley button icon
+ wParam = (WPARAM) 0; not used
+ lParam = (LPARAM) (SMADD_INFO*) &smgi; //pointer to SMADD_INFO
+}
+type
+ PSMADD_INFO2 = ^TSMADD_INFO2;
+ TSMADD_INFO2 = record
+ cbSize : int; // size of the structure
+ Protocolname : PAnsiChar;
+ ButtonIcon : HICON; // RETURN VALUE: this is filled with the
+ // icon handle of the smiley that can be used on the button
+ // do not destroy! NULL if the buttonicon is not defined...
+ NumberOfVisibleSmileys: int; // Number of visible smileys defined.
+ NumberOfSmileys : int; // Number of total smileys defined
+ hContact : THANDLE; //Contact handle
+ end;
+
+const
+ MS_SMILEYADD_GETINFO2:PAnsiChar = 'SmileyAdd/GetInfo2';
+
+// Event notifies that options have changed
+// Message dialogs usually need to redraw it's content on reception of this event
+ ME_SMILEYADD_OPTIONSCHANGED:PAnsiChar = 'SmileyAdd/OptionsChanged';
+
+ SAFL_PATH = 1; // provide smiley file path, icon otherwise
+ SAFL_UNICODE = 2; // string fields in OPTIONSDIALOGPAGE are WCHAR*
+ SAFL_OUTGOING = 4; // Parsing outgoing message
+ SAFL_NOCUSTOM = 8; // Do not use custom smileys
+
+type
+ PSMADD_BATCHPARSE2 = ^TSMADD_BATCHPARSE2;
+ TSMADD_BATCHPARSE2 = record
+ cbSize :uint; // size of the structure
+ Protocolname:PAnsiChar; // protocol to use... if you have defined a protocol, u can
+ // use your own protocol name. Smiley add wil automatically
+ // select the smileypack that is defined for your protocol.
+ // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // if you prefer those icons.
+ // If not found or NULL: "Standard" will be used
+ str :TChar; // String to parse
+ flag :uint; // One of the SAFL_ flags specifies parsing requirements
+ // This parameter should be filled by the user
+ numSmileys :uint; // Number of Smileys found, this parameter filled by SmileyAdd
+ oflag :uint; // One of the SAFL_ flags specifies content of the parse results
+ // this parameter filled by SmileyAdd
+ hContact :THANDLE; // Contact handle
+ end;
+
+type
+ PSMADD_BATCHPARSERES = ^TSMADD_BATCHPARSERES;
+ TSMADD_BATCHPARSERES = record
+ startChar:uint; // Starting smiley character
+ // Because of iterative nature of the API caller should
+ // set this parameter to correct value
+ size :uint; // Number of characters in smiley (0 if not found)
+ // Because of iterative nature of the API caller should
+ // set this parameter to correct value
+ case boolean of
+ false: (filepath:TChar);
+ true: (hIcon:HICON); // User responsible for destroying icon handle
+ end;
+const
+//find all smileys in text, API parses the provided text and returns all smileys found
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSE2*) &smgp; //pointer to SMADD_BATCHPARSE2
+//function returns pointer to array SMADD_BATCHPARSERES records for each smiley found
+//if no smileys found NULL is returned
+//if non NULL value returned pointer must be freed with MS_SMILEYADD_BATCHFREE API
+ MS_SMILEYADD_BATCHPARSE:PAnsiChar = 'SmileyAdd/BatchParse';
+
+//Free memory allocated by MS_SMILEYADD_BATCHPARSE
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSERES*) &smgp; //pointer to SMADD_BATCHPARSERES
+ MS_SMILEYADD_BATCHFREE:PAnsiChar = 'SmileyAdd/BatchFree';
+
+type
+ PSMADD_REGCAT = ^TSMADD_REGCAT;
+ TSMADD_REGCAT = record
+ cbSize :uint; // size of the structure
+ name :PAnsiChar; // smiley category name for reference
+ dispname:PAnsiChar; // smiley category name for display
+ end;
+
+const
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_REGCAT*) &smgp; //pointer to SMADD_REGCAT
+ MS_SMILEYADD_REGISTERCATEGORY:PAnsiChar = 'SmileyAdd/RegisterCategory';
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) Pointer to protocol name or NULL for all;
+ MS_SMILEYADD_RELOAD:PAnsiChar = 'SmileyAdd/Reload';
+
+{
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+}
+
+const
+// Type of Event one of
+ FVCN_PREFIRE = 1;
+ FVCN_POSTFIRE = 2;
+
+// Action of event are going to be done
+ FVCA_NONE = 0;
+ FVCA_DRAW = 1; // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+ FVCA_CUSTOMDRAW = 2;
+// FVCA_INVALIDATE = 3; // (not supported)
+// FVCA_SENDVIEWCHANGE = 4; // (not supported)
+ FVCA_SKIPDRAW = 5;
+
+// Extended NMHDR structure for WM_NOTIFY
+type
+ PFVCNDATA_NMHDR = ^TFVCNDATA_NMHDR;
+ TFVCNDATA_NMHDR = record
+ //NMHDR structure
+ hwndFrom :HWND; // Window of smiley host
+ idFrom :UINT_PTR; // ignored
+ code :UINT; // NM_FIREVIEWCHANGE
+
+ cbSize :size_t;
+ bEvent :Byte; // FVCN_ value - pre- or post- painting
+ bAction :Byte; // FVCA_ keys
+ hDC :HDC; // Canvas to draw on
+ rcRect :TRECT; // Valid/should be in case of FVCA_DRAW
+ clrBackground:COLORREF; // color to fill background if fTransparent is not set
+ fTransparent :BOOL; // if need to fill back color (not supported)
+ lParam :LPARAM; // used by host window PreFire and PostFire event
+ end;
+
+const
+// Code of WM_NOTIFY message (code)
+ NM_FIREVIEWCHANGE = NM_FIRST+1;
+
+type
+ SMADD_CONT = record
+ cbSize :uint;
+ hContact:THANDLE;
+ _type :int; // 0 - directory, 1 - file;
+ path :TChar; // smiley category name for reference
+ end;
+const
+//Loads all smileys for the contact
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_CONT*) &dir; // pointer to directory to load smiley from
+ MS_SMILEYADD_LOADCONTACTSMILEYS:PAnsiChar = 'SmileyAdd/LoadContactSmileys';
+
+{$ENDIF}
\ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_smr.inc b/plugins/ExternalAPI/delphi/m_smr.inc new file mode 100644 index 0000000000..d8feacfc6a --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_smr.inc @@ -0,0 +1,59 @@ +{
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_SMR}
+{$DEFINE M_SMR}
+
+const
+{
+Return TRUE is smr is enabled for this protocol
+If is enabled, status message is kept under CList\StatusMsg db key in user data
+
+wParam: protocol name
+lParam: ignored
+}
+ MS_SMR_ENABLED_FOR_PROTOCOL = 'SMR/MsgRetrievalEnabledForProtocol';
+
+{
+Return TRUE is smr is enabled for this contact and its protocol (smr can be
+disabled per user, if protocol is enabled)
+If is enabled, status message is kept under CList\StatusMsg db key in user data
+
+wParam: hContact
+lParam: ignored
+}
+ MS_SMR_ENABLED_FOR_CONTACT = 'SMR/MsgRetrievalEnabledForUser';
+
+{
+Enable status message retrieval for a contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_SMR_ENABLE_CONTACT = 'SMR/EnableContactMsgRetrieval';
+
+{
+Disable status message retrieval for a contact
+
+wParam: hContact
+lParam: ignored
+}
+ MS_SMR_DISABLE_CONTACT = 'SMR/DisableContactMsgRetrieval';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_snapping_windows.inc b/plugins/ExternalAPI/delphi/m_snapping_windows.inc new file mode 100644 index 0000000000..e3c513482a --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_snapping_windows.inc @@ -0,0 +1,35 @@ +{$IFNDEF SNAPPING_WINDOWS}
+{$DEFINE SNAPPING_WINDOWS}
+
+type
+ PSnapWindowProc = ^TSnapWindowProc;
+ TSnapWindowProc = record
+ hWnd : THWND;
+ m_szMoveOffset : TSIZE;
+ wParam : WPARAM;
+ lParam : LPARAM;
+ Reserved1 : int;
+ Reserved2 : int;
+ Reserved3 : int;
+ end;
+
+const
+ MS_SNAPWINDOWPROC = 'Utils/SnapWindowProc';
+
+function CallSnappingWindowProc(hwnd:hwnd; nMessage:int;
+ wParam:WPARAM;lParam:LPARAM):int;// cdecl;
+const
+ SnapInfo:TSnapWindowProc=();
+begin
+ result:=0;
+ if (nMessage=WM_MOVING) or (nMessage=WM_NCLBUTTONDOWN) or
+ (nMessage=WM_SYSCOMMAND) or (nMessage=WM_SIZING) then
+ begin
+ SnapInfo.hWnd := hwnd;
+ SnapInfo.wParam := wParam;
+ SnapInfo.lParam := lParam;
+ CallService(MS_SNAPWINDOWPROC,WPARAM(@SnapInfo),nMessage);
+ if nMessage=WM_SIZING then result:=1;
+ end;
+end;
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_spamfilter.inc b/plugins/ExternalAPI/delphi/m_spamfilter.inc new file mode 100644 index 0000000000..1e15f7fec4 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_spamfilter.inc @@ -0,0 +1,751 @@ +{
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2003-2004 Heiko 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; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_SPAMFILTER}
+{$DEFINE M_SPAMFILTER}
+
+const
+// Spam Filter Version: 2.5.2.1
+// See "spamcheck.c" in the sources for an example on how to use the spam checking services.
+
+// The functionality and the API of Spam Filter is quite complex
+// and not easy to describe or explain.
+// If you have any question or extension whishes please send me an e-mail:
+// hrathh at users.sourceforge.net
+
+// Notes:
+// * All services are fully thread-safe, you can call everything from any thread
+// (If there are problems with it it is a bug :-) )
+// * Unicode parameters can also be passed to the ANSI version of the plugin
+// and the other way round. The strings get converted as they are needed
+// using automatic two-way translation.
+// Unicode support was added in v2.5.0.0.
+
+// -------------------------------------------
+// -- Getting handles ------------------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_GETHANDLE = 'SpamFilter/GetHandle';
+
+// Description:
+// -------------
+// Gets a specified icon/window handle.
+
+// Parameters:
+// -------------
+// wParam = (UINT)uHandleType (see below);
+// lParam = 0
+
+// Possible values for wParam:
+ SFHT_HWND_PLUGIN_OPTIONS = 2; // HWND of the "Spam Filter" options dialog (if it is loaded; else NULL)
+ SFHT_HICON_SPAM = 3; // HICON of the spam icon (small): needs to be destroyed! (DestroyIcon())
+ // Added in v2.0.2.0:
+ SFHT_HICON_SPAM_LARGE = 4; // HICON of the spam icon (large): needs to be destroyed! (DestroyIcon())
+ SFHT_HICON_SPAM_LAYER = 5; // HICON of the spam layer icon (small): needs to be destroyed! (DestroyIcon())
+ // Icons are taken directly from resources, not skinned by user
+ // Added in v2.0.3.0:
+ SFHT_HWND_ADVERTISMENT_FILTER = 6; // HWND of the "Advertisment Filter" settings dialog (if it is opened; else NULL)
+ SFHT_HWND_ROBOT_FILTER = 7; // HWND of the "Robot Filter" settings dialog (if it is opened; else NULL)
+ SFHT_HWND_DISLIKEDMESSAGES_FILTER = 8; // HWND of the "Disliked Messages Filter" settings dialog (if it is opened; else NULL)
+ // Added in v2.5.0.0:
+ SFHT_HWND_SPAMDEFINITIONS_INFO = 9; // HWND of the "Spam Definitions" info dialog (if it is opened; else NULL)
+ SFHT_HWND_SPAMMERS_INFO = 10; // HWND of the Spammers info dialog (if it is opened; else NULL)
+
+ SFHT_BOOL_IS_UNICODE = 100; // No handle, returns TRUE if Spam Filter is installed as Unicode version, FALSE otherwise
+ // (You probably never need to call this since Spam Filter performs automatic two-way translation
+ // when a service is called)
+
+// Note: Icons are taken directly from resources, they are not skinned by user.
+
+
+// Return Values:
+// --------------
+// Returns the specified handle value: HINSTANCE, HWND, ICON
+//
+// Note:
+// If a handle is not available (or if it was removed) the function will
+// return NULL.
+// When you are using this service you need to check always for the
+// NULL return value.
+
+// -------------------------------------------
+// -- Activating/Deactivating the filters ----
+// -------------------------------------------
+
+ MS_SPAMFILTER_CHANGEFILTERACTIVATION = 'SpamFilter/ChangeFilterActivation';
+
+// Description:
+// -------------
+// Provides the possibility to enable or disable the spam filters.
+// Also updates the checkboxes in the spam filter options if the option dialog is opened.
+
+// Parameters:
+// -------------
+// wParam = (UINT)uFilterType (For possible values see below)
+// lParam = (BOOL)bNewState (new activation state of filter)
+
+// Possible filter type values (uFilterType):
+ SFT_ADVERTISMENT_FILTER = 1;
+ SFT_DISLIKEDMESSAGES_FILTER = 2;
+ SFT_ROBOT_FILTER = 3;
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+// -------------------------------------------
+// -- Showing configure dialogs --------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_SHOWFILTERDIALOG = 'SpamFilter/ShowFilterDialog';
+
+// Description:
+// -------------
+// Shows the configure dialog of the specified filter.
+
+// Parameters:
+// -------------
+// wParam = (HWND)hwndParent (Can be NULL)
+// lParam = (UINT)uFilterType (For possible values see above)
+// -> since 2.0.2.0: If this is zero then the options dialog will be opened pointing to the Spam Filter options.
+// Note:
+// If hwndParent is not NULL the function will not return
+// until the configure dialog is closed.
+// If hwndParent is NULL the Miranda window will be used as parent
+
+// Since 2.0.2.0:
+ SFTEX_OPTIONS_PAGE = 0;
+
+// Since 2.5.0.0:
+// Combine the following flag with the lParam/uFilterType parameter
+// to show the corresponding Spam Definitions info dialog instead
+// of the settings dialog:
+ SFTEXF_SPAMDEFINITIONS_INFO = $2000;
+// Note: SFTEXF_SPAMDEFINITIONS_INFO can't be combined with SFT_ROBOT_FILTER
+
+// Combine the following flag with the lParam/uFilterType of 0 parameter
+// to show the Spammers dialog instead of the settings dialog:
+ SFTEXF_SPAMMERS_INFO = $4000;
+// Note: SFTEXF_SPAMMERS_INFO can't be combined with SFT_*
+
+
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+// Since v2.0.3.0:
+// If the specified settings window is already opened it will be
+// brought to front (reactivated) instead (returns success though).
+// This might be changed however in the future.
+
+// Changed behaviour in v2.0.3.0:
+// If hwndParent was not set then the function returned the handle to the new window.
+// Now the function returns 0 to indicate success instead.
+
+
+// -------------------------------------------
+// -- Adding message types -------------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_REGISTERMESSAGETYPE = 'SpamFilter/MessageTypes/Register';
+
+// Description:
+// -------------
+// Adds a new message type which can be checked for spam.
+// Associated event: ME_SPAMFILTER_PREREGISTERMESSAGETYPE
+
+// Parameters:
+// -------------
+// wParam = 0
+// lParam = (MESSAGETYPEDESC*)mtd (see below)
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+// Already registered message types are:
+// (With pszSection set to the installed network protocol names, e.g. "ICQ")
+ SFMT_AUTHREQUEST = 'Auth';
+ SFMT_ADDED = 'Added'; // since v2.1.0.0
+ SFMT_MESSAGE = 'Msg';
+ SFMT_URL = 'URL';
+ SFMT_FILE = 'File';
+ SFMT_CONTACTS = 'Contacts';
+
+
+// MESSAGETYPEDESC structure:
+type
+ PMESSAGETYPEDESC = ^TMESSAGETYPEDESC;
+ TMESSAGETYPEDESC = record
+ cbSize :Integer; // Set to sizeof(MESSAGETYPEDESC)
+ pszSection :PAnsiChar; // Section of message name for database
+ // e.g. protocol name (Can not be NULL)
+ SectionDescription:TChar; // Readable name of section e.g. protocol name (can be NULL)
+ // Ignored if section existed previously
+ hSectionIcon :THANDLE; // Icon to show for section e.g. protocol icon (can be NULL)
+ // Ignored if section existed previously
+ pszName :PAnsiChar; // Name to refer to message type when spam
+ // checking and in db (Can not be NULL)
+ Description :TChar; // Description for options dialog (can be NULL)
+ hIcon :THANDLE; // EITHER: icon handle representing the message
+ // type OR: one of mirandas skin constants with
+ // a negative sign, e.g (HICON)-SKINICON_EVENT_MESSAGE,
+ // same as for LoadSkinnedIcon() -> can be 0
+ // and can also be a normal icon handle (HICON)
+ bDefaultStatus :BOOL; // Whether checking for this type should be
+ // activated or not by default
+ dwFlags :DWORD; // Flags for the message type (for possible flags see below)
+ iSectionPosition :Integer; // Approx position number for the section in the
+ // options list, lower numbers are nearer to the
+ // top (Can be 0 to be sorted alphabetically)
+ // Ignored if section existed previously (or
+ // if pszSection is NULL) Added in v2.1.1.0
+ iPosition :Integer; // Approx position number for the item in the
+ // options list, lower numbers are nearer to the
+ // top (Can be 0 to be sorted alphabetically)
+ // Added in v2.1.1.0
+ end;
+
+const
+
+// Possible MESSAGETYPEDESC flags:
+ MTDF_DEFAULTDISABLED = $00000001; // Is disabled by default
+ MTDF_HIDDEN = $00000002; // Does not get shown on the options page
+// Since v2.5.0.0
+ MTDF_UNICODE = $00000004; // pszSectionDescription and pszDescription are Unicode strings
+
+
+// -------------------------------------------
+// -- Modify new added message type (Event) --
+// -------------------------------------------
+
+ ME_SPAMFILTER_PREREGISTERMESSAGETYPE = 'SpamFilter/MessageTypes/PreRegister';
+
+// Description:
+// -------------
+// Gets fired before a new message type is added to be checked for spam.
+//
+// This is meant for asking other plugins if the specified default data is ok.
+// Other plugins (especially protocols) can disable a message type if either sending spam
+// is not possible for those protocols or if spam checking would cause unwanted side-effects.
+
+// Warning: Most elements of the MESSAGETYPEDESC structure can also be NULL.
+// However, the structure was checked for errors before this events gets called.
+
+// Parameters:
+// -----------------
+// wParam = 0 (same wParam as used for MS_SPAMFILTER_REGISTERMESSAGETYPE)
+// lParam = (MESSAGETYPEDESC*)mtd (see above, contents can be modified)
+
+// Return Values:
+// -----------------
+// Returning 0 on this event will accept the message type to be added.
+// Returning 1 will prevent the the message type to be added.
+
+// Note: Works as it does now since v2.1.1.0
+
+
+// -------------------------------------------
+// -- Uninstalling a message type ------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_REMOVEMESSAGETYPE = 'SpamFilter/RemoveMessageType';
+
+// Description:
+// -------------
+// Uninstalls a specifed message type. It removes the database setting related to the given message type.
+// Should only be used for uninstalling purposes (e.g in uninstall function of PluginUninstaller)
+
+// Parameters:
+// -------------
+// wParam = (AnsiChar*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before)
+// lParam = (AnsiChar*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before)
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error..
+
+
+// -------------------------------------------
+// -- Message type activation ----------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_ISMESSAGETYPEACTIVATED = 'SpamFilter/MessageTypes/IsActivated';
+
+// Description:
+// -------------
+// Returns if a specified message type is activated or not.
+
+// Parameters:
+// -------------
+// wParam = (AnsiChar*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before)
+// lParam = (AnsiChar*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before)
+
+// Return Values:
+// --------------
+// Returns TRUE if the message type is activated and FALSE otherwise.
+
+
+// -------------------------------------------
+// -- Reset AutoIgnore counters --------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_RESETAUTOIGNORE = 'SpamFilter/AutoIgnore/Reset';
+
+// Description:
+// -------------
+// Resets the list in which the total number of spam sent by
+// each user is kept.
+// The list is necessary to determine when a particular user reached the
+// allowed spam messages limit.
+
+// Parameters:
+// -------------
+// wParam = (BOOL)bOnlyCount (if TRUE the service will only return the user count without doing reset)
+// lParam = 0
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+// -----------------------------------------
+// -- Spam Checking ------------------------
+// -----------------------------------------
+
+ MS_SPAMFILTER_ADVERTISMENTCHECK = 'SpamFilter/AdvertismentCheck';
+ MS_SPAMFILTER_DISLIKEDMESSAGESCHECK = 'SpamFilter/DislikedMessagesCheck';
+ MS_SPAMFILTER_ROBOTCHECK = 'SpamFilter/RobotCheck';
+
+// Description:
+// -------------
+// These services provide the possibility to check a specified text for contained spam.
+// The function checks for everything that is activated in the plugin's options.
+
+// Note: These functions work as they do now since v2.1.0.0
+
+// Parameters:
+// -------------
+// wParam = (SPAMCHECKDATA*)scd
+// lParam = 0
+
+// SPAMCHECKDATA structure:
+type
+ PSPAMCHECKDATA = ^TSPAMCHECKDATA;
+ TSPAMCHECKDATA = record
+ cbSize :Integer; // sizeof(SPAMCHECKDATA)
+ pszMsgTypeSection:PAnsiChar; // The section of the message type string: You need
+ // to use MS_SPAMFILTER_REGISTERMESSAGETYPE before
+ pszMsgTypeName :PAnsiChar; // Description of the message: You need to use
+ // MS_SPAMFILTER_REGISTERMESSAGETYPE before
+ MsgText :TChar; // Pointer to the text of a message which is
+ // checked for spam. Can be NULL.
+ dwFlags :DWORD; // Flags for the spam checking. (For more details see below.)
+ case LongInt of
+ 0: (hContact: HCONTACT); // Handle to the sending contact (use pszUserName
+ // instead if no hContact is available)
+ 1: (UserName: TChar); // Name of the user, e.g. nick (set SCDF_NO_CONTACT
+ // in the flags to use this parameter) -> should
+ // be as unique as possible
+ end;
+
+const
+// Possible flags in the SPAMCHECKDATA structure:
+ SCDF_NO_NOTIFY = $00000001; // Don't show a popup, play sound or log to file if the message is spam.
+ SCDF_NO_CANCEL = $00000002; // Do check even if user pressed control key to avoid the spam check manually
+ SCDF_NO_AUTOIGNORE = $00000004; // Do not use the AutoIgnore feature for this check
+ SCDF_NO_CONTACT = $00000008; // Use pszUserName instead of hContact of union
+// Since v2.5.0.0:
+ SCDF_UNICODE = $00000010; // Specify this flag if associated message text and/or user name is Unicode
+
+
+// Return Values:
+// --------------
+// Possible return flags:
+ SFF_MARKREAD = $00000010; // Flag
+ SFF_DELETE = $00000020; // Flag
+ SFF_IGNORE = $00000040; // Flag
+ SFF_SENDMSG_NOTIFY = $00000100; // Flag, Only MS_SPAMFILTER_DISLIKEDMESSAGESCHECK
+ SFF_SENDMSG_INSTRUCTION = $00000200; // Flag, Only MS_SPAMFILTER_ROBOTCHECK
+ SFF_SENDMSG_CONFIRMATION = $00000400; // Flag, Only MS_SPAMFILTER_ROBOTCHECK
+ SFF_TESTPASSED = $00000080; // Flag, Only MS_SPAMFILTER_ROBOTCHECK
+ SFF_ISSPAM = $00000002; // Flag
+ SFF_ISNORMAL = $00000001; // Flag
+// Since 2.5.2.0:
+ SFF_HIDE = $00001000; // Flag, Only MS_SPAMFILTER_ROBOTCHECK
+
+// -------------------------------------------
+// -- Getting additional Check Info ----------
+// -------------------------------------------
+
+ MS_SPAMFILTER_GETSPAMCHECKINFO = 'SpamFilter/GetSpamCheckInfo';
+
+// Description:
+// -------------
+// Gets data needed for the processing of spam mesages.
+
+// Parameters:
+// -------------
+// wParam = (DWORD)dwDataType (For possible values see below)
+// lParam = depends on wParam (see below)
+
+// Possible values for lParam:
+
+// TRUE/FALSE: if the specified filter is enabled
+ SFSCI_ACTIVATION_FILTER = 1; // lParam = uFilterType (For possible values see above)
+
+// Strings: Get the message texts specified by the user
+// ANSI
+ SFSCI_MSGTEXT_NOTIFYA = 2; // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pszUserName) and scd->pszMsgText (and scd->cbSize) should be filled in.
+ SFSCI_MSGTEXT_INSTRUCTIONA = 3; // lParam: see SFSCI_MSGTEXT_NOTIFYA
+ SFSCI_MSGTEXT_CONFIRMATIONA = 4; // lParam: see SFSCI_MSGTEXT_NOTIFYA
+
+// Unicode (since v2.5.0.0)
+ SFSCI_MSGTEXT_NOTIFYW = 6; // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pwszUserName) and scd->pwszMsgText (and scd->cbSize) should be filled in.
+ SFSCI_MSGTEXT_INSTRUCTIONW = 7; // lParam: see SFSCI_MSGTEXT_NOTIFYW
+ SFSCI_MSGTEXT_CONFIRMATIONW = 8; // lParam: see SFSCI_MSGTEXT_NOTIFYW
+
+// TRUE/FALSE: if the above message text should be added to history.
+ SFSCI_ADD_TO_HISTORY = 5; // lParam = SFSCI_MSGTEXT_NOTIFY(A/W), SFSCI_MSGTEXT_INSTRUCTION(A/W) or SFSCI_MSGTEXT_CONFIRMATION(A/W)
+
+// Since 2.5.2.0:
+// Counts of milliseconds to delay the above message texts sending.
+ SFSCI_DELAY_TIME_REPLY = 9; // lParam=0
+
+
+// Return Values:
+// --------------
+// SFSCI_ACTIVATION_FILTER -> (BOOL)TRUE/FALSE
+// SFSCI_DELAY_TIME_REPLY -> (BOOL)TRUE/FALSE
+
+// SFSCI_MSGTEXT_NOTIFYA -> (AnsiChar*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved)
+// SFSCI_MSGTEXT_INSTRUCTIONA -> see SFSCI_MSGTEXT_NOTIFYA
+// SFSCI_MSGTEXT_CONFIRMATIONA -> see SFSCI_MSGTEXT_NOTIFYA
+
+// SFSCI_MSGTEXT_NOTIFYW -> (WCHAR*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved)
+// SFSCI_MSGTEXT_INSTRUCTIONW -> see SFSCI_MSGTEXT_NOTIFYW
+// SFSCI_MSGTEXT_CONFIRMATIONW -> see SFSCI_MSGTEXT_NOTIFYW
+
+// SFSCI_ADD_TO_HISTORY -> (BOOL)TRUE/FALSE
+
+// returns NULL on error
+
+
+// -------------------------------------------
+// -- Confirm spam check (Event) -------------
+// -------------------------------------------
+
+ ME_SPAMFILTER_OKTOSPAMCHECK = 'SpamFilter/OkToSpamCheck';
+
+// Description:
+// -------------
+// Gets fired before the spam check for a message starts.
+
+// Parameters:
+// -----------------
+// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct)
+// lParam = (UINT)uFilterType (For possible values see above)
+
+// Return Values:
+// -----------------
+// Returning 0 on this event will accept spam checking for the message,
+// Returning 1 will prevent the spam check.
+
+
+// -------------------------------------------
+// -- Confirm spam detection (Event) ---------
+// -------------------------------------------
+
+ ME_SPAMFILTER_OKTOSPAMDETECTION = 'SpamFilter/OkToSpamDetection';
+
+// Description:
+// -------------
+// Gets fired after a spam message is detected.
+
+// Parameters:
+// -----------------
+// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct)
+// lParam = (UINT)uFilterType (For possible values see above)
+
+// Return Values:
+// -----------------
+// Returning 0 on this event will accept the spam detection
+// Returning 1 cause the message not to be seen as spam.
+
+// Note: If you only would like to get the final result hook
+// ME_SPAMFILTER_SPAMRECEIVED instead
+
+
+// -------------------------------------------
+// -- Spam message received (Event) ----------
+// -------------------------------------------
+
+ ME_SPAMFILTER_SPAMRECEIVED = 'SpamFilter/SpamReceived';
+
+// Description:
+// -------------
+// Gets fired when a message if recognized as spam.
+
+// Parameters:
+// -----------------
+// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct)
+// lParam = (UINT)uFilterType (For possible values see above)
+
+// Return Values:
+// -----------------
+// The return value should be 0.
+
+
+// -------------------------------------------
+// -- Spam Filter loaded (Event) -------------
+// -------------------------------------------
+
+ ME_SPAMFILTER_MODULELOADED = 'SpamFilter/ModuleLoaded';
+
+// Description:
+// -------------
+// Gets fired when a all parts of the "Spam Filter" were loaded and available
+// to other plugins.
+// Past this event all functionality of the plugin is fully available.
+// The event works quite similar as ME_SYSTEM_MODULESLOADED.
+// You can use ME_SYSTEM_MODULESLOADED in most cases instead. Please do so!
+
+// Parameters:
+// -----------------
+// wParam = 0
+// lParam = 0
+
+// Return Values:
+// -----------------
+// The return value should be 0.
+
+
+
+// -------------------------------------------
+// -- Helper: Duplicate SPAMCHECKDATA --------
+// -------------------------------------------
+
+ MS_SPAMFILTER_COPYSPAMCHECKDATA = 'SpamFilter/SpamCheckData/Copy';
+
+// Description:
+// -------------
+// Copys all contents of a SPAMCHECKDATA struct (especially strings) to another one
+// using Miranda's Memory Manager Interface (see m_system.h).
+// Use MS_SPAMFILTER_FREESPAMCHECKDATA to free the result when no longer needed.
+
+// Available since 2.5.2.0.
+
+// Parameters:
+// -------------
+// wParam = (SPAMCHECKDATA*)pscdTo
+// lParam = (SPAMCHECKDATA*)pscdFrom
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+
+// -------------------------------------------
+// -- Helper: Free SPAMCHECKDATA -------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_FREESPAMCHECKDATA = 'SpamFilter/SpamCheckData/Free';
+
+// Description:
+// -------------
+// Frees the memory allocated by MS_SPAMFILTER_COPYSPAMCHECKDATA.
+// using Miranda's Memory Manager Interface (see m_system.h).
+
+// Available since 2.5.2.0.
+
+// Parameters:
+// -------------
+// wParam = (SPAMCHECKDATA*)pscd
+// lParam = 0
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on failure.
+
+
+
+// -------------------------------------------
+// -- Showing error messages -----------------
+// -------------------------------------------
+
+ MS_SPAMFILTER_SHOWERROR = 'SpamFilter/ShowError';
+
+// Description:
+// -------------
+// Shows a Miranda try balloon tip, popup or message box
+// with the specified error message.
+
+// Parameters:
+// -------------
+// wParam = (UINT)uErrorType (For possible values see below)
+// lParam = 0
+
+// Possible values for wParam:
+ SFSE_CRITICAL_ERROR = 1; // Unspecified critical error occured related to spam checking.
+ // Only use this for situations that may never ever occur.
+ // Please do avoid this if possible.
+
+ SFSE_SEND_FAILED = 2; // Show this error when a sending of SFSCI_MSGTEXT_NOTIFY,
+ // SFSCI_MSGTEXT_INSTRUCTION, or SFSCI_MSGTEXT_CONFIRMATION failed
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+
+// -------------------------------------------
+// -- Set contact as spammer (Contact) -------
+// -------------------------------------------
+
+ MS_SPAMFILTER_CONTACT_SETASSPAMMER = 'SpamFilter/Contact/SetAsSpammer';
+
+// Description:
+// -------------
+// This service adds a specified user to the spammer list (fully ignored).
+
+// Note: works same as MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG
+// but does not prompt the user.
+
+// Available since v2.5.0.0
+
+// Parameters:
+// -------------
+// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.)
+// lParam = (DWORD)dwFlags (flags about what should be done, see below)
+
+// Available Flags:
+ SCASF_NO_NOTIFY = $00000001; // Prevents logging and playing of sounds
+ SCASF_USE_ROBOT_SOUND = $00000002; // play robot sound instead of advertisment sound (only if SCASF_NO_NOTIFY is not set)
+ SCASF_NO_REMOVE_HISTORY = $00000004; // history is marked read instead of fully removed
+ SCASF_NO_DENY_AUTHREQUESTS = $00000008; // do not deny pending auth requests
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+// -------------------------------------------
+// -- Show mark spammer dialog (Contact) -----
+// -------------------------------------------
+
+ MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG = 'SpamFilter/Contact/ShowSetAsSpammerDialog';
+
+// Description:
+// -------------
+// This service adds a specified user to the spammer list.
+// Before it shows a dialog to let the user confirm the action.
+// For use for example as action for a button on the message dialog.
+
+// Note: This service performs the same tasks as MS_SPAMFILTER_SETCONTACTASSPAMMER
+// to execute the action the user chooses.
+
+// Available since v2.5.0.0
+
+// Parameters:
+// -------------
+// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.)
+// lParam = (HWND)hwndParent (Handle to the parent window. Can be NULL.)
+
+// Return Values:
+// --------------
+// Returns FALSE if user clicked cancel on the dialog.
+// TRUE if the contact was handled as spammer.
+
+
+// Changed in v2.5.0.0:
+// The service MS_SPAMFILTER_SETSPAMMANUALLY has been deprecated.
+// New plugins should use MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG instead.
+ MS_SPAMFILTER_SETSPAMMANUALLY = 'SpamFilter/SetSpamManually';
+
+
+// -------------------------------------------
+// -- Test if contact is spammer (Contact) ---
+// -------------------------------------------
+
+ MS_SPAMFILTER_CONTACT_ISSPAMMER = 'SpamFilter/Contact/IsSpammer';
+
+// Description:
+// -------------
+// This service tests if a specified contact is on the spammer list (fully ignored).
+
+// Available since v2.5.0.0
+
+// Parameters:
+// -------------
+// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.)
+// lParam = 0
+
+// Return Values:
+// --------------
+// Returns TRUE when the contact is on the spammer list, FALSE otherwise.
+
+
+// -------------------------------------------
+// -- Unmarks a contact as spammer (Contact) -
+// -------------------------------------------
+
+ MS_SPAMFILTER_CONTACT_UNSETSPAMMER = 'SpamFilter/Contact/UnSetSpammer';
+
+// Description:
+// -------------
+// This service restores a spammer to be again a normal contact (unignored).
+
+// Available since v2.5.0.0
+
+// Parameters:
+// -------------
+// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.)
+// lParam = 0
+
+// Return Values:
+// --------------
+// Returns 0 on success, nonzero on error.
+
+
+// -------------------------------------------
+// -- Spammer state changed (Event) ----------
+// -------------------------------------------
+
+ ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED = 'SpamFilter/Contact/SpammerStateChanged';
+
+// Description:
+// -------------
+// Gets fired when a a contact gets marked as spammer or unmarked.
+
+// Parameters:
+// -----------------
+// wParam = (HANDLE)hContact
+// lParam = (BOOL)bIsSpammer (new state)
+
+// Return Values:
+// -----------------
+// The return value should be 0.
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_speak.inc b/plugins/ExternalAPI/delphi/m_speak.inc new file mode 100644 index 0000000000..d8a9a4bfbe --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_speak.inc @@ -0,0 +1,267 @@ +{
+Copyright (C) 2007 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_SPEAK}
+{$DEFINE M_SPEAK}
+
+(*
+There is 2 ways of using the speak plugin:
+
+1. Older and simple way: just call
+ Speak_Say(hContact, _T("text to speak"))
+and the text will be spoken using contact settings. If hContact is NULL, it will use
+system settings.
+Previous versions only had an ascii version, so if you want to support then you need
+to call
+ Speak_SayA(hContact, "text to speak")
+
+
+2. Integrating with meSpeak GUI: for that you have first to register a speak type and
+then call the speak functions. In both case you have 2 options:
+
+2.1 Sending the full text: meSpeak GUI will only allow to enable/disable the type.
+To register call (in modules loaded):
+ Speak_Register("PluginName (DB key)", "name", "Prety name for GUI", "icon_xyz")
+And to speak call:
+ Speak_SayEx("name", hContact, _T("text to speak"))
+
+2.2 Using templates: you will not pass the text, but some variables. meSpeak handles
+the GUI to allow the user to create the text for those variables. These functions
+end with WT (with templates).
+To register call (in modules loaded):
+ AnsiChar *templates[] = { "Name\nDefault\n%var1%\tDescription 1\n%var2%\tDescription2\n%var3%\tDescription 3" };
+ Speak_RegisterWT("PluginName (DB key)", "name", "Prety name for GUI", "icon_xyz",
+ templates, 1);
+And to speak call:
+ TCHAR *variables[] = { _T("var1"), _T("Value 1"), _T("var2"), _T("Value 2"), _T("var3"), _T("Value 3") };
+ Speak_SayExWT("name", hContact, 0, variables, 3);
+*)
+
+const
+ MIID_SPEAK = '{1EF72725-6A83-483B-AA50-8953E359EEAD}';
+
+ {*
+ Speak a text
+
+ wParam: (HANDLE) hContact
+ lParam: (AnsiChar *) text
+ return: 0 on success
+ *}
+ MS_SPEAK_SAY_A = 'Speak/Say';
+
+ {*
+ Speak a unicode text
+
+ wParam: (HANDLE) hContact
+ lParam: (WCHAR *) text
+ return: 0 on success
+ *}
+ MS_SPEAK_SAY_W = 'Speak/SayW';
+
+type
+ PSPEAK_TYPE = ^TSPEAK_TYPE;
+ TSPEAK_TYPE = record
+ cbSize: integer;
+ module: PAnsiChar;
+ name: PAnsiChar; // Internal type name
+ description: PAnsiChar; // Will be translated
+ icon: PAnsiChar; // Name off icolib icon
+ // Aditional data if wants to use add to history services
+ templates: ^PAnsiChar; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription"
+ numTemplates: integer;
+ end;
+
+const
+ {*
+ Register and speak type
+
+ wParam: (SPEAK_TYPE *) type
+ lParam: 0
+ return: 0 on success
+ *}
+ MS_SPEAK_REGISTER = 'Speak/Register';
+
+const
+ SPEAK_CHAR = 1;
+ SPEAK_WCHAR = 2;
+
+type
+ PSPEAK_ITEM = ^TSPEAK_ITEM;
+ TSPEAK_ITEM = record
+ cbSize: integer;
+ _type: PAnsiChar; // Internal type name
+ hContact: THandle;
+ flags: integer; // SPEAK_*
+ templateNum: integer; // -1 to use text
+ case boolean of
+ true: (text: PAnsiChar);
+ false: (
+ variables: Pointer;
+ numVariables: integer;
+ );
+ end;
+
+const
+ {*
+ Speak a text
+
+ wParam: (SPEAK_ITEM *) Item
+ lParam: 0
+ return: 0 on success
+ *}
+ MS_SPEAK_SAYEX = 'Speak/SayEx';
+
+
+{$IFDEF I_AM_A_CONSTANT_THAT_IS_NEVER_DEFINED_BUT_ALLOWS_THE_CODE_BELOW_NOT_TO_BE_COMMENTED}
+// Helper functions
+
+static int Speak_SayA(HANDLE hContact, const AnsiChar *text)
+{
+ return CallService(MS_SPEAK_SAY_A, (WPARAM) hContact, (LPARAM) text);
+}
+
+static int Speak_SayW(HANDLE hContact, const WCHAR *text)
+{
+ return CallService(MS_SPEAK_SAY_W, (WPARAM) hContact, (LPARAM) text);
+}
+
+static int Speak_Register(AnsiChar *module, AnsiChar *name, AnsiChar *description, AnsiChar *icon)
+{
+ SPEAK_TYPE type;
+
+ if (!ServiceExists(MS_SPEAK_REGISTER))
+ return -1;
+
+ type.cbSize = sizeof(type);
+ type.module = module;
+ type.name = name;
+ type.description = description;
+ type.icon = icon;
+ type.templates = NULL;
+ type.numTemplates = 0;
+
+ return CallService(MS_SPEAK_REGISTER, (WPARAM) &type, 0);
+}
+
+static int Speak_RegisterWT(const AnsiChar *module, const AnsiChar *name, const AnsiChar *description,
+ const AnsiChar *icon, AnsiChar **templates, int numTemplates)
+{
+ SPEAK_TYPE type;
+
+ if (!ServiceExists(MS_SPEAK_REGISTER))
+ return -1;
+
+ type.cbSize = sizeof(type);
+ type.module = module;
+ type.name = name;
+ type.description = description;
+ type.icon = icon;
+ type.templates = templates;
+ type.numTemplates = numTemplates;
+
+ return CallService(MS_SPEAK_REGISTER, (WPARAM) &type, 0);
+}
+
+static int Speak_SayExA(AnsiChar *type, HANDLE hContact, const AnsiChar *text)
+{
+ SPEAK_ITEM item;
+
+ if (!ServiceExists(MS_SPEAK_SAYEX))
+ // Try old service
+ return Speak_SayA(hContact, text);
+
+ item.cbSize = sizeof(item);
+ item.flags = SPEAK_CHAR;
+ item.type = type;
+ item.hContact = hContact;
+ item.templateNum = -1;
+ item.text = text;
+
+ return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0);
+}
+
+static int Speak_SayExW(AnsiChar *type, HANDLE hContact, const WCHAR *text)
+{
+ SPEAK_ITEM item;
+
+ if (!ServiceExists(MS_SPEAK_SAYEX))
+ // Try old service
+ return Speak_SayW(hContact, text);
+
+ item.cbSize = sizeof(item);
+ item.flags = SPEAK_WCHAR;
+ item.type = type;
+ item.hContact = hContact;
+ item.templateNum = -1;
+ item.text = text;
+
+ return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0);
+}
+
+static int Speak_SayExWTA(AnsiChar *type, HANDLE hContact, int templateNum, AnsiChar **variables, int numVariables)
+{
+ SPEAK_ITEM item;
+
+ if (!ServiceExists(MS_SPEAK_SAYEX))
+ return -1;
+
+ item.cbSize = sizeof(item);
+ item.flags = SPEAK_CHAR;
+ item.type = type;
+ item.hContact = hContact;
+ item.templateNum = templateNum;
+ item.variables = variables;
+ item.numVariables = numVariables;
+
+ return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0);
+}
+
+static int Speak_SayExWTW(AnsiChar *type, HANDLE hContact, int templateNum, WCHAR **variables, int numVariables)
+{
+ SPEAK_ITEM item;
+
+ if (!ServiceExists(MS_SPEAK_SAYEX))
+ return -1;
+
+ item.cbSize = sizeof(item);
+ item.flags = SPEAK_WCHAR;
+ item.type = type;
+ item.hContact = hContact;
+ item.templateNum = templateNum;
+ item.variables = variables;
+ item.numVariables = numVariables;
+
+ return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0);
+}
+
+
+#ifdef UNICODE
+# define MS_SPEAK_SAY MS_SPEAK_SAY_W
+# define Speak_Say Speak_SayW
+# define Speak_SayEx Speak_SayExW
+# define Speak_SayExWT Speak_SayExWTW
+#else
+# define MS_SPEAK_SAY MS_SPEAK_SAY_A
+# define Speak_Say Speak_SayA
+# define Speak_SayEx Speak_SayExA
+# define Speak_SayExWT Speak_SayExWTA
+#endif
+
+{$ENDIF}
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_spellchecker.inc b/plugins/ExternalAPI/delphi/m_spellchecker.inc new file mode 100644 index 0000000000..cd636e1754 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_spellchecker.inc @@ -0,0 +1,68 @@ +{
+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}
+{$DEFINE M_SPELLCHECKER}
+
+type
+ SPELLCHECKER_ITEM = record
+ cbSize :int;
+ hContact :THANDLE; // The contact to get the settings from, or NULL
+ hwnd :HWND; // The hwnd of the richedit
+ window_name:PAnsiChar; // A name for this richedit
+ end;
+
+type
+ SPELLCHECKER_POPUPMENU = record
+ cbSize :int;
+ hwnd :HWND; // The hwnd of the richedit
+ hMenu :HMENU; // The handle to the menu
+ pt :TPOINT; // The point, in screen coords
+ hwndOwner:HWND; // The hwnd of owner of the popup menu. If it is null, hwnd is used
+ end;
+
+const
+{
+Adds a richedit control for the spell checker to check
+
+wParam: SPELLCHECKER_ITEM *
+lParam: ignored
+return: 0 on success
+}
+ MS_SPELLCHECKER_ADD_RICHEDIT = 'SpellChecker/AddRichedit';
+
+{
+Removes a richedit control for the spell checker to check
+
+wParam: HWND
+lParam: ignored
+return: 0 on success
+}
+ 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
+}
+ MS_SPELLCHECKER_SHOW_POPUP_MENU = 'SpellChecker/ShowPopupMenu';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_statusplugins.inc b/plugins/ExternalAPI/delphi/m_statusplugins.inc new file mode 100644 index 0000000000..5925be2d6a --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_statusplugins.inc @@ -0,0 +1,181 @@ +{
+ 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)
+type
+ PROTOCOLSETTINGEX = record
+ cbSize :integer;
+ szName :PAnsiChar; // pointer to protocol modulename
+ szMsg :TChar; // pointer to the status message (may be NULL)
+ status :word; // the status
+ lastStatus:word; // last status
+ tszAccName:TChar;
+ end;
+
+const
+// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
+// lParam = 0
+// returns 0 on success
+ MS_CS_SETSTATUSEX:PAnsiChar = 'CommonStatus/SetStatusEx';
+
+// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
+// lParam = timeout
+// returns hwnd
+ MS_CS_SHOWCONFIRMDLGEX:PAnsiChar = 'CommonStatus/ShowConfirmDialogEx';
+
+// wParam = 0
+// lParam = 0
+// returns the number of protocols registerd
+ MS_CS_GETPROTOCOUNT:PAnsiChar = 'CommonStatus/GetProtocolCount'; // added dec '04
+
+// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
+// lParam = 0
+ ME_CS_STATUSCHANGEEX:PAnsiChar = 'CommonStatus/StatusChangeEx';
+{
+// wParam = protoCount
+// lParam = 0
+ ME_CS_CSMODULELOADED:PAnsiChar = 'CommonStatus/CommonStatusLoaded';
+}
+// -- 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
+ MS_SS_GETPROFILE:PAnsiChar = 'StartupStatus/GetProfile'; // don't use this > jan '05, internal use only
+
+// wParam = profile number
+// lParam = 0
+// return 0 on success
+ MS_SS_LOADANDSETPROFILE:PAnsiChar = 'StartupStatus/LoadAndSetProfile'; // you can use this
+
+// wParam = int*, maybe NULL sets this int to the default profile number
+// lParam = 0
+// returns profile count
+ MS_SS_GETPROFILECOUNT:PAnsiChar = 'StartupStatus/GetProfileCount';
+
+// wParam = profile number
+// lParam = AnsiChar* (must be allocated, size = 128)
+// returns 0 on success
+ MS_SS_GETPROFILENAME:PAnsiChar = 'StartupStatus/GetProfileName';
+
+// -- AdvancedAutoAway --
+type
+ STATES = [
+ 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
+
+// STATUS1_SET2, // first status change happened, but user may be active ('on inactive only was disabled')
+// STATUS2_SET2 // second status change happened, but user may be active ('on inactive only was disabled')
+ ];
+
+type
+ AUTOAWAYSETTING = record
+ protocolSetting :^PROTOCOLSETTINGEX;
+ originalStatusMode:int; // this is set only when going from ACTIVE to
+ // STATUS1_SET (or to STATUS2_SET)
+ // (note: this is therefore not always valid)
+ oldState :STATES; // state before the call
+ curState :STATES; // current state
+ bstatusChanged :bool; // the status of the protocol will actually be changed
+ // (note: unlike the name suggests, the status is
+ // changed AFTER this hook is called)
+ bManual :bool; // state changed becuase status was changed manually
+ end;
+
+// 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
+const
+ ME_AAA_STATECHANGED:PAnsiChar = 'AdvancedAutoAway/StateChanged';
+{
+type
+ AAAOPTPAGE = record
+ cbSize :int;
+ pszText :PAnsiChar;
+ hInst :HINSTANCE;
+ pfnDlgProc :DLGPROC;
+ pszTemplate:PAnsiChar;
+ end;
+
+const
+// lParam=(LPARAM)(AAAOPTPAGE)&aop
+ MS_AAA_REGISTEROPTIONPAGE:PAnsiChar = 'AdvancedAutoAway/RegisterOptionPage';
+}
+// -- KeepStatus --
+ KS_CONN_STATE_LOST = 1; // lParam = protocol
+ KS_CONN_STATE_OTHERLOCATION = 2; // lParam = protocol
+ KS_CONN_STATE_RETRY = 3; // lParam = nth retry
+ KS_CONN_STATE_STOPPEDCHECKING = 4; // lParam = TRUE if success, FALSE if failed
+ KS_CONN_STATE_LOGINERROR = 5; // lParam = protocol, only if selected in options
+ KS_CONN_STATE_RETRYNOCONN = 6; // lParam = nth try, a connection attempt will not be made
+// wParam = one of above
+// lParam depends on wParam
+ ME_KS_CONNECTIONEVENT:PAnsiChar = 'KeepStatus/ConnectionEvent';
+
+// wParam = 0
+// lParam = 0
+// returns 0 on succes, nonzero on failure, probably keepstatus wasn't reconnecting
+ MS_KS_STOPRECONNECTING:PAnsiChar = '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.
+ MS_KS_ENABLEPROTOCOL:PAnsiChar = 'KeepStatus/EnableProtocol';
+
+// wParam = 0
+// lParam = protocol
+// returns TRUE if protocol is enabled for checked, FALSE otherwise
+ MS_KS_ISPROTOCOLENABLED:PAnsiChar = '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
+ MS_KS_ANNOUNCESTATUSCHANGE:PAnsiChar = 'KeepStatus/AnnounceStatusChange';
+
+function announce_status_change(szProto:PAnsiChar;newstatus:integer;szMsg:TChar):integer;// cdecl;
+var
+ ps:PROTOCOLSETTINGEX;
+begin
+ FillChar(ps,SizeOf(PROTOCOLSETTINGEX),0);
+ ps.cbSize:=SizeOf(PROTOCOLSETTINGEX);
+ if szProto<>NIL then
+ 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;
+
+ result:=CallService(MS_KS_ANNOUNCESTATUSCHANGE, 0,dword(@ps));
+end;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_tipper.inc b/plugins/ExternalAPI/delphi/m_tipper.inc new file mode 100644 index 0000000000..d9fea8208d --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_tipper.inc @@ -0,0 +1,51 @@ +{
+ 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
+}
+{$IFNDEF M_TIPPER}
+{$DEFINE M_TIPPER}
+type
+ TranslateFunc = function (hContact:THANDLE;module:PAnsiChar;setting_or_prefix:PAnsiChar;
+ buff:pWideChar;bufflen:int):pWideChar; cdecl;
+
+type
+ PDBVTranslation = ^TDBVTranslation;
+ TDBVTranslation = record
+ tfunc:TranslateFunc; // address of your translation function (see typedef above)
+ name :pWideChar; // make sure this is unique, and DO NOT translate it
+ id :dword; // will be overwritten by Tipper - do not use
+ end;
+
+{
+ add a translation to tipper
+ wParam not used
+ lParam = pointer to PDBVTranslation
+}
+const
+ MS_TIPPER_ADDTRANSLATION:PAnsiChar = 'Tipper/AddTranslation';
+
+{
+ Show tooltip
+ wParam - optional (PAnsiChar) text for text-only tips
+ lParam - (PCLCINFOTIP) infoTip
+}
+ MS_TIPPER_SHOWTIP:PAnsiChar = 'mToolTip/ShowTip';
+
+{
+ unicode extension to the basic functionality
+ wParam - optional (pWideChar) text for text-only tips
+ lParam - (PCLCINFOTIP) infoTip
+}
+ MS_TIPPER_SHOWTIPW:PAnsiChar = 'mToolTip/ShowTipW';
+
+{
+ wParam=lParam=0;
+}
+ MS_TIPPER_HIDETIP:PAnsiChar = 'mToolTip/HideTip';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_toptoolbar.inc b/plugins/ExternalAPI/delphi/m_toptoolbar.inc new file mode 100644 index 0000000000..913f2435ea --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_toptoolbar.inc @@ -0,0 +1,191 @@ +{$IFNDEF M_TOPTOOLBAR}
+{$DEFINE M_TOPTOOLBAR}
+
+const
+ TTB_OPTDIR = 'TopToolBar';
+
+//button flags
+const
+ TTBBF_DISABLED = $0001;
+ TTBBF_VISIBLE = $0002;
+ TTBBF_PUSHED = $0004;
+ TTBBF_SHOWTOOLTIP = $0008;
+ TTBBF_ISSEPARATOR = $0020;
+ TTBBF_ISLBUTTON = $0040;
+ TTBBF_ISSBUTTON = $0100;
+ TTBBF_ASPUSHBUTTON = $0200;
+
+type
+ PTTBButton = ^TTBButton;
+ TTBButton = record
+ cbSize :int;
+ pszService :PAnsiChar; // or program for lButtons
+ dwFlags :DWORD;
+ lParamUp :LPARAM;
+ wParamUp :WPARAM;
+ lParamDown :LPARAM;
+ wParamDown :WPARAM;
+ name :PAnsiChar;
+ hIconUp :HICON; // or hIconHandleUp:HANDLE
+ hIconDn :HICON; // or hIconHandleDn:HANDLE
+ pszTooltipUp :PansiChar;
+ pszTooltipDn :PansiChar;
+ end;
+
+const
+
+//=== EVENTS ===
+{
+ toptoolbar/moduleloaded event
+ wParam = lParam = 0
+ Called when the toolbar services are available
+
+ !!!Warning you may work with TTB services only in this event or later.
+
+ Im use settimer() - so notify appear in miranda message loop
+ after all onmodulesload calls.
+}
+ ME_TTB_MODULELOADED:PAnsiChar = 'TopToolBar/ModuleLoaded';
+
+
+{
+ toptoolbar/initbuttons event
+ wParam = lParam = 0
+ Called when the toolbar needs to add default buttons
+}
+ ME_TTB_INITBUTTONS:PAnsiChar = 'TopToolBar/InitButtons';
+
+{
+//=== SERVICES ===
+
+ toptoolbar/addbutton service
+ wparam = (TTBButton*)lpTTBButton
+ lparam = (hLangpack)
+ returns: hTTBButton - handle of added button on success, -1 on failure.
+}
+ MS_TTB_ADDBUTTON:PAnsiChar = 'TopToolBar/AddButton';
+
+{
+ toptoolbar/removebutton service
+ wparam = (HANDLE)hTTButton
+ lparam = 0
+ returns: 0 on success, -1 on failure.
+}
+ MS_TTB_REMOVEBUTTON:PAnsiChar = 'TopToolBar/RemoveButton';
+
+{
+ toptoolbar/setstate service
+ wparam = (HANDLE)hTTButton
+ lparam = (LPARAM) state
+ returns: 0 on success, -1 on failure.
+}
+ TTBST_PUSHED = 1;
+ TTBST_RELEASED = 2;
+
+ MS_TTB_SETBUTTONSTATE:PAnsiChar = 'TopToolBar/SetState';
+
+{
+ toptoolbar/getstate service
+ wparam = (HANDLE)hTTButton
+ lparam = 0
+ returns: state on success, -1 on failure.
+}
+ MS_TTB_GETBUTTONSTATE:PAnsiChar = 'TopToolBar/GetState';
+
+{
+ toptoolbar/getoptions service
+ (HIWORD)wparam = (HANDLE)hTTButton
+ (LOWORD)wparam = TTBO_FLAG
+ lparam = 0,or lparam=lpTTBButton if flag=TTBO_ALLDATA
+ returns: value on success, -1 on failure.
+}
+ TTBO_FLAGS = 0; // get/set all flags
+ TTBO_POS = 1; // position
+ TTBO_WIDTH = 2; // not impemented
+ TTBO_HEIGHT = 3; // not impemented
+ TTBO_TIPNAME = 4; // tool tip name
+ TTBO_ALLDATA = 5; // change all data via lparam=lpTTBButton
+
+ MS_TTB_GETBUTTONOPTIONS:PAnsiChar = 'TopToolBar/GetOptions';
+
+{
+ toptoolbar/setoptions service
+ (HIWORD)wparam = (HANDLE)hTTButton
+ (LOWORD)wparam = TTBO_FLAG
+ lparam = value
+ returns: 1 on success, -1 on failure.
+}
+ MS_TTB_SETBUTTONOPTIONS:PAnsiChar = 'TopToolBar/SetOptions';
+
+{
+ toptoolbar/setcustomproc service
+ wparam = pfnCustomproc
+ lparam = procedure parameter
+ returns: always returns 0.
+}
+ MS_TTB_SETCUSTOMPROC:PAnsiChar = 'TopToolBar/SetCustomProc';
+
+const
+ TTB_WINDOW_HANDLE = THANDLE(-1);
+
+{
+ this procedure is executed on each button on toolbar
+ and on a toolbar itself with hTTButton == TTB_WINDOW_HANDLE
+ hTTButton = button handle
+ hwndBtn = button window handle
+ userInfo = lParam passed into TopToolbar_SetCustomProc
+}
+type
+ pfnCustomProc = procedure(hTTButton:THANDLE; hwndBtn:HWND; userInfo:LPARAM); cdecl;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Toolbar internal structures
+
+type
+ TTBCtrlButton = record
+ hWindow:HWND;
+ end;
+
+type
+ pfnTTBPainterFunc = procedure(btnctrl:pointer{PTTBCtrl}; hdc:HDC); cdecl;
+
+type
+ PTTBCtrl = ^TTBCtrl;
+ TTBCtrl = record
+ hWnd :HWND;
+ hFrame :THANDLE;
+ nButtonWidth :int;
+ nButtonHeight:int;
+ nButtonSpace :int;
+ nLastHeight :int; // fix against recursion in WM_SIZE
+ bOrderChanged:boolean; // set by buttons' arrange procedure if the buttons' order was changed
+ bFlatButtons,
+ bAutoSize,
+ bSingleLine :boolean;
+ bHardUpdate :boolean; // clist modern requires to delete buttons to update them
+
+ pButtonList :PSortedList;
+
+ lResult :LRESULT; // custom window proc result
+ fnWindowProc :TWNDPROC; // custom window proc
+ end;
+
+type
+ PTBCtrlCustomize = ^TTBCtrlCustomize;
+ TTBCtrlCustomize = record
+ cbLen :size_t; // total length of the internal data structure
+ fnWindowProc:TWNDPROC; // subclassed windows procedure for the custom button
+ end;
+
+{
+ Sets the custom painting procedure for a toolbar
+ wParam = not used
+ lParam = TTBCtrlCustomize*
+ Usage: SendMessage(hwndToolbar, TTB_SETCUSTOM, 0, (LPARAM)&CustomData);
+ Only works on TopToolbars
+}
+const
+ TTB_SETCUSTOM = WM_USER+1;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_trigger.inc b/plugins/ExternalAPI/delphi/m_trigger.inc new file mode 100644 index 0000000000..7f40d161e2 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_trigger.inc @@ -0,0 +1,986 @@ +{$IFNDEF M_TRIGGER}
+{$DEFINE M_TRIGGER}
+
+// --------------------------------------------------------------------------
+// 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
+// --------------------------------------------------------------------------
+const
+ 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.
+
+type
+ TTRIGGERREGISTER = record
+ cbSize :int; // Set to sizeof(TRIGGERREGISTER).
+ pszName :PAnsiChar; // Used as identifier and shown in the options dialog,
+ // must be unique.
+ hInstance :HINSTANCE; // Only needed when options screen is available.
+ pfnDlgProc :DLGPROC; // Optional, the callback procedure for the options page.
+ pszTemplate:PAnsiChar; // Optional, template for the options page; must be
+ // WS_CHILD.
+ flags :int; // Flags, see below.
+ dFlags :int; // Specify the default DF_* flags which your trigger can
+ // send (see below).
+ end;
+
+const
+// Flags
+ TRF_NOEXPORT = 01; // 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.
+
+ DF_CONTACT = $01; // The trigger might send a contact handle with the
+ // TriggerData.
+ DF_PROTO = $02; // The trigger might send a protocol ID with the
+ // TriggerData.
+ DF_STATUS = $04; // The trigger might send a status code with the
+ // TriggerData.
+ DF_TEXT = $08; // The trigger might send a string with the
+ // TriggerData.
+ DF_LPARAM = $10; // The trigger might send a custom parameter with the
+ // TriggerData.
+ DF_UNICODE = $20; // The trigger processes WCHAR strings.
+
+// 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.
+
+ 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
+
+ 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.
+
+ 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.
+
+ 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.
+
+type
+ PTRIGGERDATA = ^TTRIGGERDATA;
+ TTRIGGERDATA = record
+ cbSize :int; // Set to sizeof(TRIGGERDATA)
+ dFlags :int; // Indicate which members are valid using the DF_* flags
+ hContact:THANDLE; // Associate a contact handle to this event.
+ szProto :PAnsiChar; // Associate a protocol ID to this event.
+ status :int; // Associcate a status code to this event.
+ szText :TChar; // Associate a string to this event.
+ lParam :LPARAM; // Associate custom data to this trigger.
+ end;
+
+type
+ PREPORTINFO = ^TREPORTINFO;
+ TREPORTINFO = record
+ cbSize :int; // Set to sizeof(REPORTINFO).
+ triggerID:DWORD; // The trigger ID of the event to trigger or 0 if
+ // this does not apply.
+ pszName :PAnsiChar; // The name of the trigger (this may be NULL if
+ // triggerID is not 0).
+ flags :int; // On of the TRG_* flags, see below.
+ td :PTRIGGERDATA; // Optional, the associated TriggerData, see above.
+ end;
+
+const
+ TRG_PERFORM = $01; // Indicates the event for this trigger actually
+ // occured and needs to be processed accordingly.
+ TRG_CLEANUP = $02; // 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.
+
+ 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.
+
+type
+ TACTIONREGISTER = record
+ cbSize :int; // Set to sizeof(ACTIONREGISTER).
+ pszName :PAnsiChar; // The name of this action, it must be a unique string.
+ pszService :PAnsiChar; // A service (called with wParam =
+ // (WPARAM)(DWORD)actionID, lParam =
+ // (LPARAM)(REPORTINFO *)&ri) or function to be called
+ // when the action has to be performed.
+// or actionFunction: function (actionID:dword; ri:PREPORTINFO):int;
+ hInstance :HINSTANCE;// Only needed when an options screen is available.
+ pfnDlgProc :DLGPROC; // Optional, the callback procedure for the options
+ // dialog.
+ pszTemplate:PAnsiChar; // Optional, template for the options dialog, must be
+ // WS_CHILD.
+ flags :int; // One of the ARF_* flags, see below.
+ end;
+
+const
+ ARF_UNICODE = $01; // This action processes unicode strings.
+ ARF_FUNCTION = $02; // The actionFunction will be called instead of the service.
+ ARF_NOEXPORT = $04; // 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.
+
+// 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.
+
+ ACT_PERFORM = $01; // Your action is to be performed.
+ ACT_CLEANUP = $02; // 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.
+
+ 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.
+
+ 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.
+
+type
+ PTRIGGERINFO = ^TTRIGGERINFO;
+ TTRIGGERINFO = record
+ cbSize:int; // (in) Set to sizeof(TRIGGERINFO).
+ dFlags:int; // (out) The default DF_* flags used by the trigger (as indicated
+ // by its TRIGGERREGISTER).
+ end;
+
+// --------------------------------------------------------------------------
+// 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.
+const
+ 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.
+
+type
+ PCONDITIONREGISTER = ^TCONDITIONREGISTER;
+ TCONDITIONREGISTER = record
+ cbSize :int; // Set to sizeof(CONDITIONREGISTER).
+ pszName :PAnsiChar; // The name identifying this condition, must be unique.
+ pszService :PAnsiChar; // 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.
+// or conditionFunction:function(conditionID:dword; ri:PREPORTINFO):int;
+ hInstance :HINSTANCE; // Only needed when an options dialog is available.
+ pfnDlgProc :DLGPROC; // Optional, the dialog procedure for the options
+ // dialog.
+ pszTemplate:PAnsiChar; // Optional, template for the options dialog, must be
+ // WS_CHILD.
+ flags :int; // CRF_* flags, see below.
+ end;
+
+// The flags that can be used to register the condition.
+
+const
+ CRF_UNICODE = $01; // The condition function or service processes
+ // unicode strings.
+ CRF_FUNCTION = $02; // The conditionFunction will be called instead of
+ // the service.
+ CRF_NOEXPORT = $04; // 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.
+
+// 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.
+
+ CRV_FALSE = 0; // The condition does not hold.
+ CRV_TRUE = 1; // The condition does hold.
+
+// REPORTINFO flags, received by the condition function or service. These
+// indicate how to process the call.
+
+ CND_PERFORM = 01; // Perform your condition and return either
+ // CRV_TRUE or CRV_FALSE to indicate whether or not
+ // your condition holds at this moment.
+ CND_CLEANUP = 02; // 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.
+
+ 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
+// --------------------------------------------------------------------------
+
+ 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).
+// Pointer to a structure describing the settings to remove (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.
+
+ ETT_DISABLE = 0; // Disable the trigger(s).
+ ETT_ENABLE = 1; // Enable the trigger(s).
+ ETT_TOGGLE = 2; // Toggle the state of the trigger(s).
+ ETT_GETSTATE = 3; // Retrieve the state of the trigger (0=disabled).
+
+// --------------------------------------------------------------------------
+// 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.
+
+ 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.
+
+type
+ PREMOVETRIGGERSETTINGS = ^TREMOVETRIGGERSETTINGS;
+ TREMOVETRIGGERSETTINGS = record
+ cbSize :int; // Set to sizeof(REMOVETRIGGERSETTINGS).
+ prefix :PAnsiChar; // A string indicating what kind of setting are to be
+ // removed, see below.
+ id :DWORD; // The ID of the set of settings to be removed.
+ szModule:PAnsiChar; // The module where the settings are stored.
+ hContact:THANDLE; // The contact for which the setting are to be removed. Can
+ // be INVALID_HANDLE_VALUE to remove the settings for all
+ // contacts and NULL.
+ end;
+
+// The following prefixes indicate what kind of settings are to be removed from
+// the database.
+const
+ PREFIX_ACTIONID = 'aid'; // The prefix for a DB setting associated to
+ // an action.
+ PREFIX_TRIGGERID = 'tid'; // The prefix for a DB setting associated to
+ // a trigger.
+ PREFIX_CONDITIONID = 'cid'; // The prefix for a DB setting associated
+ // to a condition.
+
+(* TRIGGER HELPER
+
+// Helper #1: RemoveAllTriggerSettings
+// ------------------------
+// Remove all settings from the DB given the triggerID and module.
+
+static __inline int RemoveAllTriggerSettings(DWORD triggerID, AnsiChar *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, AnsiChar *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, AnsiChar *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 AnsiChar *szModule,const AnsiChar *szSetting,BYTE val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,WORD val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,DWORD val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const AnsiChar *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const TCHAR *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const WCHAR *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const AnsiChar *val) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, DBVARIANT *dbv) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,BYTE val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,WORD val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,DWORD val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const AnsiChar *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const TCHAR *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const WCHAR *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const AnsiChar *val) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, DBVARIANT *dbv) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,BYTE val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,WORD val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,DWORD val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const AnsiChar *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const TCHAR *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const WCHAR *val) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting,const AnsiChar *val) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, int errorValue) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting, DBVARIANT *dbv) {
+
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule, const AnsiChar *szSetting,DBVARIANT *dbv) {
+
+ AnsiChar 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 AnsiChar *szModule,const AnsiChar *szSetting) {
+
+ AnsiChar dbSetting[MAX_SETTING_LEN];
+
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_CONDITIONID, conditionID, szSetting);
+ return DBDeleteContactSetting(hContact, szModule, dbSetting);
+}
+
+*)
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_userinfoex.inc b/plugins/ExternalAPI/delphi/m_userinfoex.inc new file mode 100644 index 0000000000..b4aff7e7e8 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_userinfoex.inc @@ -0,0 +1,363 @@ +{
+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_USERINFOEX}
+{$DEFINE M_USERINFOEX}
+
+{*************************************************************
+ * Interfaces Module
+}
+
+const MIID_UIUSERINFOEX:MUUID='{9C23A24B-E6AA-43c6-B0B8-D6C36D2F7B57}';
+const MIID_CONTACTINFO :MUUID='{17DBD7C9-450E-4000-BFB4-908A7EF4CE72}';
+const MIID_REMINDER :MUUID='{02E890BD-278D-4890-918D-AB2CF5DC50BD}';
+
+{*************************************************************
+ * PropertySheetPage Module
+}
+
+{ UserInfo/AddPage v0.1.0.0+
+If the hIcon member of te optiondialogpage is valid, the tree show it for nicer look.
+Otherwise the default icon is displayed for this treeitem.
+}
+const
+// ODPF_UNICODE = 8; // string fields in OPTIONSDIALOGPAGE are WCHAR*
+ ODPF_ICON = 64; // the hIcon member of the option dialog page is valid
+
+{ Handling notifications v0.1.0.4+
+A dialogbox should call SetWindowLongPtr(hDlg, DWL_MSGRESULT, PSP_CHANGED) on a PSN_INFOCHANGED notification if
+there are unsafed changes and apply button should keep enabled. Otherwise the changed status
+of the dialogbox is resetted as well as the changed status of the details dialog box itself if no page
+called this message. Because UserinfoEx now looks for changes in the settings of a user to keep the
+shown inforamtion up to date.
+}
+ PSP_CHANGED = 2;
+ PSN_ICONCHANGED = 2000;
+
+{ PSM_GETBOLDFONT v0.1.0.3+
+wParam=NULL
+lParam=(HFONT*)&hFont
+get bold dialog font. wParam is pointer to a handle that retrieves the boldfont.
+You can also call GetWindowLong(hDlg, DWL_MSGRESULT) to get the font.
+This function returns TRUE on success or FALSE otherwise.
+}
+//!! PSM_GETBOLDFONT = WM_USER+102; //defined in m_options.inc
+
+{ PSM_ISLOCKED v0.1.0.4+
+Returns state of propertysheet. If it is locked, The PSM_CHANGED messages sent by a propertysheetpage does not
+have any effect. To aVOID editcontrols, ... to check for changes on redrawing at a load of settings from database or
+if another propertysheetpage is selected, a plugin should check this state and skip those checks to reduce stressing
+the database if such a test if control's content changed does so.
+wParam=NULL
+lParam=NULL
+You can also call GetWindowLong(hDlg, DWL_MSGRESULT) to get the handle.
+This function returns TRUE if the PropertySheet is locked or FALSE otherwise.
+
+Example:
+__inline BOOLEAN PspIsLocked(HWND hPsp)
+
+ HWND hPs = GetParent(hPsp);
+ return ((BOOLEAN)SendMessage((hPs), PSM_ISLOCKED, 0, 0) || GetWindowLongPtr((hPs), DWL_MSGRESULT) != 0);
+}
+ PSM_ISLOCKED = WM_USER+901;
+
+{ PSM_GETCONTACT v0.1.0.4+
+You can get the handle to the contact the propertysheet is associated with by calling PSM_GETCONTACT
+to the parent of your propertysheetpage - the propertysheet.
+wParam=NULL
+lParam=(HANDLE*)&hContact
+You can also call GetWindowLong(hDlg, DWL_MSGRESULT) to get the handle.
+This function returns TRUE on success or FALSE otherwise.
+}
+ PSM_GETCONTACT = WM_USER+903;
+
+{ PSM_GETBASEPROTO v0.1.0.4+
+You can get a pointer to the basic protocol module by sending PSM_GETBASEPROTO to the parent of your propertysheetpage.
+wParam=NULL
+lParam=(LPCSTR*)&szBaseProto
+The propertysheet loads the basic contact protocol on creation for a better handling
+of owners (ICQ) protocol used for changing details on the server. Should also reduce database traffic.
+You can also call GetWindowLong(hDlg, DWL_MSGRESULT) to get the protocol.
+This function returns TRUE on success or FALSE otherwise.
+}
+ PSM_GETBASEPROTO = WM_USER+905;
+
+ INDEX_CURPAGE = -1;
+
+{ PSM_GETPAGEHWND v0.1.1.1+
+retrieve the windowhandle for a propertysheetpage identified by its id
+wParam=idDlg
+lParam=hInstance
+}
+ PSM_GETPAGEHWND = WM_USER+906;
+
+{ PSM_DLGMESSAGE v0.1.1.1+
+Send a message to a specified propertypage of the details dialog.
+This enables communication between propertypages without the need to know
+the window handles of each page.
+}
+type
+ PDLGCOMMAND = ^TDLGCOMMAND;
+ TDLGCOMMAND = record
+ hInst :HINST;
+ idDlg :word;
+ idDlgItem:word;
+ uMsg :uint;
+ wParam :WPARAM;
+ lParam :LPARAM;
+ end;
+
+const
+ PSM_DLGMESSAGE = WM_USER+907;
+
+(* PSM_ISAEROMODE v0.8.2.1+
+This message can be sent to the propertysheet (details dialog) to examine,
+whether the aero adaption mode is enabled or not. This message should be used in
+each propertysheet page's dialog procedure as follows:
+
+ ...
+ switch (msg) {
+ ...
+ case WM_CTLCOLORSTATIC:
+ case WM_CTLCOLORDLG:
+ if (PSIsAeroMode(hDlg))
+ return (INT_PTR)GetStockBrush(WHITE_BRUSH);
+ break;
+ ...
+
+This will draw a propertysheet page with white background, if aero adaption is enabled.
+wParam=not used
+lParam=pointer to boolean bIsAero
+*)
+ PSM_ISAEROMODE = (WM_USER+908);
+
+{*************************************************************
+ * vCard Module
+}
+
+// UserInfo/vCardExport v0.1.0.4+
+
+ MS_USERINFO_VCARD_IMPORT:PAnsiChar = 'UserInfo/vCard/Import';
+
+ MS_USERINFO_VCARD_IMPORTALL:PAnsiChar = 'UserInfo/vCard/ImportAll';
+
+// UserInfo/vCardImport v0.1.0.4+
+
+ MS_USERINFO_VCARD_EXPORT:PAnsiChar = 'UserInfo/vCard/Export';
+
+// UserInfo/vCardImport v0.1.0.4+
+
+ MS_USERINFO_VCARD_EXPORTALL:PAnsiChar = 'UserInfo/vCard/ExportAll';
+
+{*************************************************************
+ * time Module
+}
+
+{ UserInfo/LocalTime v0.1.0.3+
+Computes the local time for the desired contact and writes it to lpst.
+wParam=(WPARAM)hContact
+lParam=(LPSYSTEMTIME)lpst
+The service gets your windows box's local time, reads your timezoneinformation (Windows setting)
+and hContact's timezone from his user details. With these information contact's local time is computed
+considering daylightsaving time.
+Return values are TRUE for success and FALSE if anything went wrong.
+}
+ MS_USERINFO_LOCALTIME:PAnsiChar = 'UserInfo/LocalTime';
+
+{ UserInfo/LocalTime v0.7.0.1+
+This service provides the timezone information for a given contact
+as known by windows, too. All but the DaylightName and StandardName members
+of the class are filled out and can be used. The values are read
+from the windows registry and therefore keep up to date if the latest
+windows hotfixes are installed. There is no default API in the windows SDK
+to solve this problem.
+wParam=(WPARAM)hContact
+lParam=(TIME_ZONE_INFORMATION*)tzi
+Return values are 0 for success and 1 if no valid timezone is set for the contact.
+}
+ MS_USERINFO_TIMEZONEINFO:PAnsiChar = 'UserInfo/TimezoneInfo';
+
+{*************************************************************
+ * Reminder module
+}
+
+{ UserInfo/Reminder/Check v0.1.0.4+
+This service checks if one of your contacts has birthday in the next few days
+wParam = lParam = not used
+}
+ MS_USERINFO_REMINDER_CHECK:PAnsiChar = 'UserInfo/Reminder/Check';
+
+{ UserInfo/Reminder/Check v0.1.1.1+
+This service creates a dialog, that lists all of the anniversaries
+wParam = lParam = not used
+}
+ MS_USERINFO_REMINDER_LIST:PAnsiChar = 'UserInfo/Reminder/List';
+
+
+{ UserInfo/Reminder/Check v0.1.2.16+
+This service compares birthday date which is set by the protocol module of each contact
+to the first found custom set birthday date. If a difference is detected, the user is asked
+whether to update the custom set birthday by the one of the protocol or not.
+
+If no custom birthday is set yet and the protocol contains a valid birthday, it is copied to
+primary custom module (e.g.: mBirthday or UserInfo).
+wParam = handle to single contact or NULL to backup all
+lParam = not used
+}
+ MS_USERINFO_REMINDER_AGGRASIVEBACKUP:PAnsiChar = 'UserInfo/Reminder/AggrassiveBackup';
+
+{ UserInfo/Refresh v0.7.0.1+
+This service calls PSS_GETINFO for all contacts in the contact list
+wParam = not used
+lParam = not used
+}
+ MS_USERINFO_REFRESH:PAnsiChar = 'UserInfo/Refresh';
+
+{*************************************************************
+ * Uinfobuttonclass module
+}
+
+// button styles
+ MBS_DEFBUTTON = $00001000; // default button
+ MBS_PUSHBUTTON = $00002000; // toggle button
+ MBS_FLAT = $00004000; // flat button
+ MBS_DOWNARROW = $00008000; // has arrow on the right
+
+ MBF_UNICODE = 1;
+
+// BUTTONADDTOOLTIP
+// use lParam=MBF_UNICODE to set unicode tooltips
+// for lParam=0 the string is interpreted as ansi
+
+// message to explicitly translate the buttons text,
+// as it is not done by default translation routine
+// wParam=lParam=NULL
+ BUTTONTRANSLATE = WM_USER+6;
+
+{ UserInfo/MsgBox v0.1.0.4+
+Slightly modified version of MButtonClass, to draw both text and icon in a button control
+}
+ UINFOBUTTONCLASS = 'UInfoButtonClass';
+
+(*!! DELETED
+{*************************************************************
+ * Messagebox module
+}
+
+{ UserInfo/MsgBox v0.1.0.3+
+Some little changed message box for nicer look of miranda's messages or questions :-)
+wParam=hContact - can be null
+lParam=(TMsgBox* )pMsg - structure that holds information about the look of the message dialog
+uType member of TMsgBox can be a combination of the following values, where most of them are defined in winuser.h:
+MB_OK
+MB_OKCANCEL
+MB_YESALLNO
+MB_YESNO
+For valid icon values use one of the following MB_ICON_...
+Funktion returns: IDOK, IDYES, IDALL, IDNO or IDCANCEL
+}
+ MB_YESALLNO = $00000007;
+ MB_UNICODE = $10000000;
+
+{
+valid predefined icon values
+}
+ MB_ICON_NONE = $00000000;
+ MB_ICON_ERROR = $00000010;
+ MB_ICON_QUESTION = $00000020;
+ MB_ICON_WARNING = $00000030;
+ MB_ICON_INFO = $00000040;
+ MB_ICON_OTHER = $000000F0; // use icon TMsgBox->hiMsg
+
+type
+ PMsgBox = ^TMsgBox;
+ TMsgBox = record
+ uSize :uint; // size of this structure
+ uType :uint; // parameters
+ hiLogo :HICON; // right upper icon of the info bar
+ hiMsg :HICON; // icon left next to the message text
+ szTitle :TCHAR; // dialog window title text
+ szInfoText:TCHAR; // text of the infobar on the top of the dialog
+ szMsg :TCHAR; // the message text
+ hParent :hwnd; // parent window for the messagebox
+ end;
+
+const
+ MS_MSGBOX:PAnsiChar = 'UserInfo/MsgBox';
+*)
+{*************************************************************
+ * contact info module
+}
+
+// additional information which can be retrieved with this service
+ CNF_COPHONE = 55; // returns company phone (string)
+ CNF_COFAX = 40; // returns company fax (string)
+ CNF_COCELLULAR = 41; // returns company cellular (string)
+ CNF_COEMAIL = 42; // returns company email address (string)
+
+{ CNF_BIRTHDATE v0.1.2.18+
+returns a formated string with the birthdate in it
+wParam - 1 for long dateformat, 0 for short dateformat
+lParam - CONTACTINFO structure as for all other fields, too
+returns 0 on success and 1 on failure
+}
+ CNF_BIRTHDATE = 43; // returns date of birth (string)
+
+{*************************************************************
+ * extended integration module
+}
+
+{ UserInfo/Homepage/OpenURL v0.1.2.19+
+This service reads the contact's homepage from UserInfo module or contact's protocol module
+and opens the default browser to show it.
+wParam=hContact - handle to contact whose homepage is to show
+lParam=not used
+}
+ MS_USERINFO_HOMEPAGE_OPENURL:PAnsiChar = 'UserInfo/Homepage/OpenURL';
+
+
+{*************************************************************
+ * extended database module
+ *}
+
+{ DB/Contact/GetSettingStrEx v0.7.0.1+
+This service function reads a database setting from USERINFO module.
+If the setting does not exist, it is looked up in 'pszProto'.
+If 'hContact' points to a MetaContact, the setting is recursivly
+searched in all sub contacts, too, starting with the default contact,
+if the MetaContact does not directly provide the setting.
+This service can directly replace the default MS_DB_CONTACT_GETSETTING_STR
+for reading contact information from the database.
+There will be no difference for the user but the possible source of information.
+
+This service can be used to retrieve all kinds of settings!
+Some versions of the default MS_DB_CONTACT_GETSETTING_STR service return
+an error for BYTE, WORD and DWORD values if cgs.pValue->type is not 0.
+
+wParam = (WPARAM)(HANDLE)hContact
+lParam = (LPARAM)(DBCONTACTGETSETTING*)&cgs
+
+This service returns one of the results of MS_DB_CONTACT_GETSETTING_STR!
+}
+ MS_DB_CONTACT_GETSETTING_STR_EX:PAnsiChar = 'DB/Contact/GetSettingStrEx';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_variables.inc b/plugins/ExternalAPI/delphi/m_variables.inc new file mode 100644 index 0000000000..a4c1bda0c9 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_variables.inc @@ -0,0 +1,485 @@ +{
+ Variables Plugin for Miranda-IM (www.miranda-im.org)
+ Copyright 2003-2006 P. Boon
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+}
+
+{$IFNDEF M_VARS}
+{$DEFINE M_VARS}
+
+const MIID_VARIABLES:MUUID = '{630756DE-3681-440B-991E-77A4742DA595}';
+
+// --------------------------------------------------------------------------
+// Memory management
+// --------------------------------------------------------------------------
+
+// Release memory that was allocated by the Variables plugin, e.g. returned
+// strings.
+
+ MS_VARS_FREEMEMORY:PAnsiChar = 'Vars/FreeMemory';
+{
+ Parameters:
+ ------------------------
+ wParam = (WPARAM)(void *)pntr
+ Pointer to memory that was allocated by the Variables plugin (e.g. a
+ returned string) (can be NULL).
+ lParam = 0
+
+ Return Value:
+ ------------------------
+ Does return 0 on success, nozero otherwise.
+
+ Note: Do only use this service to free memory that was *explicitliy*
+ stated that it should be free with this service.
+}
+
+ MS_VARS_GET_MMI:PAnsiChar = 'Vars/GetMMI';
+{
+ Get Variable's RTL/CRT function poiners to malloc(), free() and
+ realloc().
+
+ Parameters:
+ ------------------------
+ wParam = 0
+ lParam = (LPARAM) &MM_INTERFACE
+ Pointer to a memory manager interface struct (see m_system.h).
+
+ Return Value:
+ ------------------------
+ Returns 0 on success, nozero otherwise
+
+ Note: Works exactly the same as the MS_SYSTEM_GET_MMI service
+ service of m_system.h.
+}
+
+// Helper function for easy using:
+
+// --------------------------------------------------------------------------
+// String formatting
+// --------------------------------------------------------------------------
+
+ MS_VARS_FORMATSTRING:PAnsiChar = 'Vars/FormatString';
+{
+ This service can be used to parse tokens in a text. The tokens will be
+ replaced by their resolved values. A token can either be a field or a
+ function. A field takes no arguments and is represented between
+ %-characters, e.g. "%winampsong%". A function can take any number of
+ arguments and is represented by a ? or !-character followed by the name
+ of the function and a list of arguments, e.g. "?add(1,2)".
+
+ Parameters:
+ ------------------------
+ wParam = (WPARAM)(FORMATINFO *)&fi
+ See below.
+ lParam = 0
+
+ Return Value:
+ ------------------------
+ Returns a pointer to the resolved string or NULL in case of an error.
+
+ Note: The returned pointer needs to be freed using MS_VARS_FREEMEMORY.
+}
+
+type
+ TFORMATINFO = record
+ cbSize :int; // Set this to sizeof(FORMATINFO).
+ flags :int; // Flags to use (see FIF_* below).
+ szFormat :TCHAR; // Text in which the tokens will be replaced (can't be NULL).
+ szExtraText:TCHAR; // Extra, context-specific string (can be NULL) ->
+ // The field "extratext" will be replaced by this
+ // string. (Previously szSource).
+ hContact :THANDLE; // Handle to contact (can be NULL) -> The field "subject"
+ // represents this contact.
+ pCount :int; // (output) Number of succesful parsed tokens, needs to
+ // be set to 0 before the call
+ eCount :int; // (output) Number of failed tokens, needs to be set to
+ // 0 before the call
+ szaTemporaryVars:^TChar; // Temporary variables valid only in the duration of the format call
+ // By pos: [i] is var name, [i + 1] is var value
+ cbTemporaryVarsSize:int; // Number of elements in szaTemporaryVars array
+ end;
+
+const
+// FORMATINFOV2_SIZE = (SizeOf(int)*4+SizeOf(pointer)*2 + SizeOf(THANDLE));
+ {$IFNDEF WIN64}
+ FORMATINFOV2_SIZE = 28;
+ {$ELSE}
+ FORMATINFOV2_SIZE = SIZEOF(TFORMATINFO);
+ {$ENDIF}
+
+const
+// Possible flags:
+ FIF_UNICODE = 1; // Expects and returns unicode text (WCHAR*).
+ FIF_TCHAR = FIF_UNICODE; // Strings in structure are TCHAR*.
+
+// --------------------------------------------------------------------------
+// Register tokens
+// --------------------------------------------------------------------------
+
+// Plugins can define tokens which will be parsed by the Variables plugin.
+
+ MS_VARS_REGISTERTOKEN:PAnsiChar = 'Vars/RegisterToken';
+{
+ With this service you can define your own token. The newly added tokens
+ using this service are taken into account on every call to
+ MS_VARS_FORMATSTRING.
+
+ Parameters:
+ ------------------------
+ wParam = 0
+ lParam = (LPARAM)(TOKENREGISTER*)&tr
+ See below.
+
+ Return Value:
+ ------------------------
+ Returns 0 on success, nonzero otherwise. Existing tokens will be
+ 'overwritten' if registered twice.
+}
+
+// Needed for szService and parseFunction:
+type
+ PARGUMENTSINFO = ^TARGUMENTSINFO;
+ TARGUMENTSINFO = record
+ cbSize:int; // You need to check if this is >=sizeof(ARGUMENTSINFO)
+ // (already filled in).
+ fi :^TFORMATINFO; // Arguments passed to MS_VARS_FORMATSTRING.
+ argc :uint; // Number of elements in the argv array.
+ argv :^TCHAR; // Argv[0] will be the token name, the following elements
+ // are the additional arguments.
+ flags :int; // (output) You can set flags here (initially 0), use the
+ // AIF_* flags (see below).
+ end;
+
+// Available flags for ARGUMENTSINFO:
+// Set the flags of the ARGUMENTSINFO struct to any of these to influence
+// further parsing.
+const
+ AIF_DONTPARSE = 1; // Don't parse the result of this function,
+ // usually the result of a token is parsed
+ // again, if the `?` is used as a function character.
+ AIF_FALSE = 2; // The function returned logical false.
+
+// Definition of parse/cleanup functions:
+{
+typedef AnsiChar* (*VARPARSEFUNCA)(ARGUMENTSINFO *ai);
+typedef WCHAR* (*VARPARSEFUNCW)(ARGUMENTSINFO *ai);
+typedef void (*VARCLEANUPFUNCA)(AnsiChar *szReturn);
+typedef void (*VARCLEANUPFUNCW)(WCHAR *wszReturn);
+
+#define VARPARSEFUNC VARPARSEFUNCW
+#define VARCLEANUPFUNC VARCLEANUPFUNCW
+}
+type
+ TTOKENREGISTER = record
+ cbSize:int; // Set this to sizeof(TOKENREGISTER).
+ szTokenString:TCHAR; // Name of the new token to be created, without %,
+ // ?, ! etc. signs (can't be NULL).
+ szService:PAnsiChar; // Name of a service that is used to request the
+ // token's value, if no service is used, a function
+ // and TRF_PARSEFUNC must be used.
+ // [VARPARSEFUNC];
+ szCleanupService:PAnsiChar; // Name of a service to be called when the
+ // memory allocated in szService can be freed
+ // (only used when flag VRF_CLEANUP is set,
+ // else set this to NULL).
+ // [VARCLEANUPFUNC]
+ szHelpText:PAnsiChar;// Help info shown in help dialog (can be NULL). Has to
+ // be in the following format:
+ // "subject\targuments\tdescription"
+ // (Example: "math\t(x, y ,...)\tx + y + ..."), or:
+ // "subject\tdescription"
+ // (Example: "miranda\tPath to the Miranda-IM
+ // executable").
+ // Note: subject and description are translated by Variables.
+ memType:int; // Describes which method Varibale's plugin needs to use to
+ // free the returned buffer, use one of the VR_MEM_* values
+ // (see below). Only valid if the flag VRF_FREEMEM is set,
+ // use TR_MEM_OWNER otherwise).
+ flags :int; // Flags to use (see below), one of TRF_* (see below).
+ end;
+
+const
+// Available Memory Storage Types:
+// These values describe which method Variables Plugin will use to free the
+// buffer returned by the parse function or service
+ TR_MEM_VARIABLES = 1; // Memory is allocated using the functions
+ // retrieved by MS_VARS_GET_MMI.
+ TR_MEM_MIRANDA = 2; // Memory is allocated using Miranda's Memory
+ // Manager Interface (using the functions
+ // returned by MS_SYSTEM_GET_MMI), if
+ // VRF_FREEMEM is set, the memory will be
+ // freed by Variables.
+ TR_MEM_OWNER = 3; // Memory is owned by the calling plugin
+ // (can't be freed by Variables Plugin
+ // automatically). This should be used if
+ // VRF_FREEMEM is not specified in the flags.
+
+// Available Flags for TOKENREGISTER:
+ TRF_FREEMEM = $01; // Variables Plugin will automatically free the
+ // pointer returned by the parse function or
+ // service (which method it will us is
+ // specified in memType -> see above).
+ TRF_CLEANUP = $02; // Call cleanup service or function, notifying
+ // that the returned buffer can be freed.
+ // Normally you should use either TRF_FREEMEM
+ // or TRF_CLEANUP.
+ TRF_PARSEFUNC = $40; // parseFunction will be used instead of a service.
+ TRF_CLEANUPFUNC = $80; // cleanupFunction will be used instead of a service.
+ TRF_USEFUNCS = TRF_PARSEFUNC or TRF_CLEANUPFUNC;
+ TRF_UNPARSEDARGS = $04; // Provide the arguments for the parse
+ // function in their raw (unparsed) form.
+ // By default, arguments are parsed before
+ // presenting them to the parse function.
+ TRF_FIELD = $08; // The token can be used as a %field%.
+ TRF_FUNCTION = $10; // The token can be used as a ?function().
+ // Normally you should use either TRF_FIELD or
+ // TRF_FUNCTION.
+ TRF_UNICODE = $20; // Strings in structure are unicode (WCHAR*).
+ // In this case, the strings pointing to the
+ // arguments in the ARGUMENTS struct are
+ // unicode also. The returned buffer is
+ // expected to be unicode also, and the
+ // unicode parse and cleanup functions are called.
+
+ TRF_TCHAR = TRF_UNICODE; // Strings in structure are TCHAR*.
+
+// Deprecated:
+ TRF_CALLSVC = TRF_CLEANUP;
+
+// Callback Service (szService) / parseFunction:
+// ------------------------
+// Service that is called automatically by the Variable's Plugin to resolve a
+// registered variable.
+
+// Parameters:
+// wParam = 0
+// lParam = (LPARAM)(ARGUMENTSINFO *)&ai
+// see above
+
+// Return Value:
+// Needs to return the pointer to a dynamically allocacated string or NULL.
+// A return value of NULL is regarded as an error (eCount will be increaded).
+// Flags in the ARGUMENTSINFO struct can be set (see above).
+
+// Callback Service (szCallbackService) / cleanupFunction:
+// ------------------------
+// This service is called when the memory that was allocated by the parse
+// function or service can be freed. Note: It will only be called when the
+// flag VRF_CLEANUP of TOKENREGISTER is set.
+
+// Parameters:
+// wParam = 0
+// lParam = (LPARAM)(AnsiChar *)&res
+// Result from parse function or service (pointer to a string).
+
+// Return Value:
+// Should return 0 on success.
+
+
+
+// --------------------------------------------------------------------------
+// Show the help dialog
+// --------------------------------------------------------------------------
+
+// Plugins can invoke Variables' help dialog which can be used for easy input
+// by users.
+
+ MS_VARS_SHOWHELPEX:PAnsiChar = 'Vars/ShowHelpEx';
+
+// This service can be used to open the help dialog of Variables. This dialog
+// provides easy input for the user and/or information about the available
+// tokens.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(HWND)hwndParent
+// lParam = (LPARAM)(VARHELPINFO)&vhi
+// See below.
+
+// Return Value:
+// ------------------------
+// Returns 0 on succes, any other value on error.
+
+type
+ TVARHELPINFO = record
+ cbSize:int; // Set to sizeof(VARHELPINFO).
+ fi:^TFORMATINFO; // Used for both input and output. If this pointer is not
+ // NULL, the information is used as the initial values for
+ // the dialog.
+ hwndCtrl:HWND; // Used for both input and output. The window text of this
+ // window will be read and used as the initial input of the
+ // input dialog. If the user presses the OK button the window
+ // text of this window will be set to the text of the input
+ // field and a EN_CHANGE message via WM_COMMAND is send to
+ // this window. (Can be NULL).
+ szSubjectDesc:PAnsiChar; // The description of the %subject% token will be set
+ // to this text, if not NULL. This is translated
+ // automatically.
+ szExtraTextDesc:PAnsiChar; // The description of the %extratext% token will be
+ // set to this text, if not NULL. This is translated
+ // automatically.
+ flags:int; // Flags, see below.
+ end;
+
+
+const
+// Flags for VARHELPINFO
+ VHF_TOKENS = $00000001; // Create a dialog with the list of tokens
+ VHF_INPUT = $00000002; // Create a dialog with an input
+ // field (this contains the list of
+ // tokens as well).
+ VHF_SUBJECT = $00000004; // Create a dialog to select a
+ // contact for the %subject% token.
+ VHF_EXTRATEXT = $00000008; // Create a dialog to enter a text
+ // for the %extratext% token.
+ VHF_HELP = $00000010; // Create a dialog with help info.
+ VHF_HIDESUBJECTTOKEN = $00000020; // Hide the %subject% token in the
+ // list of tokens.
+ VHF_HIDEEXTRATEXTTOKEN = $00000040; // Hide the %extratext% token in
+ // the list of tokens.
+ VHF_DONTFILLSTRUCT = $00000080; // Don't fill the struct with the
+ // new information if OK is pressed
+ VHF_FULLFILLSTRUCT = $00000100; // Fill all members of the struct
+ // when OK is pressed. By default
+ // only szFormat is set. With this
+ // flag on, hContact and
+ // szExtraText are also set.
+ VHF_SETLASTSUBJECT = $00000200; // Set the last contact that was
+ // used in the %subject% dialog in
+ // case fi.hContact is NULL.
+
+// Predefined flags
+ VHF_FULLDLG = VHF_INPUT or VHF_HELP or VHF_SUBJECT or VHF_EXTRATEXT;
+ VHF_SIMPLEDLG = VHF_INPUT or VHF_HELP;
+ VHF_NOINPUTDLG = VHF_TOKENS or VHF_HELP;
+
+// If the service fills information in the struct for szFormat or szExtraText,
+// these members must be free'd using the free function of Variables.
+// If wParam==NULL, the dialog is created modeless. Only one dialog can be
+// shown at the time.
+// If both hwndCtrl and fi are NULL, the user input will not be retrievable.
+// In this case, the dialog is created with only a "Close" button, instead of
+// the "OK" and "Cancel" buttons.
+// In case of modeless dialog and fi != NULL, please make sure this pointer
+// stays valid while the dialog is open.
+
+
+ MS_VARS_GETSKINITEM:PAnsiChar = 'Vars/GetSkinItem';
+{
+ This service can be used to get the icon you can use for example on the
+ Variables help button in your options screen. You can also get the tooltip
+ text to use with such a button. If icon library is available the icon will
+ be retrieved from icon library manager, otherwise the default is returned.
+
+ Parameters:
+ ------------------------
+ wParam = (WPARAM)0
+ lParam = (LPARAM)VSI_* (see below)
+
+ Return Value:
+ ------------------------
+ Depends on the information to retrieve (see below).
+}
+// VSI_ constants
+ VSI_HELPICON = 1; // Can be used on the button accessing the
+ // Variables help dialog. Returns (HICON)hIcon on
+ // success or NULL on failure;
+ VSI_HELPTIPTEXT = 2; // Returns the tooltip text you can use for the
+ // help button. Returns (AnsiChar *)szTipText, a
+ // static, translated buffer containing the help
+ // text or NULL on error.
+
+ MS_VARS_SHOWHELP:PAnsiChar = 'Vars/ShowHelp';
+{
+ WARNING: This service is obsolete, please use MS_VARS_SHOWHELPEX
+
+ Shows a help dialog where all possible tokens are displayed. The tokens
+ are explained on the dialog, too. The user can edit the initial string and
+ insert as many tokens as he likes.
+
+ Parameters:
+ ------------------------
+ wParam = (HWND)hwndEdit
+ Handle to an edit control in which the modified string
+ should be inserted (When the user clicks OK in the dialog the edited
+ string will be set to hwndEdit) (can be NULL).
+ lParam = (AnsiChar *)pszInitialString
+ String that the user is provided with initially when
+ the dialog gets opened (If this is NULL then the current text in the
+ hwndEdit edit control will be used) (can be NULL).
+
+ Return Value:
+ ------------------------
+ Returns the handle to the help dialog (HWND).
+
+ Note: Only one help dialog can be opened at a time. When the dialog gets
+ closed an EN_CHANGE of the edit controll will be triggered because the
+ contents were updated. (Only when user selected OK).
+
+ Example:
+ CallService(MS_VARS_SHOWHELP, (WPARAM)hwndEdit, (LPARAM)"some initial text");
+}
+
+// --------------------------------------------------------------------------
+// Retrieve a contact's HANDLE given a string
+// --------------------------------------------------------------------------
+
+ MS_VARS_GETCONTACTFROMSTRING:PAnsiChar = 'Vars/GetContactFromString';
+{
+ Searching for contacts in the database. You can find contacts in db by
+ searching for their name, e.g first name.
+
+ Parameters:
+ ------------------------
+ wParam = (WPARAM)(CONTACTSINFO *)&ci
+ See below.
+ lParam = 0
+
+ Return Value:
+ ------------------------
+ Returns number of contacts found matching the given string representation.
+ The hContacts array of CONTACTSINFO struct contains these hContacts after
+ the call.
+
+ Note: The hContacts array needs to be freed after use using
+ MS_VARS_FREEMEMORY.
+}
+
+type
+ TCONTACTSINFO = record
+ cbSize :int; // Set this to sizeof(CONTACTSINFO).
+ szContact:TCHAR; // String to search for, e.g. last name (can't be NULL).
+ hContacts:^THANDLE; // (output) Array of contacts found.
+ flags :DWORD; // Contact details that will be matched with the search
+ // string (flags can be combined).
+ end;
+
+const
+// Possible flags:
+ CI_PROTOID = $00000001; // The contact in the string is encoded in the
+ // format <PROTOID:UNIQUEID>, e.g. <ICQ:12345678>.
+ CI_NICK = $00000002; // Search nick names.
+ CI_LISTNAME = $00000004; // Search custom names shown in contact list.
+ CI_FIRSTNAME = $00000008; // Search contact's first names (contact details).
+ CI_LASTNAME = $00000010; // Search contact's last names (contact details).
+ CI_EMAIL = $00000020; // Search contact's email adresses (contact details).
+ CI_UNIQUEID = $00000040; // Search unique ids of the contac, e.g. UIN.
+ CI_CNFINFO = $40000000; // Searches one of the CNF_* flags (set flags to
+ // CI_CNFINFO|CNF_X), only one CNF_ type possible
+ CI_UNICODE = $80000000; // tszContact is a unicode string (WCHAR*).
+ CI_TCHAR = CI_UNICODE; // Strings in structure are TCHAR*.
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_versioninfo.inc b/plugins/ExternalAPI/delphi/m_versioninfo.inc new file mode 100644 index 0000000000..2257845432 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_versioninfo.inc @@ -0,0 +1,49 @@ +{
+Version information plugin for Miranda IM
+
+Copyright © 2002-2006 Luca Santarelli, Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_VERSIONINFO}
+{$DEFINE M_VERSIONINFO}
+
+const
+{
+ Brings up the versioninfo post as configured in the options
+ wParam - not used
+ lParam - not used
+}
+ MS_VERSIONINFO_MENU_COMMAND = 'VersionInfo/MenuCommand';
+
+{
+ Returns a string containing the versioninfo post
+ wParam - (BOOL) suppress forum style formatting. If true the post won't have forum
+ style formatting even if the option is checked in miranda's options.
+ lParam - (^PAnsiChar) Pointer to a string that receives the info. Memory is allocated
+ using miranda's version of malloc() and you need to use miranda's version
+ of free() on it.
+ Returns 0 on success.
+
+how to use:
+//...
+ data:PAnsiChar;
+ if GetInfoService(TRUE,LPARAM(@data))=0 then
+ //success
+}
+ MS_VERSIONINFO_GETINFO = 'Versioninfo/GetInfo';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_voice.inc b/plugins/ExternalAPI/delphi/m_voice.inc new file mode 100644 index 0000000000..41213d5f10 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_voice.inc @@ -0,0 +1,156 @@ +{
+Copyright (C) 2006-2009 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF __M_VOICE}
+{$DEFINE __M_VOICE}
+
+const
+ EVENTTYPE_VOICE_CALL = 8739;
+
+ VOICE_CAPS_VOICE = 1 shl 0; // Voice is supported for this protocol. You need to set this one.
+ VOICE_CAPS_CALL_CONTACT = 1 shl 1; // Set if a call can be made to a hContact (PS_VOICE_CALL_CONTACT_VALID is used to validate the string)
+ VOICE_CAPS_CALL_STRING = 1 shl 3; // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string)
+{
+ Request to the protocol capabilities relative to voice.
+
+ wParam: 0
+ lParam: 0
+ return: VOICE_CAPS_*
+}
+ PS_VOICE_CAPS = '/Voice/Caps';
+
+ VOICE_SECURE = $00000001;
+ VOICE_UNICODE = $80000000;
+
+ VOICE_STATE_TALKING = 0;
+ VOICE_STATE_RINGING = 1;
+ VOICE_STATE_CALLING = 2;
+ VOICE_STATE_ON_HOLD = 3;
+ VOICE_STATE_ENDED = 4;
+ VOICE_STATE_BUSY = 5;
+
+type
+ TVOICE_CALL = record
+ cbSize :int; // Struct size
+ moduleName:PAnsiChar; // The name of the protocol module (the same as VOICE_MODULE.name or the protocol szModule)
+ id :PAnsiChar; // Protocol especific ID for this call
+ flags :int; // VOICE_UNICODE to say the string is unicode or 0.
+ // VOICE_SECURE to say this is a encrypted call
+ hContact :THANDLE; // Contact associated with the call (can be NULL)
+ szNumber :TChar; // Number to call (can be NULL)
+ // Or the contact or the number must be != NULL
+ // If both are != NULL the call will be made to the number
+ // and will be associated with the contact
+ // This fields are only needed in first notification for a call id
+ szName :TChar; // Name of the caller. This makes sense only on incoming calls,
+ // where no contact is associated and the caller has a name and a number.
+ state :int; // VOICE_STATE_*
+ end;
+
+const
+{
+Notifies that a voice call changed state
+
+wParam: const VOICE_CALL *
+lParam: ignored
+return: 0 on success
+}
+ PE_VOICE_CALL_STATE = '/Voice/State';
+
+{
+Request to the protocol a make voice call
+
+wParam: (HANDLE) hContact
+lParam: (const TCHAR *) number
+return: 0 on success
+Or the contact or the number must be != NULL. If both are != NULL the call will be
+made to the number and will be associated with the contact.
+}
+ PS_VOICE_CALL = '/Voice/Call';
+
+{
+Service called to make the protocol answer a call or restore a hold call.
+It is an async call. If the call was answered, the PE_VOICE_CALL_STATE
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+}
+ PS_VOICE_ANSWERCALL = '/Voice/AnswerCall';
+
+{
+Service called to make the protocol answer a call. This can be called if the
+call is ringing or has started. If called any other time it should be ignored.
+It is an async call. If the call was droped, the PE_VOICE_CALL_STATE
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+}
+ PS_VOICE_DROPCALL = '/Voice/DropCall';
+
+{
+Service called to make the protocol hold a call. This means that the call should not
+be droped, but it should be muted and put in a hold, to allow other call to be answered.
+If the protocol can't hold a cal, it should be droped.
+
+This can be called if the call has started. If called any other time it should be ignored.
+It is an async call. If the call was droped, the PE_VOICE_CALL_STATE
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+}
+ PS_VOICE_HOLDCALL = '/Voice/HoldCall';
+
+{
+Send a DTMF (one digit text) to a talking call.
+
+wParam: (const char *) id
+lParam: (TCHAR) dtmf
+return: 0 on success
+}
+ PS_VOICE_SEND_DTMF = '/Voice/SendDTMF';
+
+{
+Used if protocol support VOICE_CALL_STRING. The call string is passed as
+wParam and the proto should validate it. If this service does not exist all numbers can be called.
+
+wParam: (const TCHAR *) call string
+lParam: ignored
+return: 0 if wrong, 1 if correct
+}
+ PS_VOICE_CALL_STRING_VALID = '/Voice/CallStringValid';
+
+{
+Used if protocol support VOICE_CALL_CONTACT.
+The hContact is passed as wParam and the proto should tell if this contact can be
+called. If this service does not exist all contacts can be called (or, if it is a protocol,
+all contacts from the protocol can be called).
+
+wParam: (HANDLE) hContact
+lParam: (BOOL) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?'
+return: 0 if can't be called, 1 if can
+}
+ PS_VOICE_CALL_CONTACT_VALID = '/Voice/CallContactValid';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_voiceservice.inc b/plugins/ExternalAPI/delphi/m_voiceservice.inc new file mode 100644 index 0000000000..331212397b --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_voiceservice.inc @@ -0,0 +1,87 @@ +{
+Copyright (C) 2007 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+}
+
+{$IFNDEF M_VOICESERVICE}
+{$DEFINE M_VOICESERVICE}
+
+const
+ MIID_VOICESERVICE:MUUID='{7D64437-EF2E-4F60-BB2D-3C518FE24D63};
+
+{
+This services are a mirror of the services/notifications in m_voice.h,
+with the difference that that ones are to be used by protocols, and this ones
+are to be used by plugins that can make calls to contacts in multiple protocols.
+
+To get the devices for input/output and some options, query the db directly:
+ VoiceService/EchoCancelation BYTE default: TRUE
+ VoiceService/MicBoost BYTE default: TRUE
+ VoiceService/Input TString default: windows default
+ VoiceService/Output TString default: windows default
+}
+
+type
+ TVOICE_MODULE = record
+ cbSize :int; // sizeof(VOICE_MODULE)
+ description:TChar; // The description of the voice provider. This is the name that
+ // will be shown to the user
+ name :PAnsiChar; // The internal name of the voice provider. All PS_* serivces
+ // defined in m_voide.h need to be created based in this name.
+ // For example, PS_VOICE_CALL (/Voice/Call) need to be created
+ // as <name>/Voice/Call
+ icon :PAnsiChar; // Icon to identify provider (from icolib)
+ flags :int; // or of VOICE_CAPS_*. You don't need to send VOICE_CAPS_VOICE.
+ end;
+
+{
+Register a new plugin that can make/receive voice calls (a voice provider).
+
+wParam: const VOICE_MODULE *
+lParam: ignored
+return: 0 on success
+}
+ MS_VOICESERVICE_REGISTER:PAnsiChar = 'VoiceService/Register';
+
+{
+Unregister a plugin that can make/receive voice calls (a voice provider).
+
+wParam: (const char *) Provider name
+lParam: ignored
+return: 0 on success
+}
+ MS_VOICESERVICE_UNREGISTER:PAnsiChar = 'VoiceService/Unregister';
+
+{
+Request a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: ignored
+return: the number of option calls for a contact. If > 0, it can be called
+}
+ MS_VOICESERVICE_CAN_CALL:PAnsiChar = 'VoiceService/CanCall';
+
+{
+Request a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: (char *) Voice provider or NULL to use any provider avaiable
+return: 0 on success
+}
+ MS_VOICESERVICE_CALL:PAnsiChar = 'VoiceService/Call';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_w7ui.inc b/plugins/ExternalAPI/delphi/m_w7ui.inc new file mode 100644 index 0000000000..3841319ac7 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_w7ui.inc @@ -0,0 +1,84 @@ +{$IFNDEF M_W7UI}
+{$DEFINE M_W7UI}
+
+const
+ MIS_ICOLIB = 0;
+ MIS_GENERAL = 1;
+ MIS_PROTOCOL = 2;
+
+type
+ PMIRANDAJUMPLISTITEM = ^TMIRANDAJUMPLISTITEM;
+ TMIRANDAJUMPLISTITEM = record
+ iconSource:int;
+ iconName :pAnsiChar;
+ iconIdx :int;
+ szTitle :pWideChar;
+ szPrefix :pWideChar;
+ szArgument:pWideChar;
+ end;
+
+const
+// Force jumplist rebuild
+ MS_JUMPLIST_REBUILD:pAnsiChar = 'w7/JumpList/Rebuild';
+
+// ---
+ ME_JUMPLIST_BUILDCATEGORIES:pAnsiChar = 'w7/JumpList/BuildCategories';
+
+// lParam = (WCHAR *)category name
+ ME_JUMPLIST_BUILDITEMS:pAnsiChar = 'w7/JumpList/BuildItems';
+
+// lParam = (WCHAR *)category name
+ MS_JUMPLIST_ADDCATEGORY:pAnsiChar = 'w7/JumpList/AddCategory';
+
+// lParam = (MIRANDAJUMPLISTITEM *)item
+ MS_JUMPLIST_ADDITEM:pAnsiChar = 'w7/JumpList/AddItem';
+
+// wParam = prefix
+// lParam = argument
+ ME_JUMPLIST_PROCESS:pAnsiChar = 'w7/JumpList/Process';
+
+procedure MJumpList_AddCategory(name:pWideChar);
+begin
+ CallService(MS_JUMPLIST_ADDCATEGORY, 0, LPARAM(name));
+end;
+
+procedure MJumpList_AddItem(mir_icon:pAnsiChar; title, prefix, argument:pWideChar); overload;
+var
+ item:TMIRANDAJUMPLISTITEM;
+begin
+ item.iconSource:=MIS_ICOLIB;
+ item.iconName :=mir_icon;
+ item.iconIdx :=0;
+ item.szTitle :=title;
+ item.szPrefix :=prefix;
+ item.szArgument:=argument;
+ CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item));
+end;
+
+procedure MJumpList_AddItem(skinicon:int; title, prefix, argument:pWideChar); overload;
+var
+ item:TMIRANDAJUMPLISTITEM;
+begin
+ item.iconSource:=MIS_GENERAL;
+ item.iconName :=0;
+ item.iconIdx :=skinicon;
+ item.szTitle :=title;
+ item.szPrefix :=prefix;
+ item.szArgument:=argument;
+ CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item));
+end;
+
+procedure MJumpList_AddItem(proto:pansiChar; skinicon:int; title, prefix, argument:pWideChar); overload;
+var
+ item:TMIRANDAJUMPLISTITEM;
+begin
+ item.iconSource:=MIS_PROTOCOL;
+ item.iconName :=proto;
+ item.iconIdx :=skinicon;
+ item.szTitle :=title;
+ item.szPrefix :=prefix;
+ item.szArgument:=argument;
+ CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item));
+end;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_weather.inc b/plugins/ExternalAPI/delphi/m_weather.inc new file mode 100644 index 0000000000..7a89288b39 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_weather.inc @@ -0,0 +1,163 @@ +{
+Weather Protocol plugin for Miranda IM
+Copyright (C) 2005-2009 Boris Krasnovskiy All Rights Reserved
+Copyright (C) 2002-2005 Calvin Che
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+}
+
+{$IFNDEF M_WEATHER}
+{$DEFINE M_WEATHER}
+
+// {6B612A34-DCF2-4e32-85CF-B6FD006B745E}
+const MIID_WEATHER:TGUID = '{6B612A34-DCF2-4E32-85CF-B6FD006B745E}';
+
+//============ CONSTANTS ============
+const
+// name
+ WEATHERPROTONAME = 'Weather';
+ WEATHERPROTOTEXT = 'Weather';
+ DEFCURRENTWEATHER = 'WeatherCondition';
+ WEATHERCONDITION = 'Current';
+
+// weather conditions
+ SUNNY = ID_STATUS_ONLINE;
+ NA = ID_STATUS_OFFLINE;
+ PCLOUDY = ID_STATUS_AWAY;
+ CLOUDY = ID_STATUS_NA;
+ RAIN = ID_STATUS_OCCUPIED;
+ RSHOWER = ID_STATUS_DND;
+ SNOW = ID_STATUS_FREECHAT;
+ LIGHT = ID_STATUS_INVISIBLE;
+ THUNDER = ID_STATUS_INVISIBLE;
+ SSHOWER = ID_STATUS_ONTHEPHONE;
+ FOG = ID_STATUS_OUTTOLUNCH;
+ UNAVAIL = ID_STATUS_IDLE;
+
+
+//============ WEATHER CONDITION STRUCT ============
+
+// weather conditions (added in v0.1.2.0)
+type
+ PWEATHERINFO = ^TWEATHERINFO;
+ TWEATHERINFO = record
+ hContact:THANDLE;
+ id :array [0..127] of WideChar;
+ city :array [0..127] of WideChar;
+ update :array [0.. 63] of WideChar;
+ cond :array [0..127] of WideChar;
+ temp :array [0.. 15] of WideChar;
+ low :array [0.. 15] of WideChar;
+ high :array [0.. 15] of WideChar;
+ feel :array [0.. 15] of WideChar;
+ wind :array [0.. 15] of WideChar;
+ winddir :array [0.. 63] of WideChar;
+ dewpoint:array [0.. 15] of WideChar;
+ pressure:array [0.. 15] of WideChar;
+ humid :array [0.. 15] of WideChar;
+ vis :array [0.. 15] of WideChar;
+ sunrise :array [0.. 31] of WideChar;
+ sunset :array [0.. 31] of WideChar;
+// are the other ones that important!?
+ status:word;
+ end;
+
+
+const
+// =============== WEATHER SERVICES ================
+
+// Enable or disable weather protocol.
+// WPARAM = FALSE to toggle, TRUE to use the LPARAM
+// LPARAM = TRUE to enable, FALSE to disable
+ MS_WEATHER_ENABLED:pAnsiChar = 'Weather/EnableDisable';
+
+// Update all weather info
+// WPARAM = LPARAM = NULL
+ MS_WEATHER_UPDATEALL:pAnsiChar = 'Weather/UpdateAll';
+
+// Update all weather info + erase the old ones
+// WPARAM = LPARAM = NULL
+ MS_WEATHER_REFRESHALL:pAnsiChar = 'Weather/RefreshAll';
+
+// Below are the service functions for weather contacts
+// The plugin does NOT verify that they are used in weather contact,
+// so bad call on these function may cause crashes.
+
+// Update a single station
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_UPDATE:pAnsiChar = 'Weather/Update';
+
+// Update a single station + delete old settings
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_REFRESH:pAnsiChar = 'Weather/Refresh';
+
+// View the brief info of a contact
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_BRIEF:pAnsiChar = 'Weather/Brief';
+
+// Use default browser to open the complete forecast on web
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_COMPLETE:pAnsiChar = 'Weather/CompleteForecast';
+
+// Use default browser to open the weather map defined for the contact
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_MAP:pAnsiChar = 'Weather/Map';
+
+// Open the external log of the weather contact
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_LOG:pAnsiChar = 'Weather/Log';
+
+// Edit weather contact setting
+// WPARAM = (HANDLE)hContact
+// LPARAM = NULL
+ MS_WEATHER_EDIT:pAnsiChar = 'Weather/Edit';
+
+// parse the string to turn it to weather display
+// WPARAM = (WEATHERINFO*)hContact
+// LPARAM = (char*)display_str
+ MS_WEATHER_GETDISPLAY:pAnsiChar = 'Weather/GetDisplay';
+
+// =============== WEATHER EVENTS ================
+
+{
+HANDLE hContact = (HANDLE)wParam;
+BOOL Condition_Changed = (BOOL)lParam;
+
+hContact is the handle of updated contact
+If the weather condition is differ from the last update (either temperature/condition,
+or the last update time, depend what the user choose in the options), then
+Condition_Changed is true; otherwise is false.
+}
+ ME_WEATHER_UPDATED:pAnsiChar = 'Miranda/Weather/Updated';
+
+{
+Shows a warning message for Weather PopUp.
+wParam = (char*) lpzMessage
+lParam = Type
+Type can either be SM_WARNING, SM_NOTIFY, or SM_WEATHERALERT
+
+This event is used to avoid the error popup to occurs within a thread, so the "Use
+multiply thread" fuction don't have to be enabled for weather popups to work.
+}
+ SM_WEATHERALERT = 16;
+ ME_WEATHER_ERROR:pAnsiChar = 'Miranda/Weather/Error';
+
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_webcam.inc b/plugins/ExternalAPI/delphi/m_webcam.inc new file mode 100644 index 0000000000..592e28a479 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_webcam.inc @@ -0,0 +1,142 @@ +{
+ WebCam Video plugin by Sergei Polishchuk, SoftCab Inc
+ http://www.softcab.com
+ pserge@softcab.com
+}
+
+{$IFNDEF M_WEBCAM}
+{$DEFINE M_WEBCAM}
+
+const
+ MS_WEBCAM_OPEN = 'WebCam/Open';
+{
+ This opens webcamera
+ wParam, and lParam must be zero.
+ Returns HANDLE to web camera.
+ For Example:
+ HANDLE hWebcamera = CallService(MS_WEBCAM_OPEN, 0, 0);
+}
+
+ MS_WEBCAM_ISREADY = 'WebCam/IsReady';
+{
+ This zero if camera is ready for use, and non-zero if camera is still initializing.
+ It's useful to user this function after asynchronous opening of camera
+ wParam must be zero.
+ lParam = (LPARAM)(HANDLE)hCamera - camera handle
+ For Example:
+ HANDLE hWebcamera = CallService(MS_WEBCAM_ISREADY, 0, 0);
+}
+
+ MS_WEBCAM_CLOSE = 'WebCam/Close';
+{
+ This will close web camera.
+ wParam must be zero
+ lParam = (LPARAM)(HANDLE)hWebcamera - a handle returned by MS_WEBCAM_OPEN
+ Return value is undefined.
+ For Example:
+ CallService(MS_WEBCAM_CLOSE, 0, (LPARAM)hWebcamera);
+}
+
+ MS_WEBCAM_SHOWWND = 'WebCam/Show';
+{
+ This will show or hide web camera window
+ wParam = 1 to show window, or zero to hide one
+ lParam = (LPARAM)(HANDLE)hWebcamera - handle to camera
+ Return value is undefined.
+ For Example, this will show the window:
+ CallService(MS_WEBCAM_SHOWWND, 1, (LPARAM)hWebcamera);
+}
+
+ MS_WEBCAM_FREE = 'WebCam/Free';
+{
+ This will free WEBCAM_QUERY fields.
+ wParam = sizeof(WEBCAM_QUERY)
+ lParam = (LPARAM)(WEBCAM_QUERY*)&Query
+ Return value is undefined
+ For Example:
+ CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query);
+}
+
+ MS_WEBCAM_QUERY = 'WebCam/Query';
+ WANT_PICTURE = pointer(-1);
+{
+ This will query web camera for data.
+ wParam = sizeof(WEBCAM_QUERY)
+ lParam = (LPARAM)(WEBCAM_QUERY*)&Query
+ Returns zero in case of success, or non-zero in case of any error
+ Before queryng camera, you need to setup some WEBCAM_QUERY structure fields.
+}
+
+(*
+WEBCAM_QUERY Query;
+memset(&Query, 0, sizeof(Query));
+Query.hCamera = hWebcamera;
+Query.Jpeg = WANT_PICTURE; // we want to get .JPG image
+Query.Bitmap = NULL; // we do not need .BMP image
+int ret = CallService(MS_WEBCAM_QUERY, sizeof(Query), (LPARAM)&Query);
+if(!ret)
+{ if(Query.Jpeg != NULL)
+ { // do something with JPG picture. For example, you may save it to .JPG file.
+ }
+ // now let's release the memory
+ CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query);
+}
+*)
+
+ MS_WEBCAM_SCREENSHOT = 'WebCam/ScreenShot';
+{
+ This will return window screenshot
+ wParam = sizeof(WEBCAM_QUERY)
+ lParam = (LPARAM)(WEBCAM_QUERY*)&Query
+ Returns zero in case of success, or non-zero in case of any error
+ WEBCAMBUF->hCamera specifies window handle.
+ It's not required to open webcamera in order to run this service function.
+}
+
+(*
+
+WEBCAM_QUERY Query;
+memset(&Query, 0, sizeof(Query));
+Query.hCamera = (HANDLE)GetDesktopWindow(); // getting whole desktop picture.
+Query.Jpeg = WANT_PICTURE; // we want to get .JPG image
+Query.Bitmap = NULL; // we do not need .BMP image
+int ret = CallService(MS_WEBCAM_SCREENSHOT, sizeof(Query), (LPARAM)&Query);
+if(!ret)
+{ if(Query.Jpeg != NULL)
+ { // do something with JPG picture. For example, you may save it to .JPG file.
+ }
+ // now let's release the memory
+ CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query);
+}
+
+*)
+
+ ME_WEBCAM_SNAPSHOTRECEIVED = 'WebCam/SnapshotRecv';
+{
+ This event will be fired right after receiving snapshot from remote contact.
+ wParam=(WPARAM)(HANDLE)hContact - a contact handle
+ lParam=(LPARAM)(WEBCAMBUF*)buffer - a buffer that contains JPEG image
+ IMPORTANT: you should not modify the buffer. It's read-only.
+}
+
+type
+ ptag_WEBCAMBUF = ^tag_WEBCAMBUF;
+ tag_WEBCAMBUF = record
+ Size:dword; // size of Data buffer in bytes
+ Data:array [0..0] of byte;
+ end;
+ PWEBCAMBUF = ^WEBCAMBUF;
+ WEBCAMBUF = tag_WEBCAMBUF;
+
+type
+ ptag_WEBCAM_QUERY = ^tag_WEBCAM_QUERY;
+ tag_WEBCAM_QUERY = record
+ hCamera:THANDLE; // [in] HANDLE to web camera
+ cx,cy :word; // [out] camera picture size
+ Jpeg :PWEBCAMBUF; // [in,out] points to .JPG file content in memory
+ Bitmap :PWEBCAMBUF; // [in,out] points to .BMP file content in memory
+ end;
+ PWEBCAM_QUERY = ^WEBCAM_QUERY;
+ WEBCAM_QUERY = tag_WEBCAM_QUERY;
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_yamn.inc b/plugins/ExternalAPI/delphi/m_yamn.inc new file mode 100644 index 0000000000..a44debb669 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_yamn.inc @@ -0,0 +1,156 @@ +{$IFNDEF M_YAMN}
+{$DEFINE M_YAMN}
+
+//
+//================================== VARIABLES STRUCT ========================================
+//
+
+{$IFNDEF MIRANDASERVICE}
+type
+ MIRANDASERVICE = function(WPARAM,LPARAM:int):int; cdecl;
+{$ENDIF}
+
+const
+ YAMN_VARIABLESVERSION = 3;
+
+type
+ PYAMN_VARIABLES = ^TYAMN_VARIABLES;
+ TYAMN_VARIABLES = record
+ hInst:HINSTANCE;
+ MessageWnds:THANDLE;
+ NewMailAccountWnd:THANDLE;
+ Shutdown:int;
+ end;
+ CYAMNVariables = TYAMN_VARIABLES;
+
+//
+//================================== EXPORTED FUNCTIONS STRUCT ===============================
+//
+type
+ CExportedFunctions = record
+ ID:PAnsiChar;
+ Ptr:pointer;
+ end;
+
+type
+ CExportedServices = record
+ ID:PAnsiChar;
+ Ptr:MIRANDASERVICE;
+ end;
+
+//
+//================================== YAMN EVENTS ==================================
+//
+
+const
+//UninstallPlugin Event
+//Sent when user wants to uninstall YAMN and all its plugins
+ 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)
+ 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
+ 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
+ MS_YAMN_GETVARIABLES = 'YAMN/Service/GetVar';
+
+//ForceCheck Service
+//Check mail on accounts
+//WPARAM- not used
+//LPARAM- not used
+ MS_YAMN_FORCECHECK = 'YAMN/Service/ForceCheck';
+
+//AccountCheck Service
+//Check mail on individual account
+//WPARAM- HACCOUNT
+//LPARAM- not used
+ 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.
+ 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.
+ 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.
+ 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
+ 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
+ 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
+ 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
+ MS_YAMN_BADCONNECTION = 'YAMN/Service/BadConnection';
+
+{$ENDIF}
diff --git a/plugins/ExternalAPI/delphi/m_yapp.inc b/plugins/ExternalAPI/delphi/m_yapp.inc new file mode 100644 index 0000000000..772c5cca81 --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_yapp.inc @@ -0,0 +1,88 @@ +{$IFNDEF M_YAPP}
+{$DEFINE M_YAPP}
+
+////////////////////////////////////////////////
+// YAPP API
+///////////////////////////////////////////////
+
+type
+ TPopupData = record
+ cbSize :int;
+ flags :int; // OR of PDF_* flags below
+ hContact :HANDLE;
+ hIcon :HICON;
+ szTitle :TChar;
+ szText :TChar;
+ colorBack :COLORREF; // if colorBack and colorText are equal, defaults will be used
+ colorText :COLORREF;
+ windowProc:WNDPROC; // optional custom window procedure
+ timeout :int; // -1 == infinite, 0 == default, otherwise timeout in seconds
+ opaque :pointer;
+ end;
+
+const
+ PDF_UNICODE = $0001;
+
+// windowProc messages
+ PM_INIT = WM_USER+$0202; // message sent to your windowProc after the window has been initialized
+ PM_DIENOTIFY = WM_USER+$0200; // message sent to your windowProc just before the window is destroyed (can be used e.g. to free your opaque data)
+ PM_DESTROY = WM_USER+$0201; // send to the popup hWnd (use PostMessage generally, or SendMessage inside your windowProc) to kill it
+
+// Show a popup
+//wParam = &PopupData
+//lParam = 0
+// returns -1 if popups disabled
+ MS_YAPP_SHOWPOPUP = 'YAPP/ShowPopup';
+
+// get hContact from PopupData
+// wParam = hWnd
+// lParam = 0
+// return hContact
+ MS_YAPP_GETCONTACT = 'YAPP/GetContact';
+
+// get opaque from PopupData
+// wParam = hWnd
+// lParam = 0
+// returns opaque
+ MS_YAPP_GETOPAQUE = 'YAPP/GetOpaque';
+
+//------------- Class API ----------------//
+
+type
+ TPopupClass = record
+ cbSize :int;
+ flags :int;
+ pszName :PAnsiChar;
+ szDescription:TChar;
+ hIcon :HICON;
+ colorBack :COLORREF;
+ colorText :COLORREF;
+ windowProc :WNDPROC;
+ timeout :int;
+ end;
+
+const
+ PCF_UNICODE = $0001;
+
+// wParam = 0
+// lParam = (POPUPCLASS *)&pc
+ MS_YAPP_REGISTERCLASS = 'YAPP/RegisterClass'; // old
+ MS_POPUP_REGISTERCLASS = 'PopUp/RegisterClass';
+
+type
+ TPopupClassInstance = record
+ cbSize :int;
+ pszClassName:PAnsiChar;
+ szTitle :TChar;
+ szText :TChar;
+ opaque :pointer;
+ hContact :HANDLE;
+ end;
+
+const
+// wParam = 0
+// lParam = (POPUPDATACLASS *)&pdc
+ MS_YAPP_CLASSINSTANCE = 'YAPP/ClassInstance'; // old
+ MS_POPUP_ADDPOPUPCLASS = 'PopUp/AddPopupClass';
+
+{$ENDIF}
|