Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / plugins / privacy / privacyaccountlistmodel.h
blob8969d2b2198ab1079bd7b9fe6b4ff7b1c17f9f89
1 /*
2 privacyaccountlist.h - a list of accounts that are part of the black/whitelist
4 Copyright (c) 2006 by Andre Duffeck <duffeck@kde.org>
5 Kopete (c) 2003-2006 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 *************************************************************************
16 #ifndef PRIVACYACCOUNTLIST_H
17 #define PRIVACYACCOUNTLIST_H
19 #include <QAbstractTableModel>
20 #include <QPair>
21 #include <kopete_export.h>
23 class QStringList;
24 namespace Kopete { class Protocol; }
26 typedef QPair< QString, Kopete::Protocol *> AccountListEntry;
28 class KOPETEPRIVACY_EXPORT PrivacyAccountListModel : public QAbstractTableModel
30 Q_OBJECT
32 public:
33 PrivacyAccountListModel(QObject *parent = 0);
34 ~PrivacyAccountListModel();
36 void loadAccounts( const QStringList &accounts );
37 void addAccount(const QString &accountId, Kopete::Protocol *protocol);
38 void addAccount(const AccountListEntry &entry);
40 int rowCount(const QModelIndex &parent = QModelIndex()) const;
41 int columnCount(const QModelIndex &parent = QModelIndex()) const;
42 QVariant data(const QModelIndex &index, int role) const;
43 bool removeRow(int position, const QModelIndex &index = QModelIndex());
44 bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
46 QStringList toStringList() const;
48 private:
49 QList< AccountListEntry > m_list;
52 #endif