1 #ifndef XGUI_MainMenu_H
2 #define XGUI_MainMenu_H
10 class XGUI_MainWindow;
12 class XGUI_MenuGroupPanel;
21 /**\class XGUI_MainMenu
23 * \brief Class for creation of main menu (set of workbenches)
25 class XGUI_EXPORT XGUI_MainMenu: public QObject
29 XGUI_MainMenu(XGUI_MainWindow *parent);
30 virtual ~XGUI_MainMenu();
32 //! Creates and adds a new workbench (menu group) with the given name and returns it.
33 XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
35 //! Returns workbench (menu group) by the given name.
36 XGUI_Workbench* findWorkbench(const QString& theId) const;
38 //! Returns General page (predefined workbench)
39 XGUI_Workbench* generalPage() const { return myGeneralPage; }
41 //! Rerturns last created workbench in dock widget container
42 QDockWidget* getLastDockWindow() const { return myMenuTabs.last(); }
44 //! Returns already created command by its ID
45 XGUI_Command* feature(const QString& theId) const;
47 //! Returns list of created commands
48 QList<XGUI_Command*> features() const;
50 QList<XGUI_Workbench*> workbenches() const;
52 virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
55 XGUI_MainWindow* myDesktop;
56 QList<QDockWidget*> myMenuTabs;
57 XGUI_Workbench* myGeneralPage;
59 QMap<XGUI_Command*, bool> myCommandState;