1 /***************************************************************************
2 * Copyright (C) 2005-2019 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
23 #include "client-export.h"
29 class BufferViewConfig;
30 class ClientBufferViewConfig;
32 class CLIENT_EXPORT BufferViewOverlay : public QObject
37 BufferViewOverlay(QObject* parent = nullptr);
39 inline const QSet<int>& bufferViewIds() { return _bufferViewIds; }
42 const QSet<NetworkId>& networkIds();
43 const QSet<BufferId>& bufferIds();
44 const QSet<BufferId>& removedBufferIds();
45 const QSet<BufferId>& tempRemovedBufferIds();
47 int allowedBufferTypes();
48 int minimumActivity();
50 inline bool isInitialized() { return _uninitializedViewCount == 0; }
53 void addView(int viewId);
54 void removeView(int viewId);
60 // updates propagated from the actual views
68 void customEvent(QEvent* event) override;
71 void viewInitialized();
72 void viewInitialized(BufferViewConfig* config);
76 QSet<BufferId> filterBuffersByConfig(const QList<BufferId>& buffers, const BufferViewConfig* config);
78 bool _aboutToUpdate{false};
80 QSet<int> _bufferViewIds;
81 int _uninitializedViewCount{0};
83 QSet<NetworkId> _networkIds;
84 int _allowedBufferTypes{0};
85 int _minimumActivity{0};
87 QSet<BufferId> _buffers;
88 QSet<BufferId> _removedBuffers;
89 QSet<BufferId> _tempRemovedBuffers;
91 static const int _updateEventId;