Salome HOME
Replace boost::shared_ptr<ModelAPI_Feature> on FeaturePtr
[modules/shaper.git] / src / ModuleBase / ModuleBase_ModelWidget.h
index a684515a39e8d46b67cb742a520e7e80892cbe71..ff9b6da8840cf2b899614fa3d5086d83e244aed5 100644 (file)
@@ -7,11 +7,14 @@
 
 #include <ModuleBase.h>
 
+#include <ModelAPI_Feature.h>
+
 #include <QObject>
 
 #include <boost/shared_ptr.hpp>
 
 class ModelAPI_Feature;
+class QKeyEvent;
 
 /**\class ModuleBase_ModelWidget
  * \brief An abstract custom widget class. This class realization is assumed to create some controls.
@@ -33,14 +36,28 @@ public:
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  virtual bool storeValue(FeaturePtr theFeature) = 0;
+
+  virtual bool restoreValue(FeaturePtr theFeature) = 0;
+
+  /// Returns whether the widget can accept focus, or if it corresponds to the given attribute
+  /// \param theAttribute name
+  virtual bool canFocusTo(const std::string& theAttributeName) = 0;
 
-  virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  /// Set focus to the current widget if it corresponds to the given attribute
+  virtual void focusTo() = 0;
 
+  /// Returns list of widget controls
+  /// \return a control list
+  virtual QList<QWidget*> getControls() const = 0;
 
 signals:
   /// The signal about widget values changed
   void valuesChanged();
+  /// The signal about key release on the control, that corresponds to the attribute
+  /// \param theAttributeName a name of the attribute
+  /// \param theEvent key release event
+  void keyReleased(const std::string& theAttributeName, QKeyEvent* theEvent);
 };
 
 #endif