This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui_cntlist.h
207 lines (170 loc) · 5.91 KB
/
ui_cntlist.h
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#include "include\fontpicker.h"
#define LISTTIP_HEIGHT 60
#define MSGSENDHISTORY_LIMIT 20
#define CNT_NEW_TIME 15
#define CNT_EX_NEW 0xF
class cMsgHistoryEntry {
public:
cMsgHistoryEntry(const CStdString & body , const CStdString & ext , int type , int flag)
:body(body),ext(ext),flag(flag),type(type) {
}
CStdString body , ext;
int flag , type;
};
class sUICnt {
public:
unsigned int net , status; // obie wartosc nie zawsze musza byc PRAWDZIWE!!!
unsigned int ID;
int notify;
sUIAction action;
string display;
HWND hwndMsg , hwndInfo;
bool user;
bool hidden;
bool onList;
int ex; // extended... pierwsze 4 bity - NEW
sUICnt () {hwndMsg=hwndInfo=0;
ID = notify=status=net=ex=0; action=NOACTION; user = false; activity=0;active=false;_msgControl=0;
clearMsgHistory();
hidden = true;
onList = false;
}
void imRefresh ();
void close ();
void MsgGetHandles();
int MsgUpdate(bool getHandles=true);
void cfgSet();
void checkActivity();
void setStatus(int status , string info);
void MsgSend();
void MsgWndOpen(bool queue = true , bool autoPopup=false);
void MsgWndClose();
void InfoWndOpen(bool newUser=false);
CStdString getDisplayFormatted();
int GetStatusIcon(bool sameStatus);
void ApplyFilters();
void useMsgHistory(bool next);
bool haveMsgHistory(bool next);
void clearMsgHistory();
time_t activity;
bool active;
class cMsgControl * _msgControl;
deque <cMsgHistoryEntry> msgHistory; // wpisane poprzednie wiadomoœci...
int msgHistoryPos;
// int msgStatus; // aktualny status w okienku wiadomoœci
// int msgStatus; // aktualny status w okienku wiadomoœci
private:
};
class cUICnts {
public:
map <unsigned int , sUICnt*> Cnt;
typedef map <unsigned int , sUICnt*>::iterator Cnt_it_t;
sUICnt & operator [] (int n);
void imRemove (int id , bool massive);
void imAdd (int id , bool hidden=false);
void imPrepare ();
void sort();
~cUICnts();
int findBy (int,char);
int size () {return Cnt.size();};
int compare(sUICnt * a, sUICnt * b);
bool exists(int id);
void closeAll();
void cfgSet();
void checkActivity(bool force = false);
};
// --------------
class cCntListWindow {
public:
cCntListWindow(class cCntList * owner , int x , int y , int w , int h , HWND parent , HMENU id);
~cCntListWindow();
static INT_PTR CALLBACK ListControlProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
void sort();
int find(sUICnt * cnt); // podaje pozycjê danego kontaktu na liœcie
void refresh(bool sort); // Odœwie¿a listê
void refill(); // Wype³nia na nowo
void removeCnt(sUICnt * cnt);
int addCnt(sUICnt * cnt);
void drawListItem(DRAWITEMSTRUCT * dis);
void measureListItem(MEASUREITEMSTRUCT * mis);
void cfgSet();
void callDefaultAction(); // uruchamia domyœln¹ akcjê dla zaznaczenia
class cCntListTip * tip;
WNDPROC _oldwndproc;
HWND _hwnd;
class cCntList * parent;
private:
CStdString lookupString;
int lookupLast;
};
#ifdef _VECTOR_
class cCntList {
friend class cCntListWindow;
public:
void registerWnd(class cCntListWindow * wnd);
void unregisterWnd(class cCntListWindow * wnd);
bool running();
void refresh(bool sort); // Odœwie¿a listê
void refill(); // Wype³nia na nowo
void removeCnt(sUICnt * cnt);
void addCnt(sUICnt * cnt);
void cfgSet(); // Ustawia sobie Cache po zmianach w konfigu
cCntList():_hfItem(0),_hfItemSel(0),_hfItemOnline(0) {}
private:
vector <cCntListWindow *> _wnd;
typedef vector <cCntListWindow *>::iterator _wnd_it_t;
// "cache"
int _icons; // rozmieszczenie
/*
00 - wyl
10 - lewo (mala)
01 - prawo (duza)
Bity:
Opis 0-1
Email 2-3
Telefon 4-5
*/
bool _offset;
bool _right;
bool _iconson;
bool _samestatus;
UI::CFG::enCntListInfo _info;
CStdString _infoFormat;
LOGFONTEX _lfItem , _lfItemSel, _lfItemInfo;
HFONT _hfItem , _hfItemSel , _hfItemOnline, _hfItemInfo;
bool _flickerFree;
int _infoHeight;
bool _shadow;
};
#endif //vector
class cCntListTip {
public:
cCntListTip(HWND parent=0 , bool docked = false);
~cCntListTip();
void show(int pos , HWND list=0);
void refresh(int newPos=-2);
void paint();
HWND _hwnd;
bool docked;
unsigned int cnt; // aktualny kontakt
private:
void drawItem(HDC hdc , RECT * rc , const char * name , const char * text , unsigned int ico , int maxWidth, bool multiline = false);
int charHeight; // wysokosc znaku
int realCharHeight; // wysokosc znaku
int drawIcon; // wysokosc ikonki
int toDraw; // liczba el. do narysowania
};
//-------
UIEXTERN cUICnts Cnt;
extern cCntList cntList;
extern cCntListWindow * cntListWnd;
extern cCntListTip * cntTip;
//--------------------------------------------------------------------
// - F-cje
LRESULT CALLBACK ListTipClassProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK ListControlProc (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
LRESULT CALLBACK ListTipClassProc(HWND hwnd , UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ListControlProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
int dragdropList(HWND hwnd = 0, UINT message = 0 , WPARAM wParam = 0, LPARAM lParam = 0);
void fillGroups();
void selectGroups();