diff options
Diffstat (limited to 'Swift/QtUI/MUCSearch/MUCSearchServiceItem.h')
-rw-r--r-- | Swift/QtUI/MUCSearch/MUCSearchServiceItem.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchServiceItem.h b/Swift/QtUI/MUCSearch/MUCSearchServiceItem.h new file mode 100644 index 0000000..860792f --- /dev/null +++ b/Swift/QtUI/MUCSearch/MUCSearchServiceItem.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010 Kevin Smith + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <QList> +#include <QString> + +#include "Swift/QtUI/MUCSearch/MUCSearchRoomItem.h" + +namespace Swift { + class MUCSearchServiceItem : public MUCSearchItem { + public: + MUCSearchServiceItem(const QString& jidString) : jidString_(jidString) {} + void addRoom(MUCSearchRoomItem* room) {rooms_.push_back(room);} + int rowCount() {return rooms_.count();} + MUCSearchRoomItem* getItem(int i) {return rooms_[i];} + QVariant data(int role) { + switch (role) { + case Qt::DisplayRole: return QVariant(jidString_); + default: return QVariant(); + } + } + QString getHost() {return jidString_;} + private: + QList<MUCSearchRoomItem*> rooms_; + QString jidString_; + }; +} |