1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 // File: QtxPathDialog.h
20 // Author: Sergey TELKOV
22 #ifndef QTXPATHDIALOG_H
23 #define QTXPATHDIALOG_H
25 #include "QtxDialog.h"
35 #pragma warning( disable:4251 )
38 class QTX_EXPORT QtxPathDialog : public QtxDialog
43 QtxPathDialog( QWidget* = 0, const bool = true, const bool = false, const int = Standard, WFlags = 0 );
46 QtxPathDialog( const bool, QWidget* = 0, const bool = true, const bool = false, const int = Standard, WFlags = 0 );
47 virtual ~QtxPathDialog();
49 QString fileName() const;
50 void setFileName( const QString&, const bool = false );
52 QString filter() const;
53 void setFilter( const QString& );
58 void fileNameChanged( QString );
65 void onReturnPressed();
66 void onTextChanged( const QString& );
69 virtual bool isValid();
70 virtual bool acceptData() const;
71 virtual void fileNameChanged( int, QString );
73 QFrame* optionsFrame();
74 QString fileName( const int ) const;
75 void setFileName( const int, const QString&, const bool = false );
77 QLineEdit* fileEntry( const int ) const;
78 QLineEdit* fileEntry( const int, int& ) const;
79 int createFileEntry( const QString&, const int, const int = -1 );
81 int defaultEntry() const;
82 void setDefaultEntry( const int );
86 QStringList prepareFilters() const;
87 bool hasVisibleChildren( QWidget* ) const;
88 QStringList filterWildCards( const QString& ) const;
89 QString autoExtension( const QString&, const QString& = QString::null ) const;
92 enum { OpenFile, SaveFile, OpenDir, SaveDir, NewDir };
95 typedef struct { int mode; QLineEdit* edit;
96 QPushButton* btn; QFileDialog* dlg; } FileEntry;
97 typedef QMap<int, FileEntry> FileEntryMap;
101 FileEntryMap myEntries;
103 QFrame* myEntriesFrame;
104 QFrame* myOptionsFrame;
108 #pragma warning( default:4251 )