KVIrc  4.9.2
DeveloperAPIs
KviIrcNetwork.h
Go to the documentation of this file.
1 #ifndef KVI_NETWORK_H_
2 #define KVI_NETWORK_H_
3 //=============================================================================
4 //
5 // File : KviIrcNetwork.cpp
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 
40 class KviNickServRuleSet;
41 class KviIrcServer;
42 
48 {
49  friend class KviIrcServerDataBase;
50 
51 public:
57  KviIrcNetwork(const QString & name);
58 
64  KviIrcNetwork(const KviIrcNetwork & src);
65 
69  ~KviIrcNetwork();
70 
71 protected:
72  QString m_szName;
73  QString m_szDescription;
74  QString m_szEncoding;
75  QString m_szTextEncoding;
76  QString m_szNickName;
78  QString m_szUserName;
79  QString m_szRealName;
80  QString m_szPass;
83  QStringList * m_pChannelList;
89 
90 public:
95  inline const QString & name() const { return m_szName; };
96 
104  inline const QString & encoding() const { return m_szEncoding; };
105 
112  inline const QString & textEncoding() const { return m_szTextEncoding; };
113 
118  inline const QString & description() const { return m_szDescription; };
119 
124  inline const QString & nickName() const { return m_szNickName; };
125 
130  inline const QString & alternativeNickName() const { return m_szAlternativeNickName; };
131 
136  inline const QString & realName() const { return m_szRealName; };
137 
142  inline const QString & userName() const { return m_szUserName; };
143 
148  inline const QString & password() const { return m_szPass; };
149 
154  inline const QString & onLoginCommand() const { return m_szOnLoginCommand; };
155 
160  inline const QString & onConnectCommand() const { return m_szOnConnectCommand; };
161 
166  inline const QString & userIdentityId() const { return m_szUserIdentityId; };
167 
172  inline bool autoConnect() const { return m_bAutoConnect; };
173 
178  inline QStringList * autoJoinChannelList() { return m_pChannelList; };
179 
184  inline const QString autoJoinChannelListAsString() { return m_pChannelList ? m_pChannelList->join(",") : ""; };
185 
190  inline KviNickServRuleSet * nickServRuleSet() { return m_pNickServRuleSet; };
191 
197  void setNickServRuleSet(KviNickServRuleSet * pSet);
198 
204  void copyFrom(const KviIrcNetwork & net);
205 
211  inline void setName(const QString & szName) { m_szName = szName; };
212 
221  inline void setEncoding(const QString & szEncoding) { m_szEncoding = szEncoding; };
222 
230  inline void setTextEncoding(const QString & szEncoding) { m_szTextEncoding = szEncoding; };
231 
237  inline void setDescription(const QString & szDescription) { m_szDescription = szDescription; };
238 
244  inline void setOnConnectCommand(const QString & szCmd) { m_szOnConnectCommand = szCmd; };
245 
251  inline void setOnLoginCommand(const QString & szCmd) { m_szOnLoginCommand = szCmd; };
252 
258  inline void setNickName(const QString & szNick) { m_szNickName = szNick; };
259 
265  inline void setAlternativeNickName(const QString & szNick) { m_szAlternativeNickName = szNick; };
266 
272  inline void setRealName(const QString & szReal) { m_szRealName = szReal; };
273 
279  inline void setUserName(const QString & szUser) { m_szUserName = szUser; };
280 
286  inline void setPassword(const QString & szPass) { m_szPass = szPass; };
287 
293  void setAutoJoinChannelList(QStringList * pNewChannelList);
294 
300  void setAutoJoinChannelList(const QString & szNewChannelList);
301 
307  inline void setAutoConnect(bool bAutoConnect) { m_bAutoConnect = bAutoConnect; };
308 
314  inline void setUserIdentityId(const QString & szUserIdentityId) { m_szUserIdentityId = szUserIdentityId; };
315 
320  inline KviPointerList<KviIrcServer> * serverList() { 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_
const QString & description() const
Returns the description of the network.
Definition: KviIrcNetwork.h:118
const QString & nickName() const
Returns the nickname of the user associated to the network.
Definition: KviIrcNetwork.h:124
Definition: KviHeapObject.h:124
QString m_szDescription
Definition: KviIrcNetwork.h:73
void setOnConnectCommand(const QString &szCmd)
Sets the list of commands to run on network connection.
Definition: KviIrcNetwork.h:244
The class which manages the irc servers.
Definition: KviIrcServer.h:51
Definition: KviNickServRuleSet.h:36
const QString & onLoginCommand() const
Returns the commands to run on network login.
Definition: KviIrcNetwork.h:154
void setRealName(const QString &szReal)
Sets the realname of the user associated to the network.
Definition: KviIrcNetwork.h:272
const QString & alternativeNickName() const
Returns the alternative nickname of the user associated to the network.
Definition: KviIrcNetwork.h:130
void setUserName(const QString &szUser)
Sets the username of the user associated to the network.
Definition: KviIrcNetwork.h:279
QStringList * autoJoinChannelList()
Returns the list of channels with autojoin flag.
Definition: KviIrcNetwork.h:178
bool m_bAutoConnect
Definition: KviIrcNetwork.h:85
const QString & userName() const
Returns the username of the user associated to the network.
Definition: KviIrcNetwork.h:142
QString m_szRealName
Definition: KviIrcNetwork.h:79
QStringList * m_pChannelList
Definition: KviIrcNetwork.h:83
void setTextEncoding(const QString &szEncoding)
Sets the text encondig of the network.
Definition: KviIrcNetwork.h:230
const QString & encoding() const
Returns the encoding of the network.
Definition: KviIrcNetwork.h:104
QString m_szOnLoginCommand
Definition: KviIrcNetwork.h:82
Network handling class.
Definition: KviIrcNetwork.h:47
KviNickServRuleSet * m_pNickServRuleSet
Definition: KviIrcNetwork.h:84
KviPointerList< KviIrcServer > * m_pServerList
Definition: KviIrcNetwork.h:87
const QString & name() const
Returns the name of the network.
Definition: KviIrcNetwork.h:95
QString m_szUserName
Definition: KviIrcNetwork.h:78
QString m_szUserIdentityId
Definition: KviIrcNetwork.h:86
QString m_szAlternativeNickName
Definition: KviIrcNetwork.h:77
KviIrcServer * m_pCurrentServer
Definition: KviIrcNetwork.h:88
QString m_szTextEncoding
Definition: KviIrcNetwork.h:75
const QString & textEncoding() const
Returns the text encoding of the network.
Definition: KviIrcNetwork.h:112
bool autoConnect() const
Returns true if the network has the autoconnect state on.
Definition: KviIrcNetwork.h:172
const QString autoJoinChannelListAsString()
Returns the list of channels with autojoin flag as a string.
Definition: KviIrcNetwork.h:184
QString m_szEncoding
Definition: KviIrcNetwork.h:74
void setAlternativeNickName(const QString &szNick)
Sets the alternative nickname of the user associated to the network.
Definition: KviIrcNetwork.h:265
KviNickServRuleSet * nickServRuleSet()
Returns a set of rules for the NickServ.
Definition: KviIrcNetwork.h:190
C++ Template based double linked pointer list class.
Heap Object.
QString m_szNickName
Definition: KviIrcNetwork.h:76
void setOnLoginCommand(const QString &szCmd)
Sets the list of commands to run on network login.
Definition: KviIrcNetwork.h:251
const QString & userIdentityId() const
Returns the user identity of the user associated to the network.
Definition: KviIrcNetwork.h:166
QString m_szOnConnectCommand
Definition: KviIrcNetwork.h:81
QString name()
Definition: KviRuntimeInfo.cpp:655
const QString & password() const
Returns the password of the user associated to the network.
Definition: KviIrcNetwork.h:148
QString m_szName
Definition: KviIrcNetwork.h:72
KviPointerList< KviIrcServer > * serverList()
Returns a list of servers associated to the network.
Definition: KviIrcNetwork.h:320
void setPassword(const QString &szPass)
Sets the password of the user associated to the network.
Definition: KviIrcNetwork.h:286
void setAutoConnect(bool bAutoConnect)
Sets the autoconnect flag.
Definition: KviIrcNetwork.h:307
This file contains compile time settings.
const QString & onConnectCommand() const
Returns the commands to run on network connect.
Definition: KviIrcNetwork.h:160
Irc server database handling class.
Definition: KviIrcServerDataBase.h:63
QString m_szPass
Definition: KviIrcNetwork.h:80
#define KVILIB_API
Definition: kvi_settings.h:125
void setUserIdentityId(const QString &szUserIdentityId)
Sets the user identity id of the user associated to the network.
Definition: KviIrcNetwork.h:314
void setName(const QString &szName)
Sets the name of the network.
Definition: KviIrcNetwork.h:211
void setNickName(const QString &szNick)
Sets the nickname of the user associated to the network.
Definition: KviIrcNetwork.h:258
void setDescription(const QString &szDescription)
Sets the description of the network.
Definition: KviIrcNetwork.h:237
const QString & realName() const
Returns the realname of the user associated to the network.
Definition: KviIrcNetwork.h:136
void setEncoding(const QString &szEncoding)
Sets the encondig of the network.
Definition: KviIrcNetwork.h:221