X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffertreemodel.h;h=70a961932c775a8eabe865a8dd0f33c0056ff0e2;hp=56981fca154773ad8db848a2da67c89cc494958a;hb=cd122ca8e0d2c0ffc5397e0a813c75d791a7e6e3;hpb=0555b01cbb4789122de7bc0a5325c664fbed87cd diff --git a/src/client/buffertreemodel.h b/src/client/buffertreemodel.h index 56981fca..70a96193 100644 --- a/src/client/buffertreemodel.h +++ b/src/client/buffertreemodel.h @@ -1,4 +1,4 @@ - /*************************************************************************** +/*************************************************************************** * Copyright (C) 2005-07 by The Quassel Team * * devel@quassel-irc.org * * * @@ -26,6 +26,17 @@ #include "treemodel.h" #include "buffer.h" +#include + +#include + +class BufferInfo; + +#include "selectionmodelsynchronizer.h" +#include "modelpropertymapper.h" +class MappedSelectionModel; +class QAbstractItemView; + /***************************************** * Fancy Buffer Items *****************************************/ @@ -74,27 +85,32 @@ class BufferTreeModel : public TreeModel { Q_OBJECT public: - enum myRoles { + enum myRoles { BufferTypeRole = Qt::UserRole, BufferActiveRole, BufferNameRole, - BufferIdRole + BufferUidRole }; BufferTreeModel(QObject *parent = 0); static QList defaultHeader(); - + + inline SelectionModelSynchronizer *selectionModelSynchronizer() { return _selectionModelSynchronizer; } + inline ModelPropertyMapper *propertyMapper() { return _propertyMapper; } + + void synchronizeSelectionModel(MappedSelectionModel *selectionModel); + void synchronizeView(QAbstractItemView *view); + void mapProperty(int column, int role, QObject *target, const QByteArray &property); + public slots: - void bufferUpdated(Buffer *); - void changeCurrent(const QModelIndex &, const QModelIndex &); + void bufferUpdated(Buffer *); + void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command); void selectBuffer(Buffer *buffer); - void doubleClickReceived(const QModelIndex &); void bufferActivity(Buffer::ActivityLevel, Buffer *buffer); signals: void bufferSelected(Buffer *); void invalidateFilter(); - void fakeUserInput(BufferId, QString); void selectionChanged(const QModelIndex &); private: @@ -106,7 +122,9 @@ private: QStringList mimeTypes() const; QMimeData *mimeData(const QModelIndexList &) const; bool dropMimeData(const QMimeData *, Qt::DropAction, int, int, const QModelIndex &); - + + QPointer _selectionModelSynchronizer; + QPointer _propertyMapper; Buffer *currentBuffer; };