X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fbufferwidget.h;h=40413b3790e495448fe3300edb8fa94810ef5150;hb=a23256347cc47605dd0660127052846427bc998d;hp=d035fed1dd6b803679cc4c16a8a53d2682a3c394;hpb=d28b9ec38b6ea0bc473200fc2f1e65abd1b56bd6;p=quassel.git diff --git a/src/qtui/bufferwidget.h b/src/qtui/bufferwidget.h index d035fed1..40413b37 100644 --- a/src/qtui/bufferwidget.h +++ b/src/qtui/bufferwidget.h @@ -26,9 +26,12 @@ #include "chatview.h" #include "types.h" +class Network; class ChatView; class ChatWidget; -class LayoutThread; + +#include "buffermodel.h" +#include //! Displays the contents of a Buffer. /** @@ -36,33 +39,42 @@ class LayoutThread; class BufferWidget : public QWidget { Q_OBJECT - Q_PROPERTY(uint currentBuffer READ currentBuffer WRITE setCurrentBuffer); // FIXME BufferId - public: BufferWidget(QWidget *parent = 0); virtual ~BufferWidget(); void init(); - QSize sizeHint() const; + inline BufferModel *model() { return _bufferModel; } + void setModel(BufferModel *bufferModel); -signals: - void userInput(QString msg); - void aboutToClose(); + inline QItemSelectionModel *selectionModel() const { return _selectionModel; } + void setSelectionModel(QItemSelectionModel *selectionModel); -public slots: - BufferId currentBuffer() const; - void setCurrentBuffer(BufferId bufferId); - void saveState(); + inline BufferId currentBuffer() const { return _currentBuffer; } + +protected slots: +// virtual void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint); +// virtual void commitData(QWidget *editor); + virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); +// virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); +// virtual void editorDestroyed(QObject *editor); + virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); +// virtual void rowsInserted(const QModelIndex &parent, int start, int end); +// virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); private slots: - void enterPressed(); void removeBuffer(BufferId bufferId); + void setCurrentBuffer(BufferId bufferId); private: Ui::BufferWidget ui; QHash _chatWidgets; + QHash _chatViews; + + QPointer _bufferModel; + QPointer _selectionModel; + BufferId _currentBuffer; }; - #endif