KVIrc  4.9.2
DeveloperAPIs
KviProxy.h
Go to the documentation of this file.
1 #ifndef _KVIPROXY_H_
2 #define _KVIPROXY_H_
3 
4 //=============================================================================
5 //
6 // File : KviProxy.h
7 // Creation date : Wed Dec 29 2010 01:58:01 by Elvio Basello
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 // this file was originally part of KviProxyDataBase.h
29 
30 #include "kvi_settings.h"
31 #include "kvi_inttypes.h"
32 
33 #include <QString>
34 
35 class QStringList;
36 
38 {
39 public:
40  enum Protocol
41  {
44  Http
45  };
46  KviProxy();
47  KviProxy(const KviProxy & prx);
48  ~KviProxy();
49 
50 public: // FIXME: make it private!!!!!
51  QString m_szHostname;
52  QString m_szIp;
53  QString m_szPass;
54  QString m_szUser;
55  kvi_u32_t m_uPort;
57  bool m_bIsIPv6;
58 
59 public:
60  bool isIPv6() const { return m_bIsIPv6; };
61  Protocol protocol() const { return m_protocol; };
62  const QString protocolName() const;
63  void setNamedProtocol(const char * proto);
64  kvi_u32_t port() const { return m_uPort; };
65  const QString & user() const { return m_szUser; };
66  const QString & pass() const { return m_szPass; };
67  const QString & ip() const { return m_szIp; };
68  const QString & hostName() const { return m_szHostname; };
69  void normalizeUserAndPass();
70  bool hasPass() const { return !m_szPass.isEmpty(); };
71  bool hasUser() const { return !m_szUser.isEmpty(); };
72  unsigned int passLen() const { return (unsigned int)m_szPass.length(); };
73  unsigned int userLen() const { return (unsigned int)m_szUser.length(); };
74  static void getSupportedProtocolNames(QStringList & buf);
75 
76  void setProtocol(Protocol p) { m_protocol = p; };
77  void setIPv6(bool b) { m_bIsIPv6 = b; };
78  void setPort(kvi_u32_t & p) { m_uPort = p; };
79  void setUser(const QString & u) { m_szUser = u; };
80  void setPass(const QString & p) { m_szPass = p; };
81  void setIp(const QString & i) { m_szIp = i; };
82  void setHostname(const QString & h) { m_szHostname = h; };
83 };
84 
85 #endif // _KVIPROXY_H_
bool m_bIsIPv6
Definition: KviProxy.h:57
kvi_u32_t port() const
Definition: KviProxy.h:64
QString m_szIp
Definition: KviProxy.h:52
bool hasPass() const
Definition: KviProxy.h:70
void setProtocol(Protocol p)
Definition: KviProxy.h:76
Definition: KviProxy.h:42
const QString & ip() const
Definition: KviProxy.h:67
Definition: KviProxy.h:43
Definition: KviProxy.h:37
const QString & pass() const
Definition: KviProxy.h:66
#define i
Definition: detector.cpp:73
void setPort(kvi_u32_t &p)
Definition: KviProxy.h:78
unsigned int passLen() const
Definition: KviProxy.h:72
#define h
Definition: detector.cpp:72
kvi_u32_t m_uPort
Definition: KviProxy.h:55
bool isIPv6() const
Definition: KviProxy.h:60
const QString & user() const
Definition: KviProxy.h:65
QString m_szPass
Definition: KviProxy.h:53
bool hasUser() const
Definition: KviProxy.h:71
const QString & hostName() const
Definition: KviProxy.h:68
Protocol m_protocol
Definition: KviProxy.h:56
void setHostname(const QString &h)
Definition: KviProxy.h:82
QString m_szHostname
Definition: KviProxy.h:51
QString m_szUser
Definition: KviProxy.h:54
#define u
Definition: detector.cpp:85
void setPass(const QString &p)
Definition: KviProxy.h:80
Protocol protocol() const
Definition: KviProxy.h:61
void setIp(const QString &i)
Definition: KviProxy.h:81
This file contains compile time settings.
Protocol
Definition: KviProxy.h:40
void setIPv6(bool b)
Definition: KviProxy.h:77
void setUser(const QString &u)
Definition: KviProxy.h:79
#define p
Definition: detector.cpp:80
#define KVILIB_API
Definition: kvi_settings.h:125
unsigned int userLen() const
Definition: KviProxy.h:73