#include <SUIT_Session.h>
Public Types | |
enum | { ASK = 0, SAVE, DONT_SAVE } |
enum | { NORMAL = 0, FORCED } |
typedef void * | AppLib |
Signals | |
void | applicationClosed (SUIT_Application *) |
Public Member Functions | |
SUIT_Session () | |
SUIT_Session (int, char **) | |
virtual | ~SUIT_Session () |
QStringList | arguments () |
SUIT_Application * | startApplication (const QString &, int=0, char **=0) |
QList< SUIT_Application * > | applications () const |
SUIT_Application * | activeApplication () const |
SUIT_ResourceMgr * | resourceMgr () const |
void | closeSession (int mode=ASK, int flags=0) |
int | exitFlags () const |
SUIT_ExceptionHandler * | handler () const |
void | insertApplication (SUIT_Application *) |
Static Public Member Functions | |
static SUIT_Session * | session () |
Public Attributes | |
enum SUIT_Session:: { ... } | CloseMode |
enum SUIT_Session:: { ... } | ExitStatus |
Protected Member Functions | |
virtual SUIT_ResourceMgr * | createResourceMgr (const QString &) const |
Private Types | |
typedef QList< SUIT_Application * > | AppList |
typedef QMap< QString, AppLib > | AppLibMap |
Private Slots | |
void | onApplicationClosed (SUIT_Application *) |
void | onApplicationActivated (SUIT_Application *) |
Private Member Functions | |
QString | lastError () const |
AppLib | loadLibrary (const QString &, QString &) |
QString | applicationName (const QString &) const |
Private Attributes | |
QStringList | myArguments |
SUIT_ResourceMgr * | myResMgr |
AppList | myAppList |
AppLibMap | myAppLibs |
SUIT_Application * | myActiveApp |
SUIT_ExceptionHandler * | myHandler |
int | myExitStatus |
int | myExitFlags |
Static Private Attributes | |
static SUIT_Session * | mySession = 0 |
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.
typedef void* SUIT_Session::AppLib |
|
private |
|
private |
SUIT_Session::SUIT_Session | ( | ) |
Constructor.
References mySession, and SUIT_ASSERT.
SUIT_Session::SUIT_Session | ( | int | argc, |
char ** | argv | ||
) |
References myArguments, mySession, and SUIT_ASSERT.
|
virtual |
SUIT_Application * SUIT_Session::activeApplication | ( | ) | const |
Returns the active application
References myActiveApp.
|
signal |
|
private |
Return | file name by application name. |
References Qtx::file().
QList< SUIT_Application * > SUIT_Session::applications | ( | ) | const |
Gets the list of all applications
References myAppList.
QStringList SUIT_Session::arguments | ( | ) |
Get arguments of the current session
References myArguments.
void SUIT_Session::closeSession | ( | int | mode = ASK , |
int | flags = 0 |
||
) |
Destroys session by closing all applications.
References SUIT_Application::activeStudy(), app, ASK, SUIT_Application::closeApplication(), DONT_SAVE, FORCED, SUIT_Study::isModified(), SUIT_Application::isPossibleToClose(), SUIT_Study::isSaved(), myAppList, myExitFlags, myExitStatus, SAVE, and SUIT_Study::saveDocument().
|
protectedvirtual |
Virtual method, creates an instance of ResourceManager
Reimplemented in SALOME_Session, and SUITApp_Session.
References applicationName().
int SUIT_Session::exitFlags | ( | ) | const |
Get session exit flags.
By default, exit flags are set to 0. You can use pass any flags to the closeSession() method if you need to process them later on application quiting.
References myExitFlags.
SUIT_ExceptionHandler * SUIT_Session::handler | ( | ) | const |
return | myHandler |
References myHandler.
void SUIT_Session::insertApplication | ( | SUIT_Application * | app | ) |
References applicationClosed(), myAppList, onApplicationActivated(), and onApplicationClosed().
|
private |
return | last error string. |
References Qtx::toQString().
|
private |
|
privateslot |
Slot, called on activation of some application's desktop
References app, and myActiveApp.
|
privateslot |
Removes the application from the list of launched applications. If it is a last application the session will be closed.
References applicationClosed(), myActiveApp, myAppList, and myExitStatus.
SUIT_ResourceMgr * SUIT_Session::resourceMgr | ( | ) | const |
Returns the resource manager for the specified application name.
References myResMgr.
|
static |
return | mySession |
References mySession.
SUIT_Application * SUIT_Session::startApplication | ( | const QString & | name, |
int | = 0 , |
||
char ** | = 0 |
||
) |
Starts new application using "createApplication" function of loaded DLL.
References APP_CREATE_NAME, APP_GET_HANDLER_NAME, applicationName(), createResourceMgr(), insertApplication(), lastError(), QtxResourceMgr::loadLanguage(), loadLibrary(), myAppLibs, myAppList, myHandler, myResMgr, SUIT_Application::start(), and SUIT_MessageBox::warning().
enum { ... } SUIT_Session::CloseMode |
enum { ... } SUIT_Session::ExitStatus |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |