FileDialog.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * FileDialog.h - declaration of class FileDialog
  3. *
  4. * Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #ifndef FILEDIALOG_H
  25. #define FILEDIALOG_H
  26. #include <QFileDialog>
  27. #include "lmms_export.h"
  28. class LMMS_EXPORT FileDialog : public QFileDialog
  29. {
  30. Q_OBJECT
  31. public:
  32. explicit FileDialog( QWidget *parent = 0, const QString &caption = QString(),
  33. const QString &directory = QString(),
  34. const QString &filter = QString() );
  35. static QString getExistingDirectory(QWidget *parent,
  36. const QString &caption,
  37. const QString &directory,
  38. QFileDialog::Options options = QFileDialog::ShowDirsOnly);
  39. static QString getOpenFileName(QWidget *parent = 0,
  40. const QString &caption = QString(),
  41. const QString &directory = QString(),
  42. const QString &filter = QString(),
  43. QString *selectedFilter = 0,
  44. QFileDialog::Options options = 0);
  45. void clearSelection();
  46. };
  47. #endif // FILEDIALOG_HPP