KJobWidgets

kwidgetjobtracker.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2000 Matej Koss <[email protected]>
4  SPDX-FileCopyrightText: 2007 Kevin Ottens <[email protected]>
5  SPDX-FileCopyrightText: 2009 Shaun Reich <[email protected]>
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 
16 class 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  */
24 class KJOBWIDGETS_EXPORT KWidgetJobTracker : public KAbstractWidgetJobTracker
25 {
26  Q_OBJECT
27 
28 public:
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  */
39  ~KWidgetJobTracker() override;
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)
50 public 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 
65 public:
66  bool keepOpen(KJob *job) const;
67 
68 protected Q_SLOTS:
69  /**
70  * The following slots are inherited from KJobTrackerInterface.
71  */
72  void infoMessage(KJob *job, const QString &plain, const QString &rich) override;
73  virtual 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 
84 private:
85  Q_DECLARE_PRIVATE_D(KAbstractWidgetJobTracker::d, KWidgetJobTracker)
86 #if KJOBWIDGETS_BUILD_DEPRECATED_SINCE(5, 79)
87  // Unused, kept for ABI compatibility
88  const void *__kjobwidgets_d_do_not_use;
89 #endif
90 
91  Q_PRIVATE_SLOT(d_func(), void _k_showProgressWidget())
92 };
93 
94 #endif
virtual void resumed(KJob *job)
The base class for widget based job trackers.
virtual void suspended(KJob *job)
virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
virtual void slotClean(KJob *job)
This method is called when the widget should be cleaned (after job is finished).
virtual QWidget * widget(KJob *job)=0
The widget associated to this tracker.
virtual void description(KJob *job, const QString &title, const QPair< QString, QString > &field1, const QPair< QString, QString > &field2)
virtual void speed(KJob *job, unsigned long value)
This class implements a job tracker with a widget suited for use as a progress dialog.
void unregisterJob(KJob *job) override
Unregister a job from this tracker.
void registerJob(KJob *job) override
Register a new job in this tracker.
virtual void infoMessage(KJob *job, const QString &plain, const QString &rich)
virtual void percent(KJob *job, unsigned long percent)
virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon May 17 2021 22:48:39 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.