KVIrc  4.9.2
DeveloperAPIs
KviNickServRuleSet.h
Go to the documentation of this file.
1 #ifndef _KVI_NICKSERV_RULE_SET_H_
2 #define _KVI_NICKSERV_RULE_SET_H_
3 //=============================================================================
4 //
5 // File : KviNickServRuleSet.h
6 // Creation date : Thu Aug 09 2001 16:43:56 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "kvi_settings.h"
28 #include "KviQString.h"
29 #include "KviHeapObject.h"
30 #include "KviPointerList.h"
31 #include "KviNickServRule.h"
32 
34 class KviIrcMask;
35 
37 {
38 public:
42 
43 protected:
44  KviPointerList<KviNickServRule> * m_pRules; // FIXME: Replace with KviPointerHashTable<QString,KviPointerList>
45  bool m_bEnabled;
46 
47 public:
48  // avoid crashes under windows
49  static KviNickServRuleSet * createInstance();
50  void clear();
51  bool isEnabled() { return m_bEnabled; };
52  void setEnabled(bool bEnabled) { m_bEnabled = bEnabled; };
53  bool isEmpty() { return m_pRules ? m_pRules->isEmpty() : true; };
54  void addRule(KviNickServRule * r);
55  KviNickServRule * matchRule(const QString & szNick, const KviIrcMask * nickServ, const QString & szMsg, const QString & szServer = QString::null);
56  void copyFrom(const KviNickServRuleSet & src);
57  void load(const QString & szConfigFile);
58  void save(const QString & szConfigFile);
59  void save(KviConfigurationFile * cfg, const QString & prefix);
60  KviPointerList<KviNickServRule> * rules() { return m_pRules; };
61  static KviNickServRuleSet * load(KviConfigurationFile * cfg, const QString & prefix);
62 
63 protected:
64  bool loadPrivate(KviConfigurationFile * cfg, const QString & prefix, unsigned int nEntries);
65 };
66 
67 #endif // _KVI_NICKSERV_RULE_SET_H_
Definition: KviHeapObject.h:124
void setEnabled(bool bEnabled)
Definition: KviNickServRuleSet.h:52
Definition: KviNickServRuleSet.h:36
bool isEnabled()
Definition: KviNickServRuleSet.h:51
Definition: KviConfigurationFile.h:48
bool isEmpty()
Definition: KviNickServRuleSet.h:53
Irc user mask handling.
Definition: KviIrcMask.h:45
btnDict clear()
char s char s s
Definition: KviIrcNumericCodes.h:391
KviPointerList< KviNickServRule > * rules()
Definition: KviNickServRuleSet.h:60
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
bool m_bEnabled
Definition: KviNickServRuleSet.h:45
KviPointerList< KviNickServRule > * m_pRules
Definition: KviNickServRuleSet.h:44
#define r
Definition: detector.cpp:82
Definition: KviNickServRule.h:35
C++ Template based double linked pointer list class.
Heap Object.
This file contains compile time settings.
#define KVILIB_API
Definition: kvi_settings.h:125
Helper functions for the QString class.