Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
bufferviewconfig.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2015 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  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef BUFFERVIEWCONFIG_H
22 #define BUFFERVIEWCONFIG_H
23 
24 #include "syncableobject.h"
25 
26 #include "types.h"
27 
29 {
31  Q_OBJECT
32 
33  Q_PROPERTY(QString bufferViewName READ bufferViewName WRITE setBufferViewName)
34  Q_PROPERTY(NetworkId networkId READ networkId WRITE setNetworkId)
42 
43 public :
44  BufferViewConfig(int bufferViewId, QObject *parent = 0);
45  BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0);
46 
47  inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
48 
49 public slots:
50  inline int bufferViewId() const { return _bufferViewId; }
51 
52  inline const QString &bufferViewName() const { return _bufferViewName; }
53  void setBufferViewName(const QString &bufferViewName);
54 
55  inline const NetworkId &networkId() const { return _networkId; }
56  void setNetworkId(const NetworkId &networkId);
57 
60 
61  inline bool sortAlphabetically() const { return _sortAlphabetically; }
63 
64  inline bool disableDecoration() const { return _disableDecoration; }
66 
67  inline int allowedBufferTypes() const { return _allowedBufferTypes; }
68  void setAllowedBufferTypes(int bufferTypes);
69 
70  inline int minimumActivity() const { return _minimumActivity; }
71  void setMinimumActivity(int activity);
72 
73  inline bool hideInactiveBuffers() const { return _hideInactiveBuffers; }
75 
76  inline bool hideInactiveNetworks() const { return _hideInactiveNetworks; }
78 
79  virtual inline void requestSetBufferViewName(const QString &bufferViewName) { REQUEST(ARG(bufferViewName)) }
80 
81  const QList<BufferId> &bufferList() const { return _buffers; }
82  const QSet<BufferId> &removedBuffers() const { return _removedBuffers; }
83  const QSet<BufferId> &temporarilyRemovedBuffers() const { return _temporarilyRemovedBuffers; }
84 
85  QVariantList initBufferList() const;
86  void initSetBufferList(const QVariantList &buffers);
87  void initSetBufferList(const QList<BufferId> &buffers);
88 
89  QVariantList initRemovedBuffers() const;
90  void initSetRemovedBuffers(const QVariantList &buffers);
91 
92  QVariantList initTemporarilyRemovedBuffers() const;
93  void initSetTemporarilyRemovedBuffers(const QVariantList &buffers);
94 
95  void addBuffer(const BufferId &bufferId, int pos);
96  virtual inline void requestAddBuffer(const BufferId &bufferId, int pos) { REQUEST(ARG(bufferId), ARG(pos)) }
97  void moveBuffer(const BufferId &bufferId, int pos);
98  virtual inline void requestMoveBuffer(const BufferId &bufferId, int pos) { REQUEST(ARG(bufferId), ARG(pos)) }
99  void removeBuffer(const BufferId &bufferId);
100  virtual inline void requestRemoveBuffer(const BufferId &bufferId) { REQUEST(ARG(bufferId)) }
101  void removeBufferPermanently(const BufferId &bufferId);
102  virtual inline void requestRemoveBufferPermanently(const BufferId &bufferId) { REQUEST(ARG(bufferId)) }
103 
104 signals:
105  void bufferViewNameSet(const QString &bufferViewName); // invalidate
106  void configChanged();
107  void networkIdSet(const NetworkId &networkId);
108 // void addNewBuffersAutomaticallySet(bool addNewBuffersAutomatically); // invalidate
109 // void sortAlphabeticallySet(bool sortAlphabetically); // invalidate
110 // // void disableDecorationSet(bool disableDecoration); // invalidate
111 // void allowedBufferTypesSet(int allowedBufferTypes); // invalidate
112 // void minimumActivitySet(int activity); // invalidate
113 // void hideInactiveBuffersSet(bool hideInactiveBuffers); // invalidate
114  void bufferListSet(); // invalidate
115 
116  void bufferAdded(const BufferId &bufferId, int pos);
117 // void addBufferRequested(const BufferId &bufferId, int pos);
118  void bufferMoved(const BufferId &bufferId, int pos);
119 // void moveBufferRequested(const BufferId &bufferId, int pos);
120  void bufferRemoved(const BufferId &bufferId);
121  void bufferPermanentlyRemoved(const BufferId &bufferId);
122 // void removeBufferRequested(const BufferId &bufferId);
123 // void removeBufferPermanentlyRequested(const BufferId &bufferId);
124 
125 // void setBufferViewNameRequested(const QString &bufferViewName);
126 
127 private:
138  QList<BufferId> _buffers;
139  QSet<BufferId> _removedBuffers;
141 };
142 
143 
144 #endif // BUFFERVIEWCONFIG_H