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