1/*
2 SPDX-FileCopyrightText: 2008 Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KDYNAMICJOBTRACKER_H
8#define KDYNAMICJOBTRACKER_H
9
10#include <KJobTrackerInterface>
11
12#include <memory>
13
14class KDynamicJobTrackerPrivate;
15
16/**
17 * This class implements a simple job tracker which registers any job to the KWidgetJobTracker if a
18 * kuiserver isn't available on the DBus, or to the KUiServerJobTracker, if a kuiserver is
19 * available. This way, we have the old dialogs as fallback when the user doesn't use a kuiserver
20 * applet or application.
21 */
22class KDynamicJobTracker : public KJobTrackerInterface
23{
24 Q_OBJECT
25
26public:
27 /**
28 * Creates a new KDynamicJobTracker
29 *
30 * @param parent the parent of this object.
31 */
32 explicit KDynamicJobTracker(QObject *parent = nullptr);
33
34 /**
35 * Destroys this KDynamicJobTracker
36 */
37 ~KDynamicJobTracker() override;
38
39public Q_SLOTS:
40 /**
41 * Register a new job in this tracker. This call will get forwarded to either KWidgetJobTracker
42 * or KUiServerJobTracker, depending on the availability of the Kuiserver.
43 *
44 * @param job the job to register
45 */
46 void registerJob(KJob *job) override;
47
48 /**
49 * Unregister a job from the tracker it was registered to.
50 *
51 * @param job the job to unregister
52 */
53 void unregisterJob(KJob *job) override;
54
55private:
56 std::unique_ptr<KDynamicJobTrackerPrivate> const d;
57};
58
59#endif
60

source code of kio/src/widgets/kdynamicjobtracker_p.h