Salome HOME
Issue 1303 Re-ordering of Sketcher menus: additional structure for feature info to...
[modules/shaper.git] / src / XGUI / XGUI_MenuWorkbench.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        XGUI_MenuWorkbench.hxx
4 // Created:     13 Apr 2016
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef XGUI_MENUWORKBENCH_H_
8 #define XGUI_MENUWORKBENCH_H_
9
10 #include "XGUI.h"
11
12 #include <string>
13 #include <list>
14 #include <memory>
15
16 class XGUI_MenuGroup;
17
18 /**
19 * \ingroup GUI
20 * A class for management of menu actions (features). The actions should be arranged like they are
21 * in XML file. It listens the read feature of XML and fills internal structure of menu workbenches
22 * and groups of feature. After, it creates menues and tools in the module.
23 */
24 class XGUI_EXPORT XGUI_MenuWorkbench
25 {
26  public:
27   /// Constructor
28   XGUI_MenuWorkbench(const std::string& theName);
29   /// Destructor
30   virtual ~XGUI_MenuWorkbench() {}
31
32   /// Returns a name of the workbench
33   /// \return workbench name
34   std::string getName() const { return myName; }
35
36   /// Finds or creates a group for the given name
37   /// \param theGroupName a name defined in XML
38   /// \return an instance of group
39   std::shared_ptr<XGUI_MenuGroup> findGroup(const std::string& theGroupName);
40
41   /// Returns container of existing groups
42   /// \returns list
43   const std::list<std::shared_ptr<XGUI_MenuGroup> >& groups() const;
44
45 private:
46   std::string myName; /// a name of the workbench
47   std::list<std::shared_ptr<XGUI_MenuGroup> > myGroups; /// container of existing groups
48 };
49
50 #endif /* XGUI_MENUWORKBENCH_H_ */
51