OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyGridCfg.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#pragma warning(disable:4251)
15
16namespace ot {
17
18 class Property;
19 class PropertyGroup;
20
22 public:
24 PropertyGridCfg(const PropertyGridCfg& _other);
25 virtual ~PropertyGridCfg();
26
27 PropertyGridCfg& operator = (const PropertyGridCfg& _other);
28
32 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
33
37 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
38
42 void mergeWith(const PropertyGridCfg& _other, bool _replaceExistingProperties);
43
44 void setRootGroups(const std::list<PropertyGroup*>& _groups);
45 void addRootGroup(PropertyGroup* _group);
46 const std::list<PropertyGroup*>& getRootGroups(void) const { return m_rootGroups; };
47 PropertyGroup* findGroup(const std::string& _name, bool _searchChildGroups = false) const;
48 PropertyGroup* findOrCreateGroup(const std::string& _name, bool _searchChildGroups = false);
49
51 std::list<Property*> getAllProperties(void) const;
52 std::list<Property*> findPropertiesBySpecialType(const std::string& _specialType) const;
53
56 Property* findPropertyByPath(const std::string& _path, char _delimiter = '/') const;
57
61 Property* findPropertyByPath(std::list<std::string> _path) const;
62
64 bool isEmpty(void) const;
65
66 private:
67 void clear(void);
68
69 std::list<PropertyGroup*> m_rootGroups;
70 };
71
72}
This file contains defines that may be used simplyfy class creation.
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition PropertyGridCfg.h:21
const std::list< PropertyGroup * > & getRootGroups(void) const
Definition PropertyGridCfg.h:46
Definition PropertyGroup.h:23
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
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
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30