summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Roster/RosterModel.h')
-rw-r--r--Swift/QtUI/Roster/RosterModel.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/Swift/QtUI/Roster/RosterModel.h b/Swift/QtUI/Roster/RosterModel.h
index bd34e9c..2b05044 100644
--- a/Swift/QtUI/Roster/RosterModel.h
+++ b/Swift/QtUI/Roster/RosterModel.h
@@ -1,4 +1,4 @@
/*
- * Copyright (c) 2010 Kevin Smith
+ * Copyright (c) 2010-2013 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
@@ -7,9 +7,11 @@
#pragma once
-#include "Swift/Controllers/Roster/Roster.h"
-
#include <QAbstractItemModel>
#include <QList>
+#include <Swift/Controllers/Roster/Roster.h>
+
+#include <Swift/QtUI/QtScaledAvatarCache.h>
+
namespace Swift {
enum RosterRoles {
@@ -19,4 +21,7 @@ namespace Swift {
StatusShowTypeRole = Qt::UserRole + 3,
ChildCountRole = Qt::UserRole + 4,
+ IdleRole = Qt::UserRole + 5,
+ JIDRole = Qt::UserRole + 6,
+ DisplayJIDRole = Qt::UserRole + 7
};
@@ -26,7 +31,8 @@ namespace Swift {
Q_OBJECT
public:
- RosterModel(QtTreeWidget* view);
+ RosterModel(QtTreeWidget* view, bool screenReaderMode);
~RosterModel();
void setRoster(Roster* swiftRoster);
+ Qt::ItemFlags flags(const QModelIndex& index) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
@@ -35,4 +41,6 @@ namespace Swift {
QModelIndex parent(const QModelIndex& index) const;
int rowCount(const QModelIndex& parent = QModelIndex()) const;
+ QMimeData* mimeData(const QModelIndexList& indexes) const;
+
signals:
void itemExpanded(const QModelIndex& item, bool expanded);
@@ -47,9 +55,17 @@ namespace Swift {
QString getAvatar(RosterItem* item) const;
QString getStatusText(RosterItem* item) const;
+ QString getJID(RosterItem* item) const;
+ QString getDisplayJID(RosterItem* item) const;
QIcon getPresenceIcon(RosterItem* item) const;
int getChildCount(RosterItem* item) const;
+ bool getIsIdle(RosterItem* item) const;
void reLayout();
+ /** calculates screenreader-friendly text if in screenreader mode, otherwise uses alternative text */
+ QString getScreenReaderTextOr(RosterItem* item, const QString& alternative) const;
+ private:
Roster* roster_;
QtTreeWidget* view_;
+ QtScaledAvatarCache* cachedImageScaler_;
+ bool screenReader_;
};
}