Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_MainMenu.h
index c5837e757d0d50f9a87f05334a83ae4807ba7c61..945ddcb8d9f890b6d90811986f280805c69dfb01 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef XGUI_MainMenu_H
 #define XGUI_MainMenu_H
 
+#include "XGUI.h"
 #include <QObject>
 #include <QList>
+#include <QMap>
 
 class XGUI_Command;
 class XGUI_MainWindow;
@@ -13,25 +15,48 @@ class QTabWidget;
 class QLabel;
 class QAction;
 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
 public:
   XGUI_MainMenu(XGUI_MainWindow *parent);
   virtual ~XGUI_MainMenu();
 
+  //! Creates and adds a new workbench (menu group) with the given name and returns it.
   XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
-  XGUI_Workbench* findWorkbench(const QString& theId);
 
+  //! Returns workbench (menu group) by the given name.
+  XGUI_Workbench* findWorkbench(const QString& theId)  const;
+
+  //! 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<XGUI_Command*> features() const;
+
+  QList<XGUI_Workbench*> workbenches() const;
+
+  virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
+
 private:
   XGUI_MainWindow* myDesktop;
   QList<QDockWidget*> myMenuTabs;
   XGUI_Workbench* myGeneralPage;
+
+  QMap<XGUI_Command*, bool> myCommandState;
 };
 
 #endif