KCoreAddons

kjobuidelegate.h
1 /*
2  This file is part of the KDE libraries
3 
4  SPDX-FileCopyrightText: 2000 Stephan Kulow <[email protected]>
5  SPDX-FileCopyrightText: 2000 David Faure <[email protected]>
6  SPDX-FileCopyrightText: 2006 Kevin Ottens <[email protected]>
7 
8  SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10 
11 #ifndef KJOBUIDELEGATE_H
12 #define KJOBUIDELEGATE_H
13 
14 #include <kcoreaddons_export.h>
15 #include <QObject>
16 
17 class KJob;
18 
30 class KCOREADDONS_EXPORT KJobUiDelegate : public QObject
31 {
32  Q_OBJECT
33 
34 public:
35 
41  enum Flag {
42  AutoHandlingDisabled = 0,
43  AutoErrorHandlingEnabled = 1,
44  AutoWarningHandlingEnabled = 2,
45  AutoHandlingEnabled = AutoErrorHandlingEnabled | AutoWarningHandlingEnabled
46  };
50  Q_DECLARE_FLAGS(Flags, Flag)
51 
52 
56 
62  explicit KJobUiDelegate(Flags flags); // KF6 TODO merge with default constructor, using AutoHandlingDisabled as default value
63 
67  ~KJobUiDelegate() override;
68 
69 protected:
75  virtual bool setJob(KJob *job);
76 
77 protected:
84  KJob *job() const;
85 
86  friend class KJob;
87 
88 public:
95  virtual void showErrorMessage();
96 
109  void setAutoErrorHandlingEnabled(bool enable);
110 
117  bool isAutoErrorHandlingEnabled() const;
118 
131  void setAutoWarningHandlingEnabled(bool enable);
132 
139  bool isAutoWarningHandlingEnabled() const;
140 
141 protected Q_SLOTS:
142  virtual void slotWarning(KJob *job, const QString &plain, const QString &rich);
143 
144 private:
145  void connectJob(KJob *job);
146 
147  class Private;
148  Private *const d;
149 };
150 
151 Q_DECLARE_OPERATORS_FOR_FLAGS(KJobUiDelegate::Flags)
152 
153 #endif // KJOBUIDELEGATE_H
Flag
Flags for the constructor, to enable automatic handling of errors and/or warnings.
The base class for all KJob UI delegate.
The base class for all jobs.
Definition: kjob.h:75
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 14 2020 23:02:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.