Salome HOME
Architecture changes
[modules/shaper.git] / src / ModuleBase / ModuleBase_IPropertyPanel.h
index 224691890ed8d4eae59f5a69f6e87e5c72337053..afafce7a756ce91ae5cf7506d52d0b16f3b3691b 100644 (file)
@@ -18,6 +18,7 @@
 class ModuleBase_ModelWidget;
 
 /**
+* \ingroup GUI
 * A class for Property panel object definition
 */
 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
@@ -26,7 +27,10 @@ Q_OBJECT
 public:
   /// Constructor
   /// \param theParent is a parent of the property panel
-  ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent), myIsEditing(false) {}
+  ModuleBase_IPropertyPanel(QWidget* theParent);
+
+  /// Returns header widget
+  virtual QWidget* headerWidget() const = 0;
 
   /// Returns currently active widget
   virtual ModuleBase_ModelWidget* activeWidget() const = 0;
@@ -34,6 +38,9 @@ public:
   /// Returns all property panel's widget created by WidgetFactory
   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
 
+  /// Removes all widgets in the widget area of the property panel
+  virtual void cleanContent() = 0;
+
   /// Editing mode depends on mode of current operation. This value is defined by it.
   /// \param isEditing state of editing mode flag
   virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
@@ -41,12 +48,8 @@ public:
   /// \return State of editing mode flag
   bool isEditingMode() const { return myIsEditing; }
 
-  /// Set Enable/Disable state of Ok button
-  /// \param theEnabled Enable/Disable state of Ok button
-  virtual void setOkEnabled(bool theEnabled) = 0;
-
-  /// \return Enable/disable state of Ok button
-  virtual bool isOkEnabled() const = 0;
+  /// Set focus on the Ok button
+  virtual void setFocusOnOkButton() = 0;
 
   /// Set Enable/Disable state of Cancel button
   /// \param theEnabled Enable/Disable state of Cancel button
@@ -55,6 +58,21 @@ public:
   /// \return Enable/Disable state of Cancel button
   virtual bool isCancelEnabled() const = 0;
 
+  /// Returns widget processed by preselection
+  virtual ModuleBase_ModelWidget* preselectionWidget() const = 0;
+
+  /// Sets widget processed by preselection
+  virtual void setPreselectionWidget(ModuleBase_ModelWidget* theWidget) = 0;
+
+  /// Returns the first widget, where canSetValue returns true 
+  /// \return a widget or null
+  ModuleBase_ModelWidget* findFirstAcceptingValueWidget();
+
+  /// Returns the first widget, where canSetValue returns true 
+  /// \return a widget or null
+  static ModuleBase_ModelWidget* findFirstAcceptingValueWidget(
+                          const QList<ModuleBase_ModelWidget*>& theWidgets);
+
 signals:
   /// The signal about key release on the control, that corresponds to the attribute
   /// \param theEvent key release event
@@ -69,7 +87,8 @@ signals:
   void widgetActivated(ModuleBase_ModelWidget* theWidget);
 
   /// Emited when there is no next widget
-  void noMoreWidgets();
+  /// \param thePreviousAttributeID an attribute key of the previous active widget
+  void noMoreWidgets(const std::string& thePreviousAttributeID);
 
 public slots:
   /// Activate the next widget in the property panel