Salome HOME
#1071 - sketch validation problem
[modules/shaper.git] / src / ModuleBase / ModuleBase_IModule.h
old mode 100644 (file)
new mode 100755 (executable)
index 327bb42..de02c0d
@@ -23,7 +23,6 @@ class Config_WidgetAPI;
 class ModuleBase_ModelWidget;\r
 class ModuleBase_Operation;\r
 class ModuleBase_IWorkshop;\r
-class ModuleBase_IDocumentDataModel;\r
 \r
 /**\r
  * \ingroup GUI\r
@@ -40,10 +39,10 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
 \r
   virtual ~ModuleBase_IModule() {}\r
 \r
-  // Add default selection filters of the module to the current viewer\r
+  /// Add default selection filters of the module to the current viewer\r
   virtual void activateSelectionFilters() {};\r
 \r
-  // Remove default selection filters of the module from the current viewer\r
+  /// Remove default selection filters of the module from the current viewer\r
   virtual void deactivateSelectionFilters() {};\r
 \r
   /// Reads description of features from XML file \r
@@ -62,24 +61,23 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
 \r
   /// Realizes some functionality by an operation start\r
   /// \param theOperation a started operation\r
-  virtual void onOperationStarted(ModuleBase_Operation* theOperation) {}\r
+  virtual void operationStarted(ModuleBase_Operation* theOperation) {}\r
 \r
   /// Realizes some functionality by an operation resume\r
   /// By default it emits operationResumed signal\r
   /// \param theOperation a resumed operation\r
-  virtual void onOperationResumed(ModuleBase_Operation* theOperation);\r
+  virtual void operationResumed(ModuleBase_Operation* theOperation);\r
 \r
   /// Realizes some functionality by an operation stop\r
-  virtual void onOperationStopped(ModuleBase_Operation* theOperation) {}\r
+  virtual void operationStopped(ModuleBase_Operation* theOperation) {}\r
 \r
   /// Realizes some functionality by an operation commit\r
-  virtual void onOperationCommitted(ModuleBase_Operation* theOperation) {}\r
+  virtual void operationCommitted(ModuleBase_Operation* theOperation) {}\r
 \r
   /// Realizes some functionality by an operation abort\r
-  virtual void onOperationAborted(ModuleBase_Operation* theOperation) {}\r
+  virtual void operationAborted(ModuleBase_Operation* theOperation) {}\r
 \r
   /// Realizes some functionality by an operation start\r
-  /// \param theOperation a started operation\r
   virtual ModuleBase_Operation* currentOperation() const = 0;\r
 \r
   /// Add menu items for viewer into the given menu\r
@@ -92,21 +90,20 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theMenu a popup menu to be shown in the object browser\r
   virtual void addObjectBrowserMenu(QMenu* theMenu) const {};\r
 \r
-  /// Called when it is necessary to update a command state (enable or disable it)\r
-  //virtual bool isFeatureEnabled(const QString& theCmdId) const = 0;\r
-\r
   /// Creates custom widgets for property panel\r
   /// \param theType a type of widget\r
   /// \param theParent the parent object\r
   /// \param theWidgetApi the widget configuration. The attribute of the model widget is obtained from\r
   /// \param theParentId is Id of a parent of the current attribute\r
-  /// \param theModelWidgets list of widget objects\r
   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent,\r
                                       Config_WidgetAPI* theWidgetApi, std::string theParentId)\r
   {\r
     return 0;\r
   }\r
 \r
+  /// Returns the active widget, by default it is the property panel active widget\r
+  virtual ModuleBase_ModelWidget* activeWidget() const = 0;\r
+\r
   /// Returns current workshop\r
   ModuleBase_IWorkshop* workshop() const { return myWorkshop; }\r
 \r
@@ -128,7 +125,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
 \r
   /// Returns True if the current operation can be committed. By default it is true.\r
   /// \return a boolean value\r
-  virtual bool canCommitOperation() const;\r
+  //virtual bool canCommitOperation() const;\r
 \r
   /// Returns whether the object can be erased. The default realization returns true.\r
   /// \param theObject a model object\r
@@ -147,11 +144,6 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \returns true if the action is processed\r
   virtual bool deleteObjects() { return false; };\r
 \r
-#ifdef ModuleDataModel\r
-  /// Returns data model object for representation of data tree in Object browser\r
-  virtual ModuleBase_IDocumentDataModel* dataModel() const = 0;\r
-#endif\r
-\r
   /// Performs functionality on closing document\r
   virtual void closeDocument() = 0;\r
 \r
@@ -197,12 +189,31 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   //! Returns the feature error if the current state of the feature in the module is not correct\r
   //! If the feature is correct, it returns an empty value\r
   //! \return string value\r
-  virtual QString getFeatureError(const FeaturePtr& theFeature);\r
+  virtual QString getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI = true);\r
+\r
+  /// Returns list of granted operation indices\r
+  virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const;\r
+\r
+  /// Connects or disconnects to the value changed signal of the property panel widgets\r
+  /// \param theWidget a property contol widget\r
+  /// \param isToConnect a boolean value whether connect or disconnect\r
+  virtual void connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect) {};\r
+\r
+  /// Validates the operation to change the "Apply" button state.\r
+  /// \param thePreviousState the previous state of the widget\r
+  virtual void widgetStateChanged(int thePreviousState) {};\r
+\r
+  /// Returns true if the event is processed.\r
+  /// \param thePreviousAttributeID an index of the previous active attribute\r
+  virtual bool processEnter(const std::string& thePreviousAttributeID) { return false; };\r
 \r
 signals:\r
+  /// Signal which is emitted when operation is launched\r
   void operationLaunched();\r
 \r
-  void operationResumed(ModuleBase_Operation* theOp);\r
+  /// Segnal emitted when an operation is resumed\r
+  /// \param theOp a resumed operation\r
+  void resumed(ModuleBase_Operation* theOp);\r
 \r
 public slots:\r
   /// Called on call of command corresponded to a feature\r