KIO
proxyscout.h
Go to the documentation of this file.
00001 /* 00002 Copyright (c) 2003 Malte Starostik <malte@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 00021 #ifndef KPAC_PROXYSCOUT_H 00022 #define KPAC_PROXYSCOUT_H 00023 00024 #include <kdedmodule.h> 00025 #include <kcomponentdata.h> 00026 #include <kurl.h> 00027 00028 #include <QtCore/QMap> 00029 #include <QtDBus/QtDBus> 00030 00031 class QFileSystemWatcher; 00032 00033 namespace KPAC 00034 { 00035 class Downloader; 00036 class Script; 00037 00038 class ProxyScout : public KDEDModule 00039 { 00040 Q_OBJECT 00041 Q_CLASSINFO("D-Bus Interface", "org.kde.KPAC.ProxyScout") 00042 public: 00043 ProxyScout(QObject* parent, const QList<QVariant>&); 00044 virtual ~ProxyScout(); 00045 00046 public Q_SLOTS: 00047 Q_SCRIPTABLE QString proxyForUrl( const QString& checkUrl, const QDBusMessage & ); 00048 Q_SCRIPTABLE QStringList proxiesForUrl( const QString& checkUrl, const QDBusMessage & ); 00049 Q_SCRIPTABLE Q_NOREPLY void blackListProxy( const QString& proxy ); 00050 Q_SCRIPTABLE Q_NOREPLY void reset(); 00051 00052 private Q_SLOTS: 00053 void disconnectNetwork(); 00054 void downloadResult( bool ); 00055 void proxyScriptFileChanged(const QString&); 00056 00057 private: 00058 bool startDownload(); 00059 QStringList handleRequest( const KUrl& url ); 00060 00061 KComponentData m_componentData; 00062 Downloader* m_downloader; 00063 Script* m_script; 00064 00065 struct QueuedRequest 00066 { 00067 QueuedRequest() {} 00068 QueuedRequest( const QDBusMessage&, const KUrl&, bool sendall = false); 00069 00070 QDBusMessage transaction; 00071 KUrl url; 00072 bool sendAll; 00073 }; 00074 typedef QList< QueuedRequest > RequestQueue; 00075 RequestQueue m_requestQueue; 00076 00077 typedef QMap< QString, qint64 > BlackList; 00078 BlackList m_blackList; 00079 qint64 m_suspendTime; 00080 int m_debugArea; 00081 QFileSystemWatcher* m_watcher; 00082 }; 00083 } 00084 00085 #endif // KPAC_PROXYSCOUT_H 00086 00087 // vim: ts=4 sw=4 et
KDE 4.7 API Reference