KJobWidgets

kwidgetjobtracker.h
1 /* This file is part of the KDE project
2  Copyright (C) 2000 Matej Koss <[email protected]>
3  Copyright (C) 2007 Kevin Ottens <[email protected]>
4  Copyright (C) 2009 Shaun Reich <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 
20 */
21 
22 #ifndef KWIDGETJOBTRACKER_H
23 #define KWIDGETJOBTRACKER_H
24 
25 #include <kjobwidgets_export.h>
26 #include <kabstractwidgetjobtracker.h>
27 
34 class KJOBWIDGETS_EXPORT KWidgetJobTracker : public KAbstractWidgetJobTracker
35 {
36  Q_OBJECT
37 
38 public:
44  explicit KWidgetJobTracker(QWidget *parent = nullptr);
45 
49  ~KWidgetJobTracker() override;
50 
57  QWidget *widget(KJob *job) override;
58 
59 // KDE5: move this two virtual methods to be placed correctly (ereslibre)
60 public Q_SLOTS:
66  void registerJob(KJob *job) override;
67 
73  void unregisterJob(KJob *job) override;
74 
75 public:
76  bool keepOpen(KJob *job) const;
77 
78 protected Q_SLOTS:
82  void infoMessage(KJob *job, const QString &plain, const QString &rich) override;
83  virtual void description(KJob *job, const QString &title,
84  const QPair<QString, QString> &field1,
85  const QPair<QString, QString> &field2) override;
86  void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
87  void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
88  void percent(KJob *job, unsigned long percent) override;
89  void speed(KJob *job, unsigned long value) override;
90  void slotClean(KJob *job) override;
91  void suspended(KJob *job) override;
92  void resumed(KJob *job) override;
93 
94  //TODO: Misses canResume()
95 
96 private:
97  class Private;
98  Private *const d;
99 
100  Q_PRIVATE_SLOT(d, void _k_showProgressWidget())
101 };
102 
103 #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-2020 The KDE developers.
Generated on Sat Jul 11 2020 22:47:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.