~ubuntu-branches/ubuntu/hoary/psi/hoary

« back to all changes in this revision

Viewing changes to src/userlist.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2002-04-19 02:28:44 UTC
  • Revision ID: james.westby@ubuntu.com-20020419022844-za7xgai5qyfd9xv6
Tags: upstream-0.8.5
ImportĀ upstreamĀ versionĀ 0.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** userlist.h - higher-level version of JabRoster
 
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
****************************************************************************/
 
20
 
 
21
#ifndef USERLIST_H
 
22
#define USERLIST_H
 
23
 
 
24
#include<qptrlist.h>
 
25
#include<qstring.h>
 
26
#include<qdatetime.h>
 
27
#include"jabcommon.h"
 
28
#include"common.h"
 
29
#include"message.h"
 
30
 
 
31
#define USERLIST_CONTACTS       1
 
32
#define USERLIST_SERVICES       2
 
33
 
 
34
#define USERLIST_ALL            3
 
35
 
 
36
 
 
37
class UserListItem
 
38
{
 
39
public:
 
40
        UserListItem();
 
41
        ~UserListItem();
 
42
 
 
43
        QString jid;
 
44
        QString nick;
 
45
        QString group;
 
46
        QString sub;
 
47
        int state;
 
48
        QString statusString;
 
49
        bool inList;
 
50
        bool isTransport;
 
51
 
 
52
        JabResourceList res;
 
53
};
 
54
 
 
55
class UserList
 
56
{
 
57
public:
 
58
        UserList();
 
59
        ~UserList();
 
60
 
 
61
        int size();
 
62
        void add(UserListItem *);
 
63
        void remove(UserListItem *);
 
64
        void remove(QString &jid);
 
65
        UserListItem *findByJid(const QString &jid);
 
66
        UserListItem *findServiceByJid(const QString &jid);
 
67
        UserListItem *findAnyByJid(const QString &jid);
 
68
        void clear();
 
69
        //int allQueuesEmpty();
 
70
 
 
71
        UserListItem *start(int);
 
72
        UserListItem *next();
 
73
        void end();
 
74
 
 
75
private:
 
76
        void advanceTo();
 
77
 
 
78
        int num;
 
79
        QPtrList<UserListItem> list;
 
80
        QPtrListIterator<UserListItem> *it;
 
81
        int searchtype;
 
82
};
 
83
 
 
84
class Account
 
85
{
 
86
public:
 
87
        Account();
 
88
 
 
89
        QString jid() const;
 
90
 
 
91
        QString user, pass, host, resource;
 
92
        int port, priority;
 
93
};
 
94
 
 
95
#endif