Column handles (but not yet the columns themselves) are now movable
[quassel.git] / src / qtui / chatscene.h
index 0963afa..9d8a565 100644 (file)
@@ -1,11 +1,11 @@
 /***************************************************************************
 /***************************************************************************
- *   Copyright (C) 2005-07 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
+ *   (at your option) version 3.                                           *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 #ifndef _CHATSCENE_H_
 #define _CHATSCENE_H_
 
 #ifndef _CHATSCENE_H_
 #define _CHATSCENE_H_
 
+#include <QAbstractItemModel>
 #include <QGraphicsScene>
 
 class AbstractUiMsg;
 class Buffer;
 #include <QGraphicsScene>
 
 class AbstractUiMsg;
 class Buffer;
+class ChatItem;
 class ChatLine;
 class ChatLine;
+class ColumnHandleItem;
+
 class QGraphicsSceneMouseEvent;
 
 class ChatScene : public QGraphicsScene {
   Q_OBJECT
 
   public:
 class QGraphicsSceneMouseEvent;
 
 class ChatScene : public QGraphicsScene {
   Q_OBJECT
 
   public:
-    ChatScene(Buffer *buffer, QObject *parent);
+    ChatScene(QAbstractItemModel *model, QObject *parent);
     virtual ~ChatScene();
 
     Buffer *buffer() const;
     virtual ~ChatScene();
 
     Buffer *buffer() const;
+    inline QAbstractItemModel *model() const { return _model; }
 
   public slots:
 
   public slots:
+    void setWidth(qreal);
 
 
-  protected slots:
-    void appendMsg(AbstractUiMsg *msg);
-    void prependMsg(AbstractUiMsg *msg);
+  private slots:
+    void rectChanged(const QRectF &);
 
 
-    void mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent );
+  signals:
+    void heightChanged(qreal height);
+
+  protected slots:
+    void rowsInserted(const QModelIndex &, int, int);
 
   private:
 
   private:
-    Buffer *_buffer;
-    QList<ChatLine*> _lines;
+    qreal _width, _height;
+    QAbstractItemModel *_model;
+    QList<ChatLine *> _lines;
 
 
+    ColumnHandleItem *firstColHandle, *secondColHandle;
+    qreal firstColHandlePos, secondColHandlePos;
 };
 
 #endif
 };
 
 #endif