1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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
23 // File : SUIT_FileDlg.h
24 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
26 #ifndef SUIT_FILEDLG_H
27 #define SUIT_FILEDLG_H
31 #include <QFileDialog>
38 class SUIT_FileValidator;
40 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
45 SUIT_FileDlg( QWidget*, bool, bool = true, bool = true );
46 virtual ~SUIT_FileDlg();
48 bool isOpenDlg() const;
50 bool checkPermissions() const;
51 void setCheckPermissions( const bool );
53 SUIT_FileValidator* validator() const;
54 void setValidator( SUIT_FileValidator* );
56 bool addWidgets( QWidget*, QWidget*, QWidget* );
58 QStringList selectedFiles() const;
59 QString selectedFile() const;
61 void selectFile( const QString& );
63 static QString getLastVisitedDirectory();
65 static QString getFileName( QWidget*,
68 const QString& = QString(),
71 SUIT_FileValidator* = 0 );
72 static QString getFileName( QWidget*,
75 const QString& = QString(),
78 SUIT_FileValidator* = 0 );
80 static QStringList getOpenFileNames( QWidget*,
83 const QString& = QString(),
85 SUIT_FileValidator* = 0 );
86 static QStringList getOpenFileNames( QWidget*,
89 const QString& = QString(),
91 SUIT_FileValidator* = 0 );
93 static QString getExistingDirectory( QWidget*,
95 const QString& = QString(),
97 SUIT_FileValidator* = 0 );
99 static QString getLastVisitedPath();
102 virtual bool event( QEvent* );
103 QLineEdit* lineEdit() const;
104 virtual bool acceptData();
105 QString addExtension( const QString& ) const;
106 bool processPath( const QString& );
107 void addFilter( const QString& );
108 static bool hasWildCards( const QString& );
112 void quickDir( const QString& );
119 SUIT_FileValidator* myValidator; //!< file validator
120 QLabel* myQuickLab; //!< quick dir combo box
121 QComboBox* myQuickCombo; //!< quick dir combo box
122 QList<QUrl> myUrls; //!< quick dir Sidebar Urls
123 QPushButton* myQuickButton; //!< quick dir add button
124 bool myCheckPermissions; //!< check permissions option
125 static QString myLastVisitedPath; //!< last visited path
128 #endif // SUIT_FILEDLG_H