SHAPER 9.16.0
XGUI_MenuMgr.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef XGUI_MENUMGR_H_
21#define XGUI_MENUMGR_H_
22
23#include "XGUI.h"
24
25#include <Events_Listener.h>
26
27#include <string>
28#include <list>
29#include <memory>
30
32class XGUI_Workshop;
34
35class QAction;
36
44{
45 public:
48 XGUI_EXPORT XGUI_MenuMgr(XGUI_Workshop* theWorkshop);
49 XGUI_EXPORT virtual ~XGUI_MenuMgr() {}
50
52 XGUI_EXPORT void createFeatureActions();
53
56 XGUI_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
57
58protected:
60 void addFeature(const std::shared_ptr<Config_FeatureMessage>& theMessage);
61
65 std::shared_ptr<XGUI_MenuWorkbench> findWorkbench(const std::string& theWorkbenchName);
66
72 QAction* buildAction(const std::shared_ptr<Config_FeatureMessage>& theMessage,
73 const std::string& theWchName, const bool aUseSeparator) const;
74
75private:
76 XGUI_Workshop* myWorkshop;
77
79 std::list< std::shared_ptr<XGUI_MenuWorkbench> > myWorkbenches;
80};
81
82#endif /* XGUI_MENUMGR_H_ */
Class to pass a feature entry extracted from xml file.
Definition: Config_FeatureMessage.h:39
Base interface for any event listener.
Definition: Events_Listener.h:37
A class for management of menu actions (features).
Definition: XGUI_MenuMgr.h:44
void createFeatureActions()
Creates feature actions.
Definition: XGUI_MenuMgr.cpp:156
void addFeature(const std::shared_ptr< Config_FeatureMessage > &theMessage)
Process event "Add a feature".
Definition: XGUI_MenuMgr.cpp:70
std::shared_ptr< XGUI_MenuWorkbench > findWorkbench(const std::string &theWorkbenchName)
Finds or creates a workbench for the given name.
Definition: XGUI_MenuMgr.cpp:138
virtual void processEvent(const std::shared_ptr< Events_Message > &theMessage)
Redefinition of Events_Listener method.
Definition: XGUI_MenuMgr.cpp:57
QAction * buildAction(const std::shared_ptr< Config_FeatureMessage > &theMessage, const std::string &theWchName, const bool aUseSeparator) const
Creates a new action by the message.
Definition: XGUI_MenuMgr.cpp:190
XGUI_MenuMgr(XGUI_Workshop *theWorkshop)
Constructor.
Definition: XGUI_MenuMgr.cpp:49
A class for management of menu actions (features).
Definition: XGUI_MenuWorkbench.h:42
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:83