// SPDX-FileCopyrightText: 2020 Jonah BrĂ¼chert // // SPDX-License-Identifier: LGPL-2.0-or-later #pragma once #include #include class QQmlApplicationEngine; class FileChooserQmlCallback; class QQuickWindow; class MobileFileDialog : public QObject { Q_OBJECT public: MobileFileDialog(QObject *parent); ~MobileFileDialog() override = default; QString title() const; void setTitle(const QString &title); bool selectMultiple() const; void setSelectMultiple(bool selectMultiple); bool selectExisting() const; void setSelectExisting(bool selectExisting); QStringList nameFilters() const; void setNameFilters(const QStringList &nameFilters); QStringList mimeTypeFilters() const; void setMimeTypeFilters(const QStringList &mimeTypeFilters); QUrl folder() const; void setFolder(const QUrl &folder); QString currentFile() const; void setCurrentFile(const QString ¤tFile); QString acceptLabel() const; void setAcceptLabel(const QString &acceptLabel); bool selectFolder() const; void setSelectFolder(bool selectFolder); QList results() const; uint exec(); Q_SIGNALS: void accepted(const QList &files); void titleChanged(); void selectMultipleChanged(); void selectExistingChanged(); void nameFiltersChanged(); void mimeTypeFiltersChanged(); void folderChanged(); void currentFileChanged(); void acceptLabelChanged(); void selectFolderChanged(); void cancel(); private: QQmlApplicationEngine *m_engine; FileChooserQmlCallback *m_callback; QList m_results; QQuickWindow *m_window; bool m_customTitleSet; };