X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MainMenu.h;h=48d97459135f78be9f26e3f2b6a6d7450e10f833;hb=d80699ac131d75798c6c39deff2c5e820aface5f;hp=3521be3c09584ab8b9b81f09f2e971c53380ab3e;hpb=f09c9895be486d30c9aa48da040c3aeb3ccbaa74;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MainMenu.h b/src/XGUI/XGUI_MainMenu.h index 3521be3c0..48d974591 100644 --- a/src/XGUI/XGUI_MainMenu.h +++ b/src/XGUI/XGUI_MainMenu.h @@ -1,33 +1,60 @@ #ifndef XGUI_MainMenu_H #define XGUI_MainMenu_H +#include "XGUI.h" #include #include +#include + +class XGUI_Command; +class XGUI_MainWindow; +class XGUI_Workbench; +class XGUI_MenuGroupPanel; class QTabWidget; class QLabel; class QAction; -class XGUI_Command; -class XGUI_MainWindow; class QDockWidget; +class QEvent; -class XGUI_MainMenu : public QObject +/**\class XGUI_MainMenu + * \ingroup GUI + * \brief Class for creation of main menu (set of workbenches) + */ +class XGUI_EXPORT XGUI_MainMenu: public QObject { - Q_OBJECT +Q_OBJECT public: - XGUI_MainMenu(XGUI_MainWindow *parent); - virtual ~XGUI_MainMenu(); + XGUI_MainMenu(XGUI_MainWindow *parent); + virtual ~XGUI_MainMenu(); - int addWorkbench(QString theTitle); + //! Creates and adds a new workbench (menu group) with the given name and returns it. + XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = ""); - int addGroup(int thePageId); + //! Returns workbench (menu group) by the given name. + XGUI_Workbench* findWorkbench(const QString& theId); - void addCommand(int thePageId, int theGroupId, XGUI_Command* theCommand); + //! Returns General page (predefined workbench) + XGUI_Workbench* generalPage() const { return myGeneralPage; } + + //! Rerturns last created workbench in dock widget container + QDockWidget* getLastDockWindow() const { return myMenuTabs.last(); } + + //! Returns already created command by its ID + XGUI_Command* feature(const QString& theId) const; + + //! Returns list of created commands + QList features() const; + + virtual bool eventFilter(QObject *theWatched, QEvent *theEvent); private: - XGUI_MainWindow* myDesktop; - QList myMenuTabs; + XGUI_MainWindow* myDesktop; + QList myMenuTabs; + XGUI_Workbench* myGeneralPage; + + QMap myCommandState; }; #endif