#include <STD_Application.h>
Public Types | |
enum | { MenuFileId, FileNewId, FileOpenId, FileReopenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId, MenuViewId, ViewWindowsId, ViewToolBarsId, ViewStatusBarId, NewWindowId, MenuEditId, EditCutId, EditCopyId, EditPasteId, MenuHelpId, HelpAboutId, UserID } |
Public Slots | |
virtual void | onNewDoc () |
virtual bool | onNewDoc (const QString &) |
virtual void | onCloseDoc (bool ask=true) |
virtual void | onSaveDoc () |
virtual bool | onSaveAsDoc () |
virtual void | onOpenDoc () |
virtual bool | onOpenDoc (const QString &) |
virtual bool | onReopenDoc () |
virtual void | onExit () |
virtual void | onCopy () |
virtual void | onPaste () |
virtual void | onViewStatusBar (bool) |
virtual void | onHelpAbout () |
virtual void | onDesktopClosing (SUIT_Desktop *, QCloseEvent *) |
virtual void | onConnectPopupRequest (SUIT_PopupClient *, QContextMenuEvent *) |
Public Slots inherited from SUIT_Application | |
virtual void | onHelpContextModule (const QString &, const QString &, const QString &=QString()) |
Signals | |
void | viewManagerAdded (SUIT_ViewManager *) |
void | viewManagerRemoved (SUIT_ViewManager *) |
void | viewManagerActivated (SUIT_ViewManager *) |
void | appClosed () |
Signals inherited from SUIT_Application | |
void | applicationClosed (SUIT_Application *) |
void | activated (SUIT_Application *) |
void | infoChanged (QString) |
Public Member Functions | |
STD_Application () | |
virtual | ~STD_Application () |
virtual QString | applicationName () const |
virtual bool | isPossibleToClose (bool &) |
virtual bool | useFile (const QString &) |
virtual void | createEmptyStudy () |
void | setEditEnabled (const bool) |
bool | isEditEnabled () const |
void | clearViewManagers () |
virtual void | addViewManager (SUIT_ViewManager *) |
virtual void | removeViewManager (SUIT_ViewManager *) |
SUIT_ViewManager * | activeViewManager () const |
SUIT_ViewManager * | viewManager (const QString &) const |
bool | containsViewManager (SUIT_ViewManager *) const |
ViewManagerList | viewManagers () const |
void | viewManagers (ViewManagerList &) const |
void | viewManagers (const QString &, ViewManagerList &) const |
virtual int | viewManagerId (const SUIT_ViewManager *) const |
virtual QString | getFileFilter (bool open) const |
virtual QString | getFileName (bool open, const QString &initial, const QString &filters, const QString &caption, QWidget *parent) |
QString | getDirectory (const QString &initial, const QString &caption, QWidget *parent) |
virtual void | start () |
virtual void | closeApplication () |
virtual void | contextMenuPopup (const QString &, QMenu *, QString &) |
bool | exitConfirmation () const |
void | setExitConfirmation (const bool) |
virtual void | updateDesktopTitle () |
Public Member Functions inherited from SUIT_Application | |
SUIT_Application () | |
virtual | ~SUIT_Application () |
virtual SUIT_Desktop * | desktop () |
Returns main widget (Desktop) of the application (if it exists) More... | |
virtual SUIT_Study * | activeStudy () const |
Returns active Study. If Application supports wirking with several studies this method should be redefined. More... | |
virtual QString | applicationVersion () const |
virtual int | getNbStudies () const |
SUIT_ResourceMgr * | resourceMgr () const |
SUIT_ShortcutMgr * | shortcutMgr () const |
Get access to shortcut manager. More... | |
void | putInfo (const QString &, const int=0) |
Puts the message to the status bar. More... | |
QAction * | action (const int) const |
void | addPostRoutine (void(*theRoutine)()) |
Protected Types | |
enum | { OpenCancel, OpenNew, OpenExist } |
enum | { CloseCancel, CloseSave, CloseDiscard } |
Protected Member Functions | |
virtual void | createActions () |
virtual void | updateCommandsStatus () |
virtual void | setDesktop (SUIT_Desktop *) |
virtual void | loadPreferences () |
virtual void | savePreferences () |
virtual void | studySaved (SUIT_Study *) |
virtual void | studyOpened (SUIT_Study *) |
virtual void | studyCreated (SUIT_Study *) |
virtual void | beforeCloseDoc (SUIT_Study *theDoc) |
virtual void | afterCloseDoc () |
virtual void | setActiveViewManager (SUIT_ViewManager *) |
virtual int | openChoice (const QString &) |
virtual bool | openAction (const int, const QString &) |
virtual int | closeChoice (const QString &) |
virtual bool | closeAction (const int, bool &) |
virtual bool | closeDoc (bool ask=true) |
virtual bool | closeActiveDoc (bool permanently=true) |
virtual bool | abortAllOperations () |
Abort active operations if there are any. More... | |
Protected Member Functions inherited from SUIT_Application | |
SUIT_Application * | startApplication (int, char **) const |
SUIT_Application * | startApplication (const QString &, int, char **) const |
virtual SUIT_Study * | createNewStudy () |
Creates a new Study instance. Must be redefined in new application according to its Study type. More... | |
virtual void | setActiveStudy (SUIT_Study *) |
void | setActionShown (QAction *, const bool) |
void | setActionShown (const int, const bool) |
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()) |
QAction * | createAction (const int, const QString &, const QIcon &, const QString &, const QString &, const QKeySequence &, QObject *=0, const bool=false, QObject *=0, const char *=0, const QString &=QString()) |
int | createTool (const QString &, const QString &=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) |
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) |
void | setMenuShown (QAction *, const bool) |
void | setMenuShown (const int, const bool) |
void | setToolShown (QAction *, const bool) |
void | setToolShown (const int, const bool) |
Private Slots | |
virtual void | onViewManagerActivated (SUIT_ViewManager *) |
Private Attributes | |
ViewManagerList | myViewMgrs |
SUIT_ViewManager * | myActiveViewMgr |
bool | myExitConfirm |
bool | myEditEnabled |
Additional Inherited Members | |
Protected Slots inherited from SUIT_Application | |
virtual void | onDesktopActivated () |
Static Protected Member Functions inherited from SUIT_Application | |
static QAction * | separator () |
anonymous enum |
STD_Application::STD_Application | ( | ) |
Constructor.
References setDesktop().
|
virtual |
Destructor.
References clearViewManagers().
|
protectedvirtual |
false
if some operation cannot be aborted Reimplemented in CAM_Application.
SUIT_ViewManager * STD_Application::activeViewManager | ( | ) | const |
SUIT_ViewManager | - return pointer to active view manager. |
References myActiveViewMgr.
|
virtual |
Add view manager to view managers list, if it not already there.
Reimplemented in LightApp_Application.
References SUIT_Application::activated(), SUIT_PopupClient::connectPopupRequest(), containsViewManager(), myViewMgrs, onConnectPopupRequest(), onViewManagerActivated(), and viewManagerAdded().
|
protectedvirtual |
Virtual function. Not implemented here.
Reimplemented in LightApp_Application, SalomeApp_Application, and CAM_Application.
|
signal |
|
virtual |
QString | "StdApplication" |
Implements SUIT_Application.
Reimplemented in LightApp_Application, and CAF_Application.
|
protectedvirtual |
Virtual function. Not implemented here.
Reimplemented in LightApp_Application, and CAM_Application.
void STD_Application::clearViewManagers | ( | ) |
Remove all view managers from view managers list.
References removeViewManager(), and viewManagers().
|
protectedvirtual |
Reimplemented in SalomeApp_Application.
References SUIT_Application::activeStudy(), CloseCancel, CloseDiscard, CloseSave, onSaveAsDoc(), and onSaveDoc().
|
protectedvirtual |
Close document.
References SUIT_Application::activeStudy(), afterCloseDoc(), SUIT_Session::applications(), beforeCloseDoc(), clearViewManagers(), closeApplication(), SUIT_Study::closeDocument(), SUIT_Application::desktop(), savePreferences(), SUIT_Session::session(), SUIT_Application::setActiveStudy(), setDesktop(), updateCommandsStatus(), and updateDesktopTitle().
|
virtual |
Close the Application
Reimplemented from SUIT_Application.
Reimplemented in LightApp_Application.
References SUIT_Application::activeStudy(), afterCloseDoc(), appClosed(), beforeCloseDoc(), SUIT_Application::closeApplication(), SUIT_Study::closeDocument(), SUIT_Application::desktop(), savePreferences(), SUIT_Application::setActiveStudy(), and setDesktop().
|
protectedvirtual |
Reimplemented in SalomeApp_Application.
References CloseCancel, CloseDiscard, CloseSave, SUIT_Application::desktop(), and SUIT_MessageBox::question().
|
protectedvirtual |
Close document, if it's possible.
References closeActiveDoc(), and isPossibleToClose().
bool STD_Application::containsViewManager | ( | SUIT_ViewManager * | vm | ) | const |
\c | true, if view manager vm, already in view manager list (myViewMgrs). |
References myViewMgrs.
|
inlinevirtual |
Reimplemented in LightApp_Application, SalomeApp_Application, and CAM_Application.
|
protectedvirtual |
Create actions, menus and tools
Reimplemented in LightApp_Application, SalomeApp_Application, and CAF_Application.
References SUIT_Application::createAction(), SUIT_Application::createMenu(), SUIT_Application::createTool(), SUIT_Application::desktop(), QtxDockAction::DockWidget, EditCopyId, EditPasteId, FileCloseId, FileExitId, FileNewId, FileOpenId, FileReopenId, FileSaveAsId, FileSaveId, HelpAboutId, QtxResourceMgr::loadPixmap(), MenuEditId, MenuFileId, MenuHelpId, MenuViewId, NewWindowId, onCloseDoc(), onCopy(), onExit(), onHelpAbout(), onNewDoc(), onOpenDoc(), onPaste(), onReopenDoc(), onSaveAsDoc(), onSaveDoc(), onViewStatusBar(), SUIT_Application::registerAction(), SUIT_Application::resourceMgr(), SUIT_Application::separator(), QtxDockAction::setDockType(), QtxDockAction::ToolBar, ViewStatusBarId, ViewToolBarsId, and ViewWindowsId.
|
virtual |
Create empty study.
Create new view manager and adding it to view managers list.
Reimplemented from SUIT_Application.
Reimplemented in LightApp_Application, and CAM_Application.
References SUIT_Application::createEmptyStudy().
bool STD_Application::exitConfirmation | ( | ) | const |
requirement | of exit confirmation |
References myExitConfirm.
|
virtual |
QString | - return directory name from dialog. |
Implements SUIT_Application.
References SUIT_Application::desktop().
|
virtual |
QString | - return file extension(s). |
Reimplemented in LightApp_Application, and CAF_Application.
|
virtual |
QString | - return file name from dialog. |
Implements SUIT_Application.
Reimplemented in LightApp_Application.
References SUIT_Application::desktop(), Qtx::extension(), SUIT_MessageBox::question(), and rx.
|
inline |
|
virtual |
Check the application on closing.
\c | true if possible, else false |
Reimplemented from SUIT_Application.
Reimplemented in SalomeApp_Application.
References SUIT_Study::abortAllOperations(), SUIT_Application::activeStudy(), closeAction(), closeChoice(), and SUIT_Study::studyName().
|
protectedvirtual |
Allow to load preferences before the desktop will be shown.
Reimplemented in LightApp_Application.
|
virtualslot |
Close document, if it's possible.
References closeDoc().
|
virtualslot |
Public slot.
References SUIT_PopupClient::contextMenuPopup(), contextMenuPopup(), SUIT_PopupClient::popupClientType(), QtxMenu::setTitleText(), and Qtx::simplifySeparators().
|
virtualslot |
Virtual slot. Not implemented here.
|
virtualslot |
Event on closing desktop
References closeApplication(), isPossibleToClose(), onExit(), and SUIT_Session::session().
|
virtualslot |
Closing session.
References SUIT_Session::closeSession(), SUIT_Application::desktop(), exitConfirmation(), SUIT_MessageBox::question(), and SUIT_Session::session().
|
virtualslot |
Call SUIT_MessageBox::info1(...) with about information.
References SUIT_Application::desktop(), and SUIT_MessageBox::information().
|
virtualslot |
Opens new application
|
virtualslot |
|
virtualslot |
Put file name from file dialog to onOpenDoc(const QString&) function
References getFileFilter(), and getFileName().
|
virtualslot |
\c | true, if document was opened successful, else false . |
References abortAllOperations(), openAction(), and openChoice().
|
virtualslot |
Virtual slot. Not implemented here.
|
virtualslot |
Reload document from the file.
References SUIT_Application::activeStudy(), afterCloseDoc(), SUIT_Session::applications(), beforeCloseDoc(), clearViewManagers(), closeApplication(), SUIT_Study::closeDocument(), SUIT_Application::desktop(), SUIT_Study::isSaved(), SUIT_MessageBox::question(), SUIT_Session::session(), SUIT_Application::setActiveStudy(), SUIT_Study::studyName(), updateCommandsStatus(), updateDesktopTitle(), and useFile().
|
virtualslot |
\c | true, if document saved successfully, else false . |
References abortAllOperations(), SUIT_Application::activeStudy(), SUIT_MessageBox::critical(), SUIT_Application::desktop(), getFileFilter(), getFileName(), SUIT_Application::putInfo(), SUIT_Study::saveDocumentAs(), SUIT_Study::studyName(), and studySaved().
|
virtualslot |
Save document if all ok, else error message.
References abortAllOperations(), SUIT_Application::activeStudy(), SUIT_MessageBox::critical(), SUIT_Application::desktop(), onSaveAsDoc(), SUIT_Application::putInfo(), SUIT_Study::saveDocument(), and studySaved().
|
privatevirtualslot |
Private slot, sets active manager to , if in view managers list.
References setActiveViewManager().
|
virtualslot |
Shows status bar, if on is true
, else hides status bar.
References SUIT_Application::desktop().
Reimplemented in LightApp_Application, and SalomeApp_Application.
References SUIT_Application::activeStudy(), SUIT_Session::applications(), SUIT_Application::closeApplication(), SUIT_Application::desktop(), OpenCancel, OpenExist, OpenNew, SUIT_Session::session(), SUIT_Application::startApplication(), useFile(), and SUIT_Application::useFile().
|
protectedvirtual |
Reimplemented in LightApp_Application, and SalomeApp_Application.
References SUIT_Session::applications(), OpenExist, OpenNew, and SUIT_Session::session().
|
virtual |
Remove view manager from view managers list.
Reimplemented in LightApp_Application.
References SUIT_Application::activated(), SUIT_ViewManager::closeAllViews(), SUIT_PopupClient::disconnectPopupRequest(), myActiveViewMgr, myViewMgrs, onConnectPopupRequest(), onViewManagerActivated(), and viewManagerRemoved().
|
protectedvirtual |
Allow to save preferences before the application will be closed.
Reimplemented in LightApp_Application.
|
protectedvirtual |
Sets active manager to , if in view managers list.
References containsViewManager(), myActiveViewMgr, and viewManagerActivated().
|
protectedvirtual |
Changes desktop
desk | - new desktop |
Reimplemented from SUIT_Application.
Reimplemented in LightApp_Application.
References onDesktopClosing(), and SUIT_Application::setDesktop().
void STD_Application::setEditEnabled | ( | const bool | theEnable | ) |
Sets theEnable for menu manager and for tool manager.
References SUIT_Application::action(), QtxActionMgr::actionId(), SUIT_Application::desktop(), EditCopyId, EditPasteId, SUIT_Desktop::menuMgr(), myEditEnabled, QtxActionMenuMgr::setShown(), QtxActionToolMgr::setShown(), and SUIT_Desktop::toolMgr().
void STD_Application::setExitConfirmation | ( | const bool | on | ) |
Set the requirement of exit confirmation
References myExitConfirm.
|
virtual |
Start STD_Application
Reimplemented from SUIT_Application.
Reimplemented in LightApp_Application, SalomeApp_Application, and CAM_Application.
References createActions(), loadPreferences(), myEditEnabled, setEditEnabled(), SUIT_Application::start(), updateCommandsStatus(), and updateDesktopTitle().
|
protectedvirtual |
Custom activity after study is created Updates desktop and actions
Reimplemented in LightApp_Application.
References updateCommandsStatus(), and updateDesktopTitle().
|
protectedvirtual |
Custom activity after study is opened Updates desktop and actions
Reimplemented in LightApp_Application.
References updateCommandsStatus(), and updateDesktopTitle().
|
protectedvirtual |
Custom activity after study is opened Updates desktop and actions
Reimplemented in LightApp_Application.
References updateCommandsStatus(), and updateDesktopTitle().
|
protectedvirtual |
Update commands status.
Reimplemented from SUIT_Application.
Reimplemented in LightApp_Application, SalomeApp_Application, CAM_Application, and CAF_Application.
References SUIT_Application::action(), SUIT_Application::activeStudy(), FileCloseId, FileReopenId, FileSaveAsId, FileSaveId, SUIT_Study::isModified(), SUIT_Study::isSaved(), NewWindowId, and SUIT_Application::updateCommandsStatus().
|
virtual |
Update desktop title.
Reimplemented in LightApp_Application, and SalomeApp_Application.
References SUIT_Application::activeStudy(), applicationName(), SUIT_Application::applicationVersion(), SUIT_Application::desktop(), and Qtx::file().
|
virtual |
\c | true, if document opened successfully, else false . |
Reimplemented from SUIT_Application.
References SUIT_Application::activeStudy(), studyOpened(), and SUIT_Application::useFile().
SUIT_ViewManager * STD_Application::viewManager | ( | const QString & | vmType | ) | const |
SUIT_ViewManager | by viewer manager type name. |
References myViewMgrs.
|
signal |
emit that view manager activated
|
signal |
emit that view manager added
|
virtual |
|
signal |
emit that view manager removed
ViewManagerList STD_Application::viewManagers | ( | ) | const |
ViewManagerList | - const list of all view managers. |
void STD_Application::viewManagers | ( | ViewManagerList & | lst | ) | const |
lst | - output list of all view managers. |
References myViewMgrs.
|
virtual |
vmType | - input view manager type name |
lst | - output list of view managers with types vmType. |
Implements SUIT_Application.
References myViewMgrs.
|
private |
|
private |
|
private |
|
private |