Salome HOME
84b7537858d160d9540de2c86ceba01d77496eb5
[modules/gui.git] / src / Qtx / QtxPathEdit.h
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // File:      QtxPathEdit.h
21 // Author:    Sergey TELKOV
22 //
23 #ifndef QTXPATHEDIT_H
24 #define QTXPATHEDIT_H
25
26 #include "Qtx.h"
27
28 #include <QFrame>
29
30 class QLineEdit;
31
32 class QTX_EXPORT QtxPathEdit : public QFrame
33 {
34   Q_OBJECT
35
36 public:
37   QtxPathEdit( const Qtx::PathType, QWidget* = 0, bool = false );
38   QtxPathEdit( QWidget* = 0, bool = false );
39   virtual ~QtxPathEdit();
40
41   QString       path() const;
42   void          setPath( const QString& );
43
44   Qtx::PathType pathType() const;
45   void          setPathType( const Qtx::PathType );
46
47   QString       pathFilter() const;
48   void          setPathFilter( const QString& );
49
50 private slots:
51   void          onBrowse( bool = false );
52
53 protected:
54   QLineEdit*    lineEdit() const;
55
56 private:
57   void          initialize();
58   void          updateState();
59
60 private:
61   QLineEdit*    myPath;
62   Qtx::PathType myType;
63   QString       myFilter;
64   bool          myBrowse;
65 };
66
67 #endif