1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2021 Kai Uwe Broulik <kde@broulik.de>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KUISERVERV2JOBTRACKER_H
9#define KUISERVERV2JOBTRACKER_H
10
11#include <KJobTrackerInterface>
12#include <kjobwidgets_export.h>
13
14#include <memory>
15
16class KJob;
17class KUiServerV2JobTrackerPrivate;
18
19// TODO KF7 rename to KUiServerJobTracker
20
21/*!
22 * \class KUiServerV2JobTracker
23 *
24 * \inmodule KJobWidgets
25 *
26 * \brief The interface to implement to track the progresses of a job.
27 *
28 * \since 5.81
29 */
30class KJOBWIDGETS_EXPORT KUiServerV2JobTracker : public KJobTrackerInterface
31{
32 Q_OBJECT
33
34public:
35 /*!
36 * Creates a new KJobTrackerInterface
37 *
38 * \a parent the parent object
39 */
40 explicit KUiServerV2JobTracker(QObject *parent = nullptr);
41
42 ~KUiServerV2JobTracker() override;
43
44 /*!
45 * Register a new job in this tracker.
46 *
47 * \a job the job to register
48 */
49 void registerJob(KJob *job) override;
50
51 /*!
52 * Unregister a job from this tracker.
53 *
54 * \a job the job to unregister
55 */
56 void unregisterJob(KJob *job) override;
57
58protected Q_SLOTS:
59 void finished(KJob *job) override;
60 void suspended(KJob *job) override;
61 void resumed(KJob *job) override;
62 virtual void description(KJob *job, const QString &title,
63 const QPair<QString, QString> &field1,
64 const QPair<QString, QString> &field2) override;
65 void infoMessage(KJob *job, const QString &message) override;
66 void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
67 void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
68 void percent(KJob *job, unsigned long percent) override;
69 void speed(KJob *job, unsigned long value) override;
70
71private:
72 std::unique_ptr<KUiServerV2JobTrackerPrivate> const d;
73};
74
75#endif
76

source code of kjobwidgets/src/kuiserverv2jobtracker.h