(TextLabel) Added component properties for Text Color
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-label-devel.h
1 #ifndef DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
2 #define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
3
4 /*
5  * Copyright (c) 2017 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/controls/text-controls/text-label.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace DevelTextLabel
31 {
32
33 /**
34  * @brief Enumeration for the start and end property ranges for this control.
35  * @SINCE_1_0.0
36  */
37 enum PropertyRange
38 {
39   ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
40   ANIMATABLE_PROPERTY_END_INDEX =   ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices
41 };
42
43 namespace Property
44 {
45   enum Type
46   {
47     ///////////////////////////////////////////////////////////////////////////////
48     // Event side (non-animatable) properties
49     ///////////////////////////////////////////////////////////////////////////////
50
51     RENDERING_BACKEND = Dali::Toolkit::TextLabel::Property::RENDERING_BACKEND,
52     TEXT = Dali::Toolkit::TextLabel::Property::TEXT,
53     FONT_FAMILY = Dali::Toolkit::TextLabel::Property::FONT_FAMILY,
54     FONT_STYLE = Dali::Toolkit::TextLabel::Property::FONT_STYLE,
55     POINT_SIZE = Dali::Toolkit::TextLabel::Property::POINT_SIZE,
56     MULTI_LINE = Dali::Toolkit::TextLabel::Property::MULTI_LINE,
57     HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT,
58     VERTICAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT,
59     TEXT_COLOR = Dali::Toolkit::TextLabel::Property::TEXT_COLOR,
60     SHADOW_OFFSET = Dali::Toolkit::TextLabel::Property::SHADOW_OFFSET,
61     SHADOW_COLOR = Dali::Toolkit::TextLabel::Property::SHADOW_COLOR,
62     UNDERLINE_ENABLED = Dali::Toolkit::TextLabel::Property::UNDERLINE_ENABLED,
63     UNDERLINE_COLOR = Dali::Toolkit::TextLabel::Property::UNDERLINE_COLOR,
64     UNDERLINE_HEIGHT = Dali::Toolkit::TextLabel::Property::UNDERLINE_HEIGHT,
65     ENABLE_MARKUP = Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP,
66     ENABLE_AUTO_SCROLL = Dali::Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL,
67     AUTO_SCROLL_SPEED = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED,
68     AUTO_SCROLL_LOOP_COUNT = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT,
69     AUTO_SCROLL_GAP = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_GAP,
70     LINE_SPACING = Dali::Toolkit::TextLabel::Property::LINE_SPACING,
71     UNDERLINE = Dali::Toolkit::TextLabel::Property::UNDERLINE,
72     SHADOW = Dali::Toolkit::TextLabel::Property::SHADOW,
73     EMBOSS = Dali::Toolkit::TextLabel::Property::EMBOSS,
74     OUTLINE = Dali::Toolkit::TextLabel::Property::OUTLINE,
75
76     /**
77      * @brief The size of font in pixels.
78      * @details Name "pixelSize", type Property::FLOAT.
79      *          Conversion from Point size to Pixel size:
80      *            Pixel size = Point size * DPI / 72
81      */
82     PIXEL_SIZE = OUTLINE + 1,
83
84     /**
85      * @brief Enable or disable the ellipsis.
86      * @details Name "ellipsis", type Property::BOOLEAN.
87      */
88     ELLIPSIS = OUTLINE + 2,
89
90     /**
91      * @brief delay starting time of auto scrolling and further loops
92      * @details Name "autoScrollLoopDelay", type Property::FLOAT.
93      */
94     AUTO_SCROLL_LOOP_DELAY = OUTLINE + 3,
95
96     /**
97      * @brief Auto scrolling stop behaviour.
98      * @details Name "autoScrollStopMode", type [Type](@ref Dali::Toolkit::DevelTextLabel::AutoScrollStopMode::Type) (Property::INTEGER) or Property::STRING.
99      *          Values FINISH_LOOP, IMMEDIATE, default FINISH_LOOP
100      */
101     AUTO_SCROLL_STOP_MODE = OUTLINE + 4,
102
103     /*
104      * @brief The line count of text.
105      * @details name "lineCount", type int
106      * @node This property is read-only.
107      */
108     LINE_COUNT = OUTLINE + 5,
109
110     /**
111      * @brief line wrap mode when the text lines over layout width.
112      * @details Name "lineWrapMode", type Property::STRING.
113      */
114     LINE_WRAP_MODE = OUTLINE + 6,
115
116     ///////////////////////////////////////////////////////////////////////////////
117     // Animatable Properties
118     ///////////////////////////////////////////////////////////////////////////////
119
120     /*
121      * @brief Animatable text color.
122      * @details Name "textColorAnimatable", type Property::VECTOR4.
123      *          Text color property to use if required to animate the text color.
124      */
125     TEXT_COLOR_ANIMATABLE = ANIMATABLE_PROPERTY_START_INDEX,
126
127     /**
128      * @brief The red component of the text color.
129      * @details Name "textColorRed", type Property::FLOAT.
130      * @see TEXT_COLOR_ANIMATABLE
131      */
132     TEXT_COLOR_RED = ANIMATABLE_PROPERTY_START_INDEX + 1,
133
134     /**
135      * @brief The green component of the text color.
136      * @details Name "textColorGreen", type Property::FLOAT.
137      * @see TEXT_COLOR_ANIMATABLE
138      */
139     TEXT_COLOR_GREEN = ANIMATABLE_PROPERTY_START_INDEX + 2,
140
141     /**
142      * @brief The blue component of the text color.
143      * @details Name "textColorBlue", type Property::FLOAT.
144      * @see TEXT_COLOR_ANIMATABLE
145      */
146     TEXT_COLOR_BLUE = ANIMATABLE_PROPERTY_START_INDEX + 3,
147
148     /**
149      * @brief The alpha component of the text color.
150      * @details Name "textColorAlpha", type Property::FLOAT.
151      * @see TEXT_COLOR_ANIMATABLE
152      */
153     TEXT_COLOR_ALPHA = ANIMATABLE_PROPERTY_START_INDEX + 4,
154   };
155 } // namespace Property
156
157 /**
158 * @brief The type for TextLabel::Property::AUTO_SCROLL_STOP_MODE
159 */
160 namespace AutoScrollStopMode
161 {
162 /**
163 * @ref Dali::Toolkit::DevelTextLabel::AutoScrollStopMode
164 */
165 enum Type
166 {
167   FINISH_LOOP = 0,  ///< stop animation after current loop finished.
168   IMMEDIATE         ///< stop animation immediatly and reset position.
169 };
170 } // namespace AutoScrollStopMode
171
172 } // namespace DevelText
173
174 } // namespace Toolkit
175
176 } // namespace Dali
177
178 #endif // DALI_TOOLKIT_TEXT_LABEL_DEVEL_H