#ifndef FILEDOWNLOADER_H #define FILEDOWNLOADER_H #include #include #include #include #include #include #include #include #include #include class FileDownloader : public QLopService { Q_OBJECT private: static FileDownloader* _self; static QNetworkAccessManager* m_WebCtrl; static QList* m_pendingTasks; static DownLoadHistory* m_DownLoadHistory; static QDockWidget* m_gui; FileDownloader(bool noGUI=false,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 QDockWidget* getGUI(); const QString& serviceName(); signals: public slots: int download_file(QUrl fileUrl,const QString& name); int download_file(QString fileUrl,const QString& name); private: int getTaskId(); }; #endif // FILEDOWNLOADER_H