Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SUIT_Session Class Reference

#include <SUIT_Session.h>

Inheritance diagram for SUIT_Session:
Inheritance graph

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_ApplicationstartApplication (const QString &, int=0, char **=0)
 
QList< SUIT_Application * > applications () const
 
SUIT_ApplicationactiveApplication () const
 
SUIT_ResourceMgrresourceMgr () const
 
void closeSession (int mode=ASK, int flags=0)
 
int exitFlags () const
 
SUIT_ExceptionHandlerhandler () const
 
void insertApplication (SUIT_Application *)
 

Static Public Member Functions

static SUIT_Sessionsession ()
 

Public Attributes

enum SUIT_Session:: { ... }  CloseMode
 
enum SUIT_Session:: { ... }  ExitStatus
 

Protected Member Functions

virtual SUIT_ResourceMgrcreateResourceMgr (const QString &) const
 

Private Types

typedef QList< SUIT_Application * > AppList
 
typedef QMap< QString, AppLibAppLibMap
 

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_ResourceMgrmyResMgr
 
AppList myAppList
 
AppLibMap myAppLibs
 
SUIT_ApplicationmyActiveApp
 
SUIT_ExceptionHandlermyHandler
 
int myExitStatus
 
int myExitFlags
 

Static Private Attributes

static SUIT_SessionmySession = 0
 

Detailed Description

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.

Member Typedef Documentation

typedef void* SUIT_Session::AppLib
typedef QMap<QString, AppLib> SUIT_Session::AppLibMap
private

Member Enumeration Documentation

anonymous enum
Enumerator
ASK 
SAVE 
DONT_SAVE 
anonymous enum
Enumerator
NORMAL 
FORCED 

Constructor & Destructor Documentation

SUIT_Session::SUIT_Session ( )

Constructor.

References mySession, and SUIT_ASSERT.

SUIT_Session::SUIT_Session ( int  argc,
char **  argv 
)

References myArguments, mySession, and SUIT_ASSERT.

SUIT_Session::~SUIT_Session ( )
virtual

destructor. Clear applications list and set mySession to zero.

References myAppList, myResMgr, and mySession.

Member Function Documentation

SUIT_Application * SUIT_Session::activeApplication ( ) const

Returns the active application

References myActiveApp.

void SUIT_Session::applicationClosed ( SUIT_Application )
signal
QString SUIT_Session::applicationName ( const QString &  str) const
private
Return values
Returnfile 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 
)
SUIT_ResourceMgr * SUIT_Session::createResourceMgr ( const QString &  appName) const
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.

Returns
exit flags

References myExitFlags.

SUIT_ExceptionHandler * SUIT_Session::handler ( ) const
Return values
returnmyHandler

References myHandler.

void SUIT_Session::insertApplication ( SUIT_Application app)
QString SUIT_Session::lastError ( ) const
private
Return values
returnlast error string.

References Qtx::toQString().

SUIT_Session::AppLib SUIT_Session::loadLibrary ( const QString &  name,
QString &  libName 
)
private

Load library to session.

Return values
Loadedlibrary.

References Qtx::library().

void SUIT_Session::onApplicationActivated ( SUIT_Application app)
privateslot

Slot, called on activation of some application's desktop

References app, and myActiveApp.

void SUIT_Session::onApplicationClosed ( SUIT_Application theApp)
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.

SUIT_Session * SUIT_Session::session ( )
static
Return values
returnmySession

References mySession.

SUIT_Application * SUIT_Session::startApplication ( const QString &  name,
int  = 0,
char **  = 0 
)

Member Data Documentation

enum { ... } SUIT_Session::CloseMode
enum { ... } SUIT_Session::ExitStatus
SUIT_Application* SUIT_Session::myActiveApp
private
AppLibMap SUIT_Session::myAppLibs
private
AppList SUIT_Session::myAppList
private
QStringList SUIT_Session::myArguments
private
int SUIT_Session::myExitFlags
private
int SUIT_Session::myExitStatus
private
SUIT_ExceptionHandler* SUIT_Session::myHandler
private
SUIT_ResourceMgr* SUIT_Session::myResMgr
private
SUIT_Session * SUIT_Session::mySession = 0
staticprivate

The documentation for this class was generated from the following files: