1 /* This file is part of the KDE project 2 3 Copyright (C) 2007 Lukas Appelhans <l.appelhans@gmx.de> 4 5 This program is free software; you can redistribute it and/or 6 modify it under the terms of the GNU General Public 7 License as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 */ 10 11 #ifndef DOWNLOAD_H 12 #define DOWNLOAD_H 13 14 #include "kget_export.h" 15 16 #include <QObject> 17 #include <QByteArray> 18 19 #include <QUrl> 20 21 #include <kio/job.h> 22 23 class KGET_EXPORT Download : public QObject 24 { 25 Q_OBJECT 26 public: 27 Download(const QUrl &srcUrl, const QUrl &destUrl); 28 ~Download() override; 29 30 Q_SIGNALS: 31 void finishedSuccessfully(QUrl dest, QByteArray data); 32 void finishedWithError(); 33 34 private Q_SLOTS: 35 void slotResult(KJob * job); 36 void slotData(KIO::Job *job, const QByteArray& data); 37 38 private: 39 KIO::TransferJob *m_copyJob = nullptr; 40 QUrl m_srcUrl; 41 QUrl m_destUrl; 42 QUrl m_destFile; 43 QByteArray m_data; 44 }; 45 46 #endif 47