8 #include <qpopupmenu.h>
15 class CAM_Application;
16 class QtxActionMenuMgr;
17 class QtxActionToolMgr;
20 #pragma warning( disable: 4251 )
24 * Class provide support of tool and menu managers.
26 class CAM_EXPORT CAM_Module : public QObject
32 CAM_Module( const QString& );
33 virtual ~CAM_Module();
35 virtual void initialize( CAM_Application* );
37 QString moduleName() const;
38 QPixmap moduleIcon() const;
40 CAM_DataModel* dataModel() const;
41 CAM_Application* application() const;
43 virtual QString iconName() const;
45 virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& title ) {};
46 virtual void updateCommandsStatus() {};
48 /** @name Set Menu Shown*/
50 void setMenuShown( const bool );
51 void setMenuShown( QAction*, const bool );
52 void setMenuShown( const int, const bool );
55 /** @name Set Tool Shown*/
57 void setToolShown( const bool );
58 void setToolShown( QAction*, const bool );
59 void setToolShown( const int, const bool );
63 virtual bool activateModule( SUIT_Study* );
64 virtual bool deactivateModule( SUIT_Study* );
66 virtual void connectToStudy( CAM_Study* );
68 virtual void studyClosed( SUIT_Study* );
69 virtual void studyChanged( SUIT_Study*, SUIT_Study* );
72 virtual CAM_DataModel* createDataModel();
74 virtual void setModuleName( const QString& );
75 virtual void setModuleIcon( const QPixmap& );
77 QtxActionMenuMgr* menuMgr() const;
78 QtxActionToolMgr* toolMgr() const;
80 /** @name Create tool methods.*/
82 int createTool( const QString& );
83 int createTool( const int, const int, const int = -1 );
84 int createTool( const int, const QString&, const int = -1 );
85 int createTool( QAction*, const int, const int = -1, const int = -1 );
86 int createTool( QAction*, const QString&, const int = -1, const int = -1 );
89 /** @name Create menu methods.*/
91 int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
92 int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
93 int createMenu( const int, const int, const int = -1, const int = -1 );
94 int createMenu( const int, const QString&, const int = -1, const int = -1 );
95 int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
96 int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
99 static QAction* separator();
101 /**Action ids methods.*/
103 QAction* action( const int ) const;
104 int actionId( const QAction* ) const;
107 int registerAction( const int, QAction* );
108 QAction* createAction( const int, const QString&, const QIconSet&, const QString&,
109 const QString&, const int, QObject* = 0,
110 const bool = false, QObject* = 0, const char* = 0 );
113 CAM_Application* myApp;
116 CAM_DataModel* myDataModel;
117 QMap<int, QAction*> myActionMap;
119 friend class CAM_Application;
123 #pragma warning( default: 4251 )
127 typedef CAM_Module* (*GET_MODULE_FUNC)();
130 #define GET_MODULE_NAME "createModule"