OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
MenuCfg.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
11
12// std header
13#include <list>
14
15namespace ot {
16
18 public:
19 MenuCfg();
20 MenuCfg(const std::string& _name, const std::string& _text, const std::string& _iconPath = std::string());
21 MenuCfg(const MenuCfg& _other);
22 MenuCfg(const ot::ConstJsonObject& _object);
23 virtual ~MenuCfg();
24
25 MenuCfg& operator = (const MenuCfg& _other);
26
27 virtual MenuEntryCfg* createCopy(void) const override;
28 virtual EntryType getMenuEntryType(void) const override { return MenuEntryCfg::Menu; };
29
33 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
34
38 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
39
42 void add(MenuEntryCfg* _entry);
43
49 MenuCfg* addMenu(const std::string& _name, const std::string& _text, const std::string& _iconPath = std::string());
50
56 MenuButtonCfg* addButton(const std::string& _name, const std::string& _text, const std::string& _iconPath = std::string(), MenuButtonCfg::ButtonAction _action = MenuButtonCfg::ButtonAction::NotifyOwner);
57
59 void addSeparator(void);
60
63 MenuButtonCfg* findMenuButton(const std::string& _name) const;
64
65 const std::list<MenuEntryCfg*>& getEntries(void) const { return m_childs; };
66
68 bool isEmpty(void) const;
69
70 private:
71 void clear(void);
72
73 std::list<MenuEntryCfg*> m_childs;
74
75 };
76
77}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition MenuButtonCfg.h:13
ButtonAction
Definition MenuButtonCfg.h:15
Definition MenuCfg.h:17
virtual EntryType getMenuEntryType(void) const override
Definition MenuCfg.h:28
const std::list< MenuEntryCfg * > & getEntries(void) const
Definition MenuCfg.h:65
Definition MenuClickableEntryCfg.h:13
Definition MenuEntryCfg.h:20
EntryType
Definition MenuEntryCfg.h:22
Definition Connector.h:8
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30