Salome HOME
Initialisation de la base KERNEL avec la version operationnelle de KERNEL_SRC issue...
[modules/kernel.git] / src / SALOMEGUI / QAD_FileDlg.h
1 //  File      : QAD_FileDlg.h
2 //  Created   : UI team, 17.09.02
3 //  Descr     : Open/Save File dialog
4
5 //  Modified  : Tue Sep 17 11:02:12 2002
6 //  Author    : 
7 //  Project   : SALOME
8 //  Module    : SALOMEGUI
9 //  Copyright : Open CASCADE 2001
10 //  $Header$
11
12 #ifndef QAD_FILEDIALOG_H
13 #define QAD_FILEDIALOG_H
14
15 #include <qfiledialog.h>
16 #include <qcombobox.h>
17 #include "QAD.h"
18 #include "QAD_FileValidator.h"
19
20 class QAD_EXPORT QAD_FileDlg : public QFileDialog
21 {
22     Q_OBJECT
23
24 public:
25     QAD_FileDlg( QWidget* parent, bool open, bool showQuickDir = true, bool modal = true );
26     ~QAD_FileDlg();
27
28 public:    
29     bool               isOpenDlg()    const;    
30     QString            selectedFile() const;
31
32     void               setValidator( QAD_FileValidator* );
33
34     static QString     getFileName( QWidget*           parent, 
35                                     const QString&     initial, 
36                                     const QStringList& filters, 
37                                     const QString&     caption,
38                                     bool               open,
39                                     bool               showQuickDir = true,
40                                     QAD_FileValidator* validator = 0);
41     static QString     getExistingDirectory ( QWidget*       parent,
42                                               const QString& initial,
43                                               const QString& caption, 
44                                               bool           showQuickDir = true);
45 private:
46     bool               acceptData();
47     void               addExtension();
48     bool               processPath( const QString& path );
49
50 protected slots:
51     void               accept();        
52     void               reject(); 
53     void               quickDir(const QString&);
54
55 protected:
56     bool               myOpen;             /* open/save selector  */      
57     QString            mySelectedFile;     /* selected filename   */    
58     QAD_FileValidator* myValidator;        /* file validator      */
59     static QString     myLastVisitedPath;  /* last visited path   */
60     QComboBox*         myQuickCombo;       /* quick dir combo box */
61
62 };
63
64 #endif