1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2013 David Faure <faure@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef KJOBWIDGETS_H
9#define KJOBWIDGETS_H
10
11#include <kwidgetsaddons_export.h>
12
13class QObject;
14class QWidget;
15class QWindow;
16
17/*!
18 * \namespace KJobWidgets
19 *
20 * KJobWidgets namespace
21 */
22namespace KJobWidgets
23{
24/*!
25 * Associate this job with a window given by \a window.
26 *
27 * \a job should be a KJob subclass
28 *
29 * This is used:
30 * \list
31 * \li by KDialogJobUiDelegate as parent widget for error messages
32 * \li by KWidgetJobTracker as parent widget for progress dialogs
33 * \li by KIO::AbstractJobInteractionInterface as parent widget for rename/skip dialogs
34 * and possibly more.
35 * \li by KIO::DropJob as parent widget of popup menus.
36 * This is required on Wayland to properly position the menu.
37 * \endlist
38 *
39 * \since 6.0
40 */
41KWIDGETSADDONS_EXPORT void setWindow(QObject *job, QWidget *widget);
42
43#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(6, 5)
44/*!
45 * Associate this job with a window given by \a window.
46 *
47 * Note that setWindow() will set the window handle too.
48 *
49 * \a job should be a KJob subclass
50 *
51 * \since 6.4
52 * \deprecated[6.5]
53 * use KJobWindows::setWindow() instead.
54 */
55KWIDGETSADDONS_EXPORT KWIDGETSADDONS_DEPRECATED_VERSION(6, 5, "Use KJobWindows::setWindow() instead") void setWindowHandle(QObject *job, QWindow *window);
56#endif
57
58/*!
59 * Return the window associated with this job.
60 *
61 * \a job should be a KJob subclass
62 *
63 * \since 6.0
64 */
65KWIDGETSADDONS_EXPORT QWidget *window(QObject *job);
66
67#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(6, 5)
68/*!
69 * Returns the window handle associated with this job.
70 *
71 * \a job should be a KJob subclass
72 *
73 * \since 6.4
74 * @deprecated[6.5]
75 * use KJobWindows::window() instead.
76 */
77KWIDGETSADDONS_EXPORT KWIDGETSADDONS_DEPRECATED_VERSION(6, 5, "Use KJobWindows::window() instead") QWindow *windowHandle(QObject *job);
78#endif
79
80/*!
81 * Updates the last user action timestamp to the given time.
82 *
83 * \a job should be a KJob subclass
84 *
85 * \since 6.0
86 */
87KWIDGETSADDONS_EXPORT void updateUserTimestamp(QObject *job, unsigned long time);
88/*!
89 * Returns the last user action timestamp
90 *
91 * \a job should be a KJob subclass
92 *
93 * \since 6.0
94 */
95KWIDGETSADDONS_EXPORT unsigned long userTimestamp(QObject *job);
96}
97
98#endif
99

source code of kwidgetsaddons/src/kjobwidgets.h