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() {};
45 virtual bool activateModule( SUIT_Study* );
46 virtual bool deactivateModule( SUIT_Study* );
48 virtual void studyClosed( SUIT_Study* );
49 virtual void studyChanged( SUIT_Study*, SUIT_Study* );
52 virtual CAM_DataModel* createDataModel();
54 virtual void setModuleName( const QString& );
55 virtual void setModuleIcon( const QPixmap& );
57 QtxActionMenuMgr* menuMgr() const;
58 QtxActionToolMgr* toolMgr() const;
60 /** @name Create tool methods.*/
62 int createTool( const QString& );
63 int createTool( const int, const int, const int = -1 );
64 int createTool( const int, const QString&, const int = -1 );
65 int createTool( QAction*, const int, const int = -1, const int = -1 );
66 int createTool( QAction*, const QString&, const int = -1, const int = -1 );
69 /** @name Create menu methods.*/
71 int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
72 int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
73 int createMenu( const int, const int, const int = -1, const int = -1 );
74 int createMenu( const int, const QString&, const int = -1, const int = -1 );
75 int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
76 int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
79 /** @name Set Menu Shown*/
81 void setMenuShown( const bool );
82 void setMenuShown( QAction*, const bool );
83 void setMenuShown( const int, const bool );
86 /** @name Set Tool Shown*/
88 void setToolShown( const bool );
89 void setToolShown( QAction*, const bool );
90 void setToolShown( const int, const bool );
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"