Salome HOME
9d0246c1156fa3b3043c85001e6706ca6b9d8ad2
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetBoolValue.h
1 // File:        ModuleBase_WidgetBoolValue.h
2 // Created:     04 June 2014
3 // Author:      Vitaly Smetannikov
4
5 #ifndef ModuleBase_WidgetBoolValue_H
6 #define ModuleBase_WidgetBoolValue_H
7
8 #include "ModuleBase.h"
9 #include "ModuleBase_ModelWidget.h"
10
11 class Config_WidgetAPI;
12 class QWidget;
13 class QCheckBox;
14
15 class MODULEBASE_EXPORT ModuleBase_WidgetBoolValue : public ModuleBase_ModelWidget
16 {
17 Q_OBJECT
18  public:
19   /// Constructor
20   /// \theParent the parent object
21   /// \theData the widget configuation. The attribute of the model widget is obtained from
22   ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData,
23                              const std::string& theParentId);
24
25   virtual ~ModuleBase_WidgetBoolValue();
26
27   /// Saves the internal parameters to the given feature
28   /// \param theObject a model feature to be changed
29   virtual bool storeValue() const;
30
31   virtual bool restoreValue();
32
33   /// Returns list of widget controls
34   /// \return a control list
35   virtual QList<QWidget*> getControls() const;
36
37   /// Returns the internal parent wiget control, that can be shown anywhere
38   /// \returns the widget
39   QWidget* getControl() const;
40
41  private:
42   QCheckBox* myCheckBox;
43 };
44
45 #endif