File indexing completed on 2024-12-01 06:45:40
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 2020 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 WIDGETSOPENWITHHANDLER_H 0009 #define WIDGETSOPENWITHHANDLER_H 0010 0011 #include "openwithhandlerinterface.h" 0012 0013 class QDialog; 0014 class QWidget; 0015 0016 namespace KIO 0017 { 0018 // TODO KF6: Make KIO::JobUiDelegate inherit from WidgetsOpenWithHandler 0019 // (or even merge the two classes) 0020 // so that setDelegate(new KIO::JobUiDelegate) provides both dialog boxes on error 0021 // and the open-with dialog. 0022 0023 class WidgetsOpenWithHandler : public OpenWithHandlerInterface 0024 { 0025 Q_OBJECT 0026 public: 0027 explicit WidgetsOpenWithHandler(QObject *parent = nullptr); 0028 ~WidgetsOpenWithHandler() override; 0029 0030 void promptUserForApplication(KJob *job, const QList<QUrl> &urls, const QString &mimeType) override; 0031 0032 void setWindow(QWidget *widget); 0033 0034 private: 0035 // Note: no d pointer because not exported at this point 0036 QWidget *m_parentWidget = nullptr; 0037 }; 0038 0039 } 0040 0041 #endif // WIDGETSOPENWITHHANDLER_H