Salome HOME
Provide selection synchronisation
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFeature.h
index a429421f0b3c01ef0666edc3c91ea4f6ce0343b0..8cfd499a62a3bbf2ebd5ddf721c1873e04f3c9c7 100644 (file)
 #include <QObject>
 #include <QStringList>
 
+class ModuleBase_WidgetValue;
 class ModelAPI_Feature;
+class QWidget;
+class QLabel;
+class QLineEdit;
 
 /**\class ModuleBase_WidgetFeature
  * \ingroup GUI
@@ -29,15 +33,16 @@ public:
   /// Destructor
   virtual ~ModuleBase_WidgetFeature();
 
-  /// Fill the widget values by given point
-  /// \param thePoint the point
-  bool setFeature(const FeaturePtr& theFeature);
+  /// Set the given wrapped value to the current widget
+  /// This value should be processed in the widget according to the needs
+  /// \param theValue the wrapped widget value
+  virtual bool setValue(ModuleBase_WidgetValue* theValue);
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual bool storeValue(FeaturePtr theFeature) const;
+  virtual bool storeValue(ObjectPtr theObject) const;
 
-  virtual bool restoreValue(FeaturePtr theFeature);
+  virtual bool restoreValue(ObjectPtr theObject);
 
   /// Returns the internal parent wiget control, that can be shown anywhere
   /// \returns the widget
@@ -47,9 +52,31 @@ public:
   /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
+protected:
+  /// Fill the widget values by given point
+  /// \param thePoint the point
+  /// \return the boolean result of the feature set
+  bool setObject(const ObjectPtr& theObject);
+
+  /// Returns current widget feature
+  /// \return the feature
+  const ObjectPtr object() const { return myObject; }
+
+  /// Returns the widget editor
+  /// \return the editor
+  QLineEdit* editor() const { return myEditor; }
+
+  /// Returns the possible feature kinds
+  /// \return the list of kinds
+  const QStringList& featureKinds() const { return myObjectKinds; }
+
 private:
-  FeaturePtr myFeature; ///< the current widget feature
-  QStringList myFeatureKinds; ///< the kinds of possible features
+  ObjectPtr myObject; ///< the current widget feature
+  QStringList myObjectKinds; ///< the kinds of possible features
+
+  QWidget*   myContainer; /// the parent top control
+  QLabel*    myLabel; /// the editor information label
+  QLineEdit* myEditor; ///< the feature editor to visualize the feature name
 };
 
 #endif