summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-08 12:14:01 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-13 12:29:20 (GMT)
commit705bd7256fa4812045677743fc1e939ccfd66d05 (patch)
tree84502c2c6bd6bda1bc38e7fce59cc451e05b21c4 /Swift/QtUI/MUCSearch/MUCSearchServiceItem.h
parent61078c4e4fd553bf952bae5c9d44da6cb96a3a70 (diff)
downloadswift-705bd7256fa4812045677743fc1e939ccfd66d05.zip
swift-705bd7256fa4812045677743fc1e939ccfd66d05.tar.bz2
List MUCs available on services.
Resolves: #276
Diffstat (limited to 'Swift/QtUI/MUCSearch/MUCSearchServiceItem.h')
-rw-r--r--Swift/QtUI/MUCSearch/MUCSearchServiceItem.h32
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_;
+ };
+}