KVIrc  4.9.2
DeveloperAPIs
KviUserIdentityManager.h
Go to the documentation of this file.
1 #ifndef _KVI_USERIDENTITY_MANAGER_H_
2 #define _KVI_USERIDENTITY_MANAGER_H_
3 //=============================================================================
4 //
5 // File : KviUserIdentityManager.h
6 // Creation date : Thu Dec Jan 2007 05:03:47 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 
35 #include "kvi_settings.h"
36 #include "KviHeapObject.h"
37 #include "KviPointerHashTable.h"
38 
39 class KviUserIdentity;
40 
46 {
47 protected:
53 
58 
59 protected:
63 
64 public:
69  static void init();
70 
75  static void done();
76 
81  static KviUserIdentityManager * instance() { return m_pInstance; };
82 
88 
94  const KviUserIdentity * findIdentity(const QString & szId) { return m_pIdentityDict->find(szId); };
95 
101  const KviUserIdentity * defaultIdentity();
102 
108  void setDefaultIdentity(const QString & szIdentityId) { m_szDefaultIdentity = szIdentityId; };
109 
114  KviUserIdentityManager * createWorkingCopy();
115 
121  void copyFrom(KviUserIdentityManager * pWorkingCopy);
122 
128  void releaseWorkingCopy(KviUserIdentityManager * pWorkingCopy);
129 
135  void save(const QString & szFileName);
136 
142  void load(const QString & szFileName);
143 };
144 
145 #endif // _KVI_USERIDENTITY_MANAGER_H_
Definition: KviHeapObject.h:124
static KviUserIdentityManager * instance()
Returns the instance of the identity.
Definition: KviUserIdentityManager.h:81
QString m_szDefaultIdentity
Definition: KviUserIdentityManager.h:62
const KviUserIdentity * findIdentity(const QString &szId)
Searches fot an identity.
Definition: KviUserIdentityManager.h:94
Pointer Hash Table.
void done()
Definition: KviKvs.cpp:50
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
User identity handling class.
Definition: KviUserIdentity.h:42
void setDefaultIdentity(const QString &szIdentityId)
Sets the default identity.
Definition: KviUserIdentityManager.h:108
The class to manage the user identity.
Definition: KviUserIdentityManager.h:45
KviPointerHashTable< QString, KviUserIdentity > * identityDict()
Returns the identity dictionary.
Definition: KviUserIdentityManager.h:87
Heap Object.
static KviUserIdentityManager * m_pInstance
Definition: KviUserIdentityManager.h:60
int init()
Definition: winamp.cpp:118
KviPointerHashTable< QString, KviUserIdentity > * m_pIdentityDict
Definition: KviUserIdentityManager.h:61
This file contains compile time settings.
#define KVILIB_API
Definition: kvi_settings.h:125