summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-27 17:19:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-27 17:19:20 +0300
commite1a3a426a742028570baaee7430b2b5750734e4c (patch)
treeed801bc7954fcd7c860c506d4f451a8bcb82e39b /include
parent3ae8bfcab00ae1b497b8c1c61d6dcf4bf7322e06 (diff)
obsolete structure ADDCONTACTSTRUCT, service MS_ADDCONTACT_SHOW and whole m_addcontact.h removed and replaced with Contact_Add* functions
Diffstat (limited to 'include')
-rw-r--r--include/m_addcontact.h68
-rw-r--r--include/m_contacts.h9
-rw-r--r--include/m_protosvc.h30
3 files changed, 27 insertions, 80 deletions
diff --git a/include/m_addcontact.h b/include/m_addcontact.h
deleted file mode 100644
index c4ee042ef6..0000000000
--- a/include/m_addcontact.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (c) 2012-17 Miranda NG project (https://miranda-ng.org)
-Copyright (c) 2000-08 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_ADDCONTACT_H__
-#define M_ADDCONTACT_H__ 1
-
-typedef struct{
- int handleType; // one of the HANDLE_ constants
- union {
- MEVENT hDbEvent; // hDbEvent if acs.handleType == HANDLE_EVENT
- MCONTACT hContact; // hContact if acs.handleType == HANDLE_CONTACT
- // ignored if acs.handleType == HANDLE_SEARCHRESULT
- };
- const char *szProto; // ignored if acs.handleType != HANDLE_SEARCHRESULT
- PROTOSEARCHRESULT *psr; // ignored if acs.handleType != HANDLE_SEARCHRESULT
-}ADDCONTACTSTRUCT;
-
-/*
- Description: Open the add contact dialog, see notes
-
- wParam = [ (WPARAM)hWndParent ]
- lParam = (LPARAM)(ADDCONTACTSTRUCT*)&acs
-
- Notes:
-
- During 0.3.0.0 development (circa 2003/06/08)
-
- An entire copy of the ADDCONTACTSTRUCT structure is made,
- the PROTOSEARCHRESULT is also copied at psr->cbSize, all default
- strings are copied (even if they're not needed/used)
- if you pass a structure that is bigger than PROTOSEARCHRESULT
- then do not use pointers in the newly defined area because
- they will not be copied.
-
- passing wParam == NULL will result in a dialog that is created modeless
-
- Before the circa, a modal dialog was *always* created and
- strings within PROTOSEARCHRESULT were not copied.
-
-*/
-
-#define HANDLE_SEARCHRESULT 0
-#define HANDLE_EVENT 1
-#define HANDLE_CONTACT 2
-#define MS_ADDCONTACT_SHOW "AddContact/Show"
-
-#endif // M_ADDCONTACT_H__
diff --git a/include/m_contacts.h b/include/m_contacts.h
index 9295074932..17811981b3 100644
--- a/include/m_contacts.h
+++ b/include/m_contacts.h
@@ -79,4 +79,13 @@ EXTERN_C MIR_APP_DLL(wchar_t*) Contact_GetInfo(
MCONTACT hContact, // contact id or NULL for the global data
const char *szProto = NULL); // protocol for global data. if skipped, grabbed from hContact
+/////////////////////////////////////////////////////////////////////////////////////////
+// Add contact's dialog
+
+// passing hWnd == NULL will result in a dialog that is created modeless
+
+EXTERN_C MIR_APP_DLL(void) Contact_Add(MCONTACT hContact, HWND hwndParent = nullptr);
+EXTERN_C MIR_APP_DLL(void) Contact_AddByEvent(MEVENT hEvent, HWND hwndParent = nullptr);
+EXTERN_C MIR_APP_DLL(void) Contact_AddBySearch(const char *m_szProto, struct PROTOSEARCHRESULT *m_psr, HWND hwndParent = nullptr);
+
#endif // M_CONTACTS_H__
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index cc6c6ccc13..4c1064e6e4 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -338,7 +338,8 @@ static __inline unsigned long Proto_Status2Flag(int status)
#define PSR_UNICODE 0x0001 // all strings go in UTF16-LE
#define PSR_UTF8 0x0002 // all strings go in UTF8
-typedef struct {
+struct PROTOSEARCHRESULT
+{
int cbSize;
MAllStrings nick;
MAllStrings firstName;
@@ -346,7 +347,7 @@ typedef struct {
MAllStrings email;
MAllStrings id;
int flags;
-} PROTOSEARCHRESULT;
+};
#define PS_BASICSEARCH "/BasicSearch"
@@ -371,11 +372,12 @@ typedef struct {
// Results are returned as for PS_BASICSEARCH.
// This function is only available if the PF1_SEARCHBYNAME capability is set
-typedef struct {
+struct PROTOSEARCHBYNAME
+{
wchar_t *pszNick;
wchar_t *pszFirstName;
wchar_t *pszLastName;
-} PROTOSEARCHBYNAME;
+};
#define PS_SEARCHBYNAME "/SearchByName"
@@ -405,12 +407,13 @@ typedef struct {
#define PS_SEARCHBYADVANCED "/SearchByAdvanced"
-typedef struct {
+struct CUSTOMSEARCHRESULTS
+{
size_t nSize;
int nFieldCount;
wchar_t **pszFields;
PROTOSEARCHRESULT psr;
-} CUSTOMSEARCHRESULTS;
+};
///////////////////////////////////////////////////////////////////////////////
// Adds a search result to the contact list
@@ -465,10 +468,11 @@ typedef struct {
#define FILERESUME_RENAME 3
#define FILERESUME_SKIP 4
-typedef struct {
+struct PROTOFILERESUME
+{
int action; // a FILERESUME_ flag
const wchar_t *szFilename; // full path. Only valid if action == FILERESUME_RENAME
-} PROTOFILERESUME;
+};
#define PS_FILERESUME "/FileResume"
@@ -743,14 +747,15 @@ typedef struct {
// DB event: EVENTTYPE_MESSAGE, blob contains szMessage without 0 terminator
// Return 0 - success, other failure
-typedef struct {
+struct PROTORECVEVENT
+{
DWORD flags;
DWORD timestamp; // unix time
char *szMessage; // message body in utf8
LPARAM lParam; // extra space for the network level protocol module
void *pCustomData;
DWORD cbCustomDataSize;
-} PROTORECVEVENT;
+};
#define PREF_CREATEREAD 1 // create the database event with the 'read' flag set
#define PREF_RTL 4 // 0.5+ addition: support for right-to-left messages
@@ -801,14 +806,15 @@ __forceinline INT_PTR Proto_AuthRecv(const char *szProtoName, PROTORECVEVENT *pc
#define PRFF_UNICODE 1
-typedef struct {
+struct PROTORECVFILET
+{
DWORD dwFlags; // PRFF_*
DWORD timestamp; // unix time
MAllStrings descr; // file description
int fileCount; // number of files being transferred
MAllStringArray files; // array of file names
LPARAM lParam; // extra space for the network level protocol module
-} PROTORECVFILET;
+};
#define PSR_FILE "/RecvFile"