1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2020 Ahmad Samir <a.samirh78@gmail.com> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
6 | */ |
7 | |
8 | #ifndef WIDGETSOPENOREXECUTEFILEHANDLER_H |
9 | #define WIDGETSOPENOREXECUTEFILEHANDLER_H |
10 | |
11 | #include "openorexecutefileinterface.h" |
12 | |
13 | namespace KIO |
14 | { |
15 | // TODO KF6: Make KIO::JobUiDelegate inherit from WidgetsOpenOrExecuteFileHandler |
16 | // (or even merge the two classes) |
17 | // so that setDelegate(new KIO::JobUiDelegate) invokes the dialog boxes on error |
18 | // and when showing ExecutableFileOpenDialog. |
19 | |
20 | class WidgetsOpenOrExecuteFileHandler : public OpenOrExecuteFileInterface |
21 | { |
22 | Q_OBJECT |
23 | public: |
24 | explicit WidgetsOpenOrExecuteFileHandler(QObject *parent = nullptr); |
25 | ~WidgetsOpenOrExecuteFileHandler() override; |
26 | |
27 | void promptUserOpenOrExecute(KJob *job, const QString &mimetype) override; |
28 | |
29 | void setWindow(QWidget *window); |
30 | |
31 | private: |
32 | // Note: no d pointer because it's not exported at this point |
33 | QWidget *m_parentWidget = nullptr; |
34 | }; |
35 | |
36 | } |
37 | |
38 | #endif // WIDGETSOPENOREXECUTEFILEHANDLER_H |
39 | |