making the requester type configurable
[quassel.git] / src / uisupport / bufferviewfilter.h
index e9c3fc8..813e554 100644 (file)
@@ -24,6 +24,7 @@
 #include <QColor>
 #include <QDropEvent>
 #include <QFlags>
+#include <QPixmap>
 #include <QPointer>
 #include <QSet>
 #include <QSortFilterProxyModel>
@@ -36,7 +37,7 @@
  *****************************************/
 class BufferViewFilter : public QSortFilterProxyModel {
   Q_OBJECT
-  
+
 public:
   enum Mode {
     NoActive = 0x01,
@@ -51,23 +52,24 @@ public:
   Q_DECLARE_FLAGS(Modes, Mode)
 
   BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = 0);
-  
+
   virtual Qt::ItemFlags flags(const QModelIndex &index) const;
   virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
 
   QVariant data(const QModelIndex &index, int role) const;
+  QVariant icon(const QModelIndex &index) const;
   QVariant foreground(const QModelIndex &index) const;
 
   void setConfig(BufferViewConfig *config);
   inline BufferViewConfig *config() const { return _config; }
 
   virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
-                                                                        
+
 public slots:
   void checkPreviousCurrentForRemoval(const QModelIndex &current, const QModelIndex &previous);
   void checkItemForRemoval(const QModelIndex &index) { checkItemsForRemoval(index, index); }
   void checkItemsForRemoval(const QModelIndex &topLeft, const QModelIndex &bottomRight);
-  
+
 protected:
   bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
   bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
@@ -81,23 +83,30 @@ signals:
 
 private slots:
   void configInitialized();
-    
+  void showUserStateIconsChanged();
+
 private:
   QPointer<BufferViewConfig> _config;
   Qt::SortOrder _sortOrder;
-  
+
   QColor _FgColorInactiveActivity;
   QColor _FgColorNoActivity;
   QColor _FgColorHighlightActivity;
   QColor _FgColorNewMessageActivity;
   QColor _FgColorOtherActivity;
+
+  QPixmap _userOfflineIcon;
+  QPixmap _userAwayIcon;
+  QPixmap _userOnlineIcon;
+  bool _showUserStateIcons;
+
   void loadColors();
 
   bool filterAcceptBuffer(const QModelIndex &) const;
   bool filterAcceptNetwork(const QModelIndex &) const;
   void addBuffer(const BufferId &) const;
 };
-Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)    
+Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)
 
 bool bufferIdLessThan(const BufferId &, const BufferId &);