KVIrc  4.9.2
DeveloperAPIs
KviIrcServerDataBase.h
Go to the documentation of this file.
1 #ifndef _KVI_IRCSERVERDB_H_
2 #define _KVI_IRCSERVERDB_H_
3 //=============================================================================
4 //
5 // File : KviIrcServerDataBase.h
6 // Creation date : Mon Jul 10 2000 14:15:42 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2000-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 
33 #include "kvi_settings.h"
34 #include "KviQString.h"
35 #include "KviIrcServer.h"
36 #include "KviIrcNetwork.h"
37 #include "KviPointerHashTable.h"
38 
45 {
46  QString szServer;
47  kvi_u32_t uPort;
49  bool bIPv6;
50  bool bSSL;
51  bool bSTARTTLS;
52  QString szLinkFilter;
53  QString szPass;
54  QString szNick;
55  QString szInitUMode;
56  QString szId;
58 
64 {
65 public:
71 
76 
77 private:
82 
83 public:
88  void clear();
89 
94  inline KviPointerHashTable<QString, KviIrcNetwork> * recordDict() { return m_pRecords; };
95 
106  inline KviPointerList<KviIrcServer> * autoConnectOnStartupServers() { return m_pAutoConnectOnStartupServers; };
107 
118  inline KviPointerList<KviIrcNetwork> * autoConnectOnStartupNetworks() { return m_pAutoConnectOnStartupNetworks; };
119 
124  void clearAutoConnectOnStartupServers();
125 
130  void clearAutoConnectOnStartupNetworks();
131 
137  inline void setCurrentNetwork(const QString & szNetName) { m_szCurrentNetwork = szNetName; };
138 
143  inline const QString & currentNetworkName() { return m_szCurrentNetwork; };
144 
149  KviIrcNetwork * currentNetwork();
150 
156  void addNetwork(KviIrcNetwork * pNet);
157 
163  KviIrcNetwork * findNetwork(const QString & szName);
164 
169  unsigned int networkCount() const;
170 
176  void load(const QString & szFilename);
177 
183  void save(const QString & szFilename);
184 
192  void importFromMircIni(const QString & filename, const QString & szMircIni, QStringList & recentServers);
193 
200  bool makeCurrentServer(KviIrcServerDefinition * pDef, QString & szError);
201 
209  bool makeCurrentBestServerInNetwork(const QString & szNetName, KviIrcNetwork * pNet, QString & szError);
210 };
211 
212 #endif //_KVI_IRCSERVERDB_H_
kvi_u32_t uPort
Definition: KviIrcServerDataBase.h:47
bool bIPv6
Definition: KviIrcServerDataBase.h:49
QString szId
Definition: KviIrcServerDataBase.h:56
QString szInitUMode
Definition: KviIrcServerDataBase.h:55
struct _KviIrcServerDefinition KviIrcServerDefinition
Server definition.
Definition: KviIrcServerDataBase.h:44
QString szMircIni
Definition: libkvisetup.cpp:48
QString szNick
Definition: KviIrcServerDataBase.h:54
Network handling class.
Definition: KviIrcNetwork.h:47
btnDict clear()
KviPointerList< KviIrcNetwork > * autoConnectOnStartupNetworks()
Returns a list of networks to connect on startup This list is computed when the data are loaded from ...
Definition: KviIrcServerDataBase.h:118
Pointer Hash Table.
bool bSSL
Definition: KviIrcServerDataBase.h:50
QString szPass
Definition: KviIrcServerDataBase.h:53
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
KviPointerHashTable< QString, KviIrcNetwork > * recordDict()
Returns the record dictionary of the database.
Definition: KviIrcServerDataBase.h:94
QString szLinkFilter
Definition: KviIrcServerDataBase.h:52
const QString & currentNetworkName()
Returns the current network name.
Definition: KviIrcServerDataBase.h:143
void setCurrentNetwork(const QString &szNetName)
Sets the current network.
Definition: KviIrcServerDataBase.h:137
QString m_szCurrentNetwork
Definition: KviIrcServerDataBase.h:79
KviPointerList< KviIrcNetwork > * m_pAutoConnectOnStartupNetworks
Definition: KviIrcServerDataBase.h:81
bool bPortIsValid
Definition: KviIrcServerDataBase.h:48
KviPointerList< KviIrcServer > * autoConnectOnStartupServers()
Returns a list of servers to connect on startup This list is computed when the data are loaded from d...
Definition: KviIrcServerDataBase.h:106
Irc server handling.
This file contains compile time settings.
bool bSTARTTLS
Definition: KviIrcServerDataBase.h:51
KviPointerHashTable< QString, KviIrcNetwork > * m_pRecords
Definition: KviIrcServerDataBase.h:78
Irc server database handling class.
Definition: KviIrcServerDataBase.h:63
KviPointerList< KviIrcServer > * m_pAutoConnectOnStartupServers
Definition: KviIrcServerDataBase.h:80
#define KVILIB_API
Definition: kvi_settings.h:125
Helper functions for the QString class.
QString szServer
Definition: KviIrcServerDataBase.h:46