up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / animation / keyframe_id_base.hpp
1 #ifndef _RIVE_KEY_FRAME_ID_BASE_HPP_
2 #define _RIVE_KEY_FRAME_ID_BASE_HPP_
3 #include "animation/keyframe.hpp"
4 #include "core/field_types/core_uint_type.hpp"
5 namespace rive
6 {
7         class KeyFrameIdBase : public KeyFrame
8         {
9         protected:
10                 typedef KeyFrame Super;
11
12         public:
13                 static const uint16_t typeKey = 50;
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 KeyFrameIdBase::typeKey:
22                                 case KeyFrameBase::typeKey:
23                                         return true;
24                                 default:
25                                         return false;
26                         }
27                 }
28
29                 uint16_t coreType() const override { return typeKey; }
30
31                 static const uint16_t valuePropertyKey = 122;
32
33         private:
34                 int m_Value = -1;
35         public:
36                 inline int value() const { return m_Value; }
37                 void value(int value)
38                 {
39                         if (m_Value == value)
40                         {
41                                 return;
42                         }
43                         m_Value = value;
44                         valueChanged();
45                 }
46
47                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
48                 {
49                         switch (propertyKey)
50                         {
51                                 case valuePropertyKey:
52                                         m_Value = CoreUintType::deserialize(reader);
53                                         return true;
54                         }
55                         return KeyFrame::deserialize(propertyKey, reader);
56                 }
57
58         protected:
59                 virtual void valueChanged() {}
60         };
61 } // namespace rive
62
63 #endif