summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/changeinfo/changeinfo.h
blob: 0497f288fdb74cb5ef1424bc60e441c2fc6e2532 (plain)
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
// ---------------------------------------------------------------------------80
//                ICQ plugin for Miranda Instant Messenger
//                ________________________________________
// 
// Copyright © 2001-2004 Richard Hughes, Martin Öberg
// Copyright © 2004-2010 Joe Kucera, Bio
// Copyright © 2012-2014 Miranda NG Team
// 
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// -----------------------------------------------------------------------------
//  DESCRIPTION:
//
//  ChangeInfo Plugin stuff
// -----------------------------------------------------------------------------

#ifndef __CHANGEINFO_H
#define __CHANGEINFO_H


#ifndef AW_SLIDE
#define SPI_GETCOMBOBOXANIMATION 0x1004
#define AW_SLIDE      0x40000
#define AW_ACTIVATE      0x20000
#define AW_VER_POSITIVE    0x4
#define UDM_SETPOS32            (WM_USER+113)
#define UDM_GETPOS32            (WM_USER+114)
#endif


#define LI_DIVIDER       0
#define LI_STRING        1
#define LI_LIST          2
#define LI_LONGSTRING    3
#define LI_NUMBER        4
#define LIM_TYPE         0x0000FFFF
#define LIF_ZEROISVALID  0x80000000
#define LIF_SIGNED       0x40000000
#define LIF_PASSWORD     0x20000000
#define LIF_CHANGEONLY   0x10000000

struct SettingItem
{
  const char *szDescription;
  unsigned displayType;    //LI_ constant
  int dbType;              //DBVT_ constant
  const char *szDbSetting;
  const void *pList;
};

struct SettingItemData
{
  LPARAM value;
  int changed;
};

// contants.c
extern const SettingItem setting[];
extern const int settingCount;

//dlgproc.c
struct ChangeInfoData : public MZeroedObject
{
  HWND  hwndDlg;
  CIcqProto *ppro;
  HFONT hListFont;
  HWND  hwndList;
  int   editTopIndex;
  int   iEditItem;
  char  Password[PASSWORDMAXLEN];

  SettingItemData *settingData;

  HANDLE hAckHook;
  HANDLE hUpload[2];

  ChangeInfoData() { settingData = (SettingItemData*)SAFE_MALLOC(sizeof(SettingItemData) * settingCount); hAckHook = NULL; hUpload[0] = NULL; hUpload[1] = NULL;}
  ~ChangeInfoData() { SAFE_FREE((void**)&settingData); }

  char* GetItemSettingText(int i, char *buf, size_t buf_size);
  void PaintItemSetting(HDC hdc, RECT *rc, int i, UINT itemState);

  //db.cpp
  void LoadSettingsFromDb(int keepChanged);
  void FreeStoredDbSettings(void);
  int  ChangesMade(void);
  void ClearChangeFlags(void);
  int  SaveSettingsToDb(HWND hwndDlg);

  //upload.cpp
  int  UploadSettings(void);

  //editstring.cpp
  void BeginStringEdit(int iItem,RECT *rc,int i,WORD wVKey);
  void EndStringEdit(int save);
  //editlist.cpp
  void BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey);
  void EndListEdit(int save);
};

INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);

//editstring.c
int   IsStringEditWindow(HWND hwnd);
char* BinaryToEscapes(char *str);

//editlist.c
int IsListEditWindow(HWND hwnd);

#endif /* __CHANGEINFO_H */