~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to src/contactview.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2005-01-10 17:41:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050110174143-ltocv5zapl6blf5d
Tags: 0.9.3-1
* New upstream release
* Cleaned up debian/rules (some things are done by upstream Makefiles now)
* Fixed some lintian warnings:
  - removed executable bit from some .png files
  - moved psi.desktop to /usr/share/applications
* Updated menu files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
** contactview.h - an Licq-like contact list
3
 
** Copyright (C) 2001, 2002  Justin Karneges
4
 
**
5
 
** This program is free software; you can redistribute it and/or
6
 
** modify it under the terms of the GNU General Public License
7
 
** as published by the Free Software Foundation; either version 2
8
 
** of the License, or (at your option) any later version.
9
 
**
10
 
** This program is distributed in the hope that it will be useful,
11
 
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
** GNU General Public License for more details.
14
 
**
15
 
** You should have received a copy of the GNU General Public License
16
 
** along with this program; if not, write to the Free Software
17
 
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 
**
19
 
****************************************************************************/
 
1
/*
 
2
 * contactview.h - contact list widget
 
3
 * Copyright (C) 2001, 2002  Justin Karneges
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this library; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *
 
19
 */
20
20
 
21
21
#ifndef CONTACTVIEW_H
22
22
#define CONTACTVIEW_H
23
23
 
 
24
#include<qobject.h>
24
25
#include<qlistview.h>
25
 
#include<qpainter.h>
26
 
#include<qpixmap.h>
27
 
#include<qstringlist.h>
28
 
#include<qptrlist.h>
29
26
#include<qtooltip.h>
30
 
#include<qtimer.h>
31
 
#include<qdict.h>
32
 
#include<qaction.h>
33
 
#include"jabcommon.h"
34
 
#include"userlist.h"
35
 
 
36
 
 
37
 
/****************************************************************************
38
 
  ContactView
39
 
 
40
 
  Holds a contact list.
41
 
 
42
 
****************************************************************************/
43
 
 
44
 
 
45
 
#define CV_PROFILE      0
46
 
#define CV_GROUP        1
47
 
#define CV_CONTACT      2
48
 
 
49
 
#define CVG_SELF        0
50
 
#define CVG_ONLINE      1
51
 
#define CVG_OFFLINE     2
52
 
#define CVG_NOTINLIST   3
53
 
#define CVG_AUTHWAIT    4
54
 
#define CVG_AGENTS      5
55
 
#define CVG_USER        6
56
 
 
57
 
 
58
 
#define LVI2CVI(x) (static_cast<ContactViewItem*>(x))
59
 
 
60
 
 
 
27
#include<qvaluelist.h>
 
28
#include"xmpp.h"
 
29
 
 
30
typedef QValueList<XMPP::Jid> JidList;
 
31
typedef QValueListIterator<XMPP::Jid> JidListIt;
 
32
 
 
33
class IconAction;
 
34
class UserListItem;
61
35
class ContactView;
62
36
class ContactViewItem;
63
 
 
64
 
struct ContactProfileItem
65
 
{
66
 
        UserListItem uli;
67
 
        ContactViewItem *cvi;
68
 
};
69
 
 
70
 
// ContactProfile:  this holds/manipulates a roster profile for an account
 
37
class PsiAccount;
 
38
class Icon;
 
39
class QTimer;
 
40
class QPixmap;
 
41
 
 
42
using namespace XMPP;
 
43
 
 
44
class ContactProfile;
 
45
 
 
46
// ContactProfile: this holds/manipulates a roster profile for an account
71
47
class ContactProfile : public QObject
72
48
{
73
49
        Q_OBJECT
74
 
 
75
50
public:
76
 
        ContactProfile(const QString &, const QString &, int _localStatus, bool, ContactView *);
 
51
        ContactProfile(PsiAccount *, const QString &name, ContactView *, bool unique=false);
77
52
        ~ContactProfile();
78
53
 
79
 
        QString jid, name;
80
 
        ContactView *cv;
81
 
        ContactViewItem *cvi, *cvi_online, *cvi_offline;
82
 
        QDict<ContactProfileItem> *roster;
83
 
 
84
 
        ContactView *contactView() { return cv; }
85
 
        ContactViewItem *online() { return cvi_online; }
86
 
        ContactViewItem *offline() { return cvi_offline; }
87
 
 
 
54
        void setEnabled(bool e=TRUE);
 
55
 
 
56
        const QString & name() const;
 
57
        void setName(const QString &name);
 
58
        void setState(int);
 
59
        void setUsingSSL(bool);
 
60
        ContactView *contactView() const;
 
61
        ContactViewItem *self() const;
 
62
 
 
63
        PsiAccount *psiAccount() const;
 
64
 
 
65
        void updateEntry(const UserListItem &);
 
66
        void removeEntry(const Jid &);
 
67
        void updateSelf();
 
68
        void addSelf();
 
69
        void removeSelf();
 
70
        void setAlert(const Jid &, const Icon *);
 
71
        void clearAlert(const Jid &);
 
72
        void animateNick(const Jid &);
 
73
 
 
74
        void addAllNeededContactItems();
 
75
        void removeAllUnneededContactItems();
 
76
 
 
77
        void ensureVisible(const Jid &);
88
78
        void clear();
89
 
        ContactProfileItem *cvi2cpi(ContactViewItem *);
90
 
        ContactProfileItem *findByJid(const QString &jid);
91
 
        bool isMine(ContactViewItem *);
92
 
        ContactViewItem *findCVIByJid(const QString &jid);
93
 
 
94
 
        void doContextMenu(ContactViewItem *, const QPoint &);
95
 
 
96
 
        ContactViewItem *addGroup(int group);
97
 
        ContactViewItem *addGroup(const QString &group, ContactViewItem *par);
98
 
 
99
 
        ContactViewItem *checkGroup(int group);
100
 
        ContactViewItem *checkGroup(const QString &group, ContactViewItem *par);
101
 
 
102
 
        ContactViewItem *ensureGroup(int group);
103
 
        ContactViewItem *ensureGroup(const QString &group, int status);
104
 
 
105
 
        void changeGroup(ContactViewItem *item, ContactViewItem *group_new);
106
 
        void changeGroup(ContactViewItem *item, const QString &group);
107
 
 
 
79
        
 
80
        QString makeTip(bool trim, bool doLinkify) const;
 
81
 
 
82
        ContactViewItem *checkGroup(int type);
 
83
        ContactViewItem *checkGroup(const QString &name);
 
84
 
 
85
        void setName(const char *);
 
86
 
 
87
 
 
88
signals:
 
89
        void actionDefault(const Jid &);
 
90
        void actionRecvEvent(const Jid &);
 
91
        void actionSendMessage(const Jid &);
 
92
        void actionSendMessage(const JidList &);
 
93
        void actionSendUrl(const Jid &);
 
94
        void actionRemove(const Jid &);
 
95
        void actionRename(const Jid &, const QString &);
 
96
        void actionGroupRename(const QString &, const QString &);
 
97
        void actionHistory(const Jid &);
 
98
        void actionStatusShow(const Jid &);
 
99
        void actionOpenChat(const Jid &);
 
100
        void actionOpenChatSpecific(const Jid &);
 
101
        void actionAgentSetStatus(const Jid &, int);
 
102
        void actionInfo(const Jid &);
 
103
        void actionAuth(const Jid &);
 
104
        void actionAuthRequest(const Jid &);
 
105
        void actionAuthRemove(const Jid &);
 
106
        void actionAdd(const Jid &);
 
107
        void actionGroupAdd(const Jid &, const QString &);
 
108
        void actionGroupRemove(const Jid &, const QString &);
 
109
        void actionTest(const Jid &);
 
110
        void actionSendFile(const Jid &);
 
111
        void actionSendFiles(const Jid &, const QStringList &);
 
112
        void actionDisco(const Jid &, const QString &);
 
113
        void actionInvite(const Jid &, const QString &);
 
114
        void actionAssignKey(const Jid &);
 
115
        void actionUnassignKey(const Jid &);
 
116
 
 
117
private slots:
 
118
        void updateGroups();
 
119
 
 
120
public:
 
121
        class Entry;
 
122
private:
 
123
        class Private;
 
124
        Private *d;
 
125
 
 
126
        ContactViewItem *addGroup(int type);
 
127
        ContactViewItem *addGroup(const QString &name);
 
128
        ContactViewItem *ensureGroup(int type);
 
129
        ContactViewItem *ensureGroup(const QString &name);
108
130
        void checkDestroyGroup(ContactViewItem *group);
109
131
        void checkDestroyGroup(const QString &group);
110
 
 
111
 
        ContactProfileItem *addEntry(const UserListItem &i);
112
 
        void updateEntry(const UserListItem &);
113
 
        void removeEntry(const QString &jid);
114
 
 
115
 
        void showAlert(const QString &jid, int type);
116
 
        void clearAlert(const QString &jid, int at=0);
117
 
        void clearAllAlerts(const QString &jid);
118
 
        void animateNick(const QString &jid);
119
 
 
120
 
        void removeEntry(ContactProfileItem *pi);
121
 
        void clearAlert(ContactViewItem *, int at=0);
122
 
        void clearAllAlerts(ContactViewItem *);
 
132
        ContactViewItem *addContactItem(Entry *e, ContactViewItem *group_item);
 
133
        ContactViewItem *ensureContactItem(Entry *e, ContactViewItem *group_item);
 
134
        void removeContactItem(Entry *e, ContactViewItem *i);
 
135
        void addNeededContactItems(Entry *e);
 
136
        void removeUnneededContactItems(Entry *e);
 
137
        void clearContactItems(Entry *e);
 
138
 
 
139
        void removeEntry(Entry *);
 
140
        Entry *findEntry(const Jid &) const;
 
141
        Entry *findEntry(ContactViewItem *) const;
 
142
 
 
143
        void ensureVisible(Entry *);
123
144
 
124
145
        // useful functions to grab groups of users
125
 
        QStringList contactListFromCVGroup(ContactViewItem *);
126
 
        QStringList contactListFromGroup(const QString &groupName);
127
 
        int contactSizeFromCVGroup(ContactViewItem *);
128
 
        int contactSizeFromGroup(const QString &groupName);
 
146
        JidList contactListFromCVGroup(ContactViewItem *) const;
 
147
        int contactSizeFromCVGroup(ContactViewItem *) const;
 
148
        int contactsOnlineFromCVGroup(ContactViewItem *) const;
 
149
        JidList contactListFromGroup(const QString &groupName) const;
 
150
        int contactSizeFromGroup(const QString &groupName) const;
129
151
 
130
152
        void updateGroupInfo(ContactViewItem *group);
131
 
 
132
 
        // shortcuts
 
153
        QStringList groupList() const;
 
154
 
 
155
        void deferredUpdateGroups();
 
156
 
 
157
        friend class ContactView;
133
158
        void scActionDefault(ContactViewItem *);
134
159
        void scRecvEvent(ContactViewItem *);
135
160
        void scSendMessage(ContactViewItem *);
136
161
        void scRename(ContactViewItem *);
137
 
        void scGroupChange(const QString &, const QString &);
138
162
        void scHistory(ContactViewItem *);
139
163
        void scOpenChat(ContactViewItem *);
140
164
        void scAgentSetStatus(ContactViewItem *, int);
141
165
        void scRemove(ContactViewItem *);
142
166
        void doItemRenamed(ContactViewItem *, const QString &);
143
 
 
144
 
signals:
145
 
        void actionDefault(ContactViewItem *);
146
 
        void actionRecvEvent(ContactViewItem *);
147
 
        void actionSendMessage(ContactViewItem *);
148
 
        void actionSendMessage(const QStringList &);
149
 
        void actionSendUrl(const QString &);
150
 
        void actionRemove(const QString &);
151
 
        void actionAuthorize(ContactViewItem *);
152
 
        void actionAdd(ContactViewItem *);
153
 
        void actionRename(ContactViewItem *, const QString &);
154
 
        void actionGroupChange(const QString &, const QString &);
155
 
        void actionGroupRename(const QString &, const QString &);
156
 
        void actionHistory(const QString &);
157
 
        void actionStatusShow(const QString &);
158
 
        void actionOpenChat(const QString &);
159
 
        void actionAgentSetStatus(const QString &, int);
160
 
        void actionInfo(const QString &);
161
 
        void actionOfferFile(const QString &);
162
 
 
163
 
public slots:
164
 
        void localUpdate(const JabRosterEntry &e);
165
 
 
166
 
private:
167
 
        QStringList buildGroupList();
168
 
        int localStatus;
169
 
};
170
 
 
171
 
// ContactViewItem:  this can be either a contact or a group
172
 
class ContactViewItem : public QListViewItem
173
 
{
174
 
public:
175
 
        // create profile
176
 
        ContactViewItem(const QString &xgroupname, int xgrouptype, QListView *parent);
177
 
        // create group
178
 
        ContactViewItem(const QString &xgroupname, int xgrouptype, QListViewItem *parent);
179
 
        // create user
180
 
        ContactViewItem(const QString &xjid, const QString &xname, bool xisAgent, QListViewItem *parent);
181
 
 
182
 
        ~ContactViewItem();
183
 
 
184
 
        // read functions
185
 
        int type() { return v_type; }
186
 
        int status() { return v_status; }
187
 
        QString & jid() { return v_jid; }
188
 
        QString & nick() { return v_nick; }
189
 
        QString & group() { return v_group; }
190
 
        QString & sub() { return v_sub; }
191
 
        QString & statusString() { return v_statusString; }
192
 
        bool inList() { return v_inList; }
193
 
        bool isAgent() { return v_isAgent; }
194
 
        bool isAlert() { return v_isAlert; }
195
 
        bool isAnimateNick() { return v_isAnimateNick; }
196
 
        int groupType() { return v_groupType; }
197
 
        QString & groupName() { return v_groupName; }
198
 
        JabResourceList & resList() { return v_resList; }
199
 
 
200
 
        int parentGroupType(); // use with contacts: returns grouptype of parent group
201
 
 
202
 
        // write functions
203
 
        void setStatus(int);
204
 
        void resetStatus();
205
 
        void setNick(const QString &);
206
 
        void resetNick(); // use this to cancel a rename
207
 
        void setGroup(const QString &);
208
 
        void setSub(const QString &);
209
 
        void setStatusString(const QString &);
210
 
        void setInList(bool=TRUE);
211
 
        void setIsAgent(bool=TRUE);
212
 
        void setAlert(int type);
213
 
        void clearAlert(int at=0);
214
 
        void setAttr(const QString &xnick, const QString xgroup, const QString &sub, int status);
215
 
        void setAnimateNick();
216
 
        void stopAnimateNick();
217
 
 
218
 
        void setGroupName(const QString &);
219
 
        void setGroupInfo(const QString &);
220
 
        void resetGroupName(bool showInfo=TRUE);
221
 
 
222
 
        void animate();
223
 
        void resetAnim();
224
 
 
225
 
        void animateNick();
226
 
        void optionsUpdate();
227
 
 
228
 
        bool isAway();
229
 
 
230
 
        bool needSorting; // dirty flag for group items
231
 
 
232
 
private:
233
 
        int v_type, v_status;
234
 
        QString v_jid;
235
 
        QString v_nick;
236
 
        QString v_group;
237
 
        QString v_sub;
238
 
        QString v_statusString;
239
 
        bool v_inList, v_isAgent;
240
 
        JabResourceList v_resList;
241
 
 
242
 
        int v_groupType;
243
 
        QString v_groupName, v_groupInfo;
244
 
 
245
 
        bool v_isAlert, v_isAnimateNick;
246
 
        int alertType;
247
 
        int animStep;
248
 
        QPtrList<int> alertQueue;
249
 
        int animateNickX, animateNickColor;
250
 
 
251
 
        void init();
252
 
        void drawGroupIcon();
253
 
 
254
 
public:
255
 
        int rankGroup(int groupType) const;
256
 
        int rankStatus(int status) const;
257
 
 
258
 
        // reimplemented functions
259
 
        void paintFocus(QPainter *, const QColorGroup &, const QRect &);
260
 
        void paintBranches(QPainter *, const QColorGroup &, int, int, int);
261
 
        void paintCell(QPainter *, const QColorGroup & cg, int column, int width, int alignment);
262
 
        void setOpen(bool o);
263
 
        int compare(QListViewItem *, int, bool) const;
264
 
        virtual void insertItem(QListViewItem * newChild);
265
 
        virtual void takeItem(QListViewItem * item);
266
 
        void sort();
267
 
 
268
 
        //virtual bool acceptDrop(const QMimeSource *) const;
269
 
        //void dropped(QDropEvent *);
270
 
};
271
 
 
272
 
 
 
167
        void doContextMenu(ContactViewItem *, const QPoint &);
 
168
 
 
169
        friend class ContactViewItem;
 
170
        void dragDrop(const QString &, ContactViewItem *);
 
171
        void dragDropFiles(const QStringList &, ContactViewItem *);
 
172
};
 
173
 
 
174
// ContactView: the actual widget
273
175
class ContactView : public QListView, public QToolTip
274
176
{
275
177
        Q_OBJECT
276
178
public:
277
 
 
278
179
        ContactView(QWidget *parent=0, const char *name=0);
279
180
        ~ContactView();
280
181
 
281
 
        ContactProfile *createProfile(const QString &jid, const QString &name, bool unique=FALSE);
282
 
        ContactProfile *findProfile(const QString &jid);
283
 
        void removeProfile(const QString &jid);
284
 
        void removeProfile(ContactProfile *p);
285
 
        ContactProfile *defPro();
286
 
        ContactProfile *owner(ContactViewItem *);
287
 
 
288
 
        void clear();   // override QListView
289
 
 
290
 
        bool isShowOffline() { return v_showOffline; }
291
 
        bool isShowAgents() { return v_showAgents; }
292
 
        bool isShowAway() { return v_showAway; }
293
 
 
294
 
        void sort();
295
 
        void deferredContactSort();
296
 
 
297
 
        // very handy
298
 
        void ensureVisible(ContactViewItem *);
299
 
        void setVisibility(ContactViewItem *);
300
 
 
301
 
        QAction *qa_send, *qa_chat, *qa_ren, *qa_hist, *qa_logon, *qa_recv, *qa_rem;
302
 
 
303
 
private:
304
 
        bool v_showOffline, v_showAway, v_showAgents;
305
 
 
 
182
        bool isShowOffline() const { return v_showOffline; }
 
183
        bool isShowAgents() const { return v_showAgents; }
 
184
        bool isShowAway() const { return v_showAway; }
 
185
        bool isShowHidden() const { return v_showHidden; }
 
186
        bool isShowSelf() const { return v_showSelf; }
 
187
 
 
188
        void clear();
 
189
        void resetAnim();
 
190
        QTimer *animTimer() const;
 
191
 
 
192
        IconAction *qa_send, *qa_chat, *qa_ren, *qa_hist, *qa_logon, *qa_recv, *qa_rem;
 
193
        // Avatars
 
194
        //IconAction *qa_assignAvatar, *qa_clearAvatar;
 
195
 
 
196
 
 
197
protected:
306
198
        // reimplemented
307
 
        void resizeEvent(QResizeEvent *);
 
199
        void maybeTip(const QPoint &);
308
200
        void keyPressEvent(QKeyEvent *);
309
 
        void viewportMousePressEvent(QMouseEvent *);
310
 
        void viewportMouseMoveEvent(QMouseEvent *);
311
 
 
312
 
        QPoint mousePressPos; // store pressed position, idea taken from Licq
313
 
 
314
 
        bool lcto_active; // double click active?
315
 
        QPoint lcto_pos;
316
 
        QListViewItem *lcto_item;
317
 
 
318
 
        QTimer *sortTimer;
319
 
 
320
 
        QPtrList<ContactProfile> profiles;
321
 
 
322
 
protected:
323
 
        // reimplemented
324
 
        void maybeTip(const QPoint &);
325
 
        //QDragObject *dragObject();
326
 
        void dragEnterEvent(QDragEnterEvent *);
327
 
        void dropEvent(QDropEvent *);
 
201
        QDragObject *dragObject();
328
202
 
329
203
signals:
330
204
        void showOffline(bool);
331
205
        void showAway(bool);
 
206
        void showHidden(bool);
332
207
        void showAgents(bool);
 
208
        void showSelf(bool);
333
209
 
334
210
public slots:
335
211
        void setShowOffline(bool);
336
212
        void setShowAgents(bool);
337
213
        void setShowAway(bool);
338
 
 
 
214
        void setShowHidden(bool);
 
215
        void setShowSelf(bool);
339
216
        void optionsUpdate();
340
217
 
341
218
private slots:
342
219
        void qlv_singleclick(int, QListViewItem *, const QPoint &, int);
343
220
        void qlv_doubleclick(QListViewItem *);
344
221
        void qlv_contextPopup(QListViewItem *, const QPoint &, int);
 
222
        void qlv_contextMenuRequested(QListViewItem *, const QPoint &, int);
345
223
        void qlv_itemRenamed(QListViewItem *, int, const QString &);
346
224
        void leftClickTimeOut();
347
 
        void animAlert();
348
225
 
349
226
        void doRecvEvent();
350
227
        void doRename();
355
232
        void doHistory();
356
233
        void doLogon();
357
234
        void doRemove();
358
 
 
359
 
        void actualContactSort();
 
235
        
 
236
        // Avatars
 
237
        //void doAssignAvatar();
 
238
        //void doClearAvatar();
 
239
 
 
240
public:
 
241
        class Private;
 
242
private:
 
243
        Private *d;
 
244
 
 
245
        QPoint mousePressPos; // store pressed position, idea taken from Licq
 
246
        bool v_showOffline, v_showAgents, v_showAway, v_showHidden, v_showSelf;
 
247
        bool lcto_active; // double click active?
 
248
        QPoint lcto_pos;
 
249
        QListViewItem *lcto_item;
 
250
 
 
251
        friend class ContactProfile;
 
252
        void link(ContactProfile *);
 
253
        void unlink(ContactProfile *);
 
254
};
 
255
 
 
256
// ContactViewItem: an entry in the ContactView (profile, group, or contact)
 
257
class ContactViewItem : public QObject, public QListViewItem
 
258
{
 
259
        Q_OBJECT
 
260
public:
 
261
        enum { Profile, Group, Contact };
 
262
        enum { gGeneral, gNotInList, gAgents, gPrivate, gUser };
 
263
 
 
264
        ContactViewItem(const QString &profileName, ContactProfile *, ContactView *parent);
 
265
        ContactViewItem(const QString &groupName, int groupType, ContactProfile *, ContactView *parent);
 
266
        ContactViewItem(const QString &groupName, int groupType, ContactProfile *, ContactViewItem *parent);
 
267
        ContactViewItem(UserListItem *, ContactProfile *, ContactViewItem *parent);
 
268
        ~ContactViewItem();
 
269
 
 
270
        ContactProfile *contactProfile() const;
 
271
        int type() const;
 
272
        int groupType() const;
 
273
        const QString & groupName() const;
 
274
        const QString & groupInfo() const;
 
275
        UserListItem *u() const;
 
276
        int status() const;
 
277
        bool isAgent() const;
 
278
        bool isAlerting() const;
 
279
        bool isAnimatingNick() const;
 
280
        int parentGroupType() const; // use with contacts: returns grouptype of parent group
 
281
 
 
282
        void setContact(UserListItem *);
 
283
        void setProfileName(const QString &);
 
284
        void setProfileState(int);
 
285
        void setProfileSSL(bool);
 
286
        void setGroupName(const QString &);
 
287
        void setGroupInfo(const QString &);
 
288
        void setAnimateNick();
 
289
        void setAlert(const Icon *);
 
290
        void clearAlert();
 
291
        void setIcon(const Icon *, bool alert = false);
 
292
 
 
293
        void resetStatus();
 
294
        void resetName(); // use this to cancel a rename
 
295
        void resetGroupName();
 
296
 
 
297
        void updatePosition();
 
298
        void optionsUpdate();
 
299
 
 
300
        // reimplemented functions
 
301
        int rtti() const;
 
302
        void paintFocus(QPainter *, const QColorGroup &, const QRect &);
 
303
        void paintBranches(QPainter *, const QColorGroup &, int, int, int);
 
304
        void paintCell(QPainter *, const QColorGroup & cg, int column, int width, int alignment);
 
305
        void setOpen(bool o);
 
306
        void insertItem(QListViewItem * newChild);
 
307
        void takeItem(QListViewItem * item);
 
308
        int compare(QListViewItem *, int, bool) const;
 
309
        bool acceptDrop(const QMimeSource *) const;
 
310
 
 
311
public slots:
 
312
        void resetAnim();
 
313
        void iconUpdated(const QPixmap &);
 
314
        void animateNick();
 
315
        void stopAnimateNick();
 
316
 
 
317
protected:
 
318
        void dragEntered();
 
319
        void dragLeft();
 
320
        void dropped(QDropEvent *);
 
321
 
 
322
private:
 
323
        class Private;
 
324
        Private *d;
 
325
 
 
326
        void cacheValues();
 
327
        int rankGroup(int groupType) const;
 
328
        int rankStatus(int status) const;
 
329
        void drawGroupIcon();
360
330
};
361
331
 
362
332
#endif