summaryrefslogtreecommitdiff
path: root/ExternalAPI
diff options
context:
space:
mode:
Diffstat (limited to 'ExternalAPI')
-rw-r--r--ExternalAPI/m_flags.h2
-rw-r--r--ExternalAPI/m_flags.inc74
-rw-r--r--ExternalAPI/m_nudge.h9
-rw-r--r--ExternalAPI/m_script.h143
-rw-r--r--ExternalAPI/m_voice.h158
-rw-r--r--ExternalAPI/m_voiceservice.h86
6 files changed, 469 insertions, 3 deletions
diff --git a/ExternalAPI/m_flags.h b/ExternalAPI/m_flags.h
index aafa2fb..40ea0c1 100644
--- a/ExternalAPI/m_flags.h
+++ b/ExternalAPI/m_flags.h
@@ -89,7 +89,7 @@ Returns a country number on success,
or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
*/
#define MS_FLAGS_DETECTCONTACTORIGINCOUNTRY "Flags/DetectContactOriginCountry"
-#define MS_FLAGS_GETCONTACTORIGINCOUNTRY "Flags/GetContactOriginCountry" //for beta version 0.1.1.0
+
#if !defined(FLAGS_NOSETTINGS) && defined(EXTRA_ICON_ADV2)
#define SETTING_SHOWSTATUSICONFLAG_DEFAULT 1
diff --git a/ExternalAPI/m_flags.inc b/ExternalAPI/m_flags.inc
new file mode 100644
index 0000000..f3dc0e8
--- /dev/null
+++ b/ExternalAPI/m_flags.inc
@@ -0,0 +1,74 @@
+{
+Miranda IM Country Flags Plugin
+Copyright (C) 2006-2007 H. Herkenrath
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program (Flags-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+{$ifndef M_FLAGS_H}
+{$define M_FLAGS_H}
+
+const
+
+{
+ Country Flags Plugin v0.1.0.3
+}
+
+{ interface id }
+MIID_FLAGS: TGUID = '{88A3B66E-C438-4381-BC17-71D99D225F9C}';
+
+{ Load a country flag icon from the skin library. v0.1.0.0+
+The retrieved icon should be released using MS_SKIN2_RELEASEICON after use.
+The country numbers can be retrieved using MS_UTILS_GETCOUNTRYLIST.
+Another way to get the country numbers are the CTRY_* constants in winnls.h of WinAPI.
+To retrieve the country number from a locale, call GetLocaleInfo().
+with LOCALE_ICOUNTRY.
+ wParam : countryNumber
+ lParam : (BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
+Returns a icon handle (HICON) on success, NULL on error.
+}
+MS_FLAGS_LOADCOUNTRYFLAGICON = 'Flags/LoadCountryFlagIcon';
+
+{ Create a merged country flag icon. v0.1.0.0+
+The retrieved icon should be released using DestroyIcon() after use.
+ wParam : countryNumberUpper
+ lParam : countryNumberLower
+Returns a icon handle (HICON) on success, NULL on error.
+}
+MS_FLAGS_CREATEMERGEDFLAGICON = 'Flags/CreateMergedFlagIcon';
+
+{ Get a corresponding country given an (external) IP address. v0.1.0.0+
+The retrieved number can be converted to a normal country name
+using MS_UTILS_GETCOUNTRYBYNUMBER.
+ wParam : dwExternalIP (same format as used Netlib)
+ lParam : 0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+}
+MS_FLAGS_IPTOCOUNTRY = 'Flags/IpToCountry';
+
+{ Detect the origin country of a contact. v0.1.0.0+
+This uses the contacts's IP first, and falls back on using
+CNF_COUNTRY and CNF_COCOUNTRY of contact details.
+To get the contact's IP it relies on the db setting
+"RealIP" in the proto module.
+ wParam : (WPARAM)(HANDLE)hContact
+ lParam : 0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+}
+MS_FLAGS_DETECTCONTACTORIGINCOUNTRY = 'Flags/DetectContactOriginCountry';
+
+{$endif} // M_FLAGS_H
diff --git a/ExternalAPI/m_nudge.h b/ExternalAPI/m_nudge.h
index e87e410..e80215e 100644
--- a/ExternalAPI/m_nudge.h
+++ b/ExternalAPI/m_nudge.h
@@ -1,5 +1,10 @@
#define MS_SHAKE_CLIST "SHAKE/Service/ShakeClist"
#define MS_SHAKE_CHAT "SHAKE/Service/ShakeChat"
-#define MS_SHAKE_CLIST_TRIGGER "SHAKE/Service/TriggerShakeClist"
-#define MS_SHAKE_CHAT_TRIGGER "SHAKE/Service/TirggerShakeChat"
#define MS_NUDGE_SEND "NUDGE/Send"
+
+// Hide or Show the context menu "send nudge"
+// wParam = char *szProto
+// lParam = BOOL show
+#define MS_NUDGE_SHOWMENU "NudgeShowMenu"
+
+#define MUUID_NUDGE_SEND { 0x9c66a9a, 0x57dc, 0x454d, { 0xa9, 0x30, 0xf8, 0xc0, 0x4f, 0xe2, 0x98, 0x38 } }
diff --git a/ExternalAPI/m_script.h b/ExternalAPI/m_script.h
new file mode 100644
index 0000000..957333a
--- /dev/null
+++ b/ExternalAPI/m_script.h
@@ -0,0 +1,143 @@
+/*
+
+Miranda Scripting Plugin for Miranda-IM
+Copyright 2004-2006 Piotr Pawluczuk (www.pawluczuk.info)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+/*
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_SCRIPT_H__
+#define M_SCRIPT_H__ 1
+
+#define MBOT_GETCPARAM(cp) ((void*)((unsigned char*)cp + 24))
+
+typedef enum {MBOT_NUMBER=0,MBOT_STRING=1,MBOT_VOID=2}MBOT_TYPE;
+
+#ifndef _LIBPHP_H__
+enum SVAR_TYPE{SV_NULL,SV_LONG=1,SV_WORD=2,SV_DOUBLE=3,
+ SV_STRING=4,SV_LPOINTER=5,SV_ARRAY=11};
+#endif
+
+typedef struct{
+ int cbSize; //Set to sizeof();
+ char* pszOutput;
+ char* pszResult;
+}MBOT_RESULT;
+
+struct MBOT_VPARAM{
+ void* data;
+ long length; /*length of data, used for strings, and binary strings*/
+ long type;
+};
+
+/*
+MBOT function prototypes;
+*/
+typedef int (*MBOT_RegisterFunction)(const char* name,void* fptr,long lp,
+ MBOT_TYPE rval,MBOT_TYPE p1,MBOT_TYPE p2,MBOT_TYPE p3,MBOT_TYPE p4);
+typedef int (*MBOT_UnregisterFunction)(const char* name);
+
+typedef void* (*MBOT_Malloc)(long amount);
+typedef char* (*MBOT_Strdup)(const char* str);
+typedef void (*MBOT_Free)(void* ptr);
+typedef void (*MBOT_FreeResult)(MBOT_RESULT* ptr);
+
+typedef int (*MBOT_GetVar)(const char* name,void** value,SVAR_TYPE* cType);//returns TRUE if var exists;
+typedef int (*MBOT_DelVar)(const char* name);
+typedef int (*MBOT_SetVar)(const char* name,void* value,SVAR_TYPE cType);
+typedef int (*MBOT_NewVar)(const char* name,void* value,SVAR_TYPE cType,char locked);
+
+/*******************************************************************
+ * PARAMETERS:
+ pszScript - source code of the script; ***DO NOT USE PHP TAGS*** <?php ?>
+ pResult - if set, you'll get the struct filled with the result;
+ NOTE! Remember to release the struct with "fp_freeresult"!;
+ pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer;
+ nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too
+
+ *EXAMPLE:
+ fpExecuteFile("mbot/scripts/my.php","fct1",&mbr,"parameter",
+ MBOT_STRING,"suf","hello",100,25.6);
+ *******************************************************************/
+typedef int (*MBOT_ExecuteScript)(const char* pszScript,MBOT_RESULT* pResult,
+ void* pCParam,MBOT_TYPE nCPType);
+
+/*******************************************************************
+ * PARAMETERS:
+ pszPathname - relative or absolute path of the php file;
+ pszFcnName - function name can be NULL (whole file will be executed then);
+ pResult - if set, you'll get the struct filled with the result;
+ NOTE! Remember to release the struct with "fp_freeresult"!;
+ pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer;
+ nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too
+ pszPTypes - a string containing pformats s-string,u-long,l-long,d-long,q-double,f-float,x-hex long, v - MBOT_VPARAM*
+ ... - values;
+
+ *EXAMPLE:
+ fpExecuteScript("mbot/scripts/my.php","fct1",&mbr,"parameter",
+ MBOT_STRING,"suf","hello",100,25.6);
+ *******************************************************************/
+typedef int (*MBOT_ExecuteFile)(const char* pszPathname,const char* pszFcnName,MBOT_RESULT* pResult,
+ void* pCParam,MBOT_TYPE nCPType,const char* pszPTypes,...);
+
+typedef struct{
+ int cbSize; //sizeof(MBOT_LPHP);
+ const char* pszMBotVersion;
+ //execution
+ MBOT_ExecuteScript fpExecuteScript;
+ MBOT_ExecuteFile fpExecuteFile;
+ //functions
+ MBOT_RegisterFunction fpRegister;
+ MBOT_UnregisterFunction fpUnregister;
+ //variables
+ MBOT_NewVar fpNewVar;
+ MBOT_SetVar fpSetVar;
+ MBOT_GetVar fpGetVar;
+ MBOT_DelVar fpDelVar;
+ //memory
+ MBOT_Strdup fp_strdup;
+ MBOT_Malloc fp_malloc;
+ MBOT_Free fp_free;
+ MBOT_FreeResult fp_freeresult;
+}MBOT_FUNCTIONS;
+
+/*MS_MBOT_GET_FUNCTIONS
+lParam = wParam = 0;
+returns a pointer to const MBOT_FUNCTIONS structure;
+*/
+#define MS_MBOT_GET_FCN_TABLE "MBot/GetFcnTable"
+#endif //M_SCRIPT_H__ \ No newline at end of file
diff --git a/ExternalAPI/m_voice.h b/ExternalAPI/m_voice.h
new file mode 100644
index 0000000..a81d866
--- /dev/null
+++ b/ExternalAPI/m_voice.h
@@ -0,0 +1,158 @@
+/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_VOICE_H__
+# define __M_VOICE_H__
+
+
+#define EVENTTYPE_VOICE_CALL 8739
+
+
+#define PROTOTYPE_VOICE (PROTOTYPE_ENCRYPTION-9)
+
+
+#define VOICE_UNICODE 0x80000000
+
+#ifdef UNICODE
+# define VOICE_TCHAR VOICE_UNICODE
+#else
+# define VOICE_TCHAR 0
+#endif
+
+#define VOICE_STATE_TALKING 0
+#define VOICE_STATE_RINGING 1
+#define VOICE_STATE_CALLING 2
+#define VOICE_STATE_ON_HOLD 3
+#define VOICE_STATE_ENDED 4
+
+typedef struct {
+ int cbSize; // Struct size
+ const char *szModule; // The name of the protocol module (used only in notifications)
+ char *id; // Protocol especific ID for this call
+ int flags; // Can be VOICE_CALL_CONTACT or VOICE_CALL_STRING (VOICE_UNICODE to say the string is unicode)
+ union { // Who to call
+ HANDLE hContact;
+ TCHAR *ptszContact;
+ char *pszContact;
+ WCHAR *pwszContact;
+ };
+ int state; // VOICE_STATE_*
+
+} VOICE_CALL;
+
+
+/*
+Notifies that a voice call changed state
+
+wParam: const VOICE_CALL *
+lParam: ignored
+return: 0 on success
+*/
+#define PE_VOICE_CALL_STATE "/Voice/State"
+
+
+#define VOICE_SUPPORTED 1 // Set if proto support voice calls. Probabilly will be 1 ;)
+#define VOICE_CALL_CONTACT 2 // Set if a call can be made to a hContact
+#define VOICE_CALL_CONTACT_NEED_TEST 4 // Set if the contact need to be tested with PS_VOICE_CALL_CONTACT_VALID (needs VOICE_CALL_CONTACT set to work)
+#define VOICE_CALL_STRING 8 // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string)
+#define VOICE_CAN_SET_DEVICE 16 // Set if the devices to mic in and sound out can be set (or the protocol will handle it internally)
+#define VOICE_CAN_HOLD 32 // Set if a call can be put on hold
+/*
+Get protocol voice support flags
+
+wParam: ignored
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_GETINFO "/Voice/GetInfo"
+
+/*
+Request to the protocol a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_CALL "/Voice/Call"
+
+/*
+Service called to make the protocol answer a call.
+It is an async call. If the call was answered, the PE_VOICE_STARTEDCALL
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_ANSWERCALL "/Voice/AnswerCall"
+
+/*
+Service called to make the protocol answer a call. This can be called if the
+call is ringing or has started. If called any other time it should be ignored.
+It is an async call. If the call was droped, the PE_VOICE_ENDEDCALL
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_DROPCALL "/Voice/DropCall"
+
+/*
+Service called to make the protocol hold a call. This means that the call should not
+be droped, but it should be muted and put in a hold, to allow other call to be answered.
+If the protocol can't hold a cal, it should be droped.
+
+This can be called if the call has started. If called any other time it should be ignored.
+It is an async call. If the call was droped, the PE_VOICE_HOLDEDCALL
+notification will be fired.
+
+wParam: (const char *) id
+lParam: ignored
+return: 0 on success
+*/
+#define PS_VOICE_HOLDCALL "/Voice/HoldCall"
+
+/*
+Used if protocol support VOICE_CALL_STRING. The call string is passed as
+wParam and the proto should validate it.
+
+wParam: (const TCHAR *) call string
+lParam: ignored
+return: 0 if wrong, 1 if correct
+*/
+#define PS_VOICE_CALL_STRING_VALID "/Voice/CallStringValid"
+
+/*
+Used if protocol support VOICE_CALL_CONTACT and VOICE_CALL_CONTACT_NEED_TEST.
+The hContact is passed as wParam and the proto should tell if this contact can be
+called.
+
+wParam: (HANDLE) hContact
+lParam: (BOOL) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?'
+return: 0 if can't be called, 1 if can
+*/
+#define PS_VOICE_CALL_CONTACT_VALID "/Voice/CallContactValid"
+
+
+
+
+
+#endif // __M_VOICE_H__
diff --git a/ExternalAPI/m_voiceservice.h b/ExternalAPI/m_voiceservice.h
new file mode 100644
index 0000000..98c3580
--- /dev/null
+++ b/ExternalAPI/m_voiceservice.h
@@ -0,0 +1,86 @@
+/*
+Copyright (C) 2007 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_VOICESERVICE_H__
+# define __M_VOICESERVICE_H__
+
+#include "m_voice.h"
+
+
+#define MIID_VOICESERVICE { 0x7d64437, 0xef2e, 0x4f60, { 0xbb, 0x2d, 0x3c, 0x51, 0x8f, 0xe2, 0x4d, 0x63 } }
+
+
+/*
+This services are a mirror of the services/notifications in m_voice.h,
+with the difference that that ones are to be used by protocols, and this ones
+are to be used by plugins that can make calls to contacts in multiple protocols.
+*/
+
+
+/*
+Notifies that a voice call changed state
+
+wParam: const VOICE_CALL *
+lParam: ignored
+return: 0 on success
+*/
+#define MS_VOICESERVICE_STATE "VoiceService/State"
+
+
+
+struct VOICE_MODULE
+{
+ int cbSize; // sizeof(VOICE_MODULE)
+ char *name; // The internal name of the plugin. All PS_* serivces (except PS_VOICE_GETINFO)
+ // defined in m_voide.h need to be created based in this name. For example,
+ // PS_VOICE_CALL (/Voice/Call) need to be created as <name>/Voice/Call
+ int flags; // VOICE_* from m_voice.h
+};
+/*
+Register a new plugin that can make/receive voice calls.
+
+wParam: const VOICE_MODULE *
+lParam: ignored
+return: 0 on success
+*/
+#define MS_VOICESERVICE_REGISTER "VoiceService/Register"
+
+
+/*
+Request a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: ignored
+return: the number of option calls for a contact. If > 0, it can be called
+*/
+#define MS_VOICESERVICE_CAN_CALL "VoiceService/CanCall"
+
+/*
+Request a voice call to hContact.
+
+wParam: (HANDLE) hContact
+lParam: (char *) Protocol or NULL to use any proto avaiable
+return: 0 on success
+*/
+#define MS_VOICESERVICE_CALL "VoiceService/Call"
+
+
+
+#endif // __M_VOICESERVICE_H__