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

OCC OCAF-based application. More...

#include <CAF_Application.h>

Inheritance diagram for CAF_Application:
Inheritance graph

Public Slots

virtual void onHelpAbout ()
 Called when user activatees Help->About main menu command. More...
 
- Public Slots inherited from STD_Application
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())
 

Public Member Functions

 CAF_Application ()
 Default constructor. More...
 
 CAF_Application (const Handle(TDocStd_Application)&)
 Constructor. More...
 
virtual ~CAF_Application ()
 Destructor. More...
 
virtual QString applicationName () const
 Get application name. More...
 
 Handle (TDocStd_Application) stdApp() const
 
virtual QString getFileFilter (bool) const
 
- Public Member Functions inherited from STD_Application
 STD_Application ()
 
virtual ~STD_Application ()
 
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 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  { EditUndoId = STD_Application::UserID, EditRedoId, UserID }
 
- Protected Types inherited from STD_Application
enum  { OpenCancel, OpenNew, OpenExist }
 
enum  { CloseCancel, CloseSave, CloseDiscard }
 

Protected Slots

virtual bool onUndo (int)
 Called when user activates "Undo" menu action. More...
 
virtual bool onRedo (int)
 Called when user activates "Redo" menu action. More...
 

Protected Member Functions

virtual void createActions ()
 Create menu and toolbars actions. More...
 
virtual void updateCommandsStatus ()
 Update actions state (Undo/Redo). More...
 
virtual SUIT_StudycreateNewStudy ()
 Create new empty study. More...
 
bool undo (CAF_Study *doc)
 Undo latest command operation for specified document. More...
 
bool redo (CAF_Study *doc)
 Redo latest command operation undo for specified document. More...
 
virtual void setStdApp (const Handle(TDocStd_Application)&)
 Set OCAF application. More...
 
- Protected Member Functions inherited from STD_Application
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 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 Member Functions

 Handle (TDocStd_Application) myStdApp
 

Additional Inherited Members

- Public Types inherited from STD_Application
enum  {
  MenuFileId, FileNewId, FileOpenId, FileReopenId,
  FileCloseId, FileSaveId, FileSaveAsId, FileExitId,
  MenuViewId, ViewWindowsId, ViewToolBarsId, ViewStatusBarId,
  NewWindowId, MenuEditId, EditCutId, EditCopyId,
  EditPasteId, MenuHelpId, HelpAboutId, UserID
}
 
- Signals inherited from STD_Application
void viewManagerAdded (SUIT_ViewManager *)
 
void viewManagerRemoved (SUIT_ViewManager *)
 
void viewManagerActivated (SUIT_ViewManager *)
 
void appClosed ()
 
- Static Protected Member Functions inherited from SUIT_Application
static QActionseparator ()
 

Detailed Description

Defines application configuration and behaviour for application using standard OCC OCAF data model. Allows using OCC OCAF serives (for example, undo/redo mechanizm).

Member Enumeration Documentation

anonymous enum
protected
Enumerator
EditUndoId 
EditRedoId 
UserID 

Constructor & Destructor Documentation

CAF_Application::CAF_Application ( )
CAF_Application::CAF_Application ( const Handle(TDocStd_Application)&  app)
Parameters
appOCAF application
CAF_Application::~CAF_Application ( )
virtual

Member Function Documentation

QString CAF_Application::applicationName ( ) const
virtual
Returns
application name

Reimplemented from STD_Application.

SUIT_Study * CAF_Application::createNewStudy ( )
protectedvirtual
Returns
new study

Reimplemented from SUIT_Application.

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

Reimplemented from STD_Application.

CAF_Application::Handle ( TDocStd_Application  ) const
CAF_Application::Handle ( TDocStd_Application  )
private
void CAF_Application::onHelpAbout ( )
virtualslot
bool CAF_Application::onRedo ( int  numActions)
protectedvirtualslot

Redo latest undo commands on the active document.

Parameters
numActionsredo depth (number of commands)
Returns
true on success

References SUIT_Application::activeStudy(), redo(), and updateCommandsStatus().

bool CAF_Application::onUndo ( int  numActions)
protectedvirtualslot

Undo operation on the active document.

Parameters
numActionsundo depth (number of commands)
Returns
true on success

References SUIT_Application::activeStudy(), undo(), and updateCommandsStatus().

bool CAF_Application::redo ( CAF_Study doc)
protected
Parameters
docOCAF document
Returns
true on success

References CAF_Study::redo(), and SUIT_Study::update().

void CAF_Application::setStdApp ( const Handle(TDocStd_Application)&  app)
protectedvirtual
Parameters
appnew OCAF application

References app.

bool CAF_Application::undo ( CAF_Study doc)
protected
Parameters
docOCAF document
Returns
true on success

References CAF_Study::undo(), and SUIT_Study::update().


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