filedownloader.h
44 lines
| 1.1 KiB
| text/x-c
|
CLexer
r4 | #ifndef FILEDOWNLOADER_H | |||
#define FILEDOWNLOADER_H | ||||
#include <QObject> | ||||
#include <QNetworkAccessManager> | ||||
#include <QNetworkReply> | ||||
#include <QNetworkProxy> | ||||
#include <QList> | ||||
#include <QHash> | ||||
#include <filedownloadertask.h> | ||||
#include <downloadhistory.h> | ||||
#include <qlopservice.h> | ||||
class FileDownloader : public QLopService | ||||
{ | ||||
Q_OBJECT | ||||
private: | ||||
static FileDownloader* _self; | ||||
static QNetworkAccessManager* m_WebCtrl; | ||||
static QList<FileDownloaderTask*>* m_pendingTasks; | ||||
static DownLoadHistory* m_gui; | ||||
static bool m_noGui; | ||||
static QString m_serviceName; | ||||
FileDownloader(QObject *parent = 0); | ||||
~FileDownloader(); | ||||
public: | ||||
static void init(bool noGUI=false,QObject *parent = 0); | ||||
static int downloadFile(QUrl fileUrl,const QString& name); | ||||
static int downloadFile(QString fileUrl,const QString& name); | ||||
static FileDownloaderTask *getDownloadTask(int ID); | ||||
static bool taskIsCompleted(int ID); | ||||
static FileDownloader *self(); | ||||
// QLopService methodes | ||||
QWidget* getGUI(); | ||||
const QString& serviceName(); | ||||
signals: | ||||
public slots: | ||||
private: | ||||
int getTaskId(); | ||||
}; | ||||
#endif // FILEDOWNLOADER_H | ||||