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 | |
13 | class QWidget; |
14 | class QObject; |
15 | |
16 | /** |
17 | * KJobWidgets namespace |
18 | */ |
19 | namespace KJobWidgets |
20 | { |
21 | /** |
22 | * Associate this job with a window given by @p window. |
23 | * |
24 | * @param job should be a KJob subclass |
25 | * |
26 | * This is used: |
27 | * @li by KDialogJobUiDelegate as parent widget for error messages |
28 | * @li by KWidgetJobTracker as parent widget for progress dialogs |
29 | * @li by KIO::AbstractJobInteractionInterface as parent widget for rename/skip dialogs |
30 | * and possibly more. |
31 | * @li by KIO::DropJob as parent widget of popup menus. |
32 | * This is required on Wayland to properly position the menu. |
33 | * |
34 | * @since 6.0 |
35 | */ |
36 | KWIDGETSADDONS_EXPORT void setWindow(QObject *job, QWidget *widget); |
37 | |
38 | /** |
39 | * Return the window associated with this job. |
40 | * |
41 | * @param job should be a KJob subclass |
42 | * |
43 | * @since 6.0 |
44 | */ |
45 | KWIDGETSADDONS_EXPORT QWidget *window(QObject *job); |
46 | |
47 | /** |
48 | * Updates the last user action timestamp to the given time. |
49 | * |
50 | * @param job should be a KJob subclass |
51 | * |
52 | * @since 6.0 |
53 | */ |
54 | KWIDGETSADDONS_EXPORT void updateUserTimestamp(QObject *job, unsigned long time); |
55 | /** |
56 | * Returns the last user action timestamp |
57 | * |
58 | * @param job should be a KJob subclass |
59 | * |
60 | * @since 6.0 |
61 | */ |
62 | KWIDGETSADDONS_EXPORT unsigned long userTimestamp(QObject *job); |
63 | } |
64 | |
65 | #endif |
66 | |