8 #include <qpopupmenu.h>
13 class CAM_Application;
14 class QtxActionMenuMgr;
15 class QtxActionToolMgr;
18 #pragma warning( disable: 4251 )
22 * Class provide support of tool and menu managers.
24 class CAM_EXPORT CAM_Module : public QObject
30 CAM_Module( const QString& );
31 virtual ~CAM_Module();
33 virtual void initialize( CAM_Application* );
35 QString moduleName() const;
36 QPixmap moduleIcon() const;
38 CAM_DataModel* dataModel() const;
39 CAM_Application* application() const;
41 virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& title ) {};
42 virtual void updateCommandsStatus() {};
44 /** @name Set Menu Shown*/
46 void setMenuShown( const bool );
47 void setMenuShown( QAction*, const bool );
48 void setMenuShown( const int, const bool );
51 /** @name Set Tool Shown*/
53 void setToolShown( const bool );
54 void setToolShown( QAction*, const bool );
55 void setToolShown( const int, const bool );
59 virtual bool activateModule( SUIT_Study* );
60 virtual bool deactivateModule( SUIT_Study* );
62 virtual void studyClosed( SUIT_Study* );
63 virtual void studyChanged( SUIT_Study*, SUIT_Study* );
66 virtual CAM_DataModel* createDataModel();
68 virtual void setModuleName( const QString& );
69 virtual void setModuleIcon( const QPixmap& );
71 QtxActionMenuMgr* menuMgr() const;
72 QtxActionToolMgr* toolMgr() const;
74 /** @name Create tool methods.*/
76 int createTool( const QString& );
77 int createTool( const int, const int, const int = -1 );
78 int createTool( const int, const QString&, const int = -1 );
79 int createTool( QAction*, const int, const int = -1, const int = -1 );
80 int createTool( QAction*, const QString&, const int = -1, const int = -1 );
83 /** @name Create menu methods.*/
85 int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
86 int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
87 int createMenu( const int, const int, const int = -1, const int = -1 );
88 int createMenu( const int, const QString&, const int = -1, const int = -1 );
89 int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
90 int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
93 static QAction* separator();
95 /**Action ids methods.*/
97 QAction* action( const int ) const;
98 int actionId( const QAction* ) const;
101 int registerAction( const int, QAction* );
102 QAction* createAction( const int, const QString&, const QIconSet&, const QString&,
103 const QString&, const int, QObject* = 0,
104 const bool = false, QObject* = 0, const char* = 0 );
107 CAM_Application* myApp;
110 CAM_DataModel* myDataModel;
111 QMap<int, QAction*> myActionMap;
113 friend class CAM_Application;
117 #pragma warning( default: 4251 )
121 typedef CAM_Module* (*GET_MODULE_FUNC)();
124 #define GET_MODULE_NAME "createModule"