There is a problem that ellipsis does not work properly when MIN_LINE_SIZE is set.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-effects-style.h
1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H
3
4 /*
5  * Copyright (c) 2019 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/internal/text/text-controller.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Text
31 {
32
33 namespace EffectStyle
34 {
35   enum Type
36   {
37     DEFAULT, ///< The default text effect style.
38     INPUT    ///< The input text effect style.
39   };
40 };
41
42 /**
43  * @brief Parses the shadow properties.
44  *
45  * @param[in] shadowProperties The map with the shadow properties.
46  * @param[out] colorDefined Whether the shadow's color is defined.
47  * @param[out] color The shadow's color.
48  * @param[out] offsetDefined Whether the shadow's offset is defined.
49  * @param[out] offset The shadow's offset.
50  */
51 bool ParseShadowProperties( const Property::Map& shadowProperties,
52                             bool& colorDefined,
53                             Vector4& color,
54                             bool& offsetDefined,
55                             Vector2& offset );
56
57 /**
58  * @brief Parses the underline properties.
59  *
60  * @param[in] underlineProperties The map with the underline properties.
61  * @param[out] enabled Whether the underline is enabled.
62  * @param[out] colorDefined Whether the underline's color is defined.
63  * @param[out] color The underline's color.
64  * @param[out] heightDefined Whether the underline's height is defined.
65  * @param[out] height The underline's height.
66  */
67 bool ParseUnderlineProperties( const Property::Map& underlineProperties,
68                                bool& enabled,
69                                bool& colorDefined,
70                                Vector4& color,
71                                bool& heightDefined,
72                                float& height );
73
74 /**
75  * @brief Parses the outline properties.
76  *
77  * @param[in] outlineProperties The map with the outline properties.
78  * @param[out] colorDefined Whether the outline's color is defined.
79  * @param[out] color The outline's color.
80  * @param[out] widthDefined Whether the outline's width is defined.
81  * @param[out] width The outline's width.
82  */
83 bool ParseOutlineProperties( const Property::Map& outlineProperties,
84                                bool& colorDefined,
85                                Vector4& color,
86                                bool& widthDefined,
87                                unsigned int& width );
88
89
90 /**
91  * @brief Parses the background properties.
92  *
93  * @param[in] backgroundProperties The map with the background properties.
94  * @param[out] enabled Whether the background is enabled.
95  * @param[out] colorDefined Whether the background color is defined.
96  * @param[out] color The background color.
97  */
98 bool ParseBackgroundProperties( const Property::Map& backgroundProperties,
99                                 bool& enabled,
100                                 bool& colorDefined,
101                                 Vector4& color );
102
103 /**
104  * @brief Sets the underline properties.
105  *
106  * @param[in] controller The text's controller.
107  * @param[in] value The values of the underline's properties.
108  * @param[in] type Whether the property is for the default underline or the input underline.
109  *
110  * @return Whether the underline properties have been updated.
111  */
112 bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
113
114 /**
115  * @brief Retrieves the underline's properties.
116  *
117  * @param[in] controller The text's controller.
118  * @param[out] value The value of the underline's properties.
119  * @param[in] type Whether the property is for the default underline or the input underline.
120  */
121 void GetUnderlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
122
123 /**
124  * @brief Sets the shadow properties.
125  *
126  * @param[in] controller The text's controller.
127  * @param[in] value The values of the shadow's style.
128  * @param[in] type Whether the property is for the default shadow's style or the input shadow's style.
129  *
130  * @return Whether the shadow properties have been updated.
131  */
132 bool SetShadowProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
133
134 /**
135  * @brief Retrieves the shadow's properties.
136  *
137  * @param[in] controller The text's controller.
138  * @param[out] value The value of the shadow's properties.
139  * @param[in] type Whether the property is for the default shadow or the input shadow.
140  */
141 void GetShadowProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
142
143 /**
144  * @brief Sets the emboss properties.
145  *
146  * @param[in] controller The text's controller.
147  * @param[in] value The values of the emboss's properties.
148  * @param[in] type Whether the property is for the default emboss or the input emboss.
149  *
150  * @return Whether the emboss properties have been updated.
151  */
152 bool SetEmbossProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
153
154 /**
155  * @brief Retrieves the emboss's properties.
156  *
157  * @param[in] controller The text's controller.
158  * @param[out] value The value of the emboss's properties.
159  * @param[in] type Whether the property is for the default emboss or the input emboss.
160  */
161 void GetEmbossProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
162
163 /**
164  * @brief Sets the outline properties.
165  *
166  * @param[in] controller The text's controller.
167  * @param[in] value The values of the outline's properties.
168  * @param[in] type Whether the property is for the default outline or the input outline.
169  *
170  * @return Whether the outline properties have been updated.
171  */
172 bool SetOutlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
173
174 /**
175  * @brief Retrieves the outline's properties.
176  *
177  * @param[in] controller The text's controller.
178  * @param[out] value The value of the outline's properties.
179  * @param[in] type Whether the property is for the default outline or the input outline.
180  */
181 void GetOutlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
182
183 /**
184  * @brief Sets the background properties.
185  *
186  * @param[in] controller The text's controller.
187  * @param[in] value The values of the background's properties.
188  * @param[in] type Whether the property is for the default background or the input background.
189  *
190  * @return Whether the background properties have been updated.
191  */
192 bool SetBackgroundProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
193
194 /**
195  * @brief Retrieves the background's properties.
196  *
197  * @param[in] controller The text's controller.
198  * @param[out] value The value of the underline's properties.
199  * @param[in] type Whether the property is for the default background or the input background.
200  */
201 void GetBackgroundProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
202
203 } // namespace Text
204
205 } // namespace Toolkit
206
207 } // namespace Dali
208
209 #endif // DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H