From 48f87311088ea6fdb1ad69e494ff33576d42a61a Mon Sep 17 00:00:00 2001 From: enk Date: Wed, 13 Jul 2005 10:13:18 +0000 Subject: [PATCH] Update comments --- src/STD/STD_Application.cxx | 54 ++++++++++++++++++++++++++++++++----- src/STD/STD_Application.h | 3 +++ src/STD/STD_CloseDlg.cxx | 4 +-- src/STD/STD_CloseDlg.h | 4 ++- src/STD/STD_MDIDesktop.cxx | 12 +++++++++ src/STD/STD_SDIDesktop.cxx | 5 ++++ src/STD/STD_TabDesktop.cxx | 12 +++++++++ 7 files changed, 83 insertions(+), 11 deletions(-) diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index d0c62c30a..ab3eaa891 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -26,11 +26,13 @@ #include +/*!Create and return new instance of STD_Application*/ extern "C" STD_EXPORT SUIT_Application* createApplication() { return new STD_Application(); } +/*!Constructor.*/ STD_Application::STD_Application() : SUIT_Application(), myEditEnabled( true ), @@ -44,15 +46,18 @@ myActiveViewMgr( 0 ) setDesktop( desk ); } +/*!Destructor.*/ STD_Application::~STD_Application() { } +/*! \retval QString "StdApplication"*/ QString STD_Application::applicationName() const { return QString( "StdApplication" ); } +/*!Start STD_Application*/ void STD_Application::start() { createActions(); @@ -64,6 +69,7 @@ void STD_Application::start() SUIT_Application::start(); } +/*!Event on closing desktop*/ void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e ) { if ( !isPossibleToClose() ) @@ -85,6 +91,7 @@ void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e ) closeApplication(); } +/*!Create actions, menus and tools*/ void STD_Application::createActions() { SUIT_Desktop* desk = desktop(); @@ -203,9 +210,7 @@ void STD_Application::createActions() createTool( EditPasteId, stdTBar ); } -/*! - Opens new application -*/ +/*!Opens new application*/ void STD_Application::onNewDoc() { if ( !activeStudy() ) @@ -227,6 +232,7 @@ void STD_Application::onNewDoc() } } +/*!Put file name from file dialog to onOpenDoc(const QString&) function*/ void STD_Application::onOpenDoc() { // It is preferrable to use OS-specific file dialog box here !!! @@ -237,6 +243,7 @@ void STD_Application::onOpenDoc() onOpenDoc( aName ); } +/*! \retval true, if document was opened successful, else false.*/ bool STD_Application::onOpenDoc( const QString& aName ) { bool res = true; @@ -270,10 +277,7 @@ bool STD_Application::onOpenDoc( const QString& aName ) return res; } -void STD_Application::onLoadDoc() -{ -} - +/*! \retval true, if document was loaded successful, else false.*/ bool STD_Application::onLoadDoc( const QString& aName ) { bool res = true; @@ -307,14 +311,17 @@ bool STD_Application::onLoadDoc( const QString& aName ) return res; } +/*!Virtual function. Not implemented here.*/ void STD_Application::beforeCloseDoc( SUIT_Study* ) { } +/*!Virtual function. Not implemented here.*/ void STD_Application::afterCloseDoc() { } +/*!Close document, if it's possible.*/ void STD_Application::onCloseDoc() { if ( !isPossibleToClose() ) @@ -353,6 +360,9 @@ void STD_Application::onCloseDoc() closeApplication(); } +/*!Check the application on closing. + * \retval true if possible, else false + */ bool STD_Application::isPossibleToClose() { if ( activeStudy() ) @@ -387,6 +397,7 @@ bool STD_Application::isPossibleToClose() return true; } +/*!Save document if all ok, else error message.*/ void STD_Application::onSaveDoc() { if ( !activeStudy() ) @@ -407,6 +418,7 @@ void STD_Application::onSaveDoc() onSaveAsDoc(); } +/*! \retval TRUE, if doument saved successful, else FALSE.*/ bool STD_Application::onSaveAsDoc() { SUIT_Study* study = activeStudy(); @@ -425,19 +437,23 @@ bool STD_Application::onSaveAsDoc() return isOk; } +/*!Closing session.*/ void STD_Application::onExit() { SUIT_Session::session()->closeSession(); } +/*!Virtual slot. Not implemented here.*/ void STD_Application::onCopy() { } +/*!Virtual slot. Not implemented here.*/ void STD_Application::onPaste() { } +/*!Sets \a theEnable for menu manager and for tool manager.*/ void STD_Application::setEditEnabled( bool theEnable ) { myEditEnabled = theEnable; @@ -452,6 +468,7 @@ void STD_Application::setEditEnabled( bool theEnable ) } } +/*!\retval true, if document opened successful, else false.*/ bool STD_Application::useFile(const QString& theFileName) { bool res = SUIT_Application::useFile(theFileName); @@ -460,6 +477,7 @@ bool STD_Application::useFile(const QString& theFileName) return res; } +/*!Update desktop title.*/ void STD_Application::updateDesktopTitle() { QString aTitle = applicationName(); @@ -477,6 +495,7 @@ void STD_Application::updateDesktopTitle() desktop()->setCaption( aTitle ); } +/*!Update commands status.*/ void STD_Application::updateCommandsStatus() { bool aHasStudy = activeStudy() != 0; @@ -494,6 +513,7 @@ void STD_Application::updateCommandsStatus() action( NewWindowId )->setEnabled( aHasStudy ); } +/*!\retval SUIT_ViewManager by viewer manager type name.*/ SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const { SUIT_ViewManager* vm = 0; @@ -505,6 +525,9 @@ SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const return vm; } +/*! \param vmType - input view manager type name + * \param lst - output list of view managers with types \a vmType. + */ void STD_Application::viewManagers( const QString& vmType, ViewManagerList& lst ) const { for ( QPtrListIterator it( myViewMgrs ); it.current(); ++it ) @@ -512,12 +535,14 @@ void STD_Application::viewManagers( const QString& vmType, ViewManagerList& lst lst.append( it.current() ); } +/*!\param lst - output list of all view managers.*/ void STD_Application::viewManagers( ViewManagerList& lst ) const { for ( QPtrListIterator it( myViewMgrs ); it.current(); ++it ) lst.append( it.current() ); } +/*!\retval ViewManagerList - const list of all view managers.*/ ViewManagerList STD_Application::viewManagers() const { ViewManagerList lst; @@ -525,11 +550,13 @@ ViewManagerList STD_Application::viewManagers() const return lst; } +/*!\retval SUIT_ViewManager - return pointer to active view manager.*/ SUIT_ViewManager* STD_Application::activeViewManager() const { return myActiveViewMgr; } +/*!Add view manager to view managers list, if it not already there.*/ void STD_Application::addViewManager( SUIT_ViewManager* vm ) { if ( !vm ) @@ -550,6 +577,7 @@ void STD_Application::addViewManager( SUIT_ViewManager* vm ) */ } +/*!Remove view manager from view managers list.*/ void STD_Application::removeViewManager( SUIT_ViewManager* vm ) { if ( !vm ) @@ -567,6 +595,7 @@ void STD_Application::removeViewManager( SUIT_ViewManager* vm ) myActiveViewMgr = 0; } +/*!Remove all view managers from view managers list.*/ void STD_Application::clearViewManagers() { ViewManagerList lst; @@ -576,16 +605,19 @@ void STD_Application::clearViewManagers() removeViewManager( it.current() ); } +/*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/ bool STD_Application::containsViewManager( SUIT_ViewManager* vm ) const { return myViewMgrs.contains( vm ) > 0; } +/*!Private slot, sets active manager to \vm, if \vm in view managers list.*/ void STD_Application::onViewManagerActivated( SUIT_ViewManager* vm ) { setActiveViewManager( vm ); } +/*!Sets status bar show, if \on = true, else status bar hide.*/ void STD_Application::onViewStatusBar( bool on ) { if ( on ) @@ -594,11 +626,15 @@ void STD_Application::onViewStatusBar( bool on ) desktop()->statusBar()->hide(); } +/*!Call SUIT_MessageBox::info1(...) with about information.*/ void STD_Application::onHelpAbout() { SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" ); } +/*!Create empty study. \n + * Create new view manager and adding it to view managers list. + */ void STD_Application::createEmptyStudy() { SUIT_Application::createEmptyStudy(); @@ -608,6 +644,7 @@ void STD_Application::createEmptyStudy() addViewManager( vm ); } +/*!Sets active manager to \vm, if \vm in view managers list.*/ void STD_Application::setActiveViewManager( SUIT_ViewManager* vm ) { if ( !containsViewManager( vm ) ) @@ -617,6 +654,7 @@ void STD_Application::setActiveViewManager( SUIT_ViewManager* vm ) emit viewManagerActivated( vm ); } +/*!Public slot. */ void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e ) { QtxPopupMenu* popup = new QtxPopupMenu(); @@ -636,6 +674,7 @@ void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextM delete popup; } +/*!\retval QString - return file name from dialog.*/ QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ) { @@ -697,6 +736,7 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q } } +/*!\retval QString - return directory name from dialog.*/ QString STD_Application::getDirectory( const QString& initial, const QString& caption, QWidget* parent ) { if ( !parent ) diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index e5041ccfd..a3233d73c 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -65,8 +65,11 @@ public: virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& ) {} signals: + /*!emit that view manager added*/ void viewManagerAdded( SUIT_ViewManager* ); + /*!emit that view manager removed*/ void viewManagerRemoved( SUIT_ViewManager* ); + /*!emit that view manager activated*/ void viewManagerActivated( SUIT_ViewManager* ); public slots: diff --git a/src/STD/STD_CloseDlg.cxx b/src/STD/STD_CloseDlg.cxx index 46d8d9f70..ab78c0795 100644 --- a/src/STD/STD_CloseDlg.cxx +++ b/src/STD/STD_CloseDlg.cxx @@ -9,7 +9,7 @@ using namespace std; //================================================================================ -/*! Public - +/*! * \brief creates a Close dialog box * \param parent a parent widget * \param modal bool argument, if true the dialog box is a modal dialog box @@ -70,8 +70,6 @@ STD_CloseDlg::STD_CloseDlg ( QWidget * parent, bool modal, WFlags f ) //================================================================================ /*! * \brief reaction on clicked(pressed) button - * - * */ //================================================================================ diff --git a/src/STD/STD_CloseDlg.h b/src/STD/STD_CloseDlg.h index cc41a854f..157a2fadb 100644 --- a/src/STD/STD_CloseDlg.h +++ b/src/STD/STD_CloseDlg.h @@ -3,9 +3,11 @@ #include +/*! \class QDialog + * \brief For more information see QT documentation. + */ /*!\class STD_CloseDlg * \brief Describes a dialog box shown on closing the active study - * */ class STD_CloseDlg: public QDialog { diff --git a/src/STD/STD_MDIDesktop.cxx b/src/STD/STD_MDIDesktop.cxx index 7a9aca2eb..919cd67ec 100755 --- a/src/STD/STD_MDIDesktop.cxx +++ b/src/STD/STD_MDIDesktop.cxx @@ -15,6 +15,7 @@ #include +/*!Constructor.*/ STD_MDIDesktop::STD_MDIDesktop() : SUIT_Desktop(), myWorkspace( 0 ), @@ -33,10 +34,12 @@ myWorkspaceAction( 0 ) createActions(); } +/*!destructor.*/ STD_MDIDesktop::~STD_MDIDesktop() { } +/*!\retval SUIT_ViewWindow - return const active window.*/ SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const { SUIT_ViewWindow* wnd = 0; @@ -48,6 +51,7 @@ SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const return wnd; } +/*!\retval QPtrList - return const active window list.*/ QPtrList STD_MDIDesktop::windows() const { QPtrList winList; @@ -62,16 +66,19 @@ QPtrList STD_MDIDesktop::windows() const return winList; } +/*!\retval QWidget - pointer to work space.*/ QWidget* STD_MDIDesktop::parentArea() const { return workspace(); } +/*!Call method perform for operation \a type.*/ void STD_MDIDesktop::windowOperation( const int type ) { myWorkspaceAction->perform( operationFlag( type ) ); } +/*!Sets window operations by \a first ... parameters.*/ void STD_MDIDesktop::setWindowOperations( const int first, ... ) { va_list ints; @@ -89,6 +96,7 @@ void STD_MDIDesktop::setWindowOperations( const int first, ... ) setWindowOperations( typeList ); } +/*!Sets window operations by variable \a opList - operation list.*/ void STD_MDIDesktop::setWindowOperations( const QValueList& opList ) { int flags = 0; @@ -99,17 +107,20 @@ void STD_MDIDesktop::setWindowOperations( const QValueList& opList ) myWorkspaceAction->setItems( flags ); } +/*!\retval QWorkspace pointer - work space.*/ QWorkspace* STD_MDIDesktop::workspace() const { return myWorkspace; } +/*!Emit window activated.*/ void STD_MDIDesktop::onWindowActivated( QWidget* w ) { if ( w && w->inherits( "SUIT_ViewWindow" ) ) emit windowActivated( (SUIT_ViewWindow*)w ); } +/*!Create actions: cascade, Tile, Tile Horizontal, Tile Vertical*/ void STD_MDIDesktop::createActions() { if ( myWorkspaceAction ) @@ -159,6 +170,7 @@ void STD_MDIDesktop::createActions() mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 ); } +/*!Convert STD_MDIDesktop enumerations to QtxWorkspaceAction.*/ int STD_MDIDesktop::operationFlag( const int type ) const { int res = 0; diff --git a/src/STD/STD_SDIDesktop.cxx b/src/STD/STD_SDIDesktop.cxx index 96d72d096..db6aebf30 100755 --- a/src/STD/STD_SDIDesktop.cxx +++ b/src/STD/STD_SDIDesktop.cxx @@ -6,6 +6,7 @@ #include #include +/*!Constructor. Create instance of QVBox*/ STD_SDIDesktop::STD_SDIDesktop() : SUIT_Desktop() { @@ -15,10 +16,12 @@ STD_SDIDesktop::STD_SDIDesktop() setCentralWidget( myMainWidget ); } +/*!Destructor.*/ STD_SDIDesktop::~STD_SDIDesktop() { } +/*!\retval SUIT_ViewWindow - return const active window.*/ SUIT_ViewWindow* STD_SDIDesktop::activeWindow() const { const QObjectList* children = myMainWidget->children(); @@ -45,6 +48,7 @@ SUIT_ViewWindow* STD_SDIDesktop::activeWindow() const return win; } +/*!\retval QPtrList - return const active window list.*/ QPtrList STD_SDIDesktop::windows() const { QPtrList winList; @@ -52,6 +56,7 @@ QPtrList STD_SDIDesktop::windows() const return winList; } +/*!\retval QWidget - pointer to main window.*/ QWidget* STD_SDIDesktop::parentArea() const { return myMainWidget; diff --git a/src/STD/STD_TabDesktop.cxx b/src/STD/STD_TabDesktop.cxx index d2039af15..c5a4c66b7 100644 --- a/src/STD/STD_TabDesktop.cxx +++ b/src/STD/STD_TabDesktop.cxx @@ -16,6 +16,7 @@ #include +/*!Constructor.Create new instances of QVBox and QtxWorkstack.*/ STD_TabDesktop::STD_TabDesktop() : SUIT_Desktop(), myWorkstack( 0 ), @@ -38,10 +39,12 @@ myWorkstackAction( 0 ) createActions(); } +/*!Destructor.*/ STD_TabDesktop::~STD_TabDesktop() { } +/*!\retval SUIT_ViewWindow - return const active window.*/ SUIT_ViewWindow* STD_TabDesktop::activeWindow() const { SUIT_ViewWindow* wnd = 0; @@ -53,6 +56,7 @@ SUIT_ViewWindow* STD_TabDesktop::activeWindow() const return wnd; } +/*!\retval QPtrList - return const active window list.*/ QPtrList STD_TabDesktop::windows() const { QPtrList winList; @@ -67,16 +71,19 @@ QPtrList STD_TabDesktop::windows() const return winList; } +/*!\retval QWidget pointer - QT work stack.*/ QWidget* STD_TabDesktop::parentArea() const { return workstack(); } +/*!Call method perform for operation \a type.*/ void STD_TabDesktop::windowOperation( const int type ) { myWorkstackAction->perform( operationFlag( type ) ); } +/*!Sets window operations by \a first ... parameters.*/ void STD_TabDesktop::setWindowOperations( const int first, ... ) { va_list ints; @@ -94,6 +101,7 @@ void STD_TabDesktop::setWindowOperations( const int first, ... ) setWindowOperations( typeList ); } +/*!Sets window operations by variable \a opList - operation list.*/ void STD_TabDesktop::setWindowOperations( const QValueList& opList ) { int flags = 0; @@ -104,17 +112,20 @@ void STD_TabDesktop::setWindowOperations( const QValueList& opList ) myWorkstackAction->setItems( flags ); } +/*!\retval QtxWorkstack pointer - QT work stack.*/ QtxWorkstack* STD_TabDesktop::workstack() const { return myWorkstack; } +/*!Emit window activated.*/ void STD_TabDesktop::onWindowActivated( QWidget* w ) { if ( w && w->inherits( "SUIT_ViewWindow" ) ) emit windowActivated( (SUIT_ViewWindow*)w ); } +/*!Create actions for window.*/ void STD_TabDesktop::createActions() { if ( myWorkstackAction ) @@ -149,6 +160,7 @@ void STD_TabDesktop::createActions() mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 ); } +/*!Convert STD_TabDesktop enumerations to QtxWorkstackAction*/ int STD_TabDesktop::operationFlag( const int type ) const { int res = 0; -- 2.39.2