up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / shapes / paint / trim_path_base.hpp
1 #ifndef _RIVE_TRIM_PATH_BASE_HPP_
2 #define _RIVE_TRIM_PATH_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_double_type.hpp"
5 #include "core/field_types/core_uint_type.hpp"
6 namespace rive
7 {
8         class TrimPathBase : public Component
9         {
10         protected:
11                 typedef Component Super;
12
13         public:
14                 static const uint16_t typeKey = 47;
15
16                 /// Helper to quickly determine if a core object extends another without
17                 /// RTTI at runtime.
18                 bool isTypeOf(uint16_t typeKey) const override
19                 {
20                         switch (typeKey)
21                         {
22                                 case TrimPathBase::typeKey:
23                                 case ComponentBase::typeKey:
24                                         return true;
25                                 default:
26                                         return false;
27                         }
28                 }
29
30                 uint16_t coreType() const override { return typeKey; }
31
32                 static const uint16_t startPropertyKey = 114;
33                 static const uint16_t endPropertyKey = 115;
34                 static const uint16_t offsetPropertyKey = 116;
35                 static const uint16_t modeValuePropertyKey = 117;
36
37         private:
38                 float m_Start = 0.0f;
39                 float m_End = 0.0f;
40                 float m_Offset = 0.0f;
41                 int m_ModeValue = 0;
42         public:
43                 inline float start() const { return m_Start; }
44                 void start(float value)
45                 {
46                         if (m_Start == value)
47                         {
48                                 return;
49                         }
50                         m_Start = value;
51                         startChanged();
52                 }
53
54                 inline float end() const { return m_End; }
55                 void end(float value)
56                 {
57                         if (m_End == value)
58                         {
59                                 return;
60                         }
61                         m_End = value;
62                         endChanged();
63                 }
64
65                 inline float offset() const { return m_Offset; }
66                 void offset(float value)
67                 {
68                         if (m_Offset == value)
69                         {
70                                 return;
71                         }
72                         m_Offset = value;
73                         offsetChanged();
74                 }
75
76                 inline int modeValue() const { return m_ModeValue; }
77                 void modeValue(int value)
78                 {
79                         if (m_ModeValue == value)
80                         {
81                                 return;
82                         }
83                         m_ModeValue = value;
84                         modeValueChanged();
85                 }
86
87                 Core* clone() const override;
88                 void copy(const TrimPathBase& object)
89                 {
90                         m_Start = object.m_Start;
91                         m_End = object.m_End;
92                         m_Offset = object.m_Offset;
93                         m_ModeValue = object.m_ModeValue;
94                         Component::copy(object);
95                 }
96
97                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
98                 {
99                         switch (propertyKey)
100                         {
101                                 case startPropertyKey:
102                                         m_Start = CoreDoubleType::deserialize(reader);
103                                         return true;
104                                 case endPropertyKey:
105                                         m_End = CoreDoubleType::deserialize(reader);
106                                         return true;
107                                 case offsetPropertyKey:
108                                         m_Offset = CoreDoubleType::deserialize(reader);
109                                         return true;
110                                 case modeValuePropertyKey:
111                                         m_ModeValue = CoreUintType::deserialize(reader);
112                                         return true;
113                         }
114                         return Component::deserialize(propertyKey, reader);
115                 }
116
117         protected:
118                 virtual void startChanged() {}
119                 virtual void endChanged() {}
120                 virtual void offsetChanged() {}
121                 virtual void modeValueChanged() {}
122         };
123 } // namespace rive
124
125 #endif