d52871365ff1e108cd56c5a3fad705ff41c30297
[quassel.git] / src / client / bufferviewoverlay.h
1 /***************************************************************************
2  *   Copyright (C) 2005-08 by the Quassel Project                          *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
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.                                           *
9  *                                                                         *
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.                          *
14  *                                                                         *
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  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef BUFFERVIEWOVERLAY_H
22 #define BUFFERVIEWOVERLAY_H
23
24 #include <QObject>
25
26 #include "types.h"
27
28 class ClientBufferViewConfig;
29
30 class BufferViewOverlay : public QObject {
31   Q_OBJECT
32
33 public:
34   BufferViewOverlay(QObject *parent = 0);
35
36 public slots:
37   void addView(int viewId);
38   void removeView(int viewId);
39
40   // updates propagated from the actual views
41   void update();
42
43 signals:
44   void hasChanged();
45
46 protected:
47   virtual void customEvent(QEvent *event);
48
49 private slots:
50   void viewInitialized();
51
52 private:
53   inline bool allNetworks() const { return _networkIds.contains(NetworkId()); }
54
55   void updateHelper();
56   bool _aboutToUpdate;
57
58   QSet<int> _bufferViewIds;
59
60   QSet<NetworkId> _networkIds;
61
62   bool _addBuffersAutomatically;
63   bool _hideInactiveBuffers;
64   int _allowedBufferTypes;
65   int _minimumActivity;
66
67   QSet<BufferId> _buffers;
68   QSet<BufferId> _removedBuffers;
69   QSet<BufferId> _tempRemovedBuffers;
70
71   static const int _updateEventId;
72 };
73
74 #endif //BUFFERVIEWOVERLAY_H