1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SUIT_FileDlg.h
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 #ifndef SUIT_FILEDLG_H
26 #define SUIT_FILEDLG_H
30 #include <QFileDialog>
36 class SUIT_FileValidator;
38 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
43 SUIT_FileDlg( QWidget*, bool, bool = true, bool = true );
44 virtual ~SUIT_FileDlg();
46 bool isOpenDlg() const;
48 bool checkPermissions() const;
49 void setCheckPermissions( const bool );
51 SUIT_FileValidator* validator() const;
52 void setValidator( SUIT_FileValidator* );
54 bool addWidgets( QWidget*, QWidget*, QWidget* );
56 QStringList selectedFiles() const;
57 QString selectedFile() const;
59 void selectFile( const QString& );
61 static QString getLastVisitedDirectory();
63 static QString getFileName( QWidget*,
66 const QString& = QString(),
69 SUIT_FileValidator* = 0 );
70 static QString getFileName( QWidget*,
73 const QString& = QString(),
76 SUIT_FileValidator* = 0 );
78 static QStringList getOpenFileNames( QWidget*,
81 const QString& = QString(),
83 SUIT_FileValidator* = 0 );
84 static QStringList getOpenFileNames( QWidget*,
87 const QString& = QString(),
89 SUIT_FileValidator* = 0 );
91 static QString getExistingDirectory( QWidget*,
93 const QString& = QString(),
95 SUIT_FileValidator* = 0 );
97 static QString getLastVisitedPath();
100 virtual bool event( QEvent* );
101 QLineEdit* lineEdit() const;
102 virtual bool acceptData();
103 QString addExtension( const QString& ) const;
104 bool processPath( const QString& );
105 void addFilter( const QString& );
106 static bool hasWildCards( const QString& );
110 void quickDir( const QString& );
117 SUIT_FileValidator* myValidator; //!< file validator
118 QLabel* myQuickLab; //!< quick dir combo box
119 QComboBox* myQuickCombo; //!< quick dir combo box
120 QPushButton* myQuickButton; //!< quick dir add button
121 bool myCheckPermissions; //!< check permissions option
122 static QString myLastVisitedPath; //!< last visited path
125 #endif // SUIT_FILEDLG_H