OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
MenuButtonCfg.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10
11namespace ot {
12
14 public:
17 Clear
18 };
19
20 static std::string toString(ButtonAction _action);
21 static ButtonAction stringToButtonAction(const std::string& _action);
22
24 MenuButtonCfg(const std::string& _name, const std::string& _text, const std::string& _iconPath = std::string(), ButtonAction _action = ButtonAction::NotifyOwner);
25 MenuButtonCfg(const MenuButtonCfg& _other);
26 MenuButtonCfg(const ot::ConstJsonObject& _object);
27 virtual ~MenuButtonCfg();
28
29 MenuButtonCfg& operator = (const MenuButtonCfg&) = delete;
30
31 virtual MenuEntryCfg* createCopy(void) const override;
32 virtual EntryType getMenuEntryType(void) const override { return MenuEntryCfg::Button; };
33
37 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
38
42 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
43
44 void setButtonAction(ButtonAction _action) { m_action = _action; };
45 ButtonAction getButtonAction(void) const { return m_action; };
46
47 private:
48 ButtonAction m_action;
49 };
50
51}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition MenuButtonCfg.h:13
ButtonAction
Definition MenuButtonCfg.h:15
@ NotifyOwner
Definition MenuButtonCfg.h:16
virtual EntryType getMenuEntryType(void) const override
Definition MenuButtonCfg.h:32
ButtonAction getButtonAction(void) const
Definition MenuButtonCfg.h:45
void setButtonAction(ButtonAction _action)
Definition MenuButtonCfg.h:44
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
OT_GUI_API_EXPORT std::string toString(ColorStyleName _colorStyleName)
Definition ColorStyleTypes.cpp:10
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30