Salome HOME
Fix for bug 10438: Crash during Explode on Blocks operation (Global selection on...
[modules/gui.git] / src / SUIT / SUIT_Session.h
index c51a87ed9b582c195d0afe89b75224596215e7e6..1ec8bd6386060d741070f562febdb9c0562bb98d 100755 (executable)
 class SUIT_ResourceMgr;
 class SUIT_ExceptionHandler;
 
-/*!
-  The class Sesssion manages launching of Applications. Application must be returned
-  by static function "createApplication" in external library. The Library must be loaded with 
-  loadLibrary method and after that application can be started.
-*/
-
 #ifdef WNT
 #pragma warning( disable:4251 )
 #endif
-
+/*!
+  The class Sesssion manages launching of Applications. Application must be returned \n
+  by static function "createApplication" in external library. The Library must be loaded with \n
+  loadLibrary method and after that application can be started.
+*/
 class SUIT_EXPORT SUIT_Session: public QObject
 {
   Q_OBJECT
@@ -37,6 +35,9 @@ class SUIT_EXPORT SUIT_Session: public QObject
 public:
   typedef LIB_HANDLE AppLib;
 
+  enum { ASK = 0, SAVE, DONT_SAVE } CloseMode;
+  enum { FROM_GUI = 0, FROM_CORBA_SESSION } ExitStatus;
+
 public:
   SUIT_Session();
   virtual ~SUIT_Session();
@@ -50,7 +51,7 @@ public:
 
   SUIT_ResourceMgr*            resourceMgr() const;
 
-  void                         closeSession();
+  void                         closeSession( int mode = ASK );
 
   SUIT_ExceptionHandler*       handler() const;
 
@@ -62,6 +63,7 @@ protected:
 
 private slots:
   void                         onApplicationClosed( SUIT_Application* );
+  void                         onApplicationActivated( SUIT_Application* ); 
 
 private:
   typedef QPtrList<SUIT_Application>         AppList;
@@ -77,9 +79,12 @@ private:
   SUIT_ResourceMgr*            myResMgr;
   AppList                      myAppList;
   AppLibMap                    myAppLibs;
+  SUIT_Application*            myActiveApp;
 
   SUIT_ExceptionHandler*       myHandler;
   static SUIT_Session*         mySession;
+
+  int                          myExitStatus;
 };
 
 #endif