OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsPickerCollectionCfg.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10
11// std header
12#include <string>
13#include <list>
14
15#pragma warning(disable:4251)
16
17namespace ot {
18 class GraphicsItemCfg;
19
21 public:
23 GraphicsPickerCollectionCfg(const std::string& _collectionName, const std::string& _collectionTitle);
26
28
32 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
33
37 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
38
39 void setName(const std::string& _name) { m_name = _name; };
40 const std::string& getName(void) const { return m_name; };
41
42 void setTitle(const std::string& _title) { m_title = _title; };
43 const std::string& getTitle(void) const { return m_title; };
44
45 void addChildCollection(GraphicsPickerCollectionCfg* _child);
46 const std::list<GraphicsPickerCollectionCfg*>& getChildCollections(void) const { return m_collections; };
47
48 void addItem(const std::string& _itemName, const std::string& _itemTitle, const std::string& _previewIconPath);
49 void addItem(const GraphicsPickerItemInformation& _itemInfo);
50 const std::list<GraphicsPickerItemInformation>& getItems(void) const { return m_items; };
51
54 void mergeWith(const GraphicsPickerCollectionCfg& _other);
55
56 private:
57 void memFree(void);
58
59 std::list<GraphicsPickerCollectionCfg*> m_collections;
60 std::list<GraphicsPickerItemInformation> m_items;
61 std::string m_name;
62 std::string m_title;
63 };
64}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition GraphicsPickerCollectionCfg.h:20
const std::string & getName(void) const
Definition GraphicsPickerCollectionCfg.h:40
const std::list< GraphicsPickerItemInformation > & getItems(void) const
Definition GraphicsPickerCollectionCfg.h:50
void setName(const std::string &_name)
Definition GraphicsPickerCollectionCfg.h:39
void setTitle(const std::string &_title)
Definition GraphicsPickerCollectionCfg.h:42
const std::list< GraphicsPickerCollectionCfg * > & getChildCollections(void) const
Definition GraphicsPickerCollectionCfg.h:46
const std::string & getTitle(void) const
Definition GraphicsPickerCollectionCfg.h:43
Definition GraphicsPickerItemInformation.h:19
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