50
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 /* -*- mode: c++; c-basic-offset:4 -*- |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 ui/filenamerequester.h |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 This file is part of Kleopatra, the KDE keymanager |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 Copyright (c) 2007 Klarälvdalens Datakonsult AB |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 Kleopatra is free software; you can redistribute it and/or modify |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 it under the terms of the GNU General Public License as published by |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 the Free Software Foundation; either version 2 of the License, or |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 (at your option) any later version. |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 Kleopatra is distributed in the hope that it will be useful, |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 General Public License for more details. |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 along with this program; if not, write to the Free Software |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 In addition, as a special exception, the copyright holders give |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 permission to link the code of this program with any edition of |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 the Qt library by Trolltech AS, Norway (or with modified versions |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 of Qt that use the same license as Qt), and distribute linked |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 combinations including the two. You must obey the GNU General |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 Public License in all respects for all of the code used other than |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 Qt. If you modify this file, you may extend this exception to |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 your version of the file, but you are not obligated to do so. If |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 you do not wish to do so, delete this exception statement from |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 your version. |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 */ |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 #ifndef __KLEOPATRA_UI_FILENAMEREQUESTER_H__ |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 #define __KLEOPATRA_UI_FILENAMEREQUESTER_H__ |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 #include <QWidget> |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 #include <QDir> |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 class FileNameRequester : public QWidget |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 { |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 Q_OBJECT |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 Q_PROPERTY(QString fileName READ fileName WRITE setFileName) |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 Q_PROPERTY(bool existingOnly READ existingOnly WRITE setExistingOnly) |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 public: |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 explicit FileNameRequester(QWidget *parent = Q_NULLPTR); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 explicit FileNameRequester(QDir::Filters filter, QWidget *parent = Q_NULLPTR); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
48 ~FileNameRequester(); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
49 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
50 void setFileName(const QString &name); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
51 QString fileName() const; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
52 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 void setExistingOnly(bool on); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
54 bool existingOnly() const; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
55 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
56 void setFilter(QDir::Filters f); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
57 QDir::Filters filter() const; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
58 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
59 void setNameFilter(const QString &nameFilter); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
60 QString nameFilter() const; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
61 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
62 Q_SIGNALS: |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
63 void fileNameChanged(const QString &filename); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
64 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
65 private: |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
66 virtual QString requestFileName(); |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
67 |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
68 private: |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
69 class Private; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
70 Private *d; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
71 Q_PRIVATE_SLOT(d, void slotButtonClicked()) |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
72 }; |
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
73 #endif /* __KLEOPATRA_UI_FILENAMEREQUESTER_H__ */ |