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