File indexing completed on 2024-11-24 05:00:54

0001 /*  This file is part of the KDE libraries
0002     SPDX-FileCopyrightText: 2013 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef KDEPLATFORMFILEDIALOGBASE_H
0008 #define KDEPLATFORMFILEDIALOGBASE_H
0009 
0010 #include <QDialog>
0011 #include <QUrl>
0012 
0013 class QDialogButtonBox;
0014 class KDEPlatformFileDialogBase : public QDialog
0015 {
0016     Q_OBJECT
0017 public:
0018     friend class KDEPlatformFileDialogHelper;
0019 
0020     explicit KDEPlatformFileDialogBase();
0021     virtual QUrl directory() = 0;
0022     virtual void selectMimeTypeFilter(const QString &filter) = 0;
0023     virtual void selectNameFilter(const QString &filter) = 0;
0024     virtual void setDirectory(const QUrl &directory) = 0;
0025     virtual void selectFile(const QUrl &filename) = 0;
0026     virtual QString selectedMimeTypeFilter() = 0;
0027     virtual QString selectedNameFilter() = 0;
0028     virtual QString currentFilterText() = 0;
0029     virtual QList<QUrl> selectedFiles() = 0;
0030 
0031 Q_SIGNALS:
0032     void closed();
0033     void fileSelected(const QUrl &file);
0034     void filesSelected(const QList<QUrl> &files);
0035     void currentChanged(const QUrl &path);
0036     void directoryEntered(const QUrl &directory);
0037     void filterSelected(const QString &filter);
0038 
0039 protected:
0040     void closeEvent(QCloseEvent *e) override;
0041     QDialogButtonBox *m_buttons = nullptr;
0042 };
0043 
0044 #endif