6 #include "SUIT_Application.h"
7 #include "SUIT_ResourceMgr.h"
11 #include <qptrvector.h>
12 #include <qstringlist.h>
15 #define LIB_HANDLE HINSTANCE
17 #define LIB_HANDLE void*
20 class SUIT_ResourceMgr;
21 class SUIT_ExceptionHandler;
24 The class Sesssion manages launching of Applications. Application must be returned
25 by static function "createApplication" in external library. The Library must be loaded with
26 loadLibrary method and after that application can be started.
30 #pragma warning( disable:4251 )
33 class SUIT_EXPORT SUIT_Session: public QObject
38 typedef LIB_HANDLE AppLib;
40 enum { ASK = 0, SAVE, DONT_SAVE } CloseMode;
41 enum { FROM_GUI = 0, FROM_CORBA_SESSION } ExitStatus;
45 virtual ~SUIT_Session();
47 static SUIT_Session* session();
49 SUIT_Application* startApplication( const QString&, int = 0, char** = 0 );
51 QPtrList<SUIT_Application> applications() const;
52 SUIT_Application* activeApplication() const;
54 SUIT_ResourceMgr* resourceMgr() const;
56 void closeSession( int mode = ASK );
58 SUIT_ExceptionHandler* handler() const;
61 void applicationClosed( SUIT_Application* );
64 virtual SUIT_ResourceMgr* createResourceMgr( const QString& ) const;
67 void onApplicationClosed( SUIT_Application* );
68 void onApplicationActivated( SUIT_Application* );
71 typedef QPtrList<SUIT_Application> AppList;
72 typedef QMap<QString, AppLib> AppLibMap;
73 typedef QPtrListIterator<SUIT_Application> AppListIterator;
76 QString lastError() const;
77 AppLib loadLibrary( const QString& );
78 QString applicationName( const QString& ) const;
81 SUIT_ResourceMgr* myResMgr;
84 SUIT_Application* myActiveApp;
86 SUIT_ExceptionHandler* myHandler;
87 static SUIT_Session* mySession;