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 #pragma warning( disable:4251 )
27 The class Sesssion manages launching of Applications. Application must be returned \n
28 by static function "createApplication" in external library. The Library must be loaded with \n
29 loadLibrary method and after that application can be started.
31 class SUIT_EXPORT SUIT_Session: public QObject
36 typedef LIB_HANDLE AppLib;
38 enum { ASK = 0, SAVE, DONT_SAVE } CloseMode;
39 enum { FROM_GUI = 0, FROM_CORBA_SESSION } ExitStatus;
43 virtual ~SUIT_Session();
45 static SUIT_Session* session();
47 SUIT_Application* startApplication( const QString&, int = 0, char** = 0 );
49 QPtrList<SUIT_Application> applications() const;
50 SUIT_Application* activeApplication() const;
52 SUIT_ResourceMgr* resourceMgr() const;
54 void closeSession( int mode = ASK );
56 SUIT_ExceptionHandler* handler() const;
59 void applicationClosed( SUIT_Application* );
62 virtual SUIT_ResourceMgr* createResourceMgr( const QString& ) const;
65 void onApplicationClosed( SUIT_Application* );
66 void onApplicationActivated( SUIT_Application* );
69 typedef QPtrList<SUIT_Application> AppList;
70 typedef QMap<QString, AppLib> AppLibMap;
71 typedef QPtrListIterator<SUIT_Application> AppListIterator;
74 QString lastError() const;
75 AppLib loadLibrary( const QString& );
76 QString applicationName( const QString& ) const;
79 SUIT_ResourceMgr* myResMgr;
82 SUIT_Application* myActiveApp;
84 SUIT_ExceptionHandler* myHandler;
85 static SUIT_Session* mySession;