X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fabstractbuffercontainer.h;h=b2e90fb86e0543ca04802a0d9719e081cc1afa54;hp=bf8a34c77b0258ea88212d453e7dcebb298d19d7;hb=2b44b945cf50e3dbfeabe4e5aee10db4b13f5a64;hpb=e1b6d538b7c4cc279f9218614e23adb5d8a81fe5 diff --git a/src/uisupport/abstractbuffercontainer.h b/src/uisupport/abstractbuffercontainer.h index bf8a34c7..b2e90fb8 100644 --- a/src/uisupport/abstractbuffercontainer.h +++ b/src/uisupport/abstractbuffercontainer.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * Copyright (C) 2005-2014 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ABSTRACTBUFFERCONTAINER_H_ @@ -28,19 +28,21 @@ class AbstractChatView; class AbstractUiMsg; class Buffer; -class AbstractBufferContainer : public AbstractItemView { - Q_OBJECT +class AbstractBufferContainer : public AbstractItemView +{ + Q_OBJECT - public: +public: AbstractBufferContainer(QWidget *parent); virtual ~AbstractBufferContainer(); inline BufferId currentBuffer() const { return _currentBuffer; } - signals: +signals: void currentChanged(BufferId); + void currentChanged(const QModelIndex &); - protected: +protected: //! Create an AbstractChatView for the given BufferId and add it to the UI if necessary virtual AbstractChatView *createChatView(BufferId) = 0; @@ -51,7 +53,12 @@ class AbstractBufferContainer : public AbstractItemView { */ virtual void removeChatView(BufferId) = 0; - protected slots: + //! If true, the marker line will be set automatically on buffer switch + /** \return Whether the marker line should be set on buffer switch + */ + virtual inline bool autoMarkerLine() const { return true; } + +protected slots: virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); @@ -62,20 +69,22 @@ class AbstractBufferContainer : public AbstractItemView { */ virtual void showChatView(BufferId) = 0; - private slots: +private slots: void removeBuffer(BufferId bufferId); void setCurrentBuffer(BufferId bufferId); - private: +private: BufferId _currentBuffer; QHash _chatViews; }; -class AbstractChatView { - public: +class AbstractChatView +{ +public: virtual ~AbstractChatView() {}; - + virtual MsgId lastMsgId() const = 0; }; + #endif