KJobWidgets

kwidgetjobtracker.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2000 Matej Koss <koss@miesto.sk>
4 SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
5 SPDX-FileCopyrightText: 2009 Shaun Reich <shaun.reich@kdemail.net>
6
7 SPDX-License-Identifier: LGPL-2.0-only
8*/
9
10#ifndef KWIDGETJOBTRACKER_H
11#define KWIDGETJOBTRACKER_H
12
13#include <kabstractwidgetjobtracker.h>
14#include <kjobwidgets_export.h>
15
16class KWidgetJobTrackerPrivate;
17
18/**
19 * @class KWidgetJobTracker kwidgetjobtracker.h KWidgetJobTracker
20 *
21 * This class implements a job tracker with a widget suited for use as a
22 * progress dialog.
23 */
24class KJOBWIDGETS_EXPORT KWidgetJobTracker : public KAbstractWidgetJobTracker
25{
26 Q_OBJECT
27
28public:
29 /**
30 * Creates a new KWidgetJobTracker
31 *
32 * @param parent the parent of this object and of the widget displaying the job progresses
33 */
34 explicit KWidgetJobTracker(QWidget *parent = nullptr);
35
36 /**
37 * Destroys a KWidgetJobTracker
38 */
40
41 /**
42 * The widget associated to this tracker.
43 *
44 * @param job the job that is assigned the widget we want to get
45 * @return the widget displaying the job progresses
46 */
47 QWidget *widget(KJob *job) override;
48
49 // KDE5: move this two virtual methods to be placed correctly (ereslibre)
50public Q_SLOTS:
51 /**
52 * Register a new job in this tracker.
53 *
54 * @param job the job to register
55 */
56 void registerJob(KJob *job) override;
57
58 /**
59 * Unregister a job from this tracker.
60 *
61 * @param job the job to unregister
62 */
63 void unregisterJob(KJob *job) override;
64
65public:
66 bool keepOpen(KJob *job) const;
67
68protected Q_SLOTS:
69 /**
70 * The following slots are inherited from KJobTrackerInterface.
71 */
72 void infoMessage(KJob *job, const QString &message) override;
73 void description(KJob *job, const QString &title, const QPair<QString, QString> &field1, const QPair<QString, QString> &field2) override;
74 void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
75 void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
76 void percent(KJob *job, unsigned long percent) override;
77 void speed(KJob *job, unsigned long value) override;
78 void slotClean(KJob *job) override;
79 void suspended(KJob *job) override;
80 void resumed(KJob *job) override;
81
82 // TODO: Misses canResume()
83
84private:
85 Q_DECLARE_PRIVATE(KWidgetJobTracker)
86
87 Q_PRIVATE_SLOT(d_func(), void _k_showProgressWidget())
88};
89
90#endif
The base class for widget based job trackers.
virtual void slotClean(KJob *job)
This method is called when the widget should be cleaned (after job is finished).
void unregisterJob(KJob *job) override
Unregister a job from this tracker.
void registerJob(KJob *job) override
Register a new job in this tracker.
virtual QWidget * widget(KJob *job)=0
The widget associated to this tracker.
virtual void speed(KJob *job, unsigned long value)
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 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)
This class implements a job tracker with a widget suited for use as a progress dialog.
~KWidgetJobTracker() override
Destroys a KWidgetJobTracker.
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.