- Topics are now editable even when they were empty
[quassel.git] / src / qtui / bufferwidget.h
index 980d0de..089d498 100644 (file)
 
 #include "ui_bufferwidget.h"
 
+#include "abstractitemview.h"
 #include "chatview.h"
 #include "types.h"
 
+class Network;
 class ChatView;
 class ChatWidget;
-class LayoutThread;
+
+#include "buffermodel.h"
 
 //! Displays the contents of a Buffer.
 /**
 */
-class BufferWidget : public QWidget {
+class BufferWidget : public AbstractItemView {
   Q_OBJECT
 
-  Q_PROPERTY(uint currentBuffer READ currentBuffer WRITE setCurrentBuffer)
-    
 public:
   BufferWidget(QWidget *parent = 0);
   virtual ~BufferWidget();
   void init();
 
-  QSize sizeHint() const;
-
-signals:
-  void userInput(QString msg);
-  void aboutToClose();
-
-public slots:
-  BufferId currentBuffer() const;
-  void setCurrentBuffer(BufferId bufferId);
-  void saveState();
+  inline BufferId currentBuffer() const { return _currentBuffer; }
+  
+protected slots:
+  virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous);
+  virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
 
 private slots:
-  void enterPressed();
   void removeBuffer(BufferId bufferId);
+  void setCurrentBuffer(BufferId bufferId);
 
 private:
   Ui::BufferWidget ui;
   QHash<BufferId, ChatWidget *> _chatWidgets;
+  QHash<BufferId, ChatView *> _chatViews;
+
   BufferId _currentBuffer;
 };
 
-
 #endif