libqutim  0.3.1.0
networkproxy.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Alexey Prokhin <alexey.prokhin@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 
26 #ifndef NETWORKPROXY_H
27 #define NETWORKPROXY_H
28 
29 #include "libqutim_global.h"
30 #include "config.h"
31 #include <QNetworkProxy>
32 
33 class QIcon;
34 
35 namespace qutim_sdk_0_3
36 {
37 class LocalizedString;
38 class DataItem;
39 class Protocol;
40 class Account;
41 class NetworkProxyManagerPrivate;
42 
47 {
48 public:
50  virtual ~NetworkProxyInfo();
58  virtual QString name() = 0;
62  virtual QIcon icon();
66  virtual LocalizedString description() = 0;
75  virtual DataItem settings(const Config &config) = 0;
79  virtual void saveSettings(Config config, const DataItem &settings) = 0;
83  static NetworkProxyInfo *proxy(const QString &name);
87  static QList<NetworkProxyInfo*> allProxies();
88 protected:
89  virtual void virtual_hook(int id, void *data);
90 };
91 
99 {
100 public:
104  NetworkProxyManager(Protocol *protocol);
108  virtual ~NetworkProxyManager();
112  Protocol *protocol();
116  virtual QList<NetworkProxyInfo*> proxies() = 0;
122  virtual void setProxy(Account *account, NetworkProxyInfo *proxy, const DataItem &settings) = 0;
126  static NetworkProxyManager *get(Protocol *protocol);
130  static QList<NetworkProxyManager*> allManagers();
134  static DataItem settings();
142  static DataItem settings(Account *account);
146  static QNetworkProxy toNetworkProxy(const DataItem &settings);
147 protected:
148  virtual void virtual_hook(int id, void *data);
149 private:
150  NetworkProxyManagerPrivate *p;
151 };
152 
157 {
158 public:
159  virtual QString name();
160  virtual LocalizedString description();
161  virtual DataItem settings(const Config &config);
162  virtual void saveSettings(Config config, const DataItem &settings);
166  static Socks5ProxyInfo *instance();
167 protected:
168  Socks5ProxyInfo();
169 };
170 
175 {
176 public:
177  virtual QString name();
178  virtual LocalizedString description();
179  virtual DataItem settings(const Config &config);
180  virtual void saveSettings(Config config, const DataItem &settings);
184  static HttpProxyInfo *instance();
185 protected:
186  HttpProxyInfo();
187 };
188 
189 } // namespace qutim_sdk_0_3
190 
191 //Q_DECLARE_METATYPE(qutim_sdk_0_3::NetworkProxyInfo)
192 Q_DECLARE_INTERFACE(qutim_sdk_0_3::NetworkProxyManager, "org.qutim.core.NetworkProxyManager");
193 
194 #endif // NETWORKPROXY_H
195 

Generated by Doxygen