755d7d605067612ffdf270aa2d7044d7d32e49b1
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextConstants.cs
1 // Copyright (c) 2021 Samsung Electronics Co., Ltd.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 using System;
16 using System.ComponentModel;
17 using System.Diagnostics.CodeAnalysis;
18
19 namespace Tizen.NUI.Text
20 {
21     /// <summary>
22     /// A struct to pass data of InputFilter PropertyMap. <br />
23     /// </summary>
24     /// <remarks>
25     /// InputFilter filters input based on regular expressions. <br />
26     /// Users can set the Accepted or Rejected regular expression set, or both. <br />
27     /// If both are used, Rejected has higher priority. <br />
28     /// The character set must follow the regular expression rules. <br />
29     /// Behaviour can not be guaranteed for incorrect grammars. <br />
30     /// Refer the link below for detailed rules. <br />
31     /// The functions in std::regex library use the ECMAScript grammar: <br />
32     /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
33     /// The InputFilter struct is used as an argument to SetInputFilter and GetInputFilter methods. <br />
34     /// See <see cref="Tizen.NUI.BaseComponents.TextField.SetInputFilter"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetInputFilter"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetInputFilter"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetInputFilter"/>. <br />
35     /// </remarks>
36     /// <since_tizen> 9 </since_tizen>
37     public struct InputFilter
38     {
39         /// <summary>
40         /// A regular expression in the set of characters to be accepted by the inputFilter.
41         /// </summary>
42         public string Accepted { get; set; }
43
44         /// <summary>
45         /// A regular expression in the set of characters to be rejected by the inputFilter.
46         /// </summary>
47         public string Rejected { get; set; }
48     }
49
50     /// <summary>
51     /// A struct to pass data of FontStyle PropertyMap. <br />
52     /// </summary>
53     /// <remarks>
54     /// The FontStyle struct is used as an argument to SetFontStyle and GetFontStyle methods. <br />
55     /// See <see cref="Tizen.NUI.BaseComponents.TextLabel.SetFontStyle"/>, <see cref="Tizen.NUI.BaseComponents.TextLabel.GetFontStyle"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetFontStyle"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetFontStyle"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetFontStyle"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetFontStyle"/>. <br />
56     /// </remarks>
57     [EditorBrowsable(EditorBrowsableState.Never)]
58     public struct FontStyle
59     {
60         /// <summary>
61         /// The Width defines occupied by each glyph.
62         /// </summary>
63         [EditorBrowsable(EditorBrowsableState.Never)]
64         public FontWidthType Width { get; set; }
65
66         /// <summary>
67         /// The Weight defines the thickness or darkness of the glyphs.
68         /// </summary>
69         [EditorBrowsable(EditorBrowsableState.Never)]
70         public FontWeightType Weight { get; set; }
71
72         /// <summary>
73         /// The Slant defines whether to use italics.
74         /// </summary>
75         [EditorBrowsable(EditorBrowsableState.Never)]
76         public FontSlantType Slant { get; set; }
77     }
78
79     /// <summary>
80     /// A struct to pass data of Underline PropertyMap. <br />
81     /// </summary>
82     /// <remarks>
83     /// The Underline struct is used as an argument to SetUnderline and GetUnderline methods. <br />
84     /// See <see cref="Tizen.NUI.BaseComponents.TextLabel.SetUnderline"/>, <see cref="Tizen.NUI.BaseComponents.TextLabel.GetUnderline"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetUnderline"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetUnderline"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetUnderline"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetUnderline"/>. <br />
85     /// </remarks>
86     [EditorBrowsable(EditorBrowsableState.Never)]
87     public struct Underline
88     {
89         /// <summary>
90         /// Whether the underline is enabled (the default value is false).
91         /// </summary>
92         [EditorBrowsable(EditorBrowsableState.Never)]
93         public bool Enable { get; set; }
94
95         /// <summary>
96         /// The color of the underline (if not provided then the color of the text is used).
97         /// </summary>
98         [EditorBrowsable(EditorBrowsableState.Never)]
99         public Color Color { get; set; }
100
101         /// <summary>
102         /// The height in pixels of the underline (if null, the default value is 1.0f).
103         /// </summary>
104         [EditorBrowsable(EditorBrowsableState.Never)]
105         public float? Height { get; set; }
106     }
107
108     /// <summary>
109     /// A struct to pass data of Shadow PropertyMap. <br />
110     /// </summary>
111     /// <remarks>
112     /// The Shadow struct is used as an argument to SetShadow and GetShadow methods. <br />
113     /// See <see cref="Tizen.NUI.BaseComponents.TextLabel.SetShadow"/>, <see cref="Tizen.NUI.BaseComponents.TextLabel.GetShadow"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetShadow"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetShadow"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetShadow"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetShadow"/>. <br />
114     /// </remarks>
115     [EditorBrowsable(EditorBrowsableState.Never)]
116     public struct Shadow
117     {
118         /// <summary>
119         /// The color of the shadow (the default color is Color.Black).
120         /// </summary>
121         [EditorBrowsable(EditorBrowsableState.Never)]
122         public Color Color { get; set; }
123
124         /// <summary>
125         /// The offset in pixels of the shadow (if null, the default value is 0, 0). <br />
126         /// If not provided then the shadow is not enabled. <br />
127         ///
128         /// </summary>
129         [EditorBrowsable(EditorBrowsableState.Never)]
130         public Vector2 Offset { get; set; }
131
132         /// <summary>
133         /// The radius of the Gaussian blur for the soft shadow (if null, the default value is 0.0f). <br />
134         /// If not provided then the soft shadow is not enabled. <br />
135         /// </summary>
136         [EditorBrowsable(EditorBrowsableState.Never)]
137         public float? BlurRadius { get; set; }
138     }
139
140     /// <summary>
141     /// A struct to pass data of Outline PropertyMap. <br />
142     /// </summary>
143     /// <remarks>
144     /// The Outline struct is used as an argument to SetOutline and GetOutline methods. <br />
145     /// See <see cref="Tizen.NUI.BaseComponents.TextLabel.SetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextLabel.GetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetOutline"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetOutline"/>. <br />
146     /// </remarks>
147     [EditorBrowsable(EditorBrowsableState.Never)]
148     public struct Outline
149     {
150         /// <summary>
151         /// The color of the outline (the default color is Color.White).
152         /// </summary>
153         [EditorBrowsable(EditorBrowsableState.Never)]
154         public Color Color { get; set; }
155
156         /// <summary>
157         /// The width in pixels of the outline (if null, the default value is 0.0f). <br />
158         /// If not provided then the outline is not enabled. <br />
159         /// </summary>
160         [EditorBrowsable(EditorBrowsableState.Never)]
161         public float? Width { get; set; }
162     }
163
164     /// <summary>
165     /// A struct to pass data of TextFit PropertyMap. <br />
166     /// </summary>
167     /// <remarks>
168     /// The TextFit struct is used as an argument to SetTextFit and GetTextFit methods. <br />
169     /// See <see cref="Tizen.NUI.BaseComponents.TextLabel.SetTextFit"/> and <see cref="Tizen.NUI.BaseComponents.TextLabel.GetTextFit"/>. <br />
170     /// </remarks>
171     [EditorBrowsable(EditorBrowsableState.Never)]
172     public struct TextFit
173     {
174         /// <summary>
175         /// True to enable the text fit or false to disable (the default value is false).
176         /// </summary>
177         [EditorBrowsable(EditorBrowsableState.Never)]
178         public bool Enable { get; set; }
179
180         /// <summary>
181         /// Minimum Size for text fit (if null, the default value is 10.0f).
182         /// </summary>
183         [EditorBrowsable(EditorBrowsableState.Never)]
184         public float? MinSize { get; set; }
185
186         /// <summary>
187         /// Maximum Size for text fit (if null, the default value is 100.0f).
188         /// </summary>
189         [EditorBrowsable(EditorBrowsableState.Never)]
190         public float? MaxSize { get; set; }
191
192         /// <summary>
193         /// Step Size for font increase (if null, the default value is 1.0f).
194         /// </summary>
195         [EditorBrowsable(EditorBrowsableState.Never)]
196         public float? StepSize { get; set; }
197
198         /// <summary>
199         /// The size type of font, PointSize or PixelSize (the default value is PointSize).
200         /// </summary>
201         [EditorBrowsable(EditorBrowsableState.Never)]
202         public FontSizeType FontSizeType { get; set; }
203
204         /// <summary>
205         /// Font Size for text fit
206         /// </summary>
207         [EditorBrowsable(EditorBrowsableState.Never)]
208         public float? FontSize { get; set; }
209     }
210
211     /// <summary>
212     /// A struct to pass data of Placeholder PropertyMap. <br />
213     /// </summary>
214     /// <remarks>
215     /// The Placeholder struct is used as an argument to SetPlaceholder and GetPlaceholder methods. <br />
216     /// See <see cref="Tizen.NUI.BaseComponents.TextField.SetPlaceholder"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetPlaceholder"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetPlaceholder"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.SetPlaceholder"/>. <br />
217     /// </remarks>
218     [EditorBrowsable(EditorBrowsableState.Never)]
219     public struct Placeholder
220     {
221         /// <summary>
222         /// The text to display when the TextField is empty and inactive.
223         /// </summary>
224         [EditorBrowsable(EditorBrowsableState.Never)]
225         public string Text { get; set; }
226
227         /// <summary>
228         /// The text to display when the placeholder has focus.
229         /// </summary>
230         [EditorBrowsable(EditorBrowsableState.Never)]
231         public string TextFocused { get; set; }
232
233         /// <summary>
234         /// The color of the placeholder text.
235         /// </summary>
236         [EditorBrowsable(EditorBrowsableState.Never)]
237         public Color Color { get; set; }
238
239         /// <summary>
240         /// The FontFamily of the placeholder text.
241         /// </summary>
242         [EditorBrowsable(EditorBrowsableState.Never)]
243         public string FontFamily { get; set; }
244
245         /// <summary>
246         /// The FontStyle of the placeholder text (if null, the text control FontStyle is used).
247         /// </summary>
248         [EditorBrowsable(EditorBrowsableState.Never)]
249         public FontStyle? FontStyle { get; set; }
250
251         /// <summary>
252         /// The PointSize of the placeholder text. <br />
253         /// Not required if PixelSize provided. <br />
254         /// If both provided or neither provided then the text control point size is used. <br />
255         /// </summary>
256         [EditorBrowsable(EditorBrowsableState.Never)]
257         public float? PointSize { get; set; }
258
259         /// <summary>
260         /// The PiexSize of the placeholder text.
261         /// Not required if PointSize provided. <br />
262         /// If both provided or neither provided then the text control point size is used. <br />
263         /// </summary>
264         [EditorBrowsable(EditorBrowsableState.Never)]
265         public float? PixelSize { get; set; }
266
267         /// <summary>
268         /// The ellipsis of the placeholder text (the default value is false).
269         /// </summary>
270         [EditorBrowsable(EditorBrowsableState.Never)]
271         public bool Ellipsis { get; set; }
272     }
273
274     /// <summary>
275     /// A struct to pass data of HiddenInputSettings PropertyMap. <br />
276     /// </summary>
277     /// <remarks>
278     /// The HiddenInput struct is used as an argument to SetHiddenInput and GetHiddenInput methods. <br />
279     /// See <see cref="Tizen.NUI.BaseComponents.TextField.SetHiddenInput"/> and <see cref="Tizen.NUI.BaseComponents.TextField.GetHiddenInput"/>. <br />
280     /// </remarks>
281     [EditorBrowsable(EditorBrowsableState.Never)]
282     public struct HiddenInput
283     {
284         /// <summary>
285         /// The mode for input text display. <br />
286         /// </summary>
287         [EditorBrowsable(EditorBrowsableState.Never)]
288         public HiddenInputModeType Mode { get; set; }
289
290         /// <summary>
291         /// All input characters are substituted by this character (if null, the default value is '*'). <br />
292         /// </summary>
293         [EditorBrowsable(EditorBrowsableState.Never)]
294         public char? SubstituteCharacter { get; set; }
295
296         /// <summary>
297         /// Length of text to show or hide, available when HideCount/ShowCount mode is used (if null, the default value is 0). <br />
298         /// </summary>
299         [EditorBrowsable(EditorBrowsableState.Never)]
300         public int? SubstituteCount { get; set; }
301
302         /// <summary>
303         /// Hide last character after this duration, available when ShowLastCharacter mode (if null, the default value is 1000). <br />
304         /// </summary>
305         [EditorBrowsable(EditorBrowsableState.Never)]
306         public int? ShowLastCharacterDuration { get; set; }
307     }
308
309     /// <summary>
310     /// A struct to pass data of SelectionHandleImageLeft, SelectionHandleImageRight, SelectionHandlePressedImageLeft, SelectionHandlePressedImageRight, SelectionHandleMarkerImageLeft and SelectionHandleMarkerImageRight PropertyMap. <br />
311     /// </summary>
312     /// <remarks>
313     /// The SelectionHandleImage struct is used as an argument to SetSelectionHandleImage, GetSelectionHandleImage methods, SetSelectionHandlePressedImage, GetSelectionHandlePressedImage, SetSelectionHandleMarkerImage and GetSelectionHandleMarkerImage. <br />
314     /// See <see cref="Tizen.NUI.BaseComponents.TextField.SetSelectionHandleImage"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetSelectionHandleImage"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetSelectionHandlePressedImage"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetSelectionHandlePressedImage"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetSelectionHandleMarkerImage"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetSelectionHandleMarkerImage"/>, <br />
315     /// <see cref="Tizen.NUI.BaseComponents.TextEditor.SetSelectionHandleImage"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.GetSelectionHandleImage"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetSelectionHandlePressedImage"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.GetSelectionHandlePressedImage"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetSelectionHandleMarkerImage"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetSelectionHandleMarkerImage"/>. <br />
316     /// </remarks>
317     [EditorBrowsable(EditorBrowsableState.Never)]
318     public struct SelectionHandleImage
319     {
320         /// <summary>
321         /// The image path to display for the left selection handle. <br />
322         /// It means the handle in the bottom-left. <br />
323         /// If the handle needs to be displayed in the top-left, this image will be vertically flipped. <br />
324         /// If null or empty string, it doesn't change the property. <br />
325         /// </summary>
326         [EditorBrowsable(EditorBrowsableState.Never)]
327         public string LeftImageUrl { get; set; }
328
329         /// <summary>
330         /// The image path to display for the right selection handle. <br />
331         /// It means the handle in the bottom-right. <br />
332         /// If the handle needs to be displayed in the top-right, this image will be vertically flipped. <br />
333         /// If null or empty string, it doesn't change the property. <br />
334         /// </summary>
335         [EditorBrowsable(EditorBrowsableState.Never)]
336         public string RightImageUrl { get; set; }
337     }
338 }