#include <iostream.h>
+/*!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 ),
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();
SUIT_Application::start();
}
+/*!Event on closing desktop*/
void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e )
{
if ( !isPossibleToClose() )
closeApplication();
}
+/*!Create actions, menus and tools*/
void STD_Application::createActions()
{
SUIT_Desktop* desk = desktop();
createTool( EditPasteId, stdTBar );
}
-/*!
- Opens new application
-*/
+/*!Opens new application*/
void STD_Application::onNewDoc()
{
if ( !activeStudy() )
}
}
+/*!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 !!!
onOpenDoc( aName );
}
+/*! \retval true, if document was opened successful, else false.*/
bool STD_Application::onOpenDoc( const QString& aName )
{
bool res = true;
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;
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() )
closeApplication();
}
+/*!Check the application on closing.
+ * \retval true if possible, else false
+ */
bool STD_Application::isPossibleToClose()
{
if ( activeStudy() )
return true;
}
+/*!Save document if all ok, else error message.*/
void STD_Application::onSaveDoc()
{
if ( !activeStudy() )
onSaveAsDoc();
}
+/*! \retval TRUE, if doument saved successful, else FALSE.*/
bool STD_Application::onSaveAsDoc()
{
SUIT_Study* study = activeStudy();
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;
}
}
+/*!\retval true, if document opened successful, else false.*/
bool STD_Application::useFile(const QString& theFileName)
{
bool res = SUIT_Application::useFile(theFileName);
return res;
}
+/*!Update desktop title.*/
void STD_Application::updateDesktopTitle()
{
QString aTitle = applicationName();
desktop()->setCaption( aTitle );
}
+/*!Update commands status.*/
void STD_Application::updateCommandsStatus()
{
bool aHasStudy = activeStudy() != 0;
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;
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<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
lst.append( it.current() );
}
+/*!\param lst - output list of all view managers.*/
void STD_Application::viewManagers( ViewManagerList& lst ) const
{
for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
lst.append( it.current() );
}
+/*!\retval ViewManagerList - const list of all view managers.*/
ViewManagerList STD_Application::viewManagers() const
{
ViewManagerList lst;
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 )
*/
}
+/*!Remove view manager from view managers list.*/
void STD_Application::removeViewManager( SUIT_ViewManager* vm )
{
if ( !vm )
myActiveViewMgr = 0;
}
+/*!Remove all view managers from view managers list.*/
void STD_Application::clearViewManagers()
{
ViewManagerList lst;
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 )
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();
addViewManager( vm );
}
+/*!Sets active manager to \vm, if \vm in view managers list.*/
void STD_Application::setActiveViewManager( SUIT_ViewManager* vm )
{
if ( !containsViewManager( vm ) )
emit viewManagerActivated( vm );
}
+/*!Public slot. */
void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e )
{
QtxPopupMenu* popup = new QtxPopupMenu();
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 )
{
}
}
+/*!\retval QString - return directory name from dialog.*/
QString STD_Application::getDirectory( const QString& initial, const QString& caption, QWidget* parent )
{
if ( !parent )
#include <stdarg.h>
+/*!Constructor.*/
STD_MDIDesktop::STD_MDIDesktop()
: SUIT_Desktop(),
myWorkspace( 0 ),
createActions();
}
+/*!destructor.*/
STD_MDIDesktop::~STD_MDIDesktop()
{
}
+/*!\retval SUIT_ViewWindow - return const active window.*/
SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const
{
SUIT_ViewWindow* wnd = 0;
return wnd;
}
+/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
QPtrList<SUIT_ViewWindow> STD_MDIDesktop::windows() const
{
QPtrList<SUIT_ViewWindow> winList;
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;
setWindowOperations( typeList );
}
+/*!Sets window operations by variable \a opList - operation list.*/
void STD_MDIDesktop::setWindowOperations( const QValueList<int>& opList )
{
int flags = 0;
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 )
mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 );
}
+/*!Convert STD_MDIDesktop enumerations to QtxWorkspaceAction.*/
int STD_MDIDesktop::operationFlag( const int type ) const
{
int res = 0;
#include <stdarg.h>
+/*!Constructor.Create new instances of QVBox and QtxWorkstack.*/
STD_TabDesktop::STD_TabDesktop()
: SUIT_Desktop(),
myWorkstack( 0 ),
createActions();
}
+/*!Destructor.*/
STD_TabDesktop::~STD_TabDesktop()
{
}
+/*!\retval SUIT_ViewWindow - return const active window.*/
SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
{
SUIT_ViewWindow* wnd = 0;
return wnd;
}
+/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
QPtrList<SUIT_ViewWindow> STD_TabDesktop::windows() const
{
QPtrList<SUIT_ViewWindow> winList;
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;
setWindowOperations( typeList );
}
+/*!Sets window operations by variable \a opList - operation list.*/
void STD_TabDesktop::setWindowOperations( const QValueList<int>& opList )
{
int flags = 0;
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 )
mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 );
}
+/*!Convert STD_TabDesktop enumerations to QtxWorkstackAction*/
int STD_TabDesktop::operationFlag( const int type ) const
{
int res = 0;