KVIrc  4.9.2
DeveloperAPIs
KviIrcConnectionTarget.h
Go to the documentation of this file.
1 #ifndef _KVI_IRCCONNECTIONTARGET_H_
2 #define _KVI_IRCCONNECTIONTARGET_H_
3 //=============================================================================
4 //
5 // File : KviIrcConnectionTarget.h
6 // Creation date : Tue 08 Jun 2004 14:11:59 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2004-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 
27 #include "kvi_settings.h"
28 #include "KviQString.h"
29 #include "KviHeapObject.h"
30 
31 class KviIrcNetwork;
32 class KviIrcServer;
33 class KviProxy;
34 
36 {
38 
39 public:
40  // pServer is a shallow pointer: this class makes a copy of it internally, must NOT be null
41  // pProxy may be null if a proxy is not desired. this class makes a copy of it internally
43  const KviIrcNetwork * pNetwork,
44  const KviIrcServer * pServer,
45  const KviProxy * pProxy = 0,
46  const QString & szBindAddress = QString());
48 
49 private:
50  KviIrcNetwork * m_pNetwork; // owned, never null, it's a COPY of the entry in the db
51  KviIrcServer * m_pServer; // owned, never null, it's a COPY of the entry in the db
52  KviProxy * m_pProxy; // owned, may be null, it's a COPY of the entry in the db
53  QString m_szBindAddress; // forced bind address
54 
55 public:
57  {
58  return m_pServer;
59  }
60 
62  {
63  return m_pNetwork;
64  }
65 
67  {
68  return m_pProxy;
69  }
70 
71  const QString & bindAddress()
72  {
73  return m_szBindAddress;
74  }
75 
77  {
78  return (!m_szBindAddress.isEmpty());
79  }
80 
81 protected:
82  // this is for KviIrcConnectionTargetResolver only
83  void clearProxy();
84  void setBindAddress(const QString & szBindAddress)
85  {
86  m_szBindAddress = szBindAddress;
87  }
88 };
89 
90 #endif
Definition: KviHeapObject.h:124
The class which manages the irc servers.
Definition: KviIrcServer.h:51
#define KVIRC_API
Definition: kvi_settings.h:128
KviProxy * proxy()
Definition: KviIrcConnectionTarget.h:66
Definition: KviProxy.h:37
KviIrcServer * m_pServer
Definition: KviIrcConnectionTarget.h:51
Network handling class.
Definition: KviIrcNetwork.h:47
KviIrcNetwork * network()
Definition: KviIrcConnectionTarget.h:61
void setBindAddress(const QString &szBindAddress)
Definition: KviIrcConnectionTarget.h:84
const QString & bindAddress()
Definition: KviIrcConnectionTarget.h:71
m_pServer
Definition: KvsObject_socket.cpp:317
bool hasBindAddress()
Definition: KviIrcConnectionTarget.h:76
KviIrcServer * server()
Definition: KviIrcConnectionTarget.h:56
Heap Object.
KviIrcNetwork * m_pNetwork
Definition: KviIrcConnectionTarget.h:50
Definition: KviIrcConnectionTargetResolver.h:51
This file contains compile time settings.
Definition: KviIrcConnectionTarget.h:35
Helper functions for the QString class.
QString m_szBindAddress
Definition: KviIrcConnectionTarget.h:53
KviProxy * m_pProxy
Definition: KviIrcConnectionTarget.h:52