1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : QAD_FileDlg.h
12 #ifndef QAD_FILEDIALOG_H
13 #define QAD_FILEDIALOG_H
15 #include <qcombobox.h>
16 #include <qpushbutton.h>
18 // VSR (18/01/2005): use patched QFileDialog only for the official 3.0.5 version of Qt
19 #if QT_VERSION == 0x030005
20 #include <qfiledialogP.h>
22 #include <qfiledialog.h>
23 #define QFileDialogP QFileDialog
27 #include "QAD_FileValidator.h"
29 class QAD_EXPORT QAD_FileDlg : public QFileDialogP
34 QAD_FileDlg( QWidget* parent, bool open, bool showQuickDir = true, bool modal = true );
35 virtual ~QAD_FileDlg();
38 bool isOpenDlg() const;
39 QString selectedFile() const;
41 void setValidator( QAD_FileValidator* );
43 static QString getFileName( QWidget* parent,
44 const QString& initial,
45 const QStringList& filters,
46 const QString& caption,
48 bool showQuickDir = true,
49 QAD_FileValidator* validator = 0);
50 static QStringList getOpenFileNames( QWidget* parent,
51 const QString& initial,
52 const QStringList& filters,
53 const QString& caption,
54 bool showQuickDir = true,
55 QAD_FileValidator* validator = 0);
56 static QString getExistingDirectory ( QWidget* parent,
57 const QString& initial,
58 const QString& caption,
59 bool showQuickDir = true);
62 virtual bool acceptData();
66 bool processPath( const QString& path );
71 void quickDir(const QString&);
75 bool myOpen; /* open/save selector */
76 QString mySelectedFile; /* selected filename */
77 QAD_FileValidator* myValidator; /* file validator */
78 static QString myLastVisitedPath; /* last visited path */
79 QComboBox* myQuickCombo; /* quick dir combo box */
80 QPushButton* myQuickButton; /* quick dir add button */