2
* psicontactlist.h - general abstraction of the psi-specific contact list
3
* Copyright (C) 2006 Michail Pishchagin
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.
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.
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
21
#ifndef PSICONTACTLIST_H
22
#define PSICONTACTLIST_H
26
#include "contactlist.h"
35
class PsiContactList : public ContactList
39
PsiContactList(PsiCon* psi);
44
const QList<PsiAccount*>& accounts() const;
45
const QList<PsiAccount*>& enabledAccounts() const;
46
bool haveActiveAccounts() const;
47
bool haveEnabledAccounts() const;
49
PsiAccount *defaultAccount() const;
51
UserAccountList getUserAccountList() const;
53
void createAccount(const QString& name, const Jid& j = "", const QString& pass = "", bool opt_host = false, const QString& host = "", int port = 5222, bool legacy_ssl_probe = true, UserAccount::SSLFlag ssl = UserAccount::SSL_Auto, int proxy = 0, bool modify = true);
54
void createAccount(const UserAccount&);
55
void removeAccount(PsiAccount*);
56
void setAccountEnabled(PsiAccount*, bool enabled = TRUE);
58
int queueCount() const;
59
PsiAccount *queueLowestEventId();
61
void loadAccounts(const UserAccountList &);
62
void link(PsiAccount*);
63
void unlink(PsiAccount*);
67
* This signal is emitted when account is loaded from disk or created
70
void accountAdded(PsiAccount*);
72
* This signal is emitted when account is completely removed from the
73
* program, i.e. deleted.
75
void accountRemoved(PsiAccount*);
77
* This signal is emitted when number of accounts managed by
78
* PsiContactList changes.
80
void accountCountChanged();
82
* This signal is emitted when one of the accounts emits
83
* activityChanged() signal.
85
void accountActivityChanged();
87
* This signal is emitted when the features of one of the accounts change.
89
void accountFeaturesChanged();
91
* This signal is emitted when either new account was added, or
92
* existing one was removed altogether.
97
void accountEnabledChanged();
100
PsiAccount *loadAccount(const UserAccount &);
101
PsiAccount *tryQueueLowestEventId(bool includeDND);
104
PsiContactList *contactList_;
105
QList<PsiAccount *> accounts_, enabledAccounts_;