#include <SUIT_Application.h>

Public Slots | |
| virtual void | updateCommandsStatus () |
| virtual void | onHelpContextModule (const QString &, const QString &, const QString &=QString()) |
Signals | |
| void | applicationClosed (SUIT_Application *) |
| void | activated (SUIT_Application *) |
| void | infoChanged (QString) |
Public Member Functions | |
| SUIT_Application () | |
| virtual | ~SUIT_Application () |
| virtual SUIT_Desktop * | desktop () |
| Returns main widget (Desktop) of the application (if it exists) | |
| virtual bool | isPossibleToClose (bool &) |
| virtual void | closeApplication () |
| virtual SUIT_Study * | activeStudy () const |
| Returns active Study. If Application supports wirking with several studies this method should be redefined. | |
| virtual QString | applicationName () const =0 |
| Returns Name of application. Using is not defined. | |
| virtual QString | applicationVersion () const |
| virtual void | start () |
| Shows the application's main widget. For non GUI application must be redefined. | |
| virtual bool | useFile (const QString &theFileName) |
| Opens document <theFileName> into active Study. If Study is empty - creates it. | |
| virtual void | createEmptyStudy () |
| Creates new empty Study if active Study = 0. | |
| virtual int | getNbStudies () const |
| SUIT_ResourceMgr * | resourceMgr () const |
| SUIT_ShortcutMgr * | shortcutMgr () const |
| Get access to shortcut manager. | |
| void | putInfo (const QString &, const int=0) |
| Puts the message to the status bar. | |
| virtual QString | getFileName (bool open, const QString &initial, const QString &filters, const QString &caption, QWidget *parent)=0 |
| Invokes application-specific "Open/Save File" dialog and returns the selected file name. | |
| virtual QString | getDirectory (const QString &initial, const QString &caption, QWidget *parent)=0 |
| Invokes application-specific "Select Directory" dialog and returns the selected directory name. | |
| virtual int | viewManagerId (const SUIT_ViewManager *) const =0 |
Protected Slots | |
| virtual void | onDesktopActivated () |
Protected Member Functions | |
| SUIT_Application * | startApplication (int, char **) const |
| SUIT_Application * | startApplication (const QString &, int, char **) const |
| virtual void | setDesktop (SUIT_Desktop *) |
| virtual SUIT_Study * | createNewStudy () |
| Creates a new Study instance. Must be redefined in new application according to its Study type. | |
| virtual void | setActiveStudy (SUIT_Study *) |
| void | setActionShown (QAction *, const bool) |
| void | setActionShown (const int, const bool) |
| QAction * | action (const int) const |
| int | actionId (const QAction *) const |
| QList< QAction * > | actions () const |
| QList< int > | actionIds () const |
| int | registerAction (const int, QAction *) |
| QAction * | createAction (const int, const QString &, const QIcon &, const QString &, const QString &, const int, QObject *=0, const bool=false, QObject *=0, const char *=0, const QString &=QString()) |
Create tool functions | |
| int | createTool (const QString &) |
| int | createTool (const int, const int, const int=-1) |
| int | createTool (const int, const QString &, const int=-1) |
| int | createTool (QAction *, const int, const int=-1, const int=-1) |
| int | createTool (QAction *, const QString &, const int=-1, const int=-1) |
Create menu functions | |
| int | createMenu (const QString &, const int, const int=-1, const int=-1, const int=-1) |
| int | createMenu (const QString &, const QString &, const int=-1, const int=-1, const int=-1) |
| int | createMenu (const int, const int, const int=-1, const int=-1) |
| int | createMenu (const int, const QString &, const int=-1, const int=-1) |
| int | createMenu (QAction *, const int, const int=-1, const int=-1, const int=-1) |
| int | createMenu (QAction *, const QString &, const int=-1, const int=-1, const int=-1) |
Set menu shown functions | |
| void | setMenuShown (QAction *, const bool) |
| void | setMenuShown (const int, const bool) |
Set tool shown functions | |
| void | setToolShown (QAction *, const bool) |
| void | setToolShown (const int, const bool) |
Static Protected Member Functions | |
| static QAction * | separator () |
Private Slots | |
| void | onInfoClear () |
Private Attributes | |
| SUIT_Study * | myStudy |
| SUIT_Desktop * | myDesktop |
| QMap< int, QAction * > | myActionMap |
| SUIT_ShortcutMgr * | myShortcutMgr |
| QLabel * | myStatusLabel |
An Application is a class which defines application configuration and behaviour. For example Application object defines what Viewers are used in this application, what auxilliary windows are present, how user can dial with them. Also Application object defines an sertain type of data structure by holding of pointer on an instance of SUIT_Study class (which represents Document data structure). In other words Application defines type of sata structure, type of used Viewers, type of main GUI widget (Desktop), and other auxilliary tools.
| SUIT_Application::SUIT_Application | ( | ) |
Default constructor
References SUIT_Session.insertApplication(), and SUIT_Session.session().
| SUIT_Application::~SUIT_Application | ( | ) | [virtual] |
Destructor
References myStudy, setActiveStudy(), and setDesktop().
| SUIT_Desktop * SUIT_Application::desktop | ( | ) | [virtual] |
References myDesktop.
| bool SUIT_Application::isPossibleToClose | ( | bool & | ) | [virtual] |
Returns FALSE if application can not be closed (because of non saved data for example). This method called by SUIT_Session whin closing of application was requested.
Reimplemented in SalomeApp_Application, and STD_Application.
| void SUIT_Application::closeApplication | ( | ) | [virtual] |
Performs some finalization of life cycle of this application. For instance, the application can force its documents(s) to close.
Reimplemented in STD_Application.
References applicationClosed().
| SUIT_Study * SUIT_Application::activeStudy | ( | ) | const [virtual] |
References myStudy.
| virtual QString SUIT_Application.applicationName | ( | ) | const [pure virtual] |
Implemented in CAF_Application, LightApp_Application, and STD_Application.
| QString SUIT_Application::applicationVersion | ( | ) | const [virtual] |
Reimplemented in LightApp_Application.
| void SUIT_Application::start | ( | ) | [virtual] |
Reimplemented in CAM_Application, LightApp_Application, SalomeApp_Application, and STD_Application.
References desktop(), and SUIT_ShortcutMgr.Init().
| bool SUIT_Application::useFile | ( | const QString & | theFileName | ) | [virtual] |
Opens document into active Study. If Study is empty - creates it.
| theFileName | - name of document file |
Reimplemented in STD_Application.
References activeStudy(), createEmptyStudy(), SUIT_Study.openDocument(), and setActiveStudy().
| void SUIT_Application::createEmptyStudy | ( | ) | [virtual] |
Creates new empty Study if active Study = 0
Reimplemented in CAM_Application, LightApp_Application, and STD_Application.
References activeStudy(), createNewStudy(), and setActiveStudy().
| int SUIT_Application::getNbStudies | ( | ) | const [virtual] |
Returns number of Studies. Must be redefined in Applications which support several studies for one Application instance.
References activeStudy().
| SUIT_ResourceMgr * SUIT_Application::resourceMgr | ( | ) | const |
References SUIT_Session.resourceMgr(), and SUIT_Session.session().
| SUIT_ShortcutMgr * SUIT_Application::shortcutMgr | ( | ) | const |
References SUIT_ShortcutMgr.getShortcutMgr().
| void SUIT_Application::putInfo | ( | const QString & | msg, |
| const int | msec = 0 |
||
| ) |
Puts the message to the status bar
| msg | - text of message |
| msec | - time in milliseconds, after that the status label will be cleared |
References DEFAULT_MESSAGE_DELAY, desktop(), infoChanged(), myStatusLabel, and onInfoClear().
| virtual QString SUIT_Application.getFileName | ( | bool | open, |
| const QString & | initial, | ||
| const QString & | filters, | ||
| const QString & | caption, | ||
| QWidget * | parent | ||
| ) | [pure virtual] |
Implemented in LightApp_Application, and STD_Application.
| virtual QString SUIT_Application.getDirectory | ( | const QString & | initial, |
| const QString & | caption, | ||
| QWidget * | parent | ||
| ) | [pure virtual] |
Implemented in LightApp_Application, and STD_Application.
| virtual int SUIT_Application.viewManagerId | ( | const SUIT_ViewManager * | ) | const [pure virtual] |
Implemented in STD_Application.
| void SUIT_Application.applicationClosed | ( | SUIT_Application * | ) | [signal] |
| void SUIT_Application.activated | ( | SUIT_Application * | ) | [signal] |
| void SUIT_Application.infoChanged | ( | QString | ) | [signal] |
| void SUIT_Application::updateCommandsStatus | ( | ) | [virtual, slot] |
Update status of the registerd actions
Reimplemented in CAF_Application, CAM_Application, LightApp_Application, SalomeApp_Application, and STD_Application.
| void SUIT_Application::onHelpContextModule | ( | const QString & | , |
| const QString & | , | ||
| const QString & | = QString() |
||
| ) | [virtual, slot] |
SLOT: is used for Help browsing
Reimplemented in LightApp_Application.
| void SUIT_Application::onInfoClear | ( | ) | [private, slot] |
Clear the information label in status bar after delay.
References infoChanged(), and myStatusLabel.
| SUIT_Application * SUIT_Application::startApplication | ( | int | argc, |
| char ** | argv | ||
| ) | const [protected] |
Initialize with application arguments
| argc | - number of application arguments |
| argv | - array of application arguments |
| SUIT_Application * SUIT_Application::startApplication | ( | const QString & | name, |
| int | argc, | ||
| char ** | argv | ||
| ) | const [protected] |
Initialize with application name and arguments
| name | - name of application |
| argc | - number of application arguments |
| argv | - array of application arguments |
References SUIT_Session.session(), and SUIT_Session.startApplication().
| void SUIT_Application::setDesktop | ( | SUIT_Desktop * | desk | ) | [protected, virtual] |
Sets the main window of application
| desk | - new main window (desktop) |
Reimplemented in SalomeApp_Application, and STD_Application.
References activated(), myDesktop, and onDesktopActivated().
| SUIT_Study * SUIT_Application::createNewStudy | ( | ) | [protected, virtual] |
Creates new instance of study. By default, it is called from createEmptyStudy()
Reimplemented in CAF_Application, CAM_Application, LightApp_Application, and SalomeApp_Application.
| void SUIT_Application::setActiveStudy | ( | SUIT_Study * | study | ) | [protected, virtual] |
Sets study as active
| study | - instance of study to be set as active |
Reimplemented in CAM_Application, and LightApp_Application.
References myStudy, and updateCommandsStatus().
| int SUIT_Application::createTool | ( | const QString & | name | ) | [protected] |
Creates new toolbar
| name | - name of new toolbar |
References QtxActionToolMgr.createToolBar(), desktop(), and SUIT_Desktop.toolMgr().
| int SUIT_Application::createTool | ( | const int | id, |
| const int | tBar, | ||
| const int | idx = -1 |
||
| ) | [protected] |
Creates new toolbutton
| id | - SUIT identificator of action |
| tBar | - identificator of toolbar |
| idx | - index in toolbar |
References action(), desktop(), QtxActionToolMgr.insert(), and SUIT_Desktop.toolMgr().
| int SUIT_Application::createTool | ( | const int | id, |
| const QString & | tBar, | ||
| const int | idx = -1 |
||
| ) | [protected] |
Creates new toolbutton
| id | - SUIT identificator of action |
| tBar | - name of toolbar |
| idx | - index in toolbar |
References action(), desktop(), QtxActionToolMgr.insert(), and SUIT_Desktop.toolMgr().
| int SUIT_Application::createTool | ( | QAction * | a, |
| const int | tBar, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) | [protected] |
Creates new toolbutton
| a | - action |
| tBar | - identificator of toolbar |
| id | - proposed SUIT identificator of action (if it is -1, then must be use any free) |
| idx | - index in toolbar |
References desktop(), QtxActionToolMgr.insert(), registerAction(), and SUIT_Desktop.toolMgr().
| int SUIT_Application::createTool | ( | QAction * | a, |
| const QString & | tBar, | ||
| const int | id = -1, |
||
| const int | idx = -1 |
||
| ) | [protected] |
Creates new toolbutton
| a | - action |
| tBar | - name of toolbar |
| id | - proposed SUIT identificator of action (if it is -1, then must be use any free) |
| idx | - index in toolbar |
References desktop(), QtxActionToolMgr.insert(), registerAction(), and SUIT_Desktop.toolMgr().
| int SUIT_Application::createMenu | ( | const QString & | subMenu, |
| const int | menu, | ||
| const int | id = -1, |
||
| const int | group = -1, |
||
| const int | index = -1 |
||
| ) | [protected] |
Creates new menu item
| subMenu | - menu text of new item |
| menu | - identificator of parent menu item |
| id | - proposed identificator of action |
| group | - group in menu manager |
| index | - index in menu |
References desktop(), QtxActionMenuMgr.insert(), and SUIT_Desktop.menuMgr().
| int SUIT_Application::createMenu | ( | const QString & | subMenu, |
| const QString & | menu, | ||
| const int | id = -1, |
||
| const int | group = -1, |
||
| const int | index = -1 |
||
| ) | [protected] |
Creates new menu item
| subMenu | - menu text of new item |
| menu | - menu text of parent menu item |
| id | - proposed identificator of action |
| group | - group in menu manager |
| index | - index in menu |
References desktop(), QtxActionMenuMgr.insert(), and SUIT_Desktop.menuMgr().
| int SUIT_Application::createMenu | ( | const int | id, |
| const int | menu, | ||
| const int | group = -1, |
||
| const int | index = -1 |
||
| ) | [protected] |
Creates new menu item
| id | - SUIT identificator of action |
| menu | - menu text of parent menu item |
| group | - group in menu manager |
| index | - index in menu |
References action(), desktop(), QtxActionMenuMgr.insert(), and SUIT_Desktop.menuMgr().
| int SUIT_Application::createMenu | ( | const int | id, |
| const QString & | menu, | ||
| const int | group = -1, |
||
| const int | index = -1 |
||
| ) | [protected] |
Creates new menu item
| id | - SUIT identificator of action |
| menu | - menu text of parent menu item |
| group | - group in menu manager |
| index | - index in menu |
References action(), desktop(), QtxActionMenuMgr.insert(), and SUIT_Desktop.menuMgr().
| int SUIT_Application::createMenu | ( | QAction * | a, |
| const int | menu, | ||
| const int | id = -1, |
||
| const int | group = -1, |
||
| const int | index = -1 |
||
| ) | [protected] |
Creates new menu item
| a | - action |
| menu | - identificator of parent menu item |
| id | - proposed SUIT identificator of action |
| group | - group in menu manager |
| index | - index in menu |
References desktop(), QtxActionMenuMgr.insert(), SUIT_Desktop.menuMgr(), and registerAction().
| int SUIT_Application::createMenu | ( | QAction * | a, |
| const QString & | menu, | ||
| const int | id = -1, |
||
| const int | group = -1, |
||
| const int | index = -1 |
||
| ) | [protected] |
Creates new menu item
| a | - action |
| menu | - menu text of parent menu item |
| id | - proposed SUIT identificator of action |
| group | - group in menu manager |
| index | - index in menu |
References desktop(), QtxActionMenuMgr.insert(), SUIT_Desktop.menuMgr(), and registerAction().
| void SUIT_Application::setMenuShown | ( | QAction * | a, |
| const bool | on | ||
| ) | [protected] |
Show/hide menu item corresponding to action
| a | - action |
| on | - if it is true, the item will be shown, otherwise it will be hidden |
References QtxActionMgr.actionId(), desktop(), SUIT_Desktop.menuMgr(), and QtxActionMenuMgr.setShown().
| void SUIT_Application::setMenuShown | ( | const int | id, |
| const bool | on | ||
| ) | [protected] |
Show/hide menu item corresponding to action
| id | - identificator of action in menu manager |
| on | - if it is true, the item will be shown, otherwise it will be hidden |
References action(), and setMenuShown().
| void SUIT_Application::setToolShown | ( | QAction * | a, |
| const bool | on | ||
| ) | [protected] |
Show/hide tool button corresponding to action
| a | - action |
| on | - if it is true, the button will be shown, otherwise it will be hidden |
References QtxActionMgr.actionId(), desktop(), QtxActionToolMgr.setShown(), and SUIT_Desktop.toolMgr().
| void SUIT_Application::setToolShown | ( | const int | id, |
| const bool | on | ||
| ) | [protected] |
Show/hide menu item corresponding to action
| id | - identificator of action in tool manager |
| on | - if it is true, the button will be shown, otherwise it will be hidden |
References action(), and setToolShown().
| void SUIT_Application::setActionShown | ( | QAction * | a, |
| const bool | on | ||
| ) | [protected] |
Show/hide both menu item and tool button corresponding to action
| a | - action |
| on | - if it is true, the item will be shown, otherwise it will be hidden |
References setMenuShown(), and setToolShown().
| void SUIT_Application::setActionShown | ( | const int | id, |
| const bool | on | ||
| ) | [protected] |
Show/hide both menu item and tool button corresponding to action
| id | - identificator in both menu manager and tool manager |
| on | - if it is true, the item will be shown, otherwise it will be hidden |
References setMenuShown(), and setToolShown().
| QAction * SUIT_Application::separator | ( | ) | [static, protected] |
| QAction * SUIT_Application::action | ( | const int | id | ) | const [protected] |
| id | - SUIT identificator |
References test_table.a, and myActionMap.
| int SUIT_Application::actionId | ( | const QAction * | a | ) | const [protected] |
| a | - action |
References test_table.a, and myActionMap.
References myActionMap.
| QList< int > SUIT_Application::actionIds | ( | ) | const [protected] |
References myActionMap.
| int SUIT_Application::registerAction | ( | const int | id, |
| QAction * | a | ||
| ) | [protected] |
Registers action both in menu manager and tool manager
| id | - proposed SUIT identificator (if it is -1, auto generated one is used) |
| a | - action |
References action(), actionId(), desktop(), SUIT_Desktop.menuMgr(), myActionMap, QtxActionMgr.registerAction(), and SUIT_Desktop.toolMgr().
| QAction * SUIT_Application::createAction | ( | const int | id, |
| const QString & | text, | ||
| const QIcon & | icon, | ||
| const QString & | menu, | ||
| const QString & | tip, | ||
| const int | key, | ||
| QObject * | parent = 0, |
||
| const bool | toggle = false, |
||
| QObject * | reciever = 0, |
||
| const char * | member = 0, |
||
| const QString & | shortcutAction = QString() |
||
| ) | [protected] |
Creates action and registers it both in menu manager and tool manager
| id | - proposed SUIT identificator |
| text | - description |
| icon | - icon for toolbar |
| menu | - menu text |
| tip | - tool tip |
| key | - shortcut |
| parent | - parent object |
| toggle | - if it is TRUE the action will be a toggle action, otherwise it will be a command action |
| reciever | - object that contains slot |
| member | - slot to be called when action is activated |
References test_table.a, and registerAction().
| void SUIT_Application::onDesktopActivated | ( | ) | [protected, virtual, slot] |
SLOT: it is called when desktop is activated
Reimplemented in LightApp_Application.
References activated().
SUIT_Study* SUIT_Application.myStudy [private] |
SUIT_Desktop* SUIT_Application.myDesktop [private] |
QMap<int, QAction*> SUIT_Application.myActionMap [private] |
SUIT_ShortcutMgr* SUIT_Application.myShortcutMgr [private] |
QLabel* SUIT_Application.myStatusLabel [private] |