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