KVIrc  4.9.2
DeveloperAPIs
KviUserIdentity.h
Go to the documentation of this file.
1 #ifndef _KVI_USERIDENTITY_H_
2 #define _KVI_USERIDENTITY_H_
3 //=============================================================================
4 //
5 // File : KviUserIdentity.h
6 // Creation date : Sun 21 Jan 2007 04:31:47 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC Client distribution
9 // Copyright (C) 2007-2010 Szymon Stefanek <pragma at kvirc dot net>
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 
32 #include "kvi_settings.h"
33 #include "KviHeapObject.h"
34 #include "KviPixmap.h"
35 #include "KviConfigurationFile.h"
36 #include "KviPointerHashTable.h"
37 
43 {
44  friend class KviUserIdentityManager;
45 
46 public:
52 
56  ~KviUserIdentity();
57 
58 protected:
59  QString m_szId; // the identity set name
60 
61  QString m_szNickName;
62 
66 
67  QString m_szUserName;
68  QString m_szRealName;
69  QString m_szPassword;
70 
72 
73  QString m_szPartMessage;
74  QString m_szQuitMessage;
75 
76  QString m_szAge;
77  QString m_szGender;
78  QString m_szLocation;
79  QString m_szLanguages;
80  QString m_szOtherInfo;
81 
82  QString m_szUserMode;
83 
86 
87 public:
92  const QString & id() const { return m_szId; };
93 
98  const QString & nickName() const { return m_szNickName; };
99 
104  const QString & altNickName1() const { return m_szAltNickName1; };
105 
110  const QString & altNickName2() const { return m_szAltNickName2; };
111 
116  const QString & altNickName3() const { return m_szAltNickName3; };
117 
122  const QString & userName() const { return m_szUserName; };
123 
128  const QString & password() const { return m_szPassword; };
129 
134  const KviPixmap & avatar() const { return m_pixAvatar; };
135 
140  const QString & partMessage() const { return m_szPartMessage; };
141 
146  const QString & quitMessage() const { return m_szQuitMessage; };
147 
152  const QString & age() const { return m_szAge; };
153 
158  const QString & gender() const { return m_szGender; };
159 
164  const QString & location() const { return m_szLocation; };
165 
170  const QString & languages() const { return m_szLanguages; };
171 
176  const QString & otherInfo() const { return m_szOtherInfo; };
177 
182  const QString & userMode() const { return m_szUserMode; };
183 
188  const QString & onConnectCommand() const { return m_szOnConnectCommand; };
189 
194  const QString & onLoginCommand() const { return m_szOnLoginCommand; };
195 
201  void setId(const QString & szId) { m_szId = szId; };
202 
208  void setNickName(const QString & szNickName) { m_szNickName = szNickName; };
209 
215  void setAltNickName1(const QString & szNickName) { m_szAltNickName1 = szNickName; };
216 
222  void setAltNickName2(const QString & szNickName) { m_szAltNickName2 = szNickName; };
223 
229  void setAltNickName3(const QString & szNickName) { m_szAltNickName3 = szNickName; };
230 
236  void setUserName(const QString & szUserName) { m_szUserName = szUserName; };
237 
243  void setRealName(const QString & szRealName) { m_szRealName = szRealName; };
244 
250  void setPassword(const QString & szPassword) { m_szPassword = szPassword; };
251 
257  void setAvatar(const KviPixmap & pix) { m_pixAvatar = pix; };
258 
264  void setPartMessage(const QString & szMsg) { m_szPartMessage = szMsg; };
265 
271  void setQuitMessage(const QString & szMsg) { m_szQuitMessage = szMsg; };
272 
278  void setAge(const QString & szAge) { m_szAge = szAge; };
279 
285  void setGender(const QString & szGender) { m_szGender = szGender; };
286 
292  void setLocation(const QString & szLocation) { m_szLocation = szLocation; };
293 
299  void setLanguages(const QString & szLanguages) { m_szLanguages = szLanguages; };
300 
306  void setOtherInfo(const QString & szOtherInfo) { m_szOtherInfo = szOtherInfo; };
307 
313  void setUserMode(const QString & szUserMode) { m_szUserMode = szUserMode; };
314 
320  void setOnConnectCommand(const QString & szOnConnectCommand) { m_szOnConnectCommand = szOnConnectCommand; };
321 
327  void setOnLoginCommand(const QString & szOnLoginCommand) { m_szOnLoginCommand = szOnLoginCommand; };
328 protected:
334  void copyFrom(const KviUserIdentity & src);
335 
341  bool save(KviConfigurationFile & cfg);
342 
348  bool load(KviConfigurationFile & cfg);
349 };
350 
351 #endif // _KVI_USERIDENTITY_H_
Definition: KviHeapObject.h:124
QString m_szAltNickName3
Definition: KviUserIdentity.h:65
void setAge(const QString &szAge)
Sets the age of the user.
Definition: KviUserIdentity.h:278
void setLanguages(const QString &szLanguages)
Sets the languages of the user.
Definition: KviUserIdentity.h:299
void setAltNickName3(const QString &szNickName)
Sets the third alternative nickname of the user.
Definition: KviUserIdentity.h:229
QString m_szOnConnectCommand
Definition: KviUserIdentity.h:84
QString m_szNickName
Definition: KviUserIdentity.h:61
const QString & userMode() const
Returns the user mode of the user.
Definition: KviUserIdentity.h:182
QString m_szOnLoginCommand
Definition: KviUserIdentity.h:85
KviPixmap m_pixAvatar
Definition: KviUserIdentity.h:71
Definition: KviConfigurationFile.h:48
QString m_szUserMode
Definition: KviUserIdentity.h:82
void setGender(const QString &szGender)
Sets the gender of the user.
Definition: KviUserIdentity.h:285
QString m_szOtherInfo
Definition: KviUserIdentity.h:80
QString m_szGender
Definition: KviUserIdentity.h:77
QString m_szUserName
Definition: KviUserIdentity.h:67
QString m_szAltNickName2
Definition: KviUserIdentity.h:64
void setUserName(const QString &szUserName)
Sets the username of the user.
Definition: KviUserIdentity.h:236
Pointer Hash Table.
void setOnConnectCommand(const QString &szOnConnectCommand)
Sets the commands list to run on connection.
Definition: KviUserIdentity.h:320
Definition: KviPixmap.h:33
const QString & id() const
Returns the id of the user.
Definition: KviUserIdentity.h:92
const QString & partMessage() const
Returns the part message of the user.
Definition: KviUserIdentity.h:140
void setRealName(const QString &szRealName)
Sets the realname of the user.
Definition: KviUserIdentity.h:243
void setOnLoginCommand(const QString &szOnLoginCommand)
Sets the commands list to run on login.
Definition: KviUserIdentity.h:327
void setAvatar(const KviPixmap &pix)
Sets the avatar of the user.
Definition: KviUserIdentity.h:257
QString m_szAge
Definition: KviUserIdentity.h:76
void setId(const QString &szId)
Sets the id of the user.
Definition: KviUserIdentity.h:201
const QString & otherInfo() const
Returns the other info field of the user.
Definition: KviUserIdentity.h:176
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
QString m_szAltNickName1
Definition: KviUserIdentity.h:63
User identity handling class.
Definition: KviUserIdentity.h:42
void load(const QString &szFileName)
Loads the user identity database.
Definition: KviUserIdentityManager.cpp:97
const QString & quitMessage() const
Returns the quit message of the user.
Definition: KviUserIdentity.h:146
const QString & languages() const
Returns the languages of the user.
Definition: KviUserIdentity.h:170
const QString & onLoginCommand() const
Returns the list of commands to run on login.
Definition: KviUserIdentity.h:194
QString m_szLocation
Definition: KviUserIdentity.h:78
QString m_szId
Definition: KviUserIdentity.h:59
const QString & altNickName2() const
Returns the second alternative nickname of the user.
Definition: KviUserIdentity.h:110
const QString & userName() const
Returns the username of the user.
Definition: KviUserIdentity.h:122
void setPassword(const QString &szPassword)
Sets the password of the user.
Definition: KviUserIdentity.h:250
void setLocation(const QString &szLocation)
Sets the location of the user.
Definition: KviUserIdentity.h:292
void setUserMode(const QString &szUserMode)
Sets the user mode of the user.
Definition: KviUserIdentity.h:313
The class to manage the user identity.
Definition: KviUserIdentityManager.h:45
const KviPixmap & avatar() const
Returns the avatar of the user.
Definition: KviUserIdentity.h:134
void setPartMessage(const QString &szMsg)
Sets the part messaege of the user.
Definition: KviUserIdentity.h:264
const QString & location() const
Returns the location of the user.
Definition: KviUserIdentity.h:164
const QString & age() const
Returns the age of the user.
Definition: KviUserIdentity.h:152
Heap Object.
QString m_szPassword
Definition: KviUserIdentity.h:69
void setOtherInfo(const QString &szOtherInfo)
Sets the other info for the user.
Definition: KviUserIdentity.h:306
void setAltNickName2(const QString &szNickName)
Sets the second alternative nickname of the user.
Definition: KviUserIdentity.h:222
const QString & altNickName1() const
Returns the alternative nickname of the user.
Definition: KviUserIdentity.h:104
QString m_szLanguages
Definition: KviUserIdentity.h:79
const QString & gender() const
Returns the gender of the user.
Definition: KviUserIdentity.h:158
const QString & onConnectCommand() const
Returns the list of commands to run on connection.
Definition: KviUserIdentity.h:188
void copyFrom(KviUserIdentityManager *pWorkingCopy)
Carbon copy.
Definition: KviUserIdentityManager.cpp:141
QString m_szRealName
Definition: KviUserIdentity.h:68
void setQuitMessage(const QString &szMsg)
Sets the quit messaege of the user.
Definition: KviUserIdentity.h:271
const QString & nickName() const
Returns the nickname of the user.
Definition: KviUserIdentity.h:98
const QString & altNickName3() const
Returns the third alternative nickanem of the user.
Definition: KviUserIdentity.h:116
This file contains compile time settings.
const QString & password() const
Returns the password of the user.
Definition: KviUserIdentity.h:128
void setAltNickName1(const QString &szNickName)
Sets the alternative nickname of the user.
Definition: KviUserIdentity.h:215
#define KVILIB_API
Definition: kvi_settings.h:125
QString m_szPartMessage
Definition: KviUserIdentity.h:73
QString m_szQuitMessage
Definition: KviUserIdentity.h:74
void setNickName(const QString &szNickName)
Sets the nickname of the user.
Definition: KviUserIdentity.h:208