Salome HOME
SMH: Fix for compilation with correct CASCADE
[modules/gui.git] / src / SUIT / SUIT_FileDlg.h
1 #ifndef SUIT_FILEDIALOG_H
2 #define SUIT_FILEDIALOG_H
3
4 #include "SUIT.h"
5
6 #include <qcombobox.h>
7 #include <qfiledialog.h>
8
9 class SUIT_ResourceMgr;
10 class SUIT_FileValidator;
11
12 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
13 {
14   Q_OBJECT
15
16 public:
17   SUIT_FileDlg( QWidget*, bool open, bool showQuickDir = true, bool modal = true );
18   virtual ~SUIT_FileDlg();
19
20 public:    
21   bool                isOpenDlg()    const;    
22   QString             selectedFile() const;
23
24   void                setValidator( SUIT_FileValidator* );
25
26   static QString      getFileName( QWidget* parent, const QString& initial, const QStringList& filters, 
27                                                            const QString& caption, bool open, bool showQuickDir = true,
28                                    SUIT_FileValidator* validator = 0 );
29   static QString      getExistingDirectory( QWidget* parent, const QString& initial,
30                                             const QString& caption, bool showQuickDir = true );
31
32 private:
33   bool                acceptData();
34   void                addExtension();
35   bool                processPath( const QString& path );
36
37 protected slots:
38   void                accept();        
39   void                reject(); 
40   void                quickDir( const QString& );
41
42 protected:
43   bool                myOpen;             /* open/save selector  */      
44   QString             mySelectedFile;     /* selected filename   */    
45   SUIT_FileValidator* myValidator;        /* file validator      */
46   QComboBox*          myQuickCombo;       /* quick dir combo box */
47
48   static QString      myLastVisitedPath;  /* last visited path   */
49 };
50
51 #endif