-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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 <QPixmap>
#include <QString>
#include <QMap>
+#include <QPair>
+#include <QKeySequence>
class QAction;
class QMenu;
class QIcon;
+class QtxActionGroup;
class QtxActionMenuMgr;
class QtxActionToolMgr;
class SUIT_Study;
virtual void updateModuleVisibilityState();
+ virtual bool activateOperation( int actionId );
+ virtual bool activateOperation( const QString& actionId );
+ virtual bool activateOperation( const QString& actionId, const QString& pluginName );
+
+ // actions/menu/toolbars management
+
+ QtxActionMenuMgr* menuMgr() const;
+ QtxActionToolMgr* toolMgr() const;
+
+ virtual QAction* action( const int ) const;
+ virtual int actionId( const QAction* ) const;
+ virtual QAction* createAction( 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() );
+ virtual QAction* createAction( 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() );
+ QtxActionGroup* createActionGroup( const int, const bool = true );
+
+ 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,QMenu * = 0);
+ 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 );
+
+ static QAction* separator();
+
public slots:
virtual bool activateModule( SUIT_Study* );
virtual bool deactivateModule( SUIT_Study* );
void setName( const QString& );
virtual void setModuleName( const QString& );
- QtxActionMenuMgr* menuMgr() const;
- QtxActionToolMgr* toolMgr() const;
-
- int createTool( const 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 );
-
- static QAction* separator();
-
- QAction* action( const int ) const;
- int actionId( const QAction* ) const;
-
int registerAction( const int, QAction* );
bool unregisterAction( const int );
bool unregisterAction( QAction* );
- QAction* createAction( 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() );
+ // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys
+ // after activate/deactivate modules
+ QMap<QAction*, QKeySequence> myActionShortcutMap; //!< copy actions shortcut map
+
+ virtual bool abortAllOperations();
private:
CAM_Application* myApp; //!< parent application object