KVIrc  4.9.2
DeveloperAPIs
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 "KviPointerList.h"
36 #include "KviIdentityProfile.h"
37 
39 
45 {
46 public:
52 
61 
66 
67 private:
69  static unsigned int m_uCount;
70 
71 protected:
73  bool m_bEnabled;
74 
75 public:
80  static void init();
81 
86  static void done();
87 
92  static inline KviIdentityProfileSet * instance() { return m_pSelf; };
93 
98  unsigned int count() { return m_uCount; };
99 
104  KviPointerList<KviIdentityProfile> * profiles() { return m_pProfiles; };
105 
111  KviIdentityProfile * findName(const QString & szName);
112 
118  KviIdentityProfile * findNetwork(const QString & szNetwork);
119 
124  void clear();
125 
130  bool isEmpty() { return m_pProfiles ? m_pProfiles->isEmpty() : true; };
131 
136  bool isEnabled() { return m_bEnabled; };
137 
143  void setEnabled(bool bEnabled) { m_bEnabled = bEnabled; };
144 
150  void copyFrom(const KviIdentityProfileSet & src);
151 
157  void addProfile(KviIdentityProfile * pProfile);
158 
164  void load(const QString & szConfigFile);
165 
171  void save(const QString & szConfigFile);
172 
179  void save(KviConfigurationFile * pCfg, const QString & szPrefix);
180 
181 protected:
189  bool loadPrivate(KviConfigurationFile * pCfg, const QString & szPrefix, unsigned int uEntries);
190 };
191 
192 #endif // _KVI_IDENTITY_PROFILE_SET_H_
Definition: KviHeapObject.h:124
unsigned int count()
Returns the number of instances of the class.
Definition: KviIdentityProfileSet.h:98
Definition: KviConfigurationFile.h:48
static KviIdentityProfileSet * instance()
Returns the instance of the class.
Definition: KviIdentityProfileSet.h:92
static unsigned int m_uCount
Definition: KviIdentityProfileSet.h:69
btnDict clear()
bool isEnabled()
Returns true if the profile set is enabled.
Definition: KviIdentityProfileSet.h:136
void done()
Definition: KviKvs.cpp:50
void setEnabled(bool bEnabled)
Enables the profile set.
Definition: KviIdentityProfileSet.h:143
bool isEmpty()
Returns true if the profile set is empty.
Definition: KviIdentityProfileSet.h:130
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
KviPointerList< KviIdentityProfile > * profiles()
Returns the profiles set.
Definition: KviIdentityProfileSet.h:104
static KviIdentityProfileSet * m_pSelf
Definition: KviIdentityProfileSet.h:68
C++ Template based double linked pointer list class.
Class which manages the list of identity profiles.
Definition: KviIdentityProfileSet.h:44
Heap Object.
Identity profiles handling.
Class which manages the identity profile.
Definition: KviIdentityProfile.h:45
void set(void *dst_ptr, char c, int len)
Initializes len bytes of memory starting from dst_ptr to c.
Definition: KviMemory.h:152
int init()
Definition: winamp.cpp:118
bool m_bEnabled
Definition: KviIdentityProfileSet.h:73
This file contains compile time settings.
KviPointerList< KviIdentityProfile > * m_pProfiles
Definition: KviIdentityProfileSet.h:72
#define KVILIB_API
Definition: kvi_settings.h:125