up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / animation / keyed_property_base.hpp
1 #ifndef _RIVE_KEYED_PROPERTY_BASE_HPP_
2 #define _RIVE_KEYED_PROPERTY_BASE_HPP_
3 #include "core.hpp"
4 #include "core/field_types/core_uint_type.hpp"
5 namespace rive
6 {
7         class KeyedPropertyBase : public Core
8         {
9         protected:
10                 typedef Core Super;
11
12         public:
13                 static const uint16_t typeKey = 26;
14
15                 /// Helper to quickly determine if a core object extends another without
16                 /// RTTI at runtime.
17                 bool isTypeOf(uint16_t typeKey) const override
18                 {
19                         switch (typeKey)
20                         {
21                                 case KeyedPropertyBase::typeKey:
22                                         return true;
23                                 default:
24                                         return false;
25                         }
26                 }
27
28                 uint16_t coreType() const override { return typeKey; }
29
30                 static const uint16_t propertyKeyPropertyKey = 53;
31
32         private:
33                 int m_PropertyKey = Core::invalidPropertyKey;
34         public:
35                 inline int propertyKey() const { return m_PropertyKey; }
36                 void propertyKey(int value)
37                 {
38                         if (m_PropertyKey == value)
39                         {
40                                 return;
41                         }
42                         m_PropertyKey = value;
43                         propertyKeyChanged();
44                 }
45
46                 Core* clone() const override;
47                 void copy(const KeyedPropertyBase& object)
48                 {
49                         m_PropertyKey = object.m_PropertyKey;
50                 }
51
52                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
53                 {
54                         switch (propertyKey)
55                         {
56                                 case propertyKeyPropertyKey:
57                                         m_PropertyKey = CoreUintType::deserialize(reader);
58                                         return true;
59                         }
60                         return false;
61                 }
62
63         protected:
64                 virtual void propertyKeyChanged() {}
65         };
66 } // namespace rive
67
68 #endif