2
* mucaffiliationsmodel.h
3
* Copyright (C) 2006 Remko Troncon
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 MUCAFFILIATIONSMODEL_H
22
#define MUCAFFILIATIONSMODEL_H
24
#include <QStandardItemModel>
32
class MUCAffiliationsModel : public QStandardItemModel
37
MUCAffiliationsModel();
39
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
40
virtual Qt::DropActions supportedDropActions() const;
41
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
42
QStringList mimeTypes () const;
43
QMimeData* mimeData(const QModelIndexList &indexes) const;
45
void resetAffiliationLists();
46
void setAffiliationListEnabled(XMPP::MUCItem::Affiliation, bool = true);
47
QModelIndex affiliationListIndex(XMPP::MUCItem::Affiliation);
48
void addItems(const QList<XMPP::MUCItem>&);
49
QList<XMPP::MUCItem> changes() const;
52
enum AffiliationListIndex {
53
Owners = 0, Admins = 1, Members = 2, Outcast = 3 , Unknown = 4 };
55
void resetAffiliationList(XMPP::MUCItem::Affiliation);
56
static QString affiliationlistindexToString(AffiliationListIndex);
57
AffiliationListIndex affiliationToIndex(XMPP::MUCItem::Affiliation);
58
static XMPP::MUCItem::Affiliation indexToAffiliation(int);
61
QList<XMPP::MUCItem> items_;
62
QMap<AffiliationListIndex,bool> enabled_;