GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
NamedPropertyDescriptor.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-present Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #ifndef GDCORE_NAMEDPROPERTYDESCRIPTOR
7 #define GDCORE_NAMEDPROPERTYDESCRIPTOR
8 #include <vector>
9 #include "GDCore/Project/PropertyDescriptor.h"
10 #include "GDCore/String.h"
11 namespace gd {
12 class SerializerElement;
13 }
14 
15 namespace gd {
16 
21 class GD_CORE_API NamedPropertyDescriptor : public PropertyDescriptor {
22  public:
27 
28  virtual ~NamedPropertyDescriptor();
29 
30  virtual NamedPropertyDescriptor* Clone() const {
31  return new NamedPropertyDescriptor(*this);
32  }
33 
40  name = newName;
41  return *this;
42  }
43 
47  const gd::String& GetName() const { return name; }
48 
52 
55  void SerializeTo(SerializerElement& element) const;
56 
60  void UnserializeFrom(const SerializerElement& element);
61 
65  virtual void SerializeValuesTo(SerializerElement& element) const;
66 
70  virtual void UnserializeValuesFrom(const SerializerElement& element);
72 
73  private:
74  gd::String name;
75 };
76 
77 } // namespace gd
78 
79 #endif
Used to describe a property shown in a property grid.
Definition: NamedPropertyDescriptor.h:21
NamedPropertyDescriptor & SetName(gd::String newName)
Change the name of the property.
Definition: NamedPropertyDescriptor.h:39
NamedPropertyDescriptor()
Empty constructor creating an empty property to be displayed.
Definition: NamedPropertyDescriptor.h:26
const gd::String & GetName() const
Get the name of the property.
Definition: NamedPropertyDescriptor.h:47
Used to describe a property shown in a property grid.
Definition: PropertyDescriptor.h:25
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24