Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_Workshop.h
index f9a5ee50dc7c19e7031dcd8746764a0959dbff9d..764e19f2d626079bbe01ce7dffca429f9ddd32ba 100644 (file)
@@ -31,6 +31,7 @@ class XGUI_ModuleConnector;
 
 class ModuleBase_Operation;
 class ModuleBase_IModule;
+class ModuleBase_IViewer;
 
 class Config_FeatureMessage;
 class Config_PointerMessage;
@@ -104,7 +105,7 @@ Q_OBJECT
   XGUI_Workbench* addWorkbench(const QString& theName);
 
   //! Redefinition of Events_Listener method
-  virtual void processEvent(const Events_Message* theMessage);
+  virtual void processEvent(const boost::shared_ptr<Events_Message>& theMessage);
 
   //! Returns an object which provides interface to Salome Module (LightApp_Module)
   XGUI_SalomeConnector* salomeConnector() const
@@ -113,7 +114,7 @@ Q_OBJECT
   }
 
   //! Provides an object which provides interface to Salome Viewer
-  XGUI_SalomeViewer* salomeViewer() const;
+  ModuleBase_IViewer* salomeViewer() const;
 
   //! Returns true if the application works as SALOME module
   bool isSalomeMode() const
@@ -157,6 +158,8 @@ Q_OBJECT
   //! Show the given features in 3d Viewer
   void showOnlyObjects(const QList<ObjectPtr>& theList);
 
+  void setDisplayMode(const QList<ObjectPtr>& theList, int theMode);
+
   ModuleBase_IModule* module() const
   {
     return myModule;
@@ -175,6 +178,14 @@ Q_OBJECT
   */
   void saveDocument(const QString& theName, std::list<std::string>& theFileNames);
 
+  /*
+   * If there is an active (uncommited) operation shows a prompt to abort it
+   * and performs abortion if user agreed. Returns true if
+   * - operation aborted successfully
+   * - there is no active operation
+   */
+  bool isActiveOperationAborted();
+
 signals:
   void salomeViewerSelection();
   void errorOccurred(const QString&);
@@ -190,6 +201,7 @@ signals:
   void onExit();
   void onUndo();
   void onRedo();
+  void onRebuild();
   void onPreferences();
 
   void showPropertyPanel();
@@ -202,23 +214,24 @@ signals:
 
   void activateLastPart();
 
-  /// Display all results of the current document
-  void displayAllResults();
+  void closeDocument();
 
  protected:
+  bool event(QEvent * theEvent);
   //Event-loop processing methods:
-  void addFeature(const Config_FeatureMessage*);
+  void addFeature(const boost::shared_ptr<Config_FeatureMessage>&);
   void connectWithOperation(ModuleBase_Operation* theOperation);
 
-  void onFeatureUpdatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg);
-  void onFeatureCreatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg);
-  void onFeatureRedisplayMsg(const ModelAPI_ObjectUpdatedMessage* theMsg);
-  void onObjectDeletedMsg(const ModelAPI_ObjectDeletedMessage* theMsg);
+  void onFeatureUpdatedMsg(const boost::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
+  void onFeatureCreatedMsg(const boost::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
+  void onFeatureRedisplayMsg(const boost::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
+  void onObjectDeletedMsg(const boost::shared_ptr<ModelAPI_ObjectDeletedMessage>& theMsg);
 
   void validateOperation(const QString& theOperationId);
 
   QList<QAction*> getModuleCommands() const;
 
+  void displayAllResults();
   void displayDocumentResults(DocumentPtr theDoc);
   void displayGroupResults(DocumentPtr theDoc, std::string theGroup);