Salome HOME
Issue #720:Set cursor at the same position at editing of text in spin box
[modules/shaper.git] / src / ModuleBase / ModuleBase_IPropertyPanel.h
index fdac20d135efb252e1fbd54b82a3ac17938d5fc5..59c2f8435a90b9500e244080227644b642348edb 100644 (file)
 
 class ModuleBase_ModelWidget;
 
+/**
+* \ingroup GUI
+* A class for Property panel object definition
+*/
 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
 {
 Q_OBJECT
 public:
+  /// Constructor
+  /// \param theParent is a parent of the property panel
   ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent), myIsEditing(false) {}
 
   /// Returns currently active widget
@@ -29,27 +35,38 @@ public:
   /// Returns all property panel's widget created by WidgetFactory
   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
 
-  /// Editing mode depends on mode of current operation. This value is defined by it.
-  void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
-  bool isEditingMode() const { return myIsEditing; }
+  /// Removes all widgets in the widget area of the property panel
+  virtual void cleanContent() = 0;
 
-  /// Set Enable/Disable state of Ok button
-  virtual void setOkEnabled(bool theEnabled) = 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; }
 
-  /// Returns state of Ok button
-  virtual bool isOkEnabled() const = 0;
+  /// \return State of editing mode flag
+  bool isEditingMode() const { return myIsEditing; }
 
-  /// Set Enable/Disable state of Ok button
+  /// Set Enable/Disable state of Cancel button
+  /// \param theEnabled Enable/Disable state of Cancel button
   virtual void setCancelEnabled(bool theEnabled) = 0;
 
-  /// Returns state of Ok button
+  /// \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;
+
 signals:
   /// The signal about key release on the control, that corresponds to the attribute
   /// \param theEvent key release event
   void keyReleased(QKeyEvent* theEvent);
 
+  /// The signal about the widget activation
+  /// \param theWidget the activated widget
+  void beforeWidgetActivated(ModuleBase_ModelWidget* theWidget);
+
   /// The signal about the widget activation
   /// \param theWidget the activated widget
   void widgetActivated(ModuleBase_ModelWidget* theWidget);
@@ -65,12 +82,17 @@ public slots:
   /// Activate the next from current widget in the property panel
   virtual void activateNextWidget() = 0;
 
-  // Makes the given widget active, highlights it and removes
-  // highlighting from the previous active widget
-  // emits widgetActivated(theWidget) signal
+  /**
+  * Makes the given widget active, highlights it and removes
+  * highlighting from the previous active widget
+  * emits widgetActivated(theWidget) signal
+  * \param theWidget which has to be activated
+  */
   virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
 
 protected:
+
+  /// Flag which shows that current operation is in editing mode
   bool myIsEditing;
 };