Salome HOME
Issue #2615 : EDF 2018-3 Sub-results states
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetBoolValue.h
index 17c5a68498b1bdec2e02b237216c4acb040a980c..36b3b62ef2704d8235aae5026b11fe3f65575383 100644 (file)
@@ -1,6 +1,22 @@
-// File:        ModuleBase_WidgetBoolValue.h
-// Created:     04 June 2014
-// Author:      Vitaly Smetannikov
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef ModuleBase_WidgetBoolValue_H
 #define ModuleBase_WidgetBoolValue_H
@@ -12,33 +28,39 @@ class Config_WidgetAPI;
 class QWidget;
 class QCheckBox;
 
-class MODULEBASE_EXPORT ModuleBase_WidgetBoolValue: public ModuleBase_ModelWidget
+/**
+* \ingroup GUI
+* Implementation of widget for boolean input (check box)
+*/ 
+class MODULEBASE_EXPORT ModuleBase_WidgetBoolValue : public ModuleBase_ModelWidget
 {
-  Q_OBJECT
-public:
+Q_OBJECT
+ public:
   /// Constructor
-  /// \theParent the parent object
-  /// \theData the widget configuation. The attribute of the model widget is obtained from
-  ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData, const std::string& theParentId);
+  /// \param theParent the parent object
+  /// \param theData the widget configuation. The attribute of the model widget is obtained from
+  ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData);
 
   virtual ~ModuleBase_WidgetBoolValue();
 
-  /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
-  virtual bool storeValue(ObjectPtr theObject) const;
-
-  virtual bool restoreValue(ObjectPtr theObject);
+  virtual bool canAcceptFocus() const { return false; };
 
-  /// Returns list of widget controls
-  /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
-  /// Returns the internal parent wiget control, that can be shown anywhere
-  /// \returns the widget
-  QWidget* getControl() const;
+  virtual void setHighlighted(bool isHighlighted);
+
+protected:
+  /// Saves the internal parameters to the given feature
+  /// \return True in success
+  virtual bool storeValueCustom();
+
+  virtual bool restoreValueCustom();
 
-private:
+ private:
+   /// The check box
   QCheckBox* myCheckBox;
+
+  bool myDefVal;
 };
 
-#endif
\ No newline at end of file
+#endif