OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
NavigationTreePackage.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/Flags.h"
10#include "OTCore/Serializable.h"
13
14// std header
15#include <list>
16
17namespace ot {
18
20 public:
22 NoFlags = 0x00,
23 ItemsDefaultExpanded = 0x01
24 };
26
27 static std::string toString(NavigationTreePackageFlag _flag);
28 static NavigationTreePackageFlag stringToFlag(const std::string& _flag);
29
31 virtual ~NavigationTreePackage();
32
36 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
37
41 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
42
43 void setFlag(NavigationTreePackageFlag _flag, bool _active = true) { m_flags.setFlag(_flag, _active); };
44 void setFlags(NavigationTreePackageFlags _flags) { m_flags = _flags; };
45 NavigationTreePackageFlags flags(void) const { return m_flags; };
46
47 void setRootItems(const std::list<NavigationTreeItem>& _items) { m_rootItems = _items; };
48 void addRootItem(const NavigationTreeItem& _item);
49 const std::list<NavigationTreeItem>& rootItems(void) const { return m_rootItems; };
50
53 void mergeItems(bool _mergeAllChilds = true);
54
55 private:
56 NavigationTreePackageFlags m_flags;
57 std::list<NavigationTreeItem> m_rootItems;
58 };
59
60}
61
#define OT_ADD_FLAG_FUNCTIONS(___enumName)
Will add the default bitwise operations for the provided private 32/64 bit bitfield....
Definition Flags.h:129
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The Flags class is a wrapper around a enum that allows bitwise operations (flags)....
Definition Flags.h:214
Definition NavigationTreeItem.h:35
Definition NavigationTreePackage.h:19
NavigationTreePackageFlag
Definition NavigationTreePackage.h:21
void setFlags(NavigationTreePackageFlags _flags)
Definition NavigationTreePackage.h:44
const std::list< NavigationTreeItem > & rootItems(void) const
Definition NavigationTreePackage.h:49
void setRootItems(const std::list< NavigationTreeItem > &_items)
Definition NavigationTreePackage.h:47
NavigationTreePackageFlags flags(void) const
Definition NavigationTreePackage.h:45
void setFlag(NavigationTreePackageFlag _flag, bool _active=true)
Definition NavigationTreePackage.h:43
Flags< NavigationTreePackageFlag > NavigationTreePackageFlags
Definition NavigationTreePackage.h:25
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
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