Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef HTTPPROXYLIST_H
00028 #define HTTPPROXYLIST_H
00029
00030 #include "QGpGuiToolsDLLExport.h"
00031 #include "HttpProxy.h"
00032
00033 class QNetworkReply;
00034
00035 namespace QGpGuiTools {
00036
00037 class QGPGUITOOLS_EXPORT HttpProxyList : public QObject
00038 {
00039 Q_OBJECT
00040 public:
00041 HttpProxyList(const QString& testUrl, QObject * parent=0);
00042 ~HttpProxyList();
00043
00044 void collect();
00045 bool isReady() const {return _replies.isEmpty();}
00046
00047 const HttpProxy& at(int index) {return _proxies[index];}
00048 int count() const {return _proxies.count();}
00049
00050 const QUrl& testUrl() const {return _testUrl;}
00051
00052 void printDebug(const QString& s, bool list=false) const;
00053 signals:
00054 void ready();
00055 private slots:
00056 void getScriptFinished();
00057 private:
00058 void sort();
00059 void getScript(const QString& url);
00060 void autoDetectProxies();
00061 void dnsDetectRequest(const QString& domainName);
00062 void replyReceived(QNetworkReply * reply);
00063
00064 void firefoxProxies();
00065 #if defined Q_WS_X11
00066 void kdeProxies();
00067 #elif defined Q_WS_WIN
00068 void internetExplorerProxies();
00069 #elif defined Q_WS_MAC
00070 void macProxies();
00071 #endif
00072 void systemProxies();
00073 void firefoxProxies(const QString& file);
00074 #if defined Q_WS_X11
00075 void kdeProxies(const QString& file);
00076 #endif
00077 QStringList firefoxFiles();
00078 QStringList findFiles(QDir in, QString pattern);
00079 QStringList findFiles(QDir in, QStringList patternList);
00080
00081 QUrl _testUrl;
00082 QList<HttpProxy> _proxies;
00083 QList<QNetworkReply *> _replies;
00084 };
00085
00086 }
00087
00088 #endif // HTTPPROXYLIST_H