KVIrc 5.2.6
Developer APIs
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#include <QString>
40
41class KviUserIdentity;
42
48{
49protected:
55
60
61protected:
65
66public:
71 static void init();
72
77 static void done();
78
83 static KviUserIdentityManager * instance() { return m_pInstance; };
84
90
96 const KviUserIdentity * findIdentity(const QString & szId) { return m_pIdentityDict->find(szId); };
97
103 const KviUserIdentity * defaultIdentity();
104
110 void setDefaultIdentity(const QString & szIdentityId) { m_szDefaultIdentity = szIdentityId; };
111
116 KviUserIdentityManager * createWorkingCopy();
117
123 void copyFrom(KviUserIdentityManager * pWorkingCopy);
124
130 void releaseWorkingCopy(KviUserIdentityManager * pWorkingCopy);
131
137 void save(const QString & szFileName);
138
144 void load(const QString & szFileName);
145};
146
147#endif // _KVI_USERIDENTITY_MANAGER_H_
Heap Object.
Pointer Hash Table.
Definition KviHeapObject.h:119
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
T * find(const Key &hKey)
Returns the item associated to the key.
Definition KviPointerHashTable.h:471
The class to manage the user identity.
Definition KviUserIdentityManager.h:48
KviPointerHashTable< QString, KviUserIdentity > * identityDict()
Returns the identity dictionary.
Definition KviUserIdentityManager.h:89
void setDefaultIdentity(const QString &szIdentityId)
Sets the default identity.
Definition KviUserIdentityManager.h:110
static KviUserIdentityManager * instance()
Returns the instance of the identity.
Definition KviUserIdentityManager.h:83
static KviUserIdentityManager * m_pInstance
Definition KviUserIdentityManager.h:62
KviPointerHashTable< QString, KviUserIdentity > * m_pIdentityDict
Definition KviUserIdentityManager.h:63
const KviUserIdentity * findIdentity(const QString &szId)
Searches fot an identity.
Definition KviUserIdentityManager.h:96
QString m_szDefaultIdentity
Definition KviUserIdentityManager.h:64
User identity handling class.
Definition KviUserIdentity.h:45
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124
int init()
Definition winamp.cpp:118