/* * SPDX-FileCopyrightText: 2016-2018 Red Hat Inc * * SPDX-License-Identifier: LGPL-2.0-or-later * * SPDX-FileCopyrightText: 2016-2018 Jan Grulich */ #ifndef XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H #define XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H #include #include #include #include #include #include #include class KFileWidget; class QDialogButtonBox; class MobileFileDialog; class FileDialog : public QDialog { Q_OBJECT public: friend class FileChooserPortal; friend class AppModel; explicit FileDialog(QDialog *parent = nullptr, Qt::WindowFlags flags = {}); ~FileDialog() override; Q_DISABLE_COPY_MOVE(FileDialog) public: KFileWidget *const m_fileWidget; KConfigGroup m_configGroup; }; class FileChooserPortal : public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.FileChooser") public: // Keep in sync with qflatpakfiledialog from flatpak-platform-plugin typedef struct { uint type; QString filterString; } Filter; typedef QList Filters; typedef struct { QString userVisibleName; Filters filters; } FilterList; typedef QList FilterListList; typedef struct { QString id; QString value; } Choice; typedef QList Choices; typedef struct { QString id; QString label; Choices choices; QString initialChoiceId; } Option; typedef QList