KVIrc 5.2.4
Developer APIs
KviIdentityProfileSet.h
Go to the documentation of this file.
1#ifndef _KVI_IDENTITY_PROFILE_SET_H_
2#define _KVI_IDENTITY_PROFILE_SET_H_
3//=============================================================================
4//
5// File : KviIdentityProfileSet.h
6// Creation date : Thu Dec 30 2010 15:54:48 by Elvio Basello
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2010 Elvio Basello (hellvis69 at netsons dot org)
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
33#include "kvi_settings.h"
34#include "KviHeapObject.h"
35#include "KviIdentityProfile.h"
36#include "KviPointerList.h"
37
39
45{
46public:
52
61
66
67private:
69
70protected:
73
74public:
79 static void init();
80
85 static void done();
86
91 static inline KviIdentityProfileSet * instance() { return m_pSelf; };
92
97 KviPointerList<KviIdentityProfile> * profiles() { return m_pProfiles; };
98
104 KviIdentityProfile * findName(const QString & szName);
105
111 KviIdentityProfile * findNetwork(const QString & szNetwork);
112
117 void clear();
118
123 bool isEmpty() { return m_pProfiles ? m_pProfiles->isEmpty() : true; };
124
129 bool isEnabled() { return m_bEnabled; };
130
136 void setEnabled(bool bEnabled) { m_bEnabled = bEnabled; };
137
143 void copyFrom(const KviIdentityProfileSet & src);
144
150 void addProfile(KviIdentityProfile * pProfile);
151
157 void load(const QString & szConfigFile);
158
164 void save(const QString & szConfigFile);
165
172 void save(KviConfigurationFile * pCfg, const QString & szPrefix);
173
174protected:
182 bool loadPrivate(KviConfigurationFile * pCfg, const QString & szPrefix, unsigned int uEntries);
183};
184
185#endif // _KVI_IDENTITY_PROFILE_SET_H_
Heap Object.
Identity profiles handling.
C++ Template based double linked pointer list class.
btnDict clear()
Definition KviConfigurationFile.h:50
Definition KviHeapObject.h:119
Class which manages the list of identity profiles.
Definition KviIdentityProfileSet.h:45
bool isEnabled()
Returns true if the profile set is enabled.
Definition KviIdentityProfileSet.h:129
static KviIdentityProfileSet * m_pSelf
Definition KviIdentityProfileSet.h:68
KviPointerList< KviIdentityProfile > * m_pProfiles
Definition KviIdentityProfileSet.h:71
bool m_bEnabled
Definition KviIdentityProfileSet.h:72
static KviIdentityProfileSet * instance()
Returns the instance of the class.
Definition KviIdentityProfileSet.h:91
KviPointerList< KviIdentityProfile > * profiles()
Returns the profiles set.
Definition KviIdentityProfileSet.h:97
void setEnabled(bool bEnabled)
Enables the profile set.
Definition KviIdentityProfileSet.h:136
bool isEmpty()
Returns true if the profile set is empty.
Definition KviIdentityProfileSet.h:123
Class which manages the identity profile.
Definition KviIdentityProfile.h:45
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
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124
int init()
Definition winamp.cpp:118