/*------------------------------------------------------------------------------ -- This file is a part of the QLop Software -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------*/ /*-- Author : Alexis Jeandet -- Mail : alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ #ifndef QLOPNETWORKPROXYFACTORY_H #define QLOPNETWORKPROXYFACTORY_H #include #include #include #include #define CFG_PROXY_TYPE_ENTRY "proxy/type" #define CFG_PROXY_TYPE_VALUE_NONE "none" #define CFG_PROXY_TYPE_VALUE_MANUAL "manual" #define CFG_PROXY_TYPE_VALUE_SYSTEM "system" #define CFG_PROXY_TYPE_VALUE_AUTOMATIC "automatic" #define CFG_PROXY_HTTP_HOST_ENTRY "proxy/http/host" #define CFG_PROXY_HTTP_PORT_ENTRY "proxy/http/port" #define CFG_PROXY_HTTPS_HOST_ENTRY "proxy/https/host" #define CFG_PROXY_HTTPS_PORT_ENTRY "proxy/https/port" #define CFG_PROXY_FTP_HOST_ENTRY "proxy/ftp/host" #define CFG_PROXY_FTP_PORT_ENTRY "proxy/ftp/port" #define CFG_PROXY_SOCKS_HOST_ENTRY "proxy/socks/host" #define CFG_PROXY_SOCKS_PORT_ENTRY "proxy/socks/port" #define CFG_PROXY_IGNORE_HOSTS_ENTRY "proxy/ignore_hosts" class QLopNetworkProxyFactory : public QNetworkProxyFactory { public: QLopNetworkProxyFactory(); ~QLopNetworkProxyFactory(); QList queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()); QList queryProxy_manual(const QNetworkProxyQuery &query = QNetworkProxyQuery()); QList queryProxy_system(const QNetworkProxyQuery &query = QNetworkProxyQuery()); QList queryProxy_auto(const QNetworkProxyQuery &query = QNetworkProxyQuery()); void reloadConfig(); private: typedef enum proxyCfgType_t { none=0, manual=1, system=2, automatic=3 }proxyCfgType_t; proxyCfgType_t proxyCfgType; //======================================================================= // MANUAL PROXY CFG //======================================================================= QNetworkProxy p_http_proxy,p_https_proxy,p_ftp_proxy,p_socks_proxy; QList p_ignoreHosts; ProxyPacParser* p_pacParser; }; #endif // QLOPNETWORKPROXYFACTORY_H