NCL Composer  0.1.5
 All Classes Functions Variables Pages
FileChooser.h
1 /*
2  * Copyright 2011 TeleMidia/PUC-Rio.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see
16  * <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef FILECHOOSER_H
20 #define FILECHOOSER_H
21 
22 #include <QWidget>
23 
24 namespace Ui {
25  class FileChooser;
26 }
27 
28 class FileChooser : public QWidget
29 {
30  Q_OBJECT
31  Q_ENUMS(FILECHOOSER_TYPE)
32 
33 public:
34  enum FILECHOOSER_TYPE { OPEN_FILENAME, SAVE_FILENAME, GET_EXISTINGDIRECTORY, OPEN_FILENAMES };
35 
36  explicit FileChooser(const QString &label,
37  FileChooser::FILECHOOSER_TYPE fctype,
38  const QString &caption = "",
39  const QString &filter = "",
40  QWidget *parent = 0);
41  ~FileChooser();
42 
43  QString getText();
44  void setText(const QString &value);
45 
46 private slots:
47  void on_pushButton_pressed();
48 
49 private:
50  FILECHOOSER_TYPE fctype;
51  QString filter, caption;
52  Ui::FileChooser *ui;
53 };
54 
55 #endif // FILECHOOSER_H