KVIrc 5.2.0
Developer APIs
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 "KviHeapObject.h"
29#include "KviNickServRule.h"
30#include "KviPointerList.h"
31
33class KviIrcMask;
34
35class QString;
36
38{
39public:
43
44protected:
45 KviPointerList<KviNickServRule> * m_pRules; // FIXME: Replace with KviPointerHashTable<QString,KviPointerList>
47
48public:
49 // avoid crashes under windows
50 static KviNickServRuleSet * createInstance();
51 void clear();
52 bool isEnabled() { return m_bEnabled; };
53 void setEnabled(bool bEnabled) { m_bEnabled = bEnabled; };
54 bool isEmpty() { return m_pRules ? m_pRules->isEmpty() : true; };
55 void addRule(KviNickServRule * r);
56 KviNickServRule * matchRule(const QString & szNick, const KviIrcMask * nickServ, const QString & szMsg, const QString & szServer = QString());
57 void copyFrom(const KviNickServRuleSet & src);
58 void load(const QString & szConfigFile);
59 void save(const QString & szConfigFile);
60 void save(KviConfigurationFile * cfg, const QString & prefix);
61 KviPointerList<KviNickServRule> * rules() { return m_pRules; };
62 static KviNickServRuleSet * load(KviConfigurationFile * cfg, const QString & prefix);
63
64protected:
65 bool loadPrivate(KviConfigurationFile * cfg, const QString & prefix, unsigned int nEntries);
66};
67
68#endif // _KVI_NICKSERV_RULE_SET_H_
Heap Object.
C++ Template based double linked pointer list class.
btnDict clear()
Definition KviConfigurationFile.h:50
Definition KviHeapObject.h:125
Irc user mask handling.
Definition KviIrcMask.h:48
Definition KviNickServRuleSet.h:38
void setEnabled(bool bEnabled)
Definition KviNickServRuleSet.h:53
bool isEnabled()
Definition KviNickServRuleSet.h:52
KviPointerList< KviNickServRule > * m_pRules
Definition KviNickServRuleSet.h:45
KviPointerList< KviNickServRule > * rules()
Definition KviNickServRuleSet.h:61
bool m_bEnabled
Definition KviNickServRuleSet.h:46
bool isEmpty()
Definition KviNickServRuleSet.h:54
Definition KviNickServRule.h:36
A template double linked list of pointers.
Definition KviPointerList.h:371
bool isEmpty() const
Returns true if the list is empty.
Definition KviPointerList.h:611
#define r
Definition detector.cpp:83
#define s
Definition detector.cpp:84
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124