KVIrc 5.2.6
Developer APIs
KviRegisteredUser.h
Go to the documentation of this file.
1#ifndef _KviRegisteredUser_h_
2#define _KviRegisteredUser_h_
3//=============================================================================
4//
5// File : KviRegisteredUser.h
6// Creation date : Wed Dec 29 2010 02:44:05 CEST by Elvio Basello
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
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//
28// this file was originally part of KviRegisteredUserDataBase.h
29//
30
31#include "kvi_settings.h"
32#include "KviHeapObject.h"
33#include "KviPointerHashTable.h"
34#include "KviPointerList.h"
35
36class KviIrcMask;
37class QString;
38
40{
42
43public:
45 {
47 Query = 2,
48 Notice = 4,
49 Ctcp = 8,
50 Invite = 16,
51 Dcc = 32,
53 };
54
55 KviRegisteredUser(const QString & szName);
57
58private:
61 QString m_szName;
62 QString m_szGroup;
65protected:
66 // mask ownership is transferred! (always!) returns false if the mask was already there
67 bool addMask(KviIrcMask * pMask);
68 bool removeMask(KviIrcMask * pMask);
69 KviIrcMask * findMask(const KviIrcMask & mask);
70
71public:
72 int ignoreFlags() { return m_iIgnoreFlags; };
73 void setIgnoreFlags(int iFlags) { m_iIgnoreFlags = iFlags; };
74 bool ignoreEnabled() { return m_bIgnoreEnabled; };
75 void setIgnoreEnabled(bool bEnabled) { m_bIgnoreEnabled = bEnabled; };
76 bool isIgnoreEnabledFor(IgnoreFlags flag);
77
78 const QString & name() { return m_szName; };
79 bool matches(const KviIrcMask & mask);
80 bool matchesFixed(const KviIrcMask & mask);
81 bool matchesFixed(const QString & szNick, const QString & szUser, const QString & szHost);
82
83 void setProperty(const QString & szName, const QString & szValue);
84 void setProperty(const QString & szName, bool szValue);
85
86 void setGroup(const QString & szName) { m_szGroup = szName; };
87 const QString & group() { return m_szGroup; };
88
89 const QString & getProperty(const QString & szName); // returns 0 if the property is not there
90 bool getProperty(const QString & szName, QString & szValue); // returns false if the property is not there
91 bool getBoolProperty(const QString & szName, bool bDef = false); // returns true if the property is there and is true
92 // the propertyDict may be 0!
94 // this is never zero (but may contain no masks)
96};
97
98#endif
Heap Object.
Pointer Hash Table.
C++ Template based double linked pointer list class.
Definition KviHeapObject.h:119
Irc user mask handling.
Definition KviIrcMask.h:48
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
A template double linked list of pointers.
Definition KviPointerList.h:371
Definition KviRegisteredUser.h:40
KviPointerList< KviIrcMask > * maskList()
Definition KviRegisteredUser.h:95
const QString & group()
Definition KviRegisteredUser.h:87
bool m_bIgnoreEnabled
Definition KviRegisteredUser.h:60
KviRegisteredUser(const QString &szName)
Definition KviRegisteredUser.cpp:32
int m_iIgnoreFlags
Definition KviRegisteredUser.h:59
bool addMask(KviIrcMask *pMask)
Definition KviRegisteredUser.cpp:66
QString m_szGroup
Definition KviRegisteredUser.h:62
const QString & name()
Definition KviRegisteredUser.h:78
KviPointerHashTable< QString, QString > * propertyDict()
Definition KviRegisteredUser.h:93
bool removeMask(KviIrcMask *pMask)
Definition KviRegisteredUser.cpp:78
KviIrcMask * findMask(const KviIrcMask &mask)
Definition KviRegisteredUser.cpp:56
IgnoreFlags
Definition KviRegisteredUser.h:45
@ Invite
Definition KviRegisteredUser.h:50
@ Notice
Definition KviRegisteredUser.h:48
@ Ctcp
Definition KviRegisteredUser.h:49
@ Dcc
Definition KviRegisteredUser.h:51
@ Channel
Definition KviRegisteredUser.h:46
@ Query
Definition KviRegisteredUser.h:47
@ Highlight
Definition KviRegisteredUser.h:52
friend class KviRegisteredUserDataBase
Definition KviRegisteredUser.h:41
bool ignoreEnabled()
Definition KviRegisteredUser.h:74
int ignoreFlags()
Definition KviRegisteredUser.h:72
void setIgnoreFlags(int iFlags)
Definition KviRegisteredUser.h:73
KviPointerList< KviIrcMask > * m_pMaskList
Definition KviRegisteredUser.h:64
void setIgnoreEnabled(bool bEnabled)
Definition KviRegisteredUser.h:75
KviPointerHashTable< QString, QString > * m_pPropertyDict
Definition KviRegisteredUser.h:63
QString m_szName
Definition KviRegisteredUser.h:61
void setGroup(const QString &szName)
Definition KviRegisteredUser.h:86
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124
QString szHost
Definition libkvisetup.cpp:48