Salome HOME
Issue #339: Set document filter before any other filters
[modules/shaper.git] / src / ModuleBase / ModuleBase_IModule.h
index ffe5139479fdc09fdcc09043798e4b6fcd413786..7ba5cfe1e09693d931618d6f73c189f268fdc02e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D\r
+ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D\r
 \r
 #ifndef ModuleBase_IModule_H\r
 #define ModuleBase_IModule_H\r
@@ -10,6 +10,7 @@
 \r
 #include <QString>\r
 #include <QObject>\r
+#include <QMap>\r
 \r
 #include <string>\r
 #include <map>\r
@@ -75,7 +76,9 @@ 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 addViewerItems(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
@@ -109,8 +112,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   //! Returns True if there are available Redos and there is not an active operation\r
   virtual bool canRedo() const;\r
 \r
-  /// Returns whether the object can be displayed at the bounds of the active operation.\r
-  /// Display only current operation results\r
+  /// Returns whether the object can be displayed. The default realization returns true.\r
   /// \param theObject a model object\r
   virtual bool canDisplayObject(const ObjectPtr& theObject) const;\r
 \r
@@ -122,6 +124,16 @@ public slots:
   /// Called on call of command corresponded to a feature\r
   void onFeatureTriggered();\r
 \r
+  /// Slolt called on object display\r
+  /// \param theObject a data object\r
+  /// \param theAIS a presentation object\r
+  virtual void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) {}\r
+\r
+  /// Slot called on before object erase\r
+  /// \param theObject a data object\r
+  /// \param theAIS a presentation object\r
+  virtual void onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS) {}\r
+\r
 protected slots:\r
   /// Called on selection changed event\r
   virtual void onSelectionChanged() {}\r
@@ -129,7 +141,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