1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
// ---------------------------------------------------------------------------80
// ICQ plugin for Miranda Instant Messenger
// ________________________________________
//
// Copyright © 2000,2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
// Copyright © 2001,2002 Jon Keating, Richard Hughes
// Copyright © 2002,2003,2004 Martin Öberg, Sam Kothari, Robert Rainwater
// Copyright © 2004,2005,2006 Joe Kucera
//
// 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/protocols/IcqOscarJ/utilities.h,v $
// Revision : $Revision: 3130 $
// Last change on : $Date: 2006-06-13 23:02:57 +0200 (Tue, 13 Jun 2006) $
// Last change by : $Author: jokusoftware $
//
// DESCRIPTION:
//
// Describe me here please...
//
// -----------------------------------------------------------------------------
#ifndef __UTILITIES_H
#define __UTILITIES_H
typedef struct icq_ack_args_s
{
HANDLE hContact;
int nAckType;
int nAckResult;
HANDLE hSequence;
LPARAM pszMessage;
} icq_ack_args;
typedef struct icq_contacts_cache_s
{
HANDLE hContact;
DWORD dwUin;
DWORD flags;
} icq_contacts_cache;
#define F_TEMPVIS 1
/*---------* Functions *---------------*/
void EnableDlgItem(HWND hwndDlg, UINT control, int state);
void icq_EnableMultipleControls(HWND hwndDlg, const UINT* controls, int cControls, int state);
void icq_ShowMultipleControls(HWND hwndDlg, const UINT* controls, int cControls, int state);
int IcqStatusToMiranda(WORD wStatus);
WORD MirandaStatusToIcq(int nStatus);
int MirandaStatusToSupported(int nMirandaStatus);
char *MirandaStatusToString(int);
char *MirandaStatusToStringUtf(int);
char**MirandaStatusToAwayMsg(int nStatus);
int IDFromCacheByUin(DWORD dwUin);
int CacheIDCount(void);
int SetCacheFlagsByID(int ID, DWORD flags);
int GetCacheByID(int ID, icq_contacts_cache *icc);
int GetFromCacheByID(int ID, HANDLE *hContact, DWORD *dwUin);
int AwayMsgTypeToStatus(int nMsgType);
void SetGatewayIndex(HANDLE hConn, DWORD dwIndex);
DWORD GetGatewayIndex(HANDLE hConn);
void FreeGatewayIndex(HANDLE hConn);
void AddToSpammerList(DWORD dwUIN);
BOOL IsOnSpammerList(DWORD dwUIN);
void InitCache();
void UninitCache();
void DeleteFromCache(HANDLE hContact);
HANDLE HContactFromUIN(DWORD dwUin, int *Added);
HANDLE HContactFromUID(DWORD dwUIN, char *pszUID, int *Added);
char *NickFromHandle(HANDLE hContact);
char *NickFromHandleUtf(HANDLE hContact);
char *strUID(DWORD dwUIN, char *pszUID);
void NickFromHandleStatic(HANDLE hContact, char *szNick, WORD wLen);
void SetContactHidden(HANDLE hContact, BYTE bHidden);
void makeUserOffline(HANDLE hContact);
size_t __fastcall strlennull(const char *string);
int __fastcall strcmpnull(const char *str1, const char *str2);
int null_snprintf(char *buffer, size_t count, const char* fmt, ...);
char* __fastcall null_strdup(const char *string);
void parseServerAddress(char *szServer, WORD* wPort);
char *DemangleXml(const char *string, int len);
char *MangleXml(const char *string, int len);
char *EliminateHtml(const char *string, int len);
void ResetSettingsOnListReload(void);
void ResetSettingsOnConnect(void);
void ResetSettingsOnLoad(void);
int RandRange(int nLow, int nHigh);
BOOL IsStringUIN(char* pszString);
void __cdecl icq_ProtocolAckThread(icq_ack_args* pArguments);
void icq_SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
void SetCurrentStatus(int nStatus);
BOOL writeDbInfoSettingString(HANDLE hContact, const char* szSetting, char** buf, WORD* pwLength);
BOOL writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, char **buf, WORD* pwLength);
BOOL writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szSetting, struct fieldnames_t *table, char **buf, WORD* pwLength);
BOOL writeDbInfoSettingByte(HANDLE hContact, const char *szSetting, char **buf, WORD* pwLength);
BOOL writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szSetting, struct fieldnames_t *table, char **buf, WORD* pwLength);
int GetGMTOffset(void);
BOOL validateStatusMessageRequest(HANDLE hContact, WORD byMessageType);
#define icqOnline ((gnCurrentStatus != ID_STATUS_OFFLINE) && (gnCurrentStatus != ID_STATUS_CONNECTING))
void __fastcall SAFE_FREE(void** p);
void* __fastcall SAFE_MALLOC(size_t size);
void LinkContactPhotoToFile(HANDLE hContact, char* szFile);
void ContactPhotoSettingChanged(HANDLE hContact);
HANDLE NetLib_OpenConnection(HANDLE hUser, NETLIBOPENCONNECTION* nloc);
int NetLog_Server(const char *fmt,...);
int NetLog_Direct(const char *fmt,...);
int NetLog_Uni(BOOL bDC, const char *fmt,...);
int ICQBroadcastAck(HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam);
int __fastcall ICQTranslateDialog(HWND hwndDlg);
char* __fastcall ICQTranslate(const char* src);
char* __fastcall ICQTranslateUtf(const char* src);
char* __fastcall ICQTranslateUtfStatic(const char* src, char* buf);
char* GetUserPassword(BOOL bAlways);
WORD GetMyStatusFlags();
/* Unicode UI utility functions */
wchar_t* GetWindowTextUcs(HWND hWnd);
void SetWindowTextUcs(HWND hWnd, wchar_t *text);
char* GetWindowTextUtf(HWND hWnd);
char* GetDlgItemTextUtf(HWND hwndDlg, int iItem);
void SetWindowTextUtf(HWND hWnd, const char* szText);
void SetDlgItemTextUtf(HWND hwndDlg, int iItem, const char* szText);
LONG SetWindowLongUtf(HWND hWnd, int nIndex, LONG dwNewLong);
LRESULT CallWindowProcUtf(WNDPROC OldProc, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
int ComboBoxAddStringUtf(HWND hCombo, const char* szString, DWORD data);
int ListBoxAddStringUtf(HWND hList, const char* szString);
int MessageBoxUtf(HWND hWnd, const char* szText, const char* szCaption, UINT uType);
HWND DialogBoxUtf(BOOL bModal, HINSTANCE hInstance, const char* szTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
HWND CreateDialogUtf(HINSTANCE hInstance, const char* lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc);
#endif /* __UTILITIES_H */
|