Salome HOME
Merge branch 'Dev_1.2.0' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_IModule.h
index c7cd377cc26d7c778d5c7f7e15f980043aa4fb01..6ae486f6c72c7d8c8170be9716eb25773d2ef48e 100644 (file)
@@ -10,6 +10,7 @@
 \r
 #include <QString>\r
 #include <QObject>\r
+#include <QMap>\r
 \r
 #include <string>\r
 #include <map>\r
@@ -22,6 +23,7 @@ class Config_WidgetAPI;
 class ModuleBase_ModelWidget;\r
 class ModuleBase_Operation;\r
 class ModuleBase_IWorkshop;\r
+class ModuleBase_IDocumentDataModel;\r
 \r
 /**\r
  * \ingroup GUI\r
@@ -75,11 +77,13 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
 \r
   /// Add menu atems for viewer into the given menu\r
   /// \param theMenu a popup menu to be shown in the viewer\r
-  virtual void addViewerItems(QMenu* theMenu) const {}\r
+  /// \param theStdActions a map of standard actions\r
+  /// \return true if items are added and there is no necessity to provide standard menu\r
+  virtual bool addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const { return false; }\r
 \r
   /// Add menu atems for object browser into the given menu\r
   /// \param theMenu a popup menu to be shown in the object browser\r
-  virtual void addObjectBrowserItems(QMenu* theMenu) const {};\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
@@ -113,10 +117,26 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theObject a model object\r
   virtual bool canDisplayObject(const ObjectPtr& theObject) const;\r
 \r
+  /// Returns true if selection for the object can be activate.\r
+  /// By default a result or feature of the current operation can not be activated\r
+  /// \param theObject a model object\r
+  virtual bool canActivateSelection(const ObjectPtr& theObject) const;\r
+\r
   /// Reacts to the delete action in module\r
   /// \returns true if the action is processed\r
   virtual bool deleteObjects() { return false; };\r
 \r
+  /// Returns data model object for representation of data tree in Object browser\r
+  virtual ModuleBase_IDocumentDataModel* dataModel() const = 0;\r
+\r
+  /// Returns a list of modes, where the AIS objects should be activated\r
+  /// \param theModes a list of modes\r
+  virtual void activeSelectionModes(QIntList& theModes) {}\r
+\r
+  /// This method is called on object browser creation for customisation of module specific features\r
+  /// \param theObjectBrowser a pinter on Object Browser widget\r
+  virtual void customizeObjectBrowser(QWidget* theObjectBrowser) {}\r
+\r
 public slots:\r
   /// Called on call of command corresponded to a feature\r
   void onFeatureTriggered();\r
@@ -138,7 +158,7 @@ protected slots:
  protected:\r
   /// Sends the operation for launching\r
   /// \param theOperation the operation\r
-  void sendOperation(ModuleBase_Operation* theOperation);\r
+  virtual void sendOperation(ModuleBase_Operation* theOperation);\r
 \r
   /// Creates a new operation\r
   /// \param theCmdId the operation name\r