OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ModalCommandBase.h
Go to the documentation of this file.
1#pragma once
2
3// OpenTwin header
4#include "OTGui/GuiTypes.h"
8
9// std header
10#include <list>
11#include <string>
12#include <map>
13#include "OldTreeIcon.h"
14
15namespace ot {
16
18 {
19 public:
20 ModalCommandBase(ot::ApplicationBase *app, const std::string &actionMnuID, const std::string &actionBtnID);
21 virtual ~ModalCommandBase();
22
23 virtual bool executeAction(const std::string &action, rapidjson::Document &doc) = 0;
24
25 virtual void modelSelectionChanged(std::list< UID> &selectedEntityID) = 0;
26
27 protected:
28 virtual std::string initializeAndCreateUI(const LockTypeFlags& modelRead, const LockTypeFlags& modelWrite) = 0;
29
30 void setupUI(void);
31 void addMenuPage(const std::string &menu);
32 void addMenuGroup(const std::string &menu, const std::string &group);
33 void addMenuSubgroup(const std::string &menu, const std::string &group, const std::string &subgroup);
34 void addMenuAction(const std::string &menu, const std::string &group, const std::string &buttonName, const std::string &text, const LockTypeFlags& flags, const std::string &iconName, const std::string &iconFolder = std::string("Default"));
35 void addMenuAction(const std::string &menu, const std::string &group, const std::string &subgroup, const std::string &buttonName, const std::string &text, const LockTypeFlags& flags, const std::string &iconName, const std::string &iconFolder = std::string("Default"));
36 void addMenuCheckBox(const std::string &menu, const std::string &group, const std::string &subgroup, const std::string &boxName, const std::string &boxText, bool checked, const LockTypeFlags& flags);
37 void addMenuLineEdit(const std::string &menu, const std::string &group, const std::string &subgroup, const std::string &editName, const std::string &editText, const std::string &editLabel, const LockTypeFlags& flags);
38 void setMenuCheckBox(const std::string &menu, const std::string &group, const std::string &subgroup, const std::string &boxName, bool checked);
39 void setMenuLineEdit(const std::string &menu, const std::string &group, const std::string &subgroup, const std::string &editName, const std::string &editText, bool error);
40
41 protected:
43
44 private:
45 std::string actionMenuID;
46 std::string actionButtonID;
47
48 std::map<std::string, bool> uiMenuMap;
49 std::map<std::string, bool> uiGroupMap;
50 std::map<std::string, bool> uiSubGroupMap;
51 std::map<std::string, bool> uiActionMap;
52 };
53}
#define OT_SERVICEFOUNDATION_API_EXPORT
Definition FoundationAPIExport.h:7
Definition ApplicationBase.h:45
Definition ModalCommandBase.h:18
ot::ApplicationBase * application
Definition ModalCommandBase.h:42
virtual bool executeAction(const std::string &action, rapidjson::Document &doc)=0
virtual std::string initializeAndCreateUI(const LockTypeFlags &modelRead, const LockTypeFlags &modelWrite)=0
virtual void modelSelectionChanged(std::list< UID > &selectedEntityID)=0
The app namespace contains several functions that may be used to start processes.
Definition Connector.h:8