KIO
downloader.h
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 #ifndef KPAC_DOWNLOADER_H
00022 #define KPAC_DOWNLOADER_H
00023
00024 #include <QtCore/QObject>
00025
00026 #include <kurl.h>
00027
00028 class KJob;
00029 namespace KIO { class Job; }
00030
00031 namespace KPAC
00032 {
00033 class Downloader : public QObject
00034 {
00035 Q_OBJECT
00036 public:
00037 Downloader( QObject* );
00038
00039 void download( const KUrl& );
00040 const KUrl& scriptUrl() { return m_scriptURL; }
00041 const QString& script() { return m_script; }
00042 const QString& error() { return m_error; }
00043
00044 Q_SIGNALS:
00045 void result( bool );
00046
00047 protected:
00048 virtual void failed();
00049 void setError( const QString& );
00050
00051 private Q_SLOTS:
00052 void data( KIO::Job*, const QByteArray& );
00053 void result( KJob* );
00054
00055 private:
00056 QByteArray m_data;
00057 KUrl m_scriptURL;
00058 QString m_script;
00059 QString m_error;
00060 };
00061 }
00062
00063 #endif // KPAC_DOWNLOADER_H
00064
00065