up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / shapes / paint / solid_color_base.hpp
1 #ifndef _RIVE_SOLID_COLOR_BASE_HPP_
2 #define _RIVE_SOLID_COLOR_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_color_type.hpp"
5 namespace rive
6 {
7         class SolidColorBase : public Component
8         {
9         protected:
10                 typedef Component Super;
11
12         public:
13                 static const uint16_t typeKey = 18;
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 SolidColorBase::typeKey:
22                                 case ComponentBase::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 colorValuePropertyKey = 37;
32
33         private:
34                 int m_ColorValue = 0xFF747474;
35         public:
36                 inline int colorValue() const { return m_ColorValue; }
37                 void colorValue(int value)
38                 {
39                         if (m_ColorValue == value)
40                         {
41                                 return;
42                         }
43                         m_ColorValue = value;
44                         colorValueChanged();
45                 }
46
47                 Core* clone() const override;
48                 void copy(const SolidColorBase& object)
49                 {
50                         m_ColorValue = object.m_ColorValue;
51                         Component::copy(object);
52                 }
53
54                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
55                 {
56                         switch (propertyKey)
57                         {
58                                 case colorValuePropertyKey:
59                                         m_ColorValue = CoreColorType::deserialize(reader);
60                                         return true;
61                         }
62                         return Component::deserialize(propertyKey, reader);
63                 }
64
65         protected:
66                 virtual void colorValueChanged() {}
67         };
68 } // namespace rive
69
70 #endif