[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / text-controls / placeholder-properties.h
1 #ifndef DALI_TOOLKIT_PLACEHOLDER_PROPERTIES_H
2 #define DALI_TOOLKIT_PLACEHOLDER_PROPERTIES_H
3
4 /*
5  * Copyright (c) 2020 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 namespace Dali
22 {
23 namespace Toolkit
24 {
25 /**
26  * @addtogroup dali_toolkit_controls_text_controls
27  * @{
28  */
29
30 namespace Text
31 {
32 /**
33  * @brief Placeholder text used by Text controls to show text before any text inputed.
34  * @SINCE_1_2.62
35  *
36  */
37 namespace PlaceHolder
38 {
39 /**
40  * @brief Placeholder text Properties used by Text controls to show placeholder
41  * @SINCE_1_2.62
42  *
43  */
44 namespace Property
45 {
46 /**
47  * @brief The configurable settings for the Placeholder text.
48  * @SINCE_1_2.62
49  *
50  */
51 enum Setting
52 {
53   /**
54    * @brief The text to display as a placeholder.
55    * @details Name "text", type Property::STRING.
56    * @note Optional. If not provided then no placeholder text will be shown whilst control not focused.
57    * @SINCE_1_2.62
58    */
59   TEXT,
60
61   /**
62    * @brief The text to display as placeholder when focused.
63    * @details Name "textFocused", type Property::STRING.
64    * @note Optional. If not provided then no placeholder text will be shown when focused.
65    * @SINCE_1_2.62
66    */
67   TEXT_FOCUSED,
68
69   /**
70    * @brief The colour of the placeholder text.
71    * @details Name "color", type Property::VECTOR4.
72    * @note If color not provided then 80% white will be used.
73    * @SINCE_1_2.62
74    */
75   COLOR,
76
77   /**
78    * @brief The font family to be used for placeholder text.
79    * @details Name "fontFamily", type Property::STRING.
80    * @note Optional. Default font family used if not provided.
81    * @SINCE_1_2.62
82    */
83   FONT_FAMILY,
84
85   /**
86    * @brief The font style to be used for placeholder text.
87    * @details Name "fontStyle", type Property::MAP.
88    *
89    * Example usage:
90    * @code
91    *   Property::Map fontStylePropertyMap;
92    *   fontStylePropertyMap.Insert( "weight", "bold" );
93    *   fontStylePropertyMap.Insert( "width", "condensed" );
94    *   fontStylePropertyMap.Insert( "slant", "italic" );
95    *   ...
96    *   placeholderPropertyMap[ Text::PlaceHolder::Property::FONT_STYLE] = fontStylePropertyMap;
97    * @endcode
98    *
99    * @note Optional. Default font style used if not provided.
100    * @SINCE_1_2.62
101    */
102   FONT_STYLE,
103
104   /**
105    * @brief The font point size to be used.
106    * @details Name "pointSize", type Property::FLOAT.
107    * @note Optional. Not required if PIXEL_SIZE provided.  If neither provided then the text control point size is used.
108    * @SINCE_1_2.62
109    */
110   POINT_SIZE,
111
112   /**
113    * @brief The font size in pixels to be used
114    * @details Name "pixelSize", type Property::FLOAT.
115    * @note Optional. Not required if POINT_SIZE provided. If neither provided then the text control point size is used.
116    * @SINCE_1_2.62
117    */
118   PIXEL_SIZE,
119
120   /**
121    * @brief If ellipsis should be used when placeholder is too long.
122    * @details Name "ellipsis", type Property::BOOLEAN
123    * @note Optional. Default is false.
124    * @SINCE_1_2.62
125    */
126   ELLIPSIS
127 };
128
129 } // namespace Property
130
131 } // namespace PlaceHolder
132
133 } // namespace Text
134
135 /**
136  * @}
137  */
138
139 } // namespace Toolkit
140
141 } // namespace Dali
142
143 #endif //DALI_TOOLKIT_PLACEHOLDER_PROPERTIES_H