8 #include <qpopupmenu.h>
13 class CAM_Application;
14 class QtxActionMenuMgr;
15 class QtxActionToolMgr;
18 #pragma warning( disable: 4251 )
21 class CAM_EXPORT CAM_Module : public QObject
27 CAM_Module( const QString& );
28 virtual ~CAM_Module();
30 virtual void initialize( CAM_Application* );
32 QString moduleName() const;
33 QPixmap moduleIcon() const;
35 CAM_DataModel* dataModel() const;
36 CAM_Application* application() const;
38 virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& title ) {};
39 virtual void updateCommandsStatus() {};
42 virtual bool activateModule( SUIT_Study* );
43 virtual bool deactivateModule( SUIT_Study* );
45 virtual void studyClosed( SUIT_Study* );
46 virtual void studyChanged( SUIT_Study*, SUIT_Study* );
49 virtual CAM_DataModel* createDataModel();
51 virtual void setModuleName( const QString& );
52 virtual void setModuleIcon( const QPixmap& );
54 QtxActionMenuMgr* menuMgr() const;
55 QtxActionToolMgr* toolMgr() const;
57 int createTool( const QString& );
58 int createTool( const int, const int, const int = -1 );
59 int createTool( const int, const QString&, const int = -1 );
60 int createTool( QAction*, const int, const int = -1, const int = -1 );
61 int createTool( QAction*, const QString&, const int = -1, const int = -1 );
63 int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
64 int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
65 int createMenu( const int, const int, const int = -1, const int = -1 );
66 int createMenu( const int, const QString&, const int = -1, const int = -1 );
67 int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
68 int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
70 void setMenuShown( const bool );
71 void setMenuShown( QAction*, const bool );
72 void setMenuShown( const int, const bool );
74 void setToolShown( const bool );
75 void setToolShown( QAction*, const bool );
76 void setToolShown( const int, const bool );
78 static QAction* separator();
80 QAction* action( const int ) const;
81 int actionId( const QAction* ) const;
83 int registerAction( const int, QAction* );
84 QAction* createAction( const int, const QString&, const QIconSet&, const QString&,
85 const QString&, const int, QObject* = 0,
86 const bool = false, QObject* = 0, const char* = 0 );
89 CAM_Application* myApp;
92 CAM_DataModel* myDataModel;
93 QMap<int, QAction*> myActionMap;
95 friend class CAM_Application;
99 #pragma warning( default: 4251 )
103 typedef CAM_Module* (*GET_MODULE_FUNC)();
106 #define GET_MODULE_NAME "createModule"