Changing the behavior how Quassel Events are processed.
[quassel.git] / src / common / networkconfig.h
1 /***************************************************************************
2  *   Copyright (C) 2005-09 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 NETWORKCONFIG_H_
22 #define NETWORKCONFIG_H_
23
24 #include "syncableobject.h"
25
26 class NetworkConfig : public SyncableObject {
27   SYNCABLE_OBJECT
28   Q_OBJECT
29
30   Q_PROPERTY(bool pingTimeoutEnabled READ pingTimeoutEnabled WRITE setPingTimeoutEnabled)
31   Q_PROPERTY(int pingInterval READ pingInterval WRITE setPingInterval)
32   Q_PROPERTY(int maxPingCount READ maxPingCount WRITE setMaxPingCount)
33   Q_PROPERTY(bool autoWhoEnabled READ autoWhoEnabled WRITE setAutoWhoEnabled)
34   Q_PROPERTY(int autoWhoInterval READ autoWhoInterval WRITE setAutoWhoInterval)
35   Q_PROPERTY(int autoWhoNickLimit READ autoWhoNickLimit WRITE setAutoWhoNickLimit)
36   Q_PROPERTY(int autoWhoDelay READ autoWhoDelay WRITE setAutoWhoDelay)
37
38 public:
39   NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = 0);
40
41   inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
42
43 public slots:
44   inline bool pingTimeoutEnabled() const { return _pingTimeoutEnabled; }
45   void setPingTimeoutEnabled(bool);
46   virtual inline void requestSetPingTimeoutEnabled(bool b) { REQUEST(ARG(b)) }
47
48   inline int pingInterval() const { return _pingInterval; }
49   void setPingInterval(int);
50   virtual inline void requestSetPingInterval(int i) { REQUEST(ARG(i)) }
51
52   inline int maxPingCount() const { return _maxPingCount; }
53   void setMaxPingCount(int);
54   virtual inline void requestSetMaxPingCount(int i) { REQUEST(ARG(i)) }
55
56   inline bool autoWhoEnabled() const { return _autoWhoEnabled; }
57   void setAutoWhoEnabled(bool);
58   virtual inline void requestSetAutoWhoEnabled(bool b) { REQUEST(ARG(b)) }
59
60   inline int autoWhoInterval() const { return _autoWhoInterval; }
61   void setAutoWhoInterval(int);
62   virtual inline void requestSetAutoWhoInterval(int i) { REQUEST(ARG(i)) }
63
64   inline int autoWhoNickLimit() const { return _autoWhoNickLimit; }
65   void setAutoWhoNickLimit(int);
66   virtual inline void requestSetAutoWhoNickLimit(int i) { REQUEST(ARG(i)) }
67
68   inline int autoWhoDelay() const { return _autoWhoDelay; }
69   void setAutoWhoDelay(int);
70   virtual inline void requestSetAutoWhoDelay(int i) { REQUEST(ARG(i)) }
71
72 signals:
73   void pingTimeoutEnabledSet(bool);
74   void pingIntervalSet(int);
75 //   void maxPingCountSet(int);
76   void autoWhoEnabledSet(bool);
77   void autoWhoIntervalSet(int);
78 //   void autoWhoNickLimitSet(int);
79   void autoWhoDelaySet(int);
80
81 //   void setPingTimeoutEnabledRequested(bool);
82 //   void setPingIntervalRequested(int);
83 //   void setMaxPingCountRequested(int);
84 //   void setAutoWhoEnabledRequested(bool);
85 //   void setAutoWhoIntervalRequested(int);
86 //   void setAutoWhoNickLimitRequested(int);
87 //   void setAutoWhoDelayRequested(int);
88
89 private:
90   bool _pingTimeoutEnabled;
91   int _pingInterval;
92   int _maxPingCount;
93
94   bool _autoWhoEnabled;
95   int _autoWhoInterval;
96   int _autoWhoNickLimit;
97   int _autoWhoDelay;
98 };
99
100 #endif