diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-18 17:21:08 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-18 17:21:08 +0000 |
commit | a1d6cb7bdc354be0968c6ba5ac4615e14a90eead (patch) | |
tree | a1ed17002c33644b3362e6c1e6572f3fa7ef17d7 /include | |
parent | fef6b799309b5b9d7cbb2845fa27b777477e2a61 (diff) |
these tons of code aren't needed anymore...
git-svn-id: http://svn.miranda-ng.org/main/trunk@16850 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r-- | include/delphi/m_contacts.inc | 37 | ||||
-rw-r--r-- | include/m_contacts.h | 52 |
2 files changed, 12 insertions, 77 deletions
diff --git a/include/delphi/m_contacts.inc b/include/delphi/m_contacts.inc index 5381d41913..e6636c2e17 100644 --- a/include/delphi/m_contacts.inc +++ b/include/delphi/m_contacts.inc @@ -18,23 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. {$IFNDEF M_CONTACTS}
{$DEFINE M_CONTACTS}
-type
- PCONTACTINFO = ^TCONTACTINFO;
- TCONTACTINFO = record
- cbSize : int;
- dwFlag : byte;
- hContact: TMCONTACT;
- szProto : PAnsiChar;
- _type : byte;
- retval: record // in C this is a nameless union
- case longint of
- 0: (bVal : byte);
- 1: (wVal : word);
- 2: (dVal : dword);
- 3: (szVal : TChar);
- 4: (cchVal: word);
- end;
- end;
const
@@ -90,23 +73,7 @@ const // you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
CNF_DISPLAYNC = 17;
-// Add this flag if you want to get the Unicode info
- CNF_UNICODE = $80;
-
-// If MS_CONTACT_GETCONTACTINFO returns 0 (valid), then one of the following
-// types is setting telling you what type of info you received
- CNFT_BYTE = 1;
- CNFT_WORD = 2;
- CNFT_DWORD = 3;
- CNFT_ASCIIZ = 4;
-
- {
- wParam : not used
- lParam : Pointer to an initialised TCONTACTINFO structure
- affects: Get contact information
- returns: Zero on success, non zero on failure.
- notes : If successful, the type is set and the result is put into the associated member of TCONTACTINFO
- }
- MS_CONTACT_GETCONTACTINFO:PAnsiChar = 'Miranda/Contact/GetContactInfo';
+// result must be freed using mir_free
+function Contact_GetInfo(iType:Integer; hContact:TMCONTACT; proto:PAnsiChar=0) : PWideChar; stdcall; external AppDLL;
{$ENDIF}
diff --git a/include/m_contacts.h b/include/m_contacts.h index e485922bd9..388cf11b43 100644 --- a/include/m_contacts.h +++ b/include/m_contacts.h @@ -21,20 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_CONTACTS_H__
#define M_CONTACTS_H__ 1
-typedef struct {
- int cbSize;
- BYTE dwFlag;
- MCONTACT hContact;
- char *szProto;
- BYTE type;
- union {
- BYTE bVal;
- WORD wVal;
- DWORD dVal;
- TCHAR *pszVal;
- WORD cchVal;
- };
-} CONTACTINFO;
+#ifndef M_CORE_H__
+#include <m_core.h>
+#endif
// Types of information you can retrieve by setting the dwFlag in CONTACTINFO
#define CNF_FIRSTNAME 1 // returns first name (string)
@@ -77,38 +66,17 @@ typedef struct { // Special types
// Return the custom name using the name order setting
-// IMPORTANT: When using CNF_DISPLAY you MUST free the string returned
-// You must **NOT** do this from your version of free() you have to use Miranda's free()
-// you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
#define CNF_DISPLAY 16
// Same as CNF_DISPLAY except the custom handle is not used
-// IMPORTANT: When using CNF_DISPLAYNC you MUST free the string returned
-// You must **NOT** do this from your version of free() you have to use Miranda's free()
-// you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
#define CNF_DISPLAYNC 17
-// Add this flag if you want to get the Unicode info
-#define CNF_UNICODE 0x80
-
-#if defined(_UNICODE)
- #define CNF_TCHAR CNF_UNICODE // will use TCHAR* instead of char*
-#else
- #define CNF_TCHAR 0 // will return char*, as usual
-#endif
-
-// If MS_CONTACT_GETCONTACTINFO returns 0 (valid), then one of the following
-// types is setting telling you what type of info you received
-#define CNFT_BYTE 1
-#define CNFT_WORD 2
-#define CNFT_DWORD 3
-#define CNFT_ASCIIZ 4
-
// Get contact information
-// wParam = not used
-// lParam = (CONTACTINFO *)
-// Returns 1 on failure to retrieve the info and 0 on success. If
-// sucessful, the type is set and the result is put into the associated
-// member of CONTACTINFO
-#define MS_CONTACT_GETCONTACTINFO "Miranda/Contact/GetContactInfo"
+// Returns NULL on failure to retrieve the info or a string on success.
+// If successful, this string must be freed using mir_free
+
+EXTERN_C MIR_APP_DLL(TCHAR*) Contact_GetInfo(
+ int type, // one of the CNF_* constants
+ MCONTACT hContact, // contact id or NULL for the global data
+ const char *szProto = NULL); // protocol for global data. if skipped, grabbed from hContact
#endif // M_CONTACTS_H__
|