KVIrc  4.9.2
DeveloperAPIs
KviNickServRule.h
Go to the documentation of this file.
1 #ifndef _KVI_NICKSERV_RULE_H_
2 #define _KVI_NICKSERV_RULE_H_
3 //=============================================================================
4 //
5 // File : KviNickServRule.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 
30 #include <QString>
31 
33 class KviIrcMask;
34 
36 {
37 protected:
38  QString m_szRegisteredNick; // my registered nickname
39  QString m_szNickServMask; // the NickServ service mask
40  QString m_szMessageRegexp; // the NickServ message regexp
41  QString m_szIdentifyCommand; // the IDENTIFY command to send to server
42  QString m_szServerMask; // the mask that the server must match (not used in per-network rules)
43 public:
46  const QString & szRegisteredNick,
47  const QString & szNickServMask,
48  const QString & szMessageRegexp,
49  const QString & szIdentifyCommand,
50  const QString & szServerMask = QString::null)
51  : KviHeapObject(),
52  m_szRegisteredNick(szRegisteredNick),
53  m_szNickServMask(szNickServMask),
54  m_szMessageRegexp(szMessageRegexp),
55  m_szIdentifyCommand(szIdentifyCommand),
56  m_szServerMask(szServerMask){};
57 
58 public:
59  const QString & registeredNick() const { return m_szRegisteredNick; };
60  const QString & nickServMask() const { return m_szNickServMask; };
61  const QString & messageRegexp() const { return m_szMessageRegexp; };
62  const QString & identifyCommand() const { return m_szIdentifyCommand; };
63  const QString & serverMask() const { return m_szServerMask; };
64  void setRegisteredNick(const QString & szRegisteredNick) { m_szRegisteredNick = szRegisteredNick; };
65  void setNickServMask(const QString & szNickServMask) { m_szNickServMask = szNickServMask; };
66  void setMessageRegexp(const QString & szMessageRegexp) { m_szMessageRegexp = szMessageRegexp; };
67  void setIdentifyCommand(const QString & szIdentifyCommand) { m_szIdentifyCommand = szIdentifyCommand; };
68  void setServerMask(const QString & szServerMask) { m_szServerMask = szServerMask; };
69 public:
70  // avoid crashes under windows
71  static KviNickServRule * createInstance(const QString & szRegisteredNick,
72  const QString & szNickServMask,
73  const QString & szMessageRegexp,
74  const QString & szIdentifyCommand,
75  const QString & szServerMask = QString::null);
76 
77  void save(KviConfigurationFile * cfg, const QString & prefix);
78  // returns false if the loaded data has no sense
79  bool load(KviConfigurationFile * cfg, const QString & prefix);
80  void copyFrom(const KviNickServRule & src);
81 };
82 
83 #endif // _KVI_NICKSERV_RULE_H_
KviNickServRule(const QString &szRegisteredNick, const QString &szNickServMask, const QString &szMessageRegexp, const QString &szIdentifyCommand, const QString &szServerMask=QString::null)
Definition: KviNickServRule.h:45
void setNickServMask(const QString &szNickServMask)
Definition: KviNickServRule.h:65
Definition: KviHeapObject.h:124
const QString & nickServMask() const
Definition: KviNickServRule.h:60
Definition: KviConfigurationFile.h:48
const QString & serverMask() const
Definition: KviNickServRule.h:63
Irc user mask handling.
Definition: KviIrcMask.h:45
QString m_szServerMask
Definition: KviNickServRule.h:42
void setRegisteredNick(const QString &szRegisteredNick)
Definition: KviNickServRule.h:64
void setServerMask(const QString &szServerMask)
Definition: KviNickServRule.h:68
QString m_szNickServMask
Definition: KviNickServRule.h:39
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
KviNickServRule()
Definition: KviNickServRule.h:44
Definition: KviNickServRule.h:35
Heap Object.
QString m_szIdentifyCommand
Definition: KviNickServRule.h:41
This file contains compile time settings.
const QString & registeredNick() const
Definition: KviNickServRule.h:59
void setMessageRegexp(const QString &szMessageRegexp)
Definition: KviNickServRule.h:66
void setIdentifyCommand(const QString &szIdentifyCommand)
Definition: KviNickServRule.h:67
QString m_szMessageRegexp
Definition: KviNickServRule.h:40
#define KVILIB_API
Definition: kvi_settings.h:125
const QString & messageRegexp() const
Definition: KviNickServRule.h:61
const QString & identifyCommand() const
Definition: KviNickServRule.h:62
QString m_szRegisteredNick
Definition: KviNickServRule.h:38