digiKam
dfiledialog.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * date : 2017-07-04
7  * Description : wrapper for the QFileDialog
8  *
9  * Copyright (C) 2014-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2017 by Maik Qualmann <metzpinguin at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_DFILE_DIALOG_H
26 #define DIGIKAM_DFILE_DIALOG_H
27 
28 // Qt includes
29 
30 #include <QFileDialog>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
39 class DIGIKAM_EXPORT DFileDialog : public QFileDialog
40 {
41  Q_OBJECT
42 
43 public:
44 
45  explicit DFileDialog(QWidget* const parent,
46  Qt::WindowFlags flags);
47 
48  explicit DFileDialog(QWidget* const parent = nullptr,
49  const QString& caption = QString(),
50  const QString& directory = QString(),
51  const QString& filter = QString());
52  ~DFileDialog() override;
53 
54  static QString getExistingDirectory(QWidget* const parent = nullptr,
55  const QString& caption = QString(),
56  const QString& dir = QString(),
57  Options options = ShowDirsOnly);
58 
59  static QUrl getExistingDirectoryUrl(QWidget* const parent = nullptr,
60  const QString& caption = QString(),
61  const QUrl& dir = QUrl(),
62  Options options = ShowDirsOnly,
63  const QStringList& supportedSchemes = QStringList());
64 
65  static QString getOpenFileName(QWidget* const parent = nullptr,
66  const QString& caption = QString(),
67  const QString& dir = QString(),
68  const QString& filter = QString(),
69  QString* selectedFilter = nullptr,
70  Options options = Options());
71 
72  static QStringList getOpenFileNames(QWidget* const parent = nullptr,
73  const QString& caption = QString(),
74  const QString& dir = QString(),
75  const QString& filter = QString(),
76  QString* selectedFilter = nullptr,
77  Options options = Options());
78 
79  static QUrl getOpenFileUrl(QWidget* const parent = nullptr,
80  const QString& caption = QString(),
81  const QUrl& dir = QUrl(),
82  const QString& filter = QString(),
83  QString* selectedFilter = nullptr,
84  Options options = Options(),
85  const QStringList& supportedSchemes = QStringList());
86 
87  static QList<QUrl> getOpenFileUrls(QWidget* const parent = nullptr,
88  const QString& caption = QString(),
89  const QUrl& dir = QUrl(),
90  const QString& filter = QString(),
91  QString* selectedFilter = nullptr,
92  Options options = Options(),
93  const QStringList& supportedSchemes = QStringList());
94 
95  static QString getSaveFileName(QWidget* const parent = nullptr,
96  const QString& caption = QString(),
97  const QString& dir = QString(),
98  const QString& filter = QString(),
99  QString* selectedFilter = nullptr,
100  Options options = Options());
101 
102  static QUrl getSaveFileUrl(QWidget* const parent = nullptr,
103  const QString& caption = QString(),
104  const QUrl& dir = QUrl(),
105  const QString& filter = QString(),
106  QString* selectedFilter = nullptr,
107  Options options = Options(),
108  const QStringList& supportedSchemes = QStringList());
109 
110 private:
111 
112  static QFileDialog::Option getNativeFileDialogOption();
113 };
114 
115 } // namespace Digikam
116 
117 #endif // DIGIKAM_DFILE_DIALOG_H
Definition: dfiledialog.h:40
Definition: datefolderview.cpp:43