Merge "Added code for stylable transitions" into devel/master
[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/visuals/visual-properties.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace GradientVisual
31 {
32
33 namespace Property
34 {
35
36 enum
37 {
38   /**
39    * @brief The start position of a linear gradient.
40    * @details Name "startPosition", type Property::VECTOR2.
41    * @SINCE_1_1.45
42    * @note Mandatory for Linear.
43    */
44   START_POSITION = VISUAL_PROPERTY_START_INDEX,
45
46   /**
47    * @brief The end position of a linear gradient.
48    * @details Name "endPosition", type Property::VECTOR2.
49    * @SINCE_1_1.45
50    * @note Mandatory for Linear.
51    */
52   END_POSITION,
53
54   /**
55    * @brief The center point of a radial gradient.
56    * @details Name "center", type Property::VECTOR2.
57    * @SINCE_1_1.45
58    * @note Mandatory for Radial.
59    */
60   CENTER,
61
62   /**
63    * @brief The size of the radius of a radial gradient.
64    * @details Name "radius", type Property::FLOAT.
65    * @SINCE_1_1.45
66    * @note Mandatory for Radial.
67    */
68   RADIUS,
69
70   /**
71    * @brief All the stop offsets.
72    * @details Name "stopOffset", type Property::ARRAY of Property::FLOAT.
73    * @SINCE_1_1.45
74    * @note Optional. If not supplied, default is 0.0 and 1.0.
75    */
76   STOP_OFFSET,
77
78   /**
79    * @brief The color at the stop offsets.
80    * @details Name "stopColor", type Property::ARRAY of Property::VECTOR4.
81    * @SINCE_1_1.45
82    * @note Mandatory. At least 2 values required to show a gradient.
83    */
84   STOP_COLOR,
85
86   /**
87    * @brief Defines the coordinate system for certain attributes of the points in a gradient.
88    * @details Name "units", type Units::Type (Property::INTEGER) or Property::STRING.
89    * @SINCE_1_1.45
90    * @note Optional. If not supplied, default is Units::OBJECT_BOUNDING_BOX.
91    * @see Units::Type
92    */
93   UNITS,
94
95   /**
96    * @brief Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.
97    * @details Name "spreadMethod", type SpreadMethod::Type (Property::INTEGER) or Property::STRING.
98    * @SINCE_1_1.45
99    * @note Optional. If not supplied, default is SpreadMethod::PAD.
100    * @see SpreadMethod::Type
101    */
102   SPREAD_METHOD
103 };
104
105 } // namespace Property
106
107 namespace Units
108 {
109
110 /**
111  * @brief The type of coordinate system for certain attributes of the points in a gradient.
112  *
113  * This applies to the:
114  * - Start (x1, y1) and End (x2 and y2) points of a line if using a linear gradient.
115  * - Center point (cx, cy) and radius (r) of a circle if using a radial gradient.
116  */
117 enum Type
118 {
119   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
120   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
121 };
122
123 } // namespace Units
124
125 namespace SpreadMethod
126 {
127
128 /**
129  * @brief Policies that define what happens if the gradient starts or ends inside the bounds of the target rectangle.
130  */
131 enum Type
132 {
133   PAD, ///< Uses the terminal colors of the gradient to fill the remainder of the quad. @SINCE_1_1.45
134   REFLECT, ///< Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc. until the quad is filled. @SINCE_1_1.45
135   REPEAT ///< Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc. until the quad is filled. @SINCE_1_1.45
136 };
137
138 } // namespace SpreadMethod
139
140 } // namespace GradientVisual
141
142 } // namespace Toolkit
143
144 } // namespace Dali
145
146 #endif // DALI_TOOLKIT_GRADIENT_VISUAL_PROPERTIES_H