]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_WidgetLineEdit.h
Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetLineEdit.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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<mailto:webmaster.salome@opencascade.com>
18 //
19
20 /*
21  * ModuleBase_WidgetLineEdit.h
22  *
23  *  Created on: Oct 8, 2014
24  *      Author: sbh
25  */
26
27 #ifndef MODULEBASE_WIDGETLINEEDIT_H_
28 #define MODULEBASE_WIDGETLINEEDIT_H_
29
30 #include <ModuleBase.h>
31 #include <ModuleBase_ModelWidget.h>
32
33 #include <QList>
34 #include <QString>
35 #include <QStringList>
36
37 class QWidget;
38 class QLineEdit;
39
40 /**
41 * \ingroup GUI
42 * Implementation of model widget for line edit widget.
43 * It can be defined with "stringvalue" keyword.
44 */
45 class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidget
46 {
47   Q_OBJECT
48  public:
49   /// Constructor
50   /// \param theParent the parent object
51   /// \param theData the widget configuration.
52   /// \param thePlaceHolder a string of placeholder
53   ModuleBase_WidgetLineEdit( QWidget* theParent,
54                              const Config_WidgetAPI* theData,
55                              const std::string& thePlaceHolder );
56   virtual ~ModuleBase_WidgetLineEdit();
57
58   /// Redefinition of virtual method
59   virtual QList<QWidget*> getControls() const;
60
61   /// Returns true if the event is processed.
62   virtual bool processEnter();
63
64 protected:
65   /// Saves the internal parameters to the given feature
66   /// \return True in success
67   virtual bool storeValueCustom();
68
69   /// Redefinition of virtual method
70   virtual bool restoreValueCustom();
71
72 private:
73    /// A line edit control
74   QLineEdit* myLineEdit;
75 };
76
77 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */