File indexing completed on 2024-04-28 03:56:24

0001 /*
0002     SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef DOWNLOADJOB_H
0008 #define DOWNLOADJOB_H
0009 
0010 #include "filecopyjob.h"
0011 
0012 #include <memory>
0013 
0014 namespace KNSCore
0015 {
0016 class DownloadJobPrivate;
0017 class DownloadJob : public FileCopyJob
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit DownloadJob(const QUrl &source, const QUrl &destination, int permissions = -1, JobFlags flags = DefaultFlags, QObject *parent = nullptr);
0022     explicit DownloadJob(QObject *parent = nullptr);
0023     ~DownloadJob() override;
0024 
0025     Q_SCRIPTABLE void start() override;
0026 
0027 protected Q_SLOTS:
0028     void handleWorkerCompleted();
0029     void handleWorkerError(const QString &error);
0030 
0031 private:
0032     const std::unique_ptr<DownloadJobPrivate> d;
0033 };
0034 
0035 }
0036 
0037 #endif // DOWNLOADJOB_H