1 // Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
16 using System.ComponentModel;
17 using System.Diagnostics.CodeAnalysis;
19 namespace Tizen.NUI.Text
22 /// A struct to pass data of InputFilter PropertyMap. <br />
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 />
36 /// <since_tizen> 9 </since_tizen>
37 public struct InputFilter
40 /// A regular expression in the set of characters to be accepted by the inputFilter.
42 public string Accepted { get; set; }
45 /// A regular expression in the set of characters to be rejected by the inputFilter.
47 public string Rejected { get; set; }
51 /// A struct to pass data of FontStyle PropertyMap. <br />
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 />
57 [EditorBrowsable(EditorBrowsableState.Never)]
58 public struct FontStyle
61 /// The Width defines occupied by each glyph.
63 [EditorBrowsable(EditorBrowsableState.Never)]
64 public FontWidthType Width { get; set; }
67 /// The Weight defines the thickness or darkness of the glyphs.
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 public FontWeightType Weight { get; set; }
73 /// The Slant defines whether to use italics.
75 [EditorBrowsable(EditorBrowsableState.Never)]
76 public FontSlantType Slant { get; set; }
80 /// A struct to pass data of Underline PropertyMap. <br />
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 />
86 [EditorBrowsable(EditorBrowsableState.Never)]
87 public struct Underline
90 /// Whether the underline is enabled (the default value is false).
92 [EditorBrowsable(EditorBrowsableState.Never)]
93 public bool Enable { get; set; }
96 /// The color of the underline (if not provided then the color of the text is used).
98 [EditorBrowsable(EditorBrowsableState.Never)]
99 public Color Color { get; set; }
102 /// The height in pixels of the underline (if null, the default value is 1.0f).
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public float? Height { get; set; }
109 /// A struct to pass data of Shadow PropertyMap. <br />
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 />
115 [EditorBrowsable(EditorBrowsableState.Never)]
119 /// The color of the shadow (the default color is Color.Black).
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public Color Color { get; set; }
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 />
129 [EditorBrowsable(EditorBrowsableState.Never)]
130 public Vector2 Offset { get; set; }
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 />
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public float? BlurRadius { get; set; }
141 /// A struct to pass data of Outline PropertyMap. <br />
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 />
147 [EditorBrowsable(EditorBrowsableState.Never)]
148 public struct Outline
151 /// The color of the outline (the default color is Color.White).
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 public Color Color { get; set; }
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 />
160 [EditorBrowsable(EditorBrowsableState.Never)]
161 public float? Width { get; set; }
165 /// A struct to pass data of TextFit PropertyMap. <br />
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 />
171 [EditorBrowsable(EditorBrowsableState.Never)]
172 public struct TextFit
175 /// True to enable the text fit or false to disable (the default value is false).
177 [EditorBrowsable(EditorBrowsableState.Never)]
178 public bool Enable { get; set; }
181 /// Minimum Size for text fit (if null, the default value is 10.0f).
183 [EditorBrowsable(EditorBrowsableState.Never)]
184 public float? MinSize { get; set; }
187 /// Maximum Size for text fit (if null, the default value is 100.0f).
189 [EditorBrowsable(EditorBrowsableState.Never)]
190 public float? MaxSize { get; set; }
193 /// Step Size for font increase (if null, the default value is 1.0f).
195 [EditorBrowsable(EditorBrowsableState.Never)]
196 public float? StepSize { get; set; }
199 /// The size type of font, PointSize or PixelSize (the default value is PointSize).
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public FontSizeType FontSizeType { get; set; }
205 /// Font Size for text fit
207 [EditorBrowsable(EditorBrowsableState.Never)]
208 public float? FontSize { get; set; }
212 /// A struct to pass data of Placeholder PropertyMap. <br />
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 />
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public struct Placeholder
222 /// The text to display when the TextField is empty and inactive.
224 [EditorBrowsable(EditorBrowsableState.Never)]
225 public string Text { get; set; }
228 /// The text to display when the placeholder has focus.
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public string TextFocused { get; set; }
234 /// The color of the placeholder text.
236 [EditorBrowsable(EditorBrowsableState.Never)]
237 public Color Color { get; set; }
240 /// The FontFamily of the placeholder text.
242 [EditorBrowsable(EditorBrowsableState.Never)]
243 public string FontFamily { get; set; }
246 /// The FontStyle of the placeholder text (if null, the text control FontStyle is used).
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public FontStyle? FontStyle { get; set; }
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 />
256 [EditorBrowsable(EditorBrowsableState.Never)]
257 public float? PointSize { get; set; }
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 />
264 [EditorBrowsable(EditorBrowsableState.Never)]
265 public float? PixelSize { get; set; }
268 /// The ellipsis of the placeholder text (the default value is false).
270 [EditorBrowsable(EditorBrowsableState.Never)]
271 public bool Ellipsis { get; set; }
275 /// A struct to pass data of HiddenInputSettings PropertyMap. <br />
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 />
281 [EditorBrowsable(EditorBrowsableState.Never)]
282 public struct HiddenInput
285 /// The mode for input text display. <br />
287 [EditorBrowsable(EditorBrowsableState.Never)]
288 public HiddenInputModeType Mode { get; set; }
291 /// All input characters are substituted by this character (if null, the default value is '*'). <br />
293 [EditorBrowsable(EditorBrowsableState.Never)]
294 public char? SubstituteCharacter { get; set; }
297 /// Length of text to show or hide, available when HideCount/ShowCount mode is used (if null, the default value is 0). <br />
299 [EditorBrowsable(EditorBrowsableState.Never)]
300 public int? SubstituteCount { get; set; }
303 /// Hide last character after this duration, available when ShowLastCharacter mode (if null, the default value is 1000). <br />
305 [EditorBrowsable(EditorBrowsableState.Never)]
306 public int? ShowLastCharacterDuration { get; set; }
310 /// A struct to pass data of SelectionHandleImageLeft, SelectionHandleImageRight, SelectionHandlePressedImageLeft, SelectionHandlePressedImageRight, SelectionHandleMarkerImageLeft and SelectionHandleMarkerImageRight PropertyMap. <br />
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 />
317 [EditorBrowsable(EditorBrowsableState.Never)]
318 public struct SelectionHandleImage
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 />
326 [EditorBrowsable(EditorBrowsableState.Never)]
327 public string LeftImageUrl { get; set; }
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 />
335 [EditorBrowsable(EditorBrowsableState.Never)]
336 public string RightImageUrl { get; set; }