- public:
- AbstractBufferContainer(QWidget *parent);
- virtual ~AbstractBufferContainer();
-
- inline BufferId currentBuffer() const { return _currentBuffer; }
-
- protected:
- //! Create an AbstractChatView for the given BufferId and add it to the UI if necessary
- virtual AbstractChatView *createChatView(BufferId) = 0;
-
- //! Remove a chat view from the UI and delete it
- /** This method shall remove the view from the UI (for example, from a QStackedWidget) if appropriate.
- * It also shall delete the object afterwards.
- * \param view The chat view to be removed and deleted
- */
- virtual void removeChatView(AbstractChatView *view) = 0;
-
- protected slots:
- virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
- virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
-
- //! Show the given chat view
- /** This method is called when the given chat view should be displayed. Use this e.g. for
- * selecting the appropriate page in a QStackedWidget.
- * \param view The chat view to be displayed. May be 0 if no chat view is selected.
- */
- virtual void showChatView(AbstractChatView *view) = 0;
-
- private slots:
- void appendMsg(AbstractUiMsg *);
- void prependMsg(AbstractUiMsg *);
- void removeBuffer(BufferId bufferId);
- void setCurrentBuffer(BufferId bufferId);
-
- private:
- BufferId _currentBuffer;
- QHash<BufferId, AbstractChatView *> _chatViews;
+public:
+ AbstractBufferContainer(QWidget *parent);
+ virtual ~AbstractBufferContainer();
+
+ inline BufferId currentBuffer() const { return _currentBuffer; }
+
+signals:
+ void currentChanged(BufferId);
+ void currentChanged(const QModelIndex &);
+
+protected:
+ //! Create an AbstractChatView for the given BufferId and add it to the UI if necessary
+ virtual AbstractChatView *createChatView(BufferId) = 0;
+
+ //! Remove a chat view from the UI and delete it
+ /** This method shall remove the view from the UI (for example, from a QStackedWidget) if appropriate.
+ * It also shall delete the object afterwards.
+ * \param view The chat view to be removed and deleted
+ */
+ virtual void removeChatView(BufferId) = 0;
+
+ virtual inline bool autoSetMarkerLine() const { return true; }
+
+protected slots:
+ virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
+ virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
+
+ //! Show the given chat view
+ /** This method is called when the given chat view should be displayed. Use this e.g. for
+ * selecting the appropriate page in a QStackedWidget.
+ * \param view The chat view to be displayed. May be 0 if no chat view is selected.
+ */
+ virtual void showChatView(BufferId) = 0;
+
+private slots:
+ void removeBuffer(BufferId bufferId);
+ void setCurrentBuffer(BufferId bufferId);
+
+private:
+ BufferId _currentBuffer;
+ QHash<BufferId, AbstractChatView *> _chatViews;