KJobWidgets

kuiserverv2jobtracker.h
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/**
20 * @class KUiServerV2JobTracker kuiserverv2jobtracker.h KUiServerV2JobTracker
21 *
22 * The interface to implement to track the progresses of a job.
23 *
24 * @since 5.81
25 */
26class KJOBWIDGETS_EXPORT KUiServerV2JobTracker : public KJobTrackerInterface
27{
28 Q_OBJECT
29
30public:
31 /**
32 * Creates a new KJobTrackerInterface
33 *
34 * @param parent the parent object
35 */
36 explicit KUiServerV2JobTracker(QObject *parent = nullptr);
37
38 /**
39 * Destroys a KJobTrackerInterface
40 */
41 ~KUiServerV2JobTracker() override;
42
43 /**
44 * Register a new job in this tracker.
45 *
46 * @param job the job to register
47 */
48 void registerJob(KJob *job) override;
49
50 /**
51 * Unregister a job from this tracker.
52 *
53 * @param job the job to unregister
54 */
55 void unregisterJob(KJob *job) override;
56
57protected Q_SLOTS:
58 /**
59 * The following slots are inherited from KJobTrackerInterface.
60 */
61 void finished(KJob *job) override;
62 void suspended(KJob *job) override;
63 void resumed(KJob *job) override;
64 virtual void description(KJob *job, const QString &title,
65 const QPair<QString, QString> &field1,
66 const QPair<QString, QString> &field2) override;
67 void infoMessage(KJob *job, const QString &message) override;
68 void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
69 void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
70 void percent(KJob *job, unsigned long percent) override;
71 void speed(KJob *job, unsigned long value) override;
72
73private:
74 std::unique_ptr<KUiServerV2JobTrackerPrivate> const d;
75};
76
77#endif
virtual void registerJob(KJob *job)
virtual void speed(KJob *job, unsigned long value)
virtual void finished(KJob *job)
virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
virtual void resumed(KJob *job)
virtual void percent(KJob *job, unsigned long percent)
virtual void suspended(KJob *job)
virtual void infoMessage(KJob *job, const QString &message)
virtual void unregisterJob(KJob *job)
virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
virtual void description(KJob *job, const QString &title, const QPair< QString, QString > &field1, const QPair< QString, QString > &field2)
The interface to implement to track the progresses of a job.
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:04:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.