#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 () | |
| virtual | ~SUIT_Session () |
| 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 () |
Data Fields | |
| 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 | |
| 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 |
typedef QList<SUIT_Application*> SUIT_Session.AppList [private] |
typedef QMap<QString, AppLib> SUIT_Session.AppLibMap [private] |
| SUIT_Session::SUIT_Session | ( | ) |
Constructor.
References mySession, and SUIT_ASSERT.
| SUIT_Session::~SUIT_Session | ( | ) | [virtual] |
| SUIT_Session * SUIT_Session::session | ( | ) | [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().
| QList< SUIT_Application * > SUIT_Session::applications | ( | ) | const |
Gets the list of all applications
References myAppList.
| SUIT_Application * SUIT_Session::activeApplication | ( | ) | const |
Returns the active application
References myActiveApp.
| SUIT_ResourceMgr * SUIT_Session::resourceMgr | ( | ) | const |
Returns the resource manager for the specified application name.
References myResMgr.
| void SUIT_Session::closeSession | ( | int | mode = ASK, |
| int | flags = 0 |
||
| ) |
Destroys session by closing all applications.
References SUIT_Application.activeStudy(), ASK, SUIT_Application.closeApplication(), DONT_SAVE, FORCED, SUIT_Study.isModified(), SUIT_Application.isPossibleToClose(), SUIT_Study.isSaved(), myAppList, myExitFlags, myExitStatus, SAVE, and SUIT_Study.saveDocument().
| 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().
| void SUIT_Session.applicationClosed | ( | SUIT_Application * | ) | [signal] |
| SUIT_ResourceMgr * SUIT_Session::createResourceMgr | ( | const QString & | appName | ) | const [protected, virtual] |
Virtual method, creates an instance of ResourceManager
Reimplemented in SALOME_Session, and SUITApp_Session.
References applicationName().
| void SUIT_Session::onApplicationClosed | ( | SUIT_Application * | theApp | ) | [private, slot] |
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.
| void SUIT_Session::onApplicationActivated | ( | SUIT_Application * | app | ) | [private, slot] |
Slot, called on activation of some application's desktop
References myActiveApp.
| QString SUIT_Session::lastError | ( | ) | const [private] |
| return | last error string. |
References Qtx.toQString().
| SUIT_Session::AppLib SUIT_Session::loadLibrary | ( | const QString & | name, |
| QString & | libName | ||
| ) | [private] |
| QString SUIT_Session::applicationName | ( | const QString & | str | ) | const [private] |
| Return | file name by application name. |
References Qtx.file().
| enum { ... } SUIT_Session.CloseMode |
| enum { ... } SUIT_Session.ExitStatus |
SUIT_ResourceMgr* SUIT_Session.myResMgr [private] |
AppList SUIT_Session.myAppList [private] |
AppLibMap SUIT_Session.myAppLibs [private] |
SUIT_Application* SUIT_Session.myActiveApp [private] |
SUIT_ExceptionHandler* SUIT_Session.myHandler [private] |
SUIT_Session * SUIT_Session::mySession = 0 [static, private] |
int SUIT_Session.myExitStatus [private] |
int SUIT_Session.myExitFlags [private] |