X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbufferviewoverlay.h;h=38dad7337e21539f6f9a514f110fe317421d8acd;hp=d52871365ff1e108cd56c5a3fad705ff41c30297;hb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;hpb=f48d855945219c3a1897a17bf15830dfee104f0b diff --git a/src/client/bufferviewoverlay.h b/src/client/bufferviewoverlay.h index d5287136..38dad733 100644 --- a/src/client/bufferviewoverlay.h +++ b/src/client/bufferviewoverlay.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2018 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 BUFFERVIEWOVERLAY_H @@ -25,50 +25,70 @@ #include "types.h" +class BufferViewConfig; class ClientBufferViewConfig; -class BufferViewOverlay : public QObject { - Q_OBJECT +class BufferViewOverlay : public QObject +{ + Q_OBJECT public: - BufferViewOverlay(QObject *parent = 0); + BufferViewOverlay(QObject *parent = 0); + + inline const QSet &bufferViewIds() { return _bufferViewIds; } + bool allNetworks(); + + const QSet &networkIds(); + const QSet &bufferIds(); + const QSet &removedBufferIds(); + const QSet &tempRemovedBufferIds(); + + int allowedBufferTypes(); + int minimumActivity(); + + inline bool isInitialized() { return _uninitializedViewCount == 0; } public slots: - void addView(int viewId); - void removeView(int viewId); + void addView(int viewId); + void removeView(int viewId); - // updates propagated from the actual views - void update(); + void reset(); + void save(); + void restore(); + + // updates propagated from the actual views + void update(); signals: - void hasChanged(); + void hasChanged(); + void initDone(); protected: - virtual void customEvent(QEvent *event); + virtual void customEvent(QEvent *event); private slots: - void viewInitialized(); + void viewInitialized(); + void viewInitialized(BufferViewConfig *config); private: - inline bool allNetworks() const { return _networkIds.contains(NetworkId()); } - - void updateHelper(); - bool _aboutToUpdate; + void updateHelper(); + QSet filterBuffersByConfig(const QList &buffers, const BufferViewConfig *config); - QSet _bufferViewIds; + bool _aboutToUpdate; - QSet _networkIds; + QSet _bufferViewIds; + int _uninitializedViewCount; - bool _addBuffersAutomatically; - bool _hideInactiveBuffers; - int _allowedBufferTypes; - int _minimumActivity; + QSet _networkIds; + int _allowedBufferTypes; + int _minimumActivity; - QSet _buffers; - QSet _removedBuffers; - QSet _tempRemovedBuffers; + QSet _buffers; + QSet _removedBuffers; + QSet _tempRemovedBuffers; - static const int _updateEventId; + static const int _updateEventId; }; + #endif //BUFFERVIEWOVERLAY_H