File indexing completed on 2024-04-21 15:01:35

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2013 David Faure <faure@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef KJOBWIDGETS_H
0009 #define KJOBWIDGETS_H
0010 
0011 #include <kjobwidgets_export.h>
0012 
0013 class QWidget;
0014 class QWindow;
0015 class KJob;
0016 
0017 /**
0018  * KJobWidgets namespace
0019  */
0020 namespace KJobWidgets
0021 {
0022 /**
0023  * Associate this job with a window given by @p window.
0024  * This is used:
0025  * @li by KDialogJobUiDelegate as parent widget for error messages
0026  * @li by KWidgetJobTracker as parent widget for progress dialogs
0027  * @li by KIO::AbstractJobInteractionInterface as parent widget for rename/skip dialogs
0028  * and possibly more.
0029  * @li by KIO::DropJob as parent widget of popup menus.
0030  * This is required on Wayland to properly position the menu.
0031  *
0032  * @since 5.0
0033  */
0034 KJOBWIDGETS_EXPORT void setWindow(KJob *job, QWidget *widget);
0035 
0036 /**
0037  * Return the window associated with this job.
0038  * @since 5.0
0039  */
0040 KJOBWIDGETS_EXPORT QWidget *window(KJob *job);
0041 
0042 /**
0043  * Updates the last user action timestamp to the given time.
0044  * @since 5.0
0045  */
0046 KJOBWIDGETS_EXPORT void updateUserTimestamp(KJob *job, unsigned long time);
0047 /**
0048  * Returns the last user action timestamp
0049  * @since 5.0
0050  */
0051 KJOBWIDGETS_EXPORT unsigned long userTimestamp(KJob *job);
0052 }
0053 
0054 /**
0055  * KJobWindows namespace
0056  */
0057 namespace KJobWindows
0058 {
0059 /**
0060  * Associate this job with a window given by @p window.
0061  * This is used:
0062  * @li by KDialogJobUiDelegate as parent widget for error messages
0063  * @li by KWidgetJobTracker as parent widget for progress dialogs
0064  * @li by KIO::AbstractJobInteractionInterface as parent widget for rename/skip dialogs
0065  * and possibly more.
0066  * @li by KIO::DropJob as parent widget of popup menus.
0067  * This is required on Wayland to properly position the menu.
0068  *
0069  * @since 5.42
0070  */
0071 KJOBWIDGETS_EXPORT void setWindow(KJob *job, QWindow *window);
0072 
0073 /**
0074  * Return the window associated with this job.
0075  * @since 5.42
0076  */
0077 KJOBWIDGETS_EXPORT QWindow *window(KJob *job);
0078 }
0079 
0080 #endif