fb21fe9b95473380d67d135a71dcbb6b3f4697f5
[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) 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/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[out] colorDefined Whether the shadow's color is defined.
46  * @param[out] color The shadow's color.
47  * @param[out] offsetDefined Whether the shadow's offset is defined.
48  * @param[out] offset The shadow's offset.
49  */
50 bool ParseProperties( const std::string& shadowProperties,
51                       bool& colorDefined,
52                       Vector4& color,
53                       bool& offsetDefined,
54                       Vector2& offset );
55
56 /**
57  * @brief Parses the underline properties.
58  *
59  * @param[out] enabled Whether the underline is enabled.
60  * @param[out] colorDefined Whether the underline's color is defined.
61  * @param[out] color The underline's color.
62  * @param[out] heightDefined Whether the underline's height is defined.
63  * @param[out] height The underline's height.
64  */
65 bool ParseProperties( const std::string& underlineProperties,
66                       bool& enabled,
67                       bool& colorDefined,
68                       Vector4& color,
69                       bool& heightDefined,
70                       float& height );
71
72 /**
73  * @brief Sets the underline properties.
74  *
75  * @param[in] controller The text's controller.
76  * @param[in] value The values of the underline's properties.
77  * @param[in] type Whether the property is for the default underline or the input underline.
78  *
79  * @return Whether the underline properties have been updated.
80  */
81 bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
82
83 /**
84  * @brief Retrieves the underline's properties.
85  *
86  * @param[in] controller The text's controller.
87  * @param[out] value The value of the underline's properties.
88  * @param[in] type Whether the property is for the default underline or the input underline.
89  */
90 void GetUnderlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
91
92 /**
93  * @brief Sets the shadow properties.
94  *
95  * @param[in] controller The text's controller.
96  * @param[in] value The values of the shadow's style.
97  * @param[in] type Whether the property is for the default shadow's style or the input shadow's style.
98  *
99  * @return Whether the shadow properties have been updated.
100  */
101 bool SetShadowProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
102
103 /**
104  * @brief Retrieves the shadow's properties.
105  *
106  * @param[in] controller The text's controller.
107  * @param[out] value The value of the shadow's properties.
108  * @param[in] type Whether the property is for the default shadow or the input shadow.
109  */
110 void GetShadowProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
111
112 /**
113  * @brief Sets the emboss properties.
114  *
115  * @param[in] controller The text's controller.
116  * @param[in] value The values of the emboss's properties.
117  * @param[in] type Whether the property is for the default emboss or the input emboss.
118  *
119  * @return Whether the emboss properties have been updated.
120  */
121 bool SetEmbossProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
122
123 /**
124  * @brief Retrieves the emboss's properties.
125  *
126  * @param[in] controller The text's controller.
127  * @param[out] value The value of the emboss's properties.
128  * @param[in] type Whether the property is for the default emboss or the input emboss.
129  */
130 void GetEmbossProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
131
132 /**
133  * @brief Sets the outline properties.
134  *
135  * @param[in] controller The text's controller.
136  * @param[in] value The values of the outline's properties.
137  * @param[in] type Whether the property is for the default outline or the input outline.
138  *
139  * @return Whether the outline properties have been updated.
140  */
141 bool SetOutlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
142
143 /**
144  * @brief Retrieves the outline's properties.
145  *
146  * @param[in] controller The text's controller.
147  * @param[out] value The value of the outline's properties.
148  * @param[in] type Whether the property is for the default outline or the input outline.
149  */
150 void GetOutlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
151
152 } // namespace Text
153
154 } // namespace Toolkit
155
156 } // namespace Dali
157
158 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H__