Salome HOME
Issue #2998: Add help description for automatic creation of constraints
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidator.h
old mode 100755 (executable)
new mode 100644 (file)
index cb62c11..778ae77
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  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
 //
 // 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
+// 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>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetValidator_H_
 #define ModuleBase_WidgetValidator_H_
 
-#include <ModuleBase.h>
+#include "ModuleBase.h"
+
+#include "ModuleBase_Definitions.h"
+
+#include <SelectMgr_ListOfFilter.hxx>
 
 #include <QList>
 #include <memory>
@@ -47,6 +50,17 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidator
                              ModuleBase_IWorkshop* theWorkshop);
   virtual ~ModuleBase_WidgetValidator();
 
+  /// Fills given container with selection modes if the widget has it
+  /// \param [out] theModuleSelectionModes module additional modes, -1 means all default modes
+  /// \param theModes [out] a container of modes
+  virtual void selectionModes(int& theModuleSelectionModes, QIntList& theModes) {}
+
+  /// Appends into container of workshop selection filters
+  /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
+  /// \param [out] selection filters
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
+                                SelectMgr_ListOfFilter& theSelectionFilters);
+
   /// Returns true if the validation is activated
   bool isInValidate() const { return myIsInValidate; }
 
@@ -58,11 +72,6 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidator
   /// \return a boolean value
   virtual bool isValidSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
 
-  /// It obtains selection filters from the workshop and activates them in the active viewer
-  /// \param toActivate a flag about activation or deactivation the filters
-  /// \return true if the selection filter of the widget is activated in viewer context
-  bool activateFilters(const bool toActivate);
-
     /// Creates a backup of the current values of the attribute
   /// It should be realized in the specific widget because of different
   /// parameters of the current attribute
@@ -82,14 +91,14 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidator
   /// \return true if all validators return that the attribute is valid
   bool isValidAttribute(const std::shared_ptr<ModelAPI_Attribute>& theAttribute) const;
 
+  //! Clear all validated cash in the widget
+  void clearValidatedCash();
+
 private:
   /// Returns true if the workshop validator filter has been already activated
   /// \return boolean value
   bool isFilterActivated() const;
 
-  //! Clear all validated cash in the widget
-  void clearValidatedCash();
-
   /// Gets the validity state of the presentation in an internal map.
   /// Returns true if the valid state of value is stored
   /// \param theValue a viewer presentation