]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_MainMenu.h
Salome HOME
Make XGUI as a shared library
[modules/shaper.git] / src / XGUI / XGUI_MainMenu.h
1 #ifndef XGUI_MainMenu_H
2 #define XGUI_MainMenu_H
3
4 #include "XGUI.h"
5 #include <QObject>
6 #include <QList>
7
8 class XGUI_Command;
9 class XGUI_MainWindow;
10 class XGUI_Workbench;
11 class XGUI_MenuGroupPanel;
12
13 class QTabWidget;
14 class QLabel;
15 class QAction;
16 class QDockWidget;
17 class QEvent;
18
19 /**\class XGUI_MainMenu
20  * \ingroup GUI
21  * \brief Class for creation of main menu (set of workbenches)
22  */
23 class XGUI_EXPORT XGUI_MainMenu: public QObject
24 {
25 Q_OBJECT
26 public:
27   XGUI_MainMenu(XGUI_MainWindow *parent);
28   virtual ~XGUI_MainMenu();
29
30   //! Creates and adds a new workbench (menu group) with the given name and returns it.
31   XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
32
33   //! Returns workbench (menu group) by the given name.
34   XGUI_Workbench* findWorkbench(const QString& theId);
35
36   //! Returns General page (predefined workbench)
37   XGUI_Workbench* generalPage() const { return myGeneralPage; }
38
39   //! Rerturns last created workbench in dock widget container
40   QDockWidget* getLastDockWindow() const { return myMenuTabs.last(); }
41
42   //! Returns already created command by its ID
43   XGUI_Command* feature(const QString& theId) const;
44
45   //! Returns list of created commands
46   QList<XGUI_Command*> features() const;
47
48 protected:
49   virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
50
51 private:
52   XGUI_MainWindow* myDesktop;
53   QList<QDockWidget*> myMenuTabs;
54   XGUI_Workbench* myGeneralPage;
55 };
56
57 #endif