KJobWidgets

kdialogjobuidelegate.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000 Stephan Kulow <[email protected]>
4  SPDX-FileCopyrightText: 2000 David Faure <[email protected]>
5  SPDX-FileCopyrightText: 2006, 2007 Kevin Ottens <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9 
10 #ifndef KDIALOGJOBUIDELEGATE_H
11 #define KDIALOGJOBUIDELEGATE_H
12 
13 #include <KJobUiDelegate>
14 #include <kjobwidgets_export.h>
15 
16 #include <memory>
17 
18 /**
19  * @class KDialogJobUiDelegate kdialogjobuidelegate.h KDialogJobUiDelegate
20  *
21  * A UI delegate using KMessageBox for interaction (showing errors and warnings).
22  *
23  * The KMessageBox will use window as a parent in an application-modal.
24  */
25 class KJOBWIDGETS_EXPORT KDialogJobUiDelegate : public KJobUiDelegate
26 {
27  Q_OBJECT
28 
29 public:
30  /**
31  * Constructs a new KDialogJobUiDelegate.
32  */
34 
35  /**
36  * Constructs a new KDialogJobUiDelegate.
37  * @param flags allows to enable automatic error/warning handling
38  * @param window the window associated with this delegate, see setWindow.
39  * @since 5.70
40  */
41  explicit KDialogJobUiDelegate(KJobUiDelegate::Flags flags, QWidget *window);
42 
43  /**
44  * Destroys the KDialogJobUiDelegate.
45  */
46  ~KDialogJobUiDelegate() override;
47 
48 public:
49  /**
50  * @reimp
51  */
52  bool setJob(KJob *job) override;
53 
54  /**
55  * Associate this delegate with a window given by @p window.
56  * Needed for dialog boxes to respect stacking order, centering to parent, focus going back to parent after closing...
57  * @param window the window to associate to
58  * @see window()
59  */
60  virtual void setWindow(QWidget *window);
61 
62  /**
63  * Returns the window this delegate is associated with.
64  * @return the associated window
65  * @see setWindow()
66  */
67  QWidget *window() const;
68 
69  /**
70  * Updates the last user action timestamp to the given time.
71  * See KApplication::updateUserTimestamp().
72  */
73  void updateUserTimestamp(unsigned long time);
74 
75  /**
76  * @internal
77  */
78  unsigned long userTimestamp() const;
79 
80  void showErrorMessage() override;
81 
82 protected Q_SLOTS:
83  void slotWarning(KJob *job, const QString &plain, const QString &rich) override;
84 
85 private:
86  std::unique_ptr<class KDialogJobUiDelegatePrivate> const d;
87 };
88 
89 #endif
Q_SLOTSQ_SLOTS
virtual void showErrorMessage()
virtual bool setJob(KJob *job)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 8 2023 04:09:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.