-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "CAM_Study.h"
#include <QtxAction.h>
+#include <QtxActionGroup.h>
#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
+#include <QMenu>
+
/*!
\class CAM_Module
\brief Base implementation of the module in the CAM application architecture.
QAction* a = 0;
if ( myActionMap.contains( id ) )
a = myActionMap[id];
+ else if ( menuMgr() ) {
+ QMenu* m = menuMgr()->findMenu( id );
+ if ( m ) a = m->menuAction();
+ }
return a;
}
return a;
}
+/*!
+ \brief Create new action group.
+ \param id action group ID
+ \param exclusive \c true for exclusive action group
+ \return created action group
+*/
+QtxActionGroup* CAM_Module::createActionGroup( const int id, const bool exclusive )
+{
+ QtxActionGroup* a = qobject_cast<QtxActionGroup*>( action( id ) );
+ if ( !a ) {
+ a = new QtxActionGroup( this );
+ registerAction( id, a );
+ }
+ a->setExclusive( exclusive );
+ return a;
+}
+
/*!
\brief Register action in the internal action map.
}
+/*!
+ \brief Activate GUI operation of module by its ID.
+ This method is called from CAM_Application::startOperation().
+ \param actionId is a numerical unique operation id.
+*/
+bool CAM_Module::activateOperation( int actionId )
+{
+ return false;
+}
+
+/*!
+ \brief Activate GUI operation of module by its ID.
+ This method is called from CAM_Application::startOperation().
+ \param actionId is a string unique operation id.
+*/
+bool CAM_Module::activateOperation( const QString& actionId )
+{
+ return false;
+}
+
+/*!
+ \brief Activate GUI operation of module by its ID and \a pluginName.
+ This method is called from CAM_Application::startOperation().
+ \param actionId is a string unique operation id.
+ \param pluginName is a name of a plugin where the operation is implemented.
+*/
+bool CAM_Module::activateOperation( const QString& actionId, const QString& pluginName )
+{
+ return false;
+}
+
/*!
\brief Connect data model of the module to the active study