8 #include <qpopupmenu.h>
14 class CAM_Application;
15 class QtxActionMenuMgr;
16 class QtxActionToolMgr;
19 #pragma warning( disable: 4251 )
23 * Class provide support of tool and menu managers.
25 class CAM_EXPORT CAM_Module : public QObject
31 CAM_Module( const QString& );
32 virtual ~CAM_Module();
34 virtual void initialize( CAM_Application* );
36 QString moduleName() const;
37 QPixmap moduleIcon() const;
39 CAM_DataModel* dataModel() const;
40 CAM_Application* application() const;
42 virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& title ) {};
43 virtual void updateCommandsStatus() {};
45 /** @name Set Menu Shown*/
47 void setMenuShown( const bool );
48 void setMenuShown( QAction*, const bool );
49 void setMenuShown( const int, const bool );
52 /** @name Set Tool Shown*/
54 void setToolShown( const bool );
55 void setToolShown( QAction*, const bool );
56 void setToolShown( const int, const bool );
60 virtual bool activateModule( SUIT_Study* );
61 virtual bool deactivateModule( SUIT_Study* );
63 virtual void connectToStudy( CAM_Study* );
65 virtual void studyClosed( SUIT_Study* );
66 virtual void studyChanged( SUIT_Study*, SUIT_Study* );
69 virtual CAM_DataModel* createDataModel();
71 virtual void setModuleName( const QString& );
72 virtual void setModuleIcon( const QPixmap& );
74 QtxActionMenuMgr* menuMgr() const;
75 QtxActionToolMgr* toolMgr() const;
77 /** @name Create tool methods.*/
79 int createTool( const QString& );
80 int createTool( const int, const int, const int = -1 );
81 int createTool( const int, const QString&, const int = -1 );
82 int createTool( QAction*, const int, const int = -1, const int = -1 );
83 int createTool( QAction*, const QString&, const int = -1, const int = -1 );
86 /** @name Create menu methods.*/
88 int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
89 int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
90 int createMenu( const int, const int, const int = -1, const int = -1 );
91 int createMenu( const int, const QString&, const int = -1, const int = -1 );
92 int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
93 int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
96 static QAction* separator();
98 /**Action ids methods.*/
100 QAction* action( const int ) const;
101 int actionId( const QAction* ) const;
104 int registerAction( const int, QAction* );
105 QAction* createAction( const int, const QString&, const QIconSet&, const QString&,
106 const QString&, const int, QObject* = 0,
107 const bool = false, QObject* = 0, const char* = 0 );
110 CAM_Application* myApp;
113 CAM_DataModel* myDataModel;
114 QMap<int, QAction*> myActionMap;
116 friend class CAM_Application;
120 #pragma warning( default: 4251 )
124 typedef CAM_Module* (*GET_MODULE_FUNC)();
127 #define GET_MODULE_NAME "createModule"