Fix next frame time build issue to cast to platform supported duration.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / visuals / gradient-visual-properties.h
1 #ifndef DALI_TOOLKIT_GRADIENT_VISUAL_PROPERTIES_H
2 #define DALI_TOOLKIT_GRADIENT_VISUAL_PROPERTIES_H
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/toolkit-property-index-ranges.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 /**
31  * @addtogroup dali_toolkit_visuals
32  * @{
33  */
34
35 /**
36  * @brief GradientVisual is to render a smooth transition of colors to the control's quad.
37  * @SINCE_1_1.45
38  */
39 namespace GradientVisual
40 {
41
42 /**
43  * @brief GradientVisual Property.
44  * @SINCE_1_1.45
45  */
46 namespace Property
47 {
48
49 /**
50  * @brief Enumeration for the instance of properties belonging to the GradientVisual.
51  * @SINCE_1_1.45
52  */
53 enum
54 {
55   /**
56    * @brief The start position of a linear gradient.
57    * @details Name "startPosition", type Property::VECTOR2.
58    * @SINCE_1_1.45
59    * @note Mandatory for Linear.
60    */
61   START_POSITION = VISUAL_PROPERTY_START_INDEX,
62
63   /**
64    * @brief The end position of a linear gradient.
65    * @details Name "endPosition", type Property::VECTOR2.
66    * @SINCE_1_1.45
67    * @note Mandatory for Linear.
68    */
69   END_POSITION,
70
71   /**
72    * @brief The center point of a radial gradient.
73    * @details Name "center", type Property::VECTOR2.
74    * @SINCE_1_1.45
75    * @note Mandatory for Radial.
76    */
77   CENTER,
78
79   /**
80    * @brief The size of the radius of a radial gradient.
81    * @details Name "radius", type Property::FLOAT.
82    * @SINCE_1_1.45
83    * @note Mandatory for Radial.
84    */
85   RADIUS,
86
87   /**
88    * @brief All the stop offsets.
89    * @details Name "stopOffset", type Property::ARRAY of Property::FLOAT.
90    * @SINCE_1_1.45
91    * @note Optional. If not supplied, default is 0.0 and 1.0.
92    */
93   STOP_OFFSET,
94
95   /**
96    * @brief The color at the stop offsets.
97    * @details Name "stopColor", type Property::ARRAY of Property::VECTOR4.
98    * @SINCE_1_1.45
99    * @note Mandatory. At least 2 values required to show a gradient.
100    */
101   STOP_COLOR,
102
103   /**
104    * @brief Defines the coordinate system for certain attributes of the points in a gradient.
105    * @details Name "units", type Units::Type (Property::INTEGER) or Property::STRING.
106    * @SINCE_1_1.45
107    * @note Optional. If not supplied, default is Units::OBJECT_BOUNDING_BOX.
108    * @see Units::Type
109    */
110   UNITS,
111
112   /**
113    * @brief Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.
114    * @details Name "spreadMethod", type SpreadMethod::Type (Property::INTEGER) or Property::STRING.
115    * @SINCE_1_1.45
116    * @note Optional. If not supplied, default is SpreadMethod::PAD.
117    * @see SpreadMethod::Type
118    */
119   SPREAD_METHOD
120 };
121
122 } // namespace Property
123
124 /**
125  * @brief The type of coordinate system for certain attributes of the points in a gradient.
126  *
127  * This applies to the:
128  * - Start (x1, y1) and End (x2 and y2) points of a line if using a linear gradient.
129  * - Center point (cx, cy) and radius (r) of a circle if using a radial gradient.
130  * @SINCE_1_1.45
131  */
132 namespace Units
133 {
134
135 /**
136  * @brief The type of coordinate system for certain attributes of the points in a gradient.
137  *
138  * This applies to the:
139  * - Start (x1, y1) and End (x2 and y2) points of a line if using a linear gradient.
140  * - Center point (cx, cy) and radius (r) of a circle if using a radial gradient.
141  * @SINCE_1_1.45
142  */
143 enum Type
144 {
145   OBJECT_BOUNDING_BOX, ///< Uses the normals for the start, end & center points, i.e. top-left is (-0.5, -0.5) and bottom-right is (0.5, 0.5). @SINCE_1_1.45
146   USER_SPACE ///< Uses the user coordinates for the start, end & center points, i.e. in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200). @SINCE_1_1.45
147 };
148
149 } // namespace Units
150
151 /**
152  * @brief Policies that define what happens if the gradient starts or ends inside the bounds of the target rectangle.
153  * @SINCE_1_1.45
154  */
155 namespace SpreadMethod
156 {
157
158 /**
159  * @brief Policies that define what happens if the gradient starts or ends inside the bounds of the target rectangle.
160  * @SINCE_1_1.45
161  */
162 enum Type
163 {
164   PAD, ///< Uses the terminal colors of the gradient to fill the remainder of the quad. @SINCE_1_1.45
165   REFLECT, ///< Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc. until the quad is filled. @SINCE_1_1.45
166   REPEAT ///< Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc. until the quad is filled. @SINCE_1_1.45
167 };
168
169 } // namespace SpreadMethod
170
171 } // namespace GradientVisual
172
173 /**
174  * @}
175  */
176
177 } // namespace Toolkit
178
179 } // namespace Dali
180
181 #endif // DALI_TOOLKIT_GRADIENT_VISUAL_PROPERTIES_H