| 1 | /* |
| 2 | This file is part of the KDE libraries |
| 3 | SPDX-FileCopyrightText: 2020 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 WIDGETSOPENWITHHANDLER_H |
| 9 | #define WIDGETSOPENWITHHANDLER_H |
| 10 | |
| 11 | #include "openwithhandlerinterface.h" |
| 12 | |
| 13 | class QDialog; |
| 14 | class QWidget; |
| 15 | |
| 16 | namespace KIO |
| 17 | { |
| 18 | // TODO KF6: Make KIO::JobUiDelegate inherit from WidgetsOpenWithHandler |
| 19 | // (or even merge the two classes) |
| 20 | // so that setDelegate(new KIO::JobUiDelegate) provides both dialog boxes on error |
| 21 | // and the open-with dialog. |
| 22 | |
| 23 | class WidgetsOpenWithHandler : public OpenWithHandlerInterface |
| 24 | { |
| 25 | Q_OBJECT |
| 26 | public: |
| 27 | explicit WidgetsOpenWithHandler(QObject *parent = nullptr); |
| 28 | ~WidgetsOpenWithHandler() override; |
| 29 | |
| 30 | void promptUserForApplication(KJob *job, const QList<QUrl> &urls, const QString &mimeType) override; |
| 31 | |
| 32 | void setWindow(QWidget *widget); |
| 33 | |
| 34 | private: |
| 35 | // Note: no d pointer because not exported at this point |
| 36 | QWidget *m_parentWidget = nullptr; |
| 37 | }; |
| 38 | |
| 39 | } |
| 40 | |
| 41 | #endif // WIDGETSOPENWITHHANDLER_H |
| 42 | |