KNewStuff

filecopyjob.h
1/*
2 SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <admin@leinir.dk>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef FILECOPYJOB_H
8#define FILECOPYJOB_H
9
10#include "jobbase.h"
11
12#include <QUrl>
13
14#include <memory>
15
16namespace KNSCore
17{
18class FileCopyJobPrivate;
19class FileCopyJob : public KJob
20{
22public:
23 explicit FileCopyJob(const QUrl &source, const QUrl &destination, int permissions = -1, JobFlags flags = DefaultFlags, QObject *parent = nullptr);
24 explicit FileCopyJob(QObject *parent = nullptr);
25 ~FileCopyJob() override;
26
27 Q_SCRIPTABLE void start() override;
28
29 QUrl destUrl() const;
30 QUrl srcUrl() const;
31
32 // This will create either a FileCopyJob, or an instance of
33 // a subclass, depending on the nature of the URLs passed to
34 // it
35 static FileCopyJob *file_copy(const QUrl &source, const QUrl &destination, int permissions = -1, JobFlags flags = DefaultFlags, QObject *parent = nullptr);
36
37protected Q_SLOTS:
38 void handleProgressUpdate(qlonglong current, qlonglong total);
39 void handleCompleted();
40 void handleError(const QString &errorMessage);
41
42private:
43 const std::unique_ptr<FileCopyJobPrivate> d;
44};
45
46}
47
48#endif // FILECOPYJOB_H
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:54:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.