[Adaptation Layer] Added rive-tizen adaptation layer class.
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / animation / linear_animation_base.hpp
1 #ifndef _RIVE_LINEAR_ANIMATION_BASE_HPP_
2 #define _RIVE_LINEAR_ANIMATION_BASE_HPP_
3 #include "animation/animation.hpp"
4 #include "core/field_types/core_bool_type.hpp"
5 #include "core/field_types/core_double_type.hpp"
6 #include "core/field_types/core_uint_type.hpp"
7 namespace rive
8 {
9         class LinearAnimationBase : public Animation
10         {
11         protected:
12                 typedef Animation Super;
13
14         public:
15                 static const uint16_t typeKey = 31;
16
17                 /// Helper to quickly determine if a core object extends another without
18                 /// RTTI at runtime.
19                 bool isTypeOf(uint16_t typeKey) const override
20                 {
21                         switch (typeKey)
22                         {
23                                 case LinearAnimationBase::typeKey:
24                                 case AnimationBase::typeKey:
25                                         return true;
26                                 default:
27                                         return false;
28                         }
29                 }
30
31                 uint16_t coreType() const override { return typeKey; }
32
33                 static const uint16_t fpsPropertyKey = 56;
34                 static const uint16_t durationPropertyKey = 57;
35                 static const uint16_t speedPropertyKey = 58;
36                 static const uint16_t loopValuePropertyKey = 59;
37                 static const uint16_t workStartPropertyKey = 60;
38                 static const uint16_t workEndPropertyKey = 61;
39                 static const uint16_t enableWorkAreaPropertyKey = 62;
40
41         private:
42                 int m_Fps = 60;
43                 int m_Duration = 60;
44                 float m_Speed = 1.0f;
45                 int m_LoopValue = 0;
46                 int m_WorkStart = -1;
47                 int m_WorkEnd = -1;
48                 bool m_EnableWorkArea = false;
49         public:
50                 inline int fps() const { return m_Fps; }
51                 void fps(int value)
52                 {
53                         if (m_Fps == value)
54                         {
55                                 return;
56                         }
57                         m_Fps = value;
58                         fpsChanged();
59                 }
60
61                 inline int duration() const { return m_Duration; }
62                 void duration(int value)
63                 {
64                         if (m_Duration == value)
65                         {
66                                 return;
67                         }
68                         m_Duration = value;
69                         durationChanged();
70                 }
71
72                 inline float speed() const { return m_Speed; }
73                 void speed(float value)
74                 {
75                         if (m_Speed == value)
76                         {
77                                 return;
78                         }
79                         m_Speed = value;
80                         speedChanged();
81                 }
82
83                 inline int loopValue() const { return m_LoopValue; }
84                 void loopValue(int value)
85                 {
86                         if (m_LoopValue == value)
87                         {
88                                 return;
89                         }
90                         m_LoopValue = value;
91                         loopValueChanged();
92                 }
93
94                 inline int workStart() const { return m_WorkStart; }
95                 void workStart(int value)
96                 {
97                         if (m_WorkStart == value)
98                         {
99                                 return;
100                         }
101                         m_WorkStart = value;
102                         workStartChanged();
103                 }
104
105                 inline int workEnd() const { return m_WorkEnd; }
106                 void workEnd(int value)
107                 {
108                         if (m_WorkEnd == value)
109                         {
110                                 return;
111                         }
112                         m_WorkEnd = value;
113                         workEndChanged();
114                 }
115
116                 inline bool enableWorkArea() const { return m_EnableWorkArea; }
117                 void enableWorkArea(bool value)
118                 {
119                         if (m_EnableWorkArea == value)
120                         {
121                                 return;
122                         }
123                         m_EnableWorkArea = value;
124                         enableWorkAreaChanged();
125                 }
126
127                 Core* clone() const override;
128                 void copy(const LinearAnimationBase& object)
129                 {
130                         m_Fps = object.m_Fps;
131                         m_Duration = object.m_Duration;
132                         m_Speed = object.m_Speed;
133                         m_LoopValue = object.m_LoopValue;
134                         m_WorkStart = object.m_WorkStart;
135                         m_WorkEnd = object.m_WorkEnd;
136                         m_EnableWorkArea = object.m_EnableWorkArea;
137                         Animation::copy(object);
138                 }
139
140                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
141                 {
142                         switch (propertyKey)
143                         {
144                                 case fpsPropertyKey:
145                                         m_Fps = CoreUintType::deserialize(reader);
146                                         return true;
147                                 case durationPropertyKey:
148                                         m_Duration = CoreUintType::deserialize(reader);
149                                         return true;
150                                 case speedPropertyKey:
151                                         m_Speed = CoreDoubleType::deserialize(reader);
152                                         return true;
153                                 case loopValuePropertyKey:
154                                         m_LoopValue = CoreUintType::deserialize(reader);
155                                         return true;
156                                 case workStartPropertyKey:
157                                         m_WorkStart = CoreUintType::deserialize(reader);
158                                         return true;
159                                 case workEndPropertyKey:
160                                         m_WorkEnd = CoreUintType::deserialize(reader);
161                                         return true;
162                                 case enableWorkAreaPropertyKey:
163                                         m_EnableWorkArea = CoreBoolType::deserialize(reader);
164                                         return true;
165                         }
166                         return Animation::deserialize(propertyKey, reader);
167                 }
168
169         protected:
170                 virtual void fpsChanged() {}
171                 virtual void durationChanged() {}
172                 virtual void speedChanged() {}
173                 virtual void loopValueChanged() {}
174                 virtual void workStartChanged() {}
175                 virtual void workEndChanged() {}
176                 virtual void enableWorkAreaChanged() {}
177         };
178 } // namespace rive
179
180 #endif