umbrello  2.31.90
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
umlfiledialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2003-2020 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef UMLFILEDIALOG_H
12 #define UMLFILEDIALOG_H
13 
14 #include <QtGlobal>
15 
16 #if QT_VERSION >= 0x050000
17 #include <QFileDialog>
18 #else
19 #include <kfiledialog.h>
20 #endif
21 
31 class UMLFileDialog : public QObject
32 {
33  Q_OBJECT
34 public:
35 #if QT_VERSION >= 0x050000
36  UMLFileDialog(const QUrl &startDir, const QString &filter, QWidget *parent, QWidget *widget=0);
37 #else
38  UMLFileDialog(const KUrl &startDir, const QString &filter, QWidget *parent, QWidget *widget=0);
39 #endif
41 
42  int exec();
43  void setCaption(const QString &caption);
44 #if QT_VERSION >= 0x050000
45  void setAcceptMode(QFileDialog::AcceptMode mode);
46  void setMimeTypeFilters(const QStringList &filters);
47 
48  void selectUrl(const QUrl &url);
49  void setUrl(const QUrl &url);
50  QUrl selectedUrl();
51 #else
52  void setOperationMode(KFileDialog::OperationMode mode);
53  void setUrl(const KUrl &url, bool clearforward=true);
54  KUrl selectedUrl();
55 #endif
56  void setSelection(const QString &name);
57 
58 #if QT_VERSION < 0x050000
59  void setMimeFilter(const QStringList &types, const QString &defaultType=QString());
60  QString currentMimeFilter();
61 #endif
62 
63 protected:
64 #if QT_VERSION >= 0x050000
65  QFileDialog *m_dialog;
66 #else
67  KFileDialog *m_dialog;
68 #endif
69 };
70 
71 #endif
Definition: umlfiledialog.h:32
QString currentMimeFilter()
return the mime type of the selected file
Definition: umlfiledialog.cpp:148
KFileDialog * m_dialog
Definition: umlfiledialog.h:67
void setMimeFilter(const QStringList &types, const QString &defaultType=QString())
Definition: umlfiledialog.cpp:134
void setOperationMode(KFileDialog::OperationMode mode)
Definition: umlfiledialog.cpp:114
void setSelection(const QString &name)
Definition: umlfiledialog.cpp:129
~UMLFileDialog()
Definition: umlfiledialog.cpp:58
void setUrl(const KUrl &url, bool clearforward=true)
Definition: umlfiledialog.cpp:119
void setCaption(const QString &caption)
Definition: umlfiledialog.cpp:109
int exec()
Definition: umlfiledialog.cpp:63
UMLFileDialog(const KUrl &startDir, const QString &filter, QWidget *parent, QWidget *widget=0)
Definition: umlfiledialog.cpp:51
KUrl selectedUrl()
Definition: umlfiledialog.cpp:124
Definition: types.py:1