KVIrc 5.2.0
Developer APIs
KviIrcNetwork.h
Go to the documentation of this file.
1#ifndef KVI_NETWORK_H_
2#define KVI_NETWORK_H_
3//=============================================================================
4//
5// File : KviIrcNetwork.h
6// Creation date : Wed Aug 27 2008 17:44:56 by Alexey Uzhva
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2008 Alexey Uzhva (wizard at opendoor dot ru)
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
37#include <QString>
38#include <QStringList>
39
41class KviIrcServer;
42
48{
50
51public:
57 KviIrcNetwork(const QString & name);
58
64 KviIrcNetwork(const KviIrcNetwork & src);
65
70
71protected:
72 QString m_szName;
74 QString m_szEncoding;
76 QString m_szNickName;
78 QString m_szUserName;
79 QString m_szRealName;
80 QString m_szPass;
83 QStringList * m_pChannelList;
88 KviIrcServer * m_pCurrentServer = nullptr;
89
90public:
95 const QString & name() const { return m_szName; }
96
104 const QString & encoding() const { return m_szEncoding; }
105
112 const QString & textEncoding() const { return m_szTextEncoding; }
113
118 const QString & description() const { return m_szDescription; }
119
124 const QString & nickName() const { return m_szNickName; }
125
130 const QString & alternativeNickName() const { return m_szAlternativeNickName; }
131
136 const QString & realName() const { return m_szRealName; }
137
142 const QString & userName() const { return m_szUserName; }
143
148 const QString & password() const { return m_szPass; }
149
154 const QString & onLoginCommand() const { return m_szOnLoginCommand; }
155
160 const QString & onConnectCommand() const { return m_szOnConnectCommand; }
161
166 const QString & userIdentityId() const { return m_szUserIdentityId; }
167
172 bool autoConnect() const { return m_bAutoConnect; }
173
178 QStringList * autoJoinChannelList() { return m_pChannelList; }
179
184 const QString autoJoinChannelListAsString() { return m_pChannelList ? m_pChannelList->join(",") : ""; }
185
190 KviNickServRuleSet * nickServRuleSet() { return m_pNickServRuleSet; }
191
197 void setNickServRuleSet(KviNickServRuleSet * pSet);
198
204 void copyFrom(const KviIrcNetwork & net);
205
211 void setName(const QString & szName) { m_szName = szName; }
212
221 void setEncoding(const QString & szEncoding) { m_szEncoding = szEncoding; }
222
230 void setTextEncoding(const QString & szEncoding) { m_szTextEncoding = szEncoding; }
231
237 void setDescription(const QString & szDescription) { m_szDescription = szDescription; }
238
244 void setOnConnectCommand(const QString & szCmd) { m_szOnConnectCommand = szCmd; }
245
251 void setOnLoginCommand(const QString & szCmd) { m_szOnLoginCommand = szCmd; }
252
258 void setNickName(const QString & szNick) { m_szNickName = szNick; }
259
265 void setAlternativeNickName(const QString & szNick) { m_szAlternativeNickName = szNick; }
266
272 void setRealName(const QString & szReal) { m_szRealName = szReal; }
273
279 void setUserName(const QString & szUser) { m_szUserName = szUser; }
280
286 void setPassword(const QString & szPass) { m_szPass = szPass; }
287
293 void setAutoJoinChannelList(QStringList * pNewChannelList);
294
300 void setAutoJoinChannelList(const QString & szNewChannelList);
301
307 void setAutoConnect(bool bAutoConnect) { m_bAutoConnect = bAutoConnect; }
308
314 void setUserIdentityId(const QString & szUserIdentityId) { m_szUserIdentityId = szUserIdentityId; }
315
320 KviPointerList<KviIrcServer> * serverList() const { return m_pServerList; }
321
326 KviIrcServer * currentServer();
327
333 void insertServer(KviIrcServer * pServer);
334
340 KviIrcServer * findServer(const QString & szHostname);
341
347 KviIrcServer * findServer(const KviIrcServer * pServer);
348
354 void setCurrentServer(KviIrcServer * pServer);
355};
356
357#endif // KVI_NETWORK_H_
Heap Object.
C++ Template based double linked pointer list class.
Definition KviHeapObject.h:125
Network handling class.
Definition KviIrcNetwork.h:48
KviPointerList< KviIrcServer > * serverList() const
Returns a list of servers associated to the network.
Definition KviIrcNetwork.h:320
const QString & textEncoding() const
Returns the text encoding of the network.
Definition KviIrcNetwork.h:112
KviPointerList< KviIrcServer > * m_pServerList
Definition KviIrcNetwork.h:87
const QString & nickName() const
Returns the nickname of the user associated to the network.
Definition KviIrcNetwork.h:124
QString m_szPass
Definition KviIrcNetwork.h:80
void setAlternativeNickName(const QString &szNick)
Sets the alternative nickname of the user associated to the network.
Definition KviIrcNetwork.h:265
QString m_szEncoding
Definition KviIrcNetwork.h:74
void setEncoding(const QString &szEncoding)
Sets the encondig of the network.
Definition KviIrcNetwork.h:221
QString m_szNickName
Definition KviIrcNetwork.h:76
void setOnConnectCommand(const QString &szCmd)
Sets the list of commands to run on network connection.
Definition KviIrcNetwork.h:244
const QString & encoding() const
Returns the encoding of the network.
Definition KviIrcNetwork.h:104
void setNickName(const QString &szNick)
Sets the nickname of the user associated to the network.
Definition KviIrcNetwork.h:258
void setName(const QString &szName)
Sets the name of the network.
Definition KviIrcNetwork.h:211
bool m_bAutoConnect
Definition KviIrcNetwork.h:85
void setPassword(const QString &szPass)
Sets the password of the user associated to the network.
Definition KviIrcNetwork.h:286
QString m_szAlternativeNickName
Definition KviIrcNetwork.h:77
QString m_szOnConnectCommand
Definition KviIrcNetwork.h:81
bool autoConnect() const
Returns true if the network has the autoconnect state on.
Definition KviIrcNetwork.h:172
QString m_szTextEncoding
Definition KviIrcNetwork.h:75
const QString & realName() const
Returns the realname of the user associated to the network.
Definition KviIrcNetwork.h:136
QString m_szRealName
Definition KviIrcNetwork.h:79
QStringList * autoJoinChannelList()
Returns the list of channels with autojoin flag.
Definition KviIrcNetwork.h:178
void setUserIdentityId(const QString &szUserIdentityId)
Sets the user identity id of the user associated to the network.
Definition KviIrcNetwork.h:314
const QString & password() const
Returns the password of the user associated to the network.
Definition KviIrcNetwork.h:148
void setTextEncoding(const QString &szEncoding)
Sets the text encondig of the network.
Definition KviIrcNetwork.h:230
KviNickServRuleSet * m_pNickServRuleSet
Definition KviIrcNetwork.h:84
QString m_szUserName
Definition KviIrcNetwork.h:78
void setRealName(const QString &szReal)
Sets the realname of the user associated to the network.
Definition KviIrcNetwork.h:272
QString m_szDescription
Definition KviIrcNetwork.h:73
void setUserName(const QString &szUser)
Sets the username of the user associated to the network.
Definition KviIrcNetwork.h:279
KviNickServRuleSet * nickServRuleSet()
Returns a set of rules for the NickServ.
Definition KviIrcNetwork.h:190
const QString & alternativeNickName() const
Returns the alternative nickname of the user associated to the network.
Definition KviIrcNetwork.h:130
const QString & onLoginCommand() const
Returns the commands to run on network login.
Definition KviIrcNetwork.h:154
QString m_szName
Definition KviIrcNetwork.h:72
const QString & userIdentityId() const
Returns the user identity of the user associated to the network.
Definition KviIrcNetwork.h:166
QStringList * m_pChannelList
Definition KviIrcNetwork.h:83
const QString & onConnectCommand() const
Returns the commands to run on network connect.
Definition KviIrcNetwork.h:160
QString m_szOnLoginCommand
Definition KviIrcNetwork.h:82
void setDescription(const QString &szDescription)
Sets the description of the network.
Definition KviIrcNetwork.h:237
const QString autoJoinChannelListAsString()
Returns the list of channels with autojoin flag as a string.
Definition KviIrcNetwork.h:184
QString m_szUserIdentityId
Definition KviIrcNetwork.h:86
const QString & name() const
Returns the name of the network.
Definition KviIrcNetwork.h:95
const QString & description() const
Returns the description of the network.
Definition KviIrcNetwork.h:118
void setOnLoginCommand(const QString &szCmd)
Sets the list of commands to run on network login.
Definition KviIrcNetwork.h:251
const QString & userName() const
Returns the username of the user associated to the network.
Definition KviIrcNetwork.h:142
void setAutoConnect(bool bAutoConnect)
Sets the autoconnect flag.
Definition KviIrcNetwork.h:307
Irc server database handling class.
Definition KviIrcServerDataBase.h:67
The class which manages the irc servers.
Definition KviIrcServer.h:52
Definition KviNickServRuleSet.h:38
A template double linked list of pointers.
Definition KviPointerList.h:371
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124