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

#include <STD_Application.h>

Inheritance diagram for STD_Application:
Inheritance graph

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_ViewManageractiveViewManager () const
 
SUIT_ViewManagerviewManager (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_Desktopdesktop ()
 Returns main widget (Desktop) of the application (if it exists) More...
 
virtual SUIT_StudyactiveStudy () 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_ResourceMgrresourceMgr () const
 
SUIT_ShortcutMgrshortcutMgr () const
 Get access to shortcut manager. More...
 
void putInfo (const QString &, const int=0)
 Puts the message to the status bar. More...
 
QActionaction (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_ApplicationstartApplication (int, char **) const
 
SUIT_ApplicationstartApplication (const QString &, int, char **) const
 
virtual SUIT_StudycreateNewStudy ()
 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 *)
 
QActioncreateAction (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())
 
QActioncreateAction (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_ViewManagermyActiveViewMgr
 
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 QActionseparator ()
 

Member Enumeration Documentation

anonymous enum
Enumerator
MenuFileId 
FileNewId 
FileOpenId 
FileReopenId 
FileCloseId 
FileSaveId 
FileSaveAsId 
FileExitId 
MenuViewId 
ViewWindowsId 
ViewToolBarsId 
ViewStatusBarId 
NewWindowId 
MenuEditId 
EditCutId 
EditCopyId 
EditPasteId 
MenuHelpId 
HelpAboutId 
UserID 
anonymous enum
protected
Enumerator
OpenCancel 
OpenNew 
OpenExist 
anonymous enum
protected
Enumerator
CloseCancel 
CloseSave 
CloseDiscard 

Constructor & Destructor Documentation

STD_Application::STD_Application ( )

Constructor.

References setDesktop().

STD_Application::~STD_Application ( )
virtual

Destructor.

References clearViewManagers().

Member Function Documentation

bool STD_Application::abortAllOperations ( )
protectedvirtual
Returns
false if some operation cannot be aborted

Reimplemented in CAM_Application.

SUIT_ViewManager * STD_Application::activeViewManager ( ) const
Return values
SUIT_ViewManager- return pointer to active view manager.

References myActiveViewMgr.

void STD_Application::addViewManager ( SUIT_ViewManager vm)
virtual
void STD_Application::afterCloseDoc ( )
protectedvirtual

Virtual function. Not implemented here.

Reimplemented in LightApp_Application, SalomeApp_Application, and CAM_Application.

void STD_Application::appClosed ( )
signal
QString STD_Application::applicationName ( ) const
virtual
Return values
QString"StdApplication"

Implements SUIT_Application.

Reimplemented in LightApp_Application, and CAF_Application.

void STD_Application::beforeCloseDoc ( SUIT_Study theDoc)
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().

bool STD_Application::closeAction ( const int  choice,
bool &  closePermanently 
)
protectedvirtual
int STD_Application::closeChoice ( const QString &  docName)
protectedvirtual
bool STD_Application::closeDoc ( bool  ask = true)
protectedvirtual

Close document, if it's possible.

References closeActiveDoc(), and isPossibleToClose().

bool STD_Application::containsViewManager ( SUIT_ViewManager vm) const
Return values
\ctrue, if view manager vm, already in view manager list (myViewMgrs).

References myViewMgrs.

virtual void STD_Application::contextMenuPopup ( const QString &  ,
QMenu ,
QString &   
)
inlinevirtual
void STD_Application::createEmptyStudy ( )
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
Return values
requirementof exit confirmation

References myExitConfirm.

QString STD_Application::getDirectory ( const QString &  initial,
const QString &  caption,
QWidget parent 
)
virtual
Return values
QString- return directory name from dialog.

Implements SUIT_Application.

References SUIT_Application::desktop().

QString STD_Application::getFileFilter ( bool  open) const
virtual
Return values
QString- return file extension(s).

Reimplemented in LightApp_Application, and CAF_Application.

QString STD_Application::getFileName ( bool  open,
const QString &  initial,
const QString &  filters,
const QString &  caption,
QWidget parent 
)
virtual
Return values
QString- return file name from dialog.

Implements SUIT_Application.

Reimplemented in LightApp_Application.

References SUIT_Application::desktop(), Qtx::extension(), SUIT_MessageBox::question(), and rx.

bool STD_Application::isEditEnabled ( ) const
inline
bool STD_Application::isPossibleToClose ( bool &  closePermanently)
virtual

Check the application on closing.

Return values
\ctrue 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().

void STD_Application::loadPreferences ( )
protectedvirtual

Allow to load preferences before the desktop will be shown.

Reimplemented in LightApp_Application.

void STD_Application::onCloseDoc ( bool  ask = true)
virtualslot

Close document, if it's possible.

References closeDoc().

void STD_Application::onConnectPopupRequest ( SUIT_PopupClient client,
QContextMenuEvent *  e 
)
virtualslot
void STD_Application::onCopy ( )
virtualslot

Virtual slot. Not implemented here.

void STD_Application::onDesktopClosing ( SUIT_Desktop ,
QCloseEvent *  e 
)
virtualslot

Event on closing desktop

References closeApplication(), isPossibleToClose(), onExit(), and SUIT_Session::session().

void STD_Application::onExit ( )
virtualslot
void STD_Application::onHelpAbout ( )
virtualslot

Call SUIT_MessageBox::info1(...) with about information.

References SUIT_Application::desktop(), and SUIT_MessageBox::information().

void STD_Application::onNewDoc ( )
virtualslot

Opens new application

void STD_Application::onOpenDoc ( )
virtualslot

Put file name from file dialog to onOpenDoc(const QString&) function

References getFileFilter(), and getFileName().

bool STD_Application::onOpenDoc ( const QString &  aName)
virtualslot
Return values
\ctrue, if document was opened successful, else false.

References abortAllOperations(), openAction(), and openChoice().

void STD_Application::onPaste ( )
virtualslot

Virtual slot. Not implemented here.

bool STD_Application::onSaveAsDoc ( )
virtualslot
void STD_Application::onSaveDoc ( )
virtualslot
void STD_Application::onViewManagerActivated ( SUIT_ViewManager vm)
privatevirtualslot

Private slot, sets active manager to , if in view managers list.

References setActiveViewManager().

void STD_Application::onViewStatusBar ( bool  on)
virtualslot

Shows status bar, if on is true, else hides status bar.

References SUIT_Application::desktop().

int STD_Application::openChoice ( const QString &  aName)
protectedvirtual
void STD_Application::removeViewManager ( SUIT_ViewManager vm)
virtual
void STD_Application::savePreferences ( )
protectedvirtual

Allow to save preferences before the application will be closed.

Reimplemented in LightApp_Application.

void STD_Application::setActiveViewManager ( SUIT_ViewManager vm)
protectedvirtual

Sets active manager to , if in view managers list.

References containsViewManager(), myActiveViewMgr, and viewManagerActivated().

void STD_Application::setDesktop ( SUIT_Desktop desk)
protectedvirtual

Changes desktop

Parameters
desk- new desktop

Reimplemented from SUIT_Application.

Reimplemented in LightApp_Application.

References onDesktopClosing(), and SUIT_Application::setDesktop().

void STD_Application::setEditEnabled ( const bool  theEnable)
void STD_Application::setExitConfirmation ( const bool  on)

Set the requirement of exit confirmation

References myExitConfirm.

void STD_Application::studyCreated ( SUIT_Study )
protectedvirtual

Custom activity after study is created Updates desktop and actions

Reimplemented in LightApp_Application.

References updateCommandsStatus(), and updateDesktopTitle().

void STD_Application::studyOpened ( SUIT_Study )
protectedvirtual

Custom activity after study is opened Updates desktop and actions

Reimplemented in LightApp_Application.

References updateCommandsStatus(), and updateDesktopTitle().

void STD_Application::studySaved ( SUIT_Study )
protectedvirtual

Custom activity after study is opened Updates desktop and actions

Reimplemented in LightApp_Application.

References updateCommandsStatus(), and updateDesktopTitle().

void STD_Application::updateDesktopTitle ( )
virtual
bool STD_Application::useFile ( const QString &  theFileName)
virtual
Return values
\ctrue, 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
Return values
SUIT_ViewManagerby viewer manager type name.

References myViewMgrs.

void STD_Application::viewManagerActivated ( SUIT_ViewManager )
signal

emit that view manager activated

void STD_Application::viewManagerAdded ( SUIT_ViewManager )
signal

emit that view manager added

int STD_Application::viewManagerId ( const SUIT_ViewManager theManager) const
virtual

Return index of the view ma

Implements SUIT_Application.

References myViewMgrs.

void STD_Application::viewManagerRemoved ( SUIT_ViewManager )
signal

emit that view manager removed

ViewManagerList STD_Application::viewManagers ( ) const
Return values
ViewManagerList- const list of all view managers.
void STD_Application::viewManagers ( ViewManagerList lst) const
Parameters
lst- output list of all view managers.

References myViewMgrs.

void STD_Application::viewManagers ( const QString &  vmType,
ViewManagerList lst 
) const
virtual
Parameters
vmType- input view manager type name
lst- output list of view managers with types vmType.

Implements SUIT_Application.

References myViewMgrs.

Member Data Documentation

SUIT_ViewManager* STD_Application::myActiveViewMgr
private
bool STD_Application::myEditEnabled
private
bool STD_Application::myExitConfirm
private
ViewManagerList STD_Application::myViewMgrs
private

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