2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 extern alias TizenSystemSettings;
18 using TizenSystemSettings.Tizen.System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
26 namespace Tizen.NUI.BaseComponents
29 /// A control which provides a single line editable text field.
31 /// <since_tizen> 3 </since_tizen>
32 public partial class TextField : View
34 private string textFieldTextSid = null;
35 private string textFieldPlaceHolderTextSid = null;
36 private string textFieldPlaceHolderTextFocusedSid = null;
37 private bool systemlangTextFlag = false;
38 private InputMethodContext inputMethodCotext = null;
39 private float fontSizeScale = 1.0f;
40 private bool hasFontSizeChangedCallback = false;
42 static TextField() { }
45 /// Creates the TextField control.
47 /// <since_tizen> 3 </since_tizen>
48 public TextField() : this(Interop.TextField.New(), true)
50 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54 /// Creates the TextField with setting the status of shown or hidden.
56 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
57 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
58 [EditorBrowsable(EditorBrowsableState.Never)]
59 public TextField(bool shown) : this(Interop.TextField.New(), true)
61 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 /// Get attributes, it is abstract function and must be override.
68 [EditorBrowsable(EditorBrowsableState.Never)]
69 protected override ViewStyle CreateViewStyle()
71 return new TextFieldStyle();
74 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(cPtr, cMemoryOwn, viewStyle)
82 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null)
90 internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.NewTextField(TextField.getCPtr(handle)), true)
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100 internal enum ExceedPolicyType
102 ExceedPolicyOriginal,
107 /// The TranslatableText property.<br />
108 /// The text can set the SID value.<br />
110 /// <exception cref='ArgumentNullException'>
111 /// ResourceManager about multilingual is null.
113 /// <since_tizen> 4 </since_tizen>
114 public string TranslatableText
118 return (string)GetValue(TranslatableTextProperty);
122 SetValue(TranslatableTextProperty, value);
125 private string translatableText
129 return textFieldTextSid;
133 if (NUIApplication.MultilingualResourceManager == null)
135 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
137 textFieldTextSid = value;
138 Text = SetTranslatable(textFieldTextSid);
139 NotifyPropertyChanged();
144 /// The TranslatablePlaceholderText property.<br />
145 /// The text can set the SID value.<br />
147 /// <exception cref='ArgumentNullException'>
148 /// ResourceManager about multilingual is null.
150 /// <since_tizen> 4 </since_tizen>
151 public string TranslatablePlaceholderText
155 return (string)GetValue(TranslatablePlaceholderTextProperty);
159 SetValue(TranslatablePlaceholderTextProperty, value);
162 private string translatablePlaceholderText
166 return textFieldPlaceHolderTextSid;
170 if (NUIApplication.MultilingualResourceManager == null)
172 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
174 textFieldPlaceHolderTextSid = value;
175 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
176 NotifyPropertyChanged();
181 /// The TranslatablePlaceholderTextFocused property.<br />
182 /// The text can set the SID value.<br />
184 /// <exception cref='ArgumentNullException'>
185 /// ResourceManager about multilingual is null.
187 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
188 [EditorBrowsable(EditorBrowsableState.Never)]
189 public string TranslatablePlaceholderTextFocused
193 return (string)GetValue(TranslatablePlaceholderTextFocusedProperty);
197 SetValue(TranslatablePlaceholderTextFocusedProperty, value);
200 private string translatablePlaceholderTextFocused
204 return textFieldPlaceHolderTextFocusedSid;
208 if (NUIApplication.MultilingualResourceManager == null)
210 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
212 textFieldPlaceHolderTextFocusedSid = value;
213 PlaceholderTextFocused = SetTranslatable(textFieldPlaceHolderTextFocusedSid);
214 NotifyPropertyChanged();
219 /// The Text property.
221 /// <since_tizen> 3 </since_tizen>
226 return (string)GetValue(TextProperty);
230 SetValueAndForceSendChangeSignal(TextProperty, value);
231 NotifyPropertyChanged();
236 /// The PlaceholderText property.
238 /// <since_tizen> 3 </since_tizen>
239 public string PlaceholderText
243 return (string)GetValue(PlaceholderTextProperty);
247 SetValue(PlaceholderTextProperty, value);
248 NotifyPropertyChanged();
253 /// The PlaceholderTextFocused property.
255 /// <since_tizen> 3 </since_tizen>
256 public string PlaceholderTextFocused
260 return (string)GetValue(PlaceholderTextFocusedProperty);
264 SetValue(PlaceholderTextFocusedProperty, value);
265 NotifyPropertyChanged();
270 /// The FontFamily property.
272 /// <since_tizen> 3 </since_tizen>
273 public string FontFamily
277 return (string)GetValue(FontFamilyProperty);
281 SetValue(FontFamilyProperty, value);
282 NotifyPropertyChanged();
287 /// The FontStyle property.
288 /// The fontStyle map contains the following keys :<br />
289 /// <list type="table">
290 /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
291 /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
292 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
295 /// <since_tizen> 3 </since_tizen>
296 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
297 public PropertyMap FontStyle
301 return (PropertyMap)GetValue(FontStyleProperty);
305 SetValue(FontStyleProperty, value);
306 NotifyPropertyChanged();
311 /// Set FontStyle to TextField. <br />
313 /// <param name="fontStyle">The FontStyle</param>
315 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
318 /// The following example demonstrates how to use the SetFontStyle method.
320 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
321 /// fontStyle.Width = FontWidthType.Expanded;
322 /// fontStyle.Weight = FontWeightType.Bold;
323 /// fontStyle.Slant = FontSlantType.Italic;
324 /// field.SetFontStyle(fontStyle);
327 [EditorBrowsable(EditorBrowsableState.Never)]
328 public void SetFontStyle(FontStyle fontStyle)
330 SetProperty(TextField.Property.FontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
331 NotifyPropertyChanged();
335 /// Get FontStyle from TextField. <br />
337 /// <returns>The FontStyle</returns>
339 /// <see cref="Tizen.NUI.Text.FontStyle"/>
341 [EditorBrowsable(EditorBrowsableState.Never)]
342 public FontStyle GetFontStyle()
344 var map = new PropertyMap();
345 GetProperty(TextField.Property.FontStyle).Get(map);
346 return TextUtils.GetFontStyleStruct(map);
350 /// The PointSize property.
352 /// <since_tizen> 3 </since_tizen>
353 public float PointSize
357 return (float)GetValue(PointSizeProperty);
361 SetValue(PointSizeProperty, value);
362 NotifyPropertyChanged();
367 /// The MaxLength property.
369 /// <since_tizen> 3 </since_tizen>
374 return (int)GetValue(MaxLengthProperty);
378 SetValue(MaxLengthProperty, value);
379 NotifyPropertyChanged();
384 /// The ExceedPolicy property.
386 /// <since_tizen> 3 </since_tizen>
387 public int ExceedPolicy
391 return (int)GetValue(ExceedPolicyProperty);
395 SetValue(ExceedPolicyProperty, value);
396 NotifyPropertyChanged();
401 /// The HorizontalAlignment property.
403 /// <since_tizen> 3 </since_tizen>
404 public HorizontalAlignment HorizontalAlignment
408 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
412 SetValue(HorizontalAlignmentProperty, value);
413 NotifyPropertyChanged();
418 /// The VerticalAlignment property.
420 /// <since_tizen> 3 </since_tizen>
421 public VerticalAlignment VerticalAlignment
425 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
429 SetValue(VerticalAlignmentProperty, value);
430 NotifyPropertyChanged();
431 NotifyPropertyChanged();
436 /// The TextColor property.
439 /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
441 /// <since_tizen> 3 </since_tizen>
442 public Color TextColor
446 Color temp = (Color)GetValue(TextColorProperty);
447 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
451 SetValue(TextColorProperty, value);
452 NotifyPropertyChanged();
457 /// The PlaceholderTextColor property.
460 /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
462 /// <since_tizen> 3 </since_tizen>
463 public Vector4 PlaceholderTextColor
467 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
468 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
472 SetValue(PlaceholderTextColorProperty, value);
473 NotifyPropertyChanged();
478 /// The ShadowOffset property.
480 /// <since_tizen> 3 </since_tizen>
482 /// Deprecated.(API Level 6) Use Shadow instead.
483 /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
485 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
486 public Vector2 ShadowOffset
490 PropertyMap map = new PropertyMap();
491 GetProperty(TextField.Property.SHADOW).Get(map);
492 Vector2 shadowOffset = new Vector2();
493 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
494 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
498 PropertyMap temp = new PropertyMap();
499 temp.Insert("offset", new PropertyValue(value));
500 SetValue(ShadowProperty, temp);
501 NotifyPropertyChanged();
506 /// The ShadowColor property.
508 /// <since_tizen> 3 </since_tizen>
510 /// Deprecated.(API Level 6) Use Shadow instead.
511 /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
513 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
514 public Vector4 ShadowColor
518 PropertyMap map = new PropertyMap();
519 GetProperty(TextField.Property.SHADOW).Get(map);
520 Vector4 shadowColor = new Vector4();
521 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
522 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
526 PropertyMap temp = new PropertyMap();
527 temp.Insert("color", new PropertyValue(value));
528 SetValue(ShadowProperty, temp);
529 NotifyPropertyChanged();
534 /// The PrimaryCursorColor property.
537 /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
539 /// <since_tizen> 3 </since_tizen>
540 public Vector4 PrimaryCursorColor
544 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
545 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
549 SetValue(PrimaryCursorColorProperty, value);
550 NotifyPropertyChanged();
555 /// The SecondaryCursorColor property.
558 /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
560 /// <since_tizen> 3 </since_tizen>
561 public Vector4 SecondaryCursorColor
565 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
566 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
570 SetValue(SecondaryCursorColorProperty, value);
571 NotifyPropertyChanged();
576 /// The EnableCursorBlink property.
578 /// <since_tizen> 3 </since_tizen>
579 public bool EnableCursorBlink
583 return (bool)GetValue(EnableCursorBlinkProperty);
587 SetValue(EnableCursorBlinkProperty, value);
588 NotifyPropertyChanged();
593 /// The CursorBlinkInterval property.
595 /// <since_tizen> 3 </since_tizen>
596 public float CursorBlinkInterval
600 return (float)GetValue(CursorBlinkIntervalProperty);
604 SetValue(CursorBlinkIntervalProperty, value);
605 NotifyPropertyChanged();
610 /// The CursorBlinkDuration property.
612 /// <since_tizen> 3 </since_tizen>
613 public float CursorBlinkDuration
617 return (float)GetValue(CursorBlinkDurationProperty);
621 SetValue(CursorBlinkDurationProperty, value);
622 NotifyPropertyChanged();
627 /// The CursorWidth property.
629 /// <since_tizen> 3 </since_tizen>
630 public int CursorWidth
634 return (int)GetValue(CursorWidthProperty);
638 SetValue(CursorWidthProperty, value);
639 NotifyPropertyChanged();
644 /// The GrabHandleImage property.
646 /// <since_tizen> 3 </since_tizen>
647 public string GrabHandleImage
651 return (string)GetValue(GrabHandleImageProperty);
655 SetValue(GrabHandleImageProperty, value);
656 NotifyPropertyChanged();
661 /// The GrabHandlePressedImage property.
663 /// <since_tizen> 3 </since_tizen>
664 public string GrabHandlePressedImage
668 return (string)GetValue(GrabHandlePressedImageProperty);
672 SetValue(GrabHandlePressedImageProperty, value);
673 NotifyPropertyChanged();
678 /// The ScrollThreshold property.
680 /// <since_tizen> 3 </since_tizen>
681 public float ScrollThreshold
685 return (float)GetValue(ScrollThresholdProperty);
689 SetValue(ScrollThresholdProperty, value);
690 NotifyPropertyChanged();
695 /// The ScrollSpeed property.
697 /// <since_tizen> 3 </since_tizen>
698 public float ScrollSpeed
702 return (float)GetValue(ScrollSpeedProperty);
706 SetValue(ScrollSpeedProperty, value);
707 NotifyPropertyChanged();
712 /// The SelectionHandleImageLeft property.
713 /// The selectionHandleImageLeft map contains the following key :<br />
714 /// <list type="table">
715 /// <item><term>filename (string)</term><description>The path of image file</description></item>
718 /// <since_tizen> 3 </since_tizen>
719 public PropertyMap SelectionHandleImageLeft
723 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
727 SetValue(SelectionHandleImageLeftProperty, value);
728 NotifyPropertyChanged();
733 /// The SelectionHandleImageRight property.
734 /// The selectionHandleImageRight map contains the following key :<br />
735 /// <list type="table">
736 /// <item><term>filename (string)</term><description>The path of image file</description></item>
739 /// <since_tizen> 3 </since_tizen>
740 public PropertyMap SelectionHandleImageRight
744 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
748 SetValue(SelectionHandleImageRightProperty, value);
749 NotifyPropertyChanged();
754 /// The SelectionHandlePressedImageLeft property.
755 /// The selectionHandlePressedImageLeft map contains the following key :<br />
756 /// <list type="table">
757 /// <item><term>filename (string)</term><description>The path of image file</description></item>
760 /// <since_tizen> 3 </since_tizen>
761 public PropertyMap SelectionHandlePressedImageLeft
765 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
769 SetValue(SelectionHandlePressedImageLeftProperty, value);
770 NotifyPropertyChanged();
775 /// The SelectionHandlePressedImageRight property.
776 /// The selectionHandlePressedImageRight map contains the following key :<br />
777 /// <list type="table">
778 /// <item><term>filename (string)</term><description>The path of image file</description></item>
781 /// <since_tizen> 3 </since_tizen>
782 public PropertyMap SelectionHandlePressedImageRight
786 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
790 SetValue(SelectionHandlePressedImageRightProperty, value);
791 NotifyPropertyChanged();
796 /// The SelectionHandleMarkerImageLeft property.
797 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
798 /// <list type="table">
799 /// <item><term>filename (string)</term><description>The path of image file</description></item>
802 /// <since_tizen> 3 </since_tizen>
803 public PropertyMap SelectionHandleMarkerImageLeft
807 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
811 SetValue(SelectionHandleMarkerImageLeftProperty, value);
812 NotifyPropertyChanged();
817 /// The SelectionHandleMarkerImageRight property.
818 /// The selectionHandleMarkerImageRight map contains the following key :<br />
819 /// <list type="table">
820 /// <item><term>filename (string)</term><description>The path of image file</description></item>
823 /// <since_tizen> 3 </since_tizen>
824 public PropertyMap SelectionHandleMarkerImageRight
828 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
832 SetValue(SelectionHandleMarkerImageRightProperty, value);
833 NotifyPropertyChanged();
838 /// The SelectionHighlightColor property.
841 /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
843 /// <since_tizen> 3 </since_tizen>
844 public Vector4 SelectionHighlightColor
848 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
849 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
853 SetValue(SelectionHighlightColorProperty, value);
854 NotifyPropertyChanged();
859 /// The DecorationBoundingBox property.
862 /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
864 /// <since_tizen> 3 </since_tizen>
865 public Rectangle DecorationBoundingBox
869 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
870 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
874 SetValue(DecorationBoundingBoxProperty, value);
875 NotifyPropertyChanged();
880 /// The InputMethodSettings property.
883 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
886 /// The following example demonstrates how to set the InputMethodSettings property.
888 /// InputMethod method = new InputMethod();
889 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
890 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
891 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
892 /// method.Variation = 1;
893 /// textField.InputMethodSettings = method.OutputMap;
896 /// <since_tizen> 3 </since_tizen>
897 public PropertyMap InputMethodSettings
901 return (PropertyMap)GetValue(InputMethodSettingsProperty);
905 SetValue(InputMethodSettingsProperty, value);
906 NotifyPropertyChanged();
911 /// The InputColor property.
914 /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
916 /// <since_tizen> 3 </since_tizen>
917 public Vector4 InputColor
921 Vector4 temp = (Vector4)GetValue(InputColorProperty);
922 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
926 SetValue(InputColorProperty, value);
927 NotifyPropertyChanged();
932 /// The EnableMarkup property.
934 /// <since_tizen> 3 </since_tizen>
935 public bool EnableMarkup
939 return (bool)GetValue(EnableMarkupProperty);
943 SetValue(EnableMarkupProperty, value);
944 NotifyPropertyChanged();
949 /// The InputFontFamily property.
951 /// <since_tizen> 3 </since_tizen>
952 public string InputFontFamily
956 return (string)GetValue(InputFontFamilyProperty);
960 SetValue(InputFontFamilyProperty, value);
961 NotifyPropertyChanged();
966 /// The InputFontStyle property.
967 /// The inputFontStyle map contains the following keys :<br />
968 /// <list type="table">
969 /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
970 /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
971 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
974 /// <since_tizen> 3 </since_tizen>
975 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
976 public PropertyMap InputFontStyle
980 return (PropertyMap)GetValue(InputFontStyleProperty);
984 SetValue(InputFontStyleProperty, value);
985 NotifyPropertyChanged();
990 /// Set InputFontStyle to TextField. <br />
992 /// <param name="fontStyle">The FontStyle</param>
994 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
997 /// The following example demonstrates how to use the SetInputFontStyle method.
999 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
1000 /// fontStyle.Width = FontWidthType.Expanded;
1001 /// fontStyle.Weight = FontWeightType.Bold;
1002 /// fontStyle.Slant = FontSlantType.Italic;
1003 /// field.SetInputFontStyle(fontStyle);
1006 [EditorBrowsable(EditorBrowsableState.Never)]
1007 public void SetInputFontStyle(FontStyle fontStyle)
1009 SetProperty(TextField.Property.InputFontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
1010 NotifyPropertyChanged();
1014 /// Get InputFontStyle from TextField. <br />
1016 /// <returns>The FontStyle</returns>
1018 /// <see cref="Tizen.NUI.Text.FontStyle"/>
1020 [EditorBrowsable(EditorBrowsableState.Never)]
1021 public FontStyle GetInputFontStyle()
1023 var map = new PropertyMap();
1024 GetProperty(TextField.Property.InputFontStyle).Get(map);
1025 return TextUtils.GetFontStyleStruct(map);
1029 /// The InputPointSize property.
1031 /// <since_tizen> 3 </since_tizen>
1032 public float InputPointSize
1036 return (float)GetValue(InputPointSizeProperty);
1040 SetValue(InputPointSizeProperty, value);
1041 NotifyPropertyChanged();
1046 /// The Underline property.
1047 /// The underline map contains the following keys :<br />
1048 /// <list type="table">
1049 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1050 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1051 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1054 /// <since_tizen> 3 </since_tizen>
1055 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1056 public PropertyMap Underline
1060 return (PropertyMap)GetValue(UnderlineProperty);
1064 SetValue(UnderlineProperty, value);
1065 NotifyPropertyChanged();
1070 /// Set Underline to TextField. <br />
1072 /// <param name="underline">The Underline</param>
1074 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1077 /// The following example demonstrates how to use the SetUnderline method.
1079 /// var underline = new Tizen.NUI.Text.Underline();
1080 /// underline.Enable = true;
1081 /// underline.Color = new Color("#3498DB");
1082 /// underline.Height = 2.0f;
1083 /// field.SetUnderline(underline);
1086 [EditorBrowsable(EditorBrowsableState.Never)]
1087 public void SetUnderline(Underline underline)
1089 SetProperty(TextField.Property.UNDERLINE, new PropertyValue(TextUtils.GetUnderlineMap(underline)));
1093 /// Get Underline from TextField. <br />
1095 /// <returns>The Underline</returns>
1097 /// <see cref="Tizen.NUI.Text.Underline"/>
1099 [EditorBrowsable(EditorBrowsableState.Never)]
1100 public Underline GetUnderline()
1102 var map = new PropertyMap();
1103 GetProperty(TextField.Property.UNDERLINE).Get(map);
1104 return TextUtils.GetUnderlineStruct(map);
1108 /// The InputUnderline property.
1110 /// <since_tizen> 3 </since_tizen>
1111 public string InputUnderline
1115 return (string)GetValue(InputUnderlineProperty);
1119 SetValue(InputUnderlineProperty, value);
1120 NotifyPropertyChanged();
1125 /// The Shadow property.
1126 /// The shadow map contains the following keys :<br />
1127 /// <list type="table">
1128 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1129 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1130 /// <item><term>blurRadius (float)</term><description>The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled)</description></item>
1133 /// <since_tizen> 3 </since_tizen>
1134 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1135 public PropertyMap Shadow
1139 return (PropertyMap)GetValue(ShadowProperty);
1143 SetValue(ShadowProperty, value);
1144 NotifyPropertyChanged();
1149 /// Set Shadow to TextField. <br />
1151 /// <param name="shadow">The Shadow</param>
1153 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1156 /// The following example demonstrates how to use the SetShadow method.
1158 /// var shadow = new Tizen.NUI.Text.Shadow();
1159 /// shadow.Offset = new Vector2(3, 3);
1160 /// shadow.Color = new Color("#F1C40F");
1161 /// field.SetShadow(shadow);
1164 [EditorBrowsable(EditorBrowsableState.Never)]
1165 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1167 SetProperty(TextField.Property.SHADOW, new PropertyValue(TextUtils.GetShadowMap(shadow)));
1171 /// Get Shadow from TextField. <br />
1173 /// <returns>The Shadow</returns>
1175 /// <see cref="Tizen.NUI.Text.Shadow"/>
1177 [EditorBrowsable(EditorBrowsableState.Never)]
1178 public Tizen.NUI.Text.Shadow GetShadow()
1180 var map = new PropertyMap();
1181 GetProperty(TextField.Property.SHADOW).Get(map);
1182 return TextUtils.GetShadowStruct(map);
1186 /// The InputShadow property.
1188 /// <since_tizen> 3 </since_tizen>
1189 public string InputShadow
1193 return (string)GetValue(InputShadowProperty);
1197 SetValue(InputShadowProperty, value);
1198 NotifyPropertyChanged();
1203 /// The Emboss property.
1205 /// <since_tizen> 3 </since_tizen>
1206 public string Emboss
1210 return (string)GetValue(EmbossProperty);
1214 SetValue(EmbossProperty, value);
1215 NotifyPropertyChanged();
1220 /// The InputEmboss property.
1222 /// <since_tizen> 3 </since_tizen>
1223 public string InputEmboss
1227 return (string)GetValue(InputEmbossProperty);
1231 SetValue(InputEmbossProperty, value);
1232 NotifyPropertyChanged();
1237 /// The Outline property.
1238 /// The outline map contains the following keys :<br />
1239 /// <list type="table">
1240 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1241 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1244 /// <since_tizen> 3 </since_tizen>
1245 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1246 public PropertyMap Outline
1250 return (PropertyMap)GetValue(OutlineProperty);
1254 SetValue(OutlineProperty, value);
1255 NotifyPropertyChanged();
1260 /// Set Outline to TextField. <br />
1262 /// <param name="outline">The Outline</param>
1264 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1267 /// The following example demonstrates how to use the SetOutline method.
1269 /// var outline = new Tizen.NUI.Text.Outline();
1270 /// outline.Width = 2.0f;
1271 /// outline.Color = new Color("#45B39D");
1272 /// field.SetOutline(outline);
1275 [EditorBrowsable(EditorBrowsableState.Never)]
1276 public void SetOutline(Outline outline)
1278 SetProperty(TextField.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
1282 /// Get Outline from TextField. <br />
1284 /// <returns>The Outline</returns>
1286 /// <see cref="Tizen.NUI.Text.Outline"/>
1288 [EditorBrowsable(EditorBrowsableState.Never)]
1289 public Outline GetOutline()
1291 var map = new PropertyMap();
1292 GetProperty(TextField.Property.OUTLINE).Get(map);
1293 return TextUtils.GetOutlineStruct(map);
1297 /// The InputOutline property.
1299 /// <since_tizen> 3 </since_tizen>
1300 public string InputOutline
1304 return (string)GetValue(InputOutlineProperty);
1308 SetValue(InputOutlineProperty, value);
1309 NotifyPropertyChanged();
1314 /// The HiddenInputSettings property.
1315 /// The hiddenInputSettings map contains the following keys :<br />
1316 /// <list type="table">
1317 /// <item><term>HiddenInputProperty.Mode (int)</term><description>The mode for input text display (Use HiddenInputModeType)</description></item>
1318 /// <item><term>HiddenInputProperty.SubstituteCharacter (int)</term><description>All input characters are substituted by this character</description></item>
1319 /// <item><term>HiddenInputProperty.SubstituteCount (int)</term><description>Length of text to show or hide, available when HideCount/ShowCount mode is used</description></item>
1320 /// <item><term>HiddenInputProperty.ShowLastCharacterDuration (int)</term><description>Hide last character after this duration, available when ShowLastCharacter mode</description></item>
1324 /// See <see cref="HiddenInputProperty"/> and <see cref="HiddenInputModeType"/> for a detailed description.
1327 /// The following example demonstrates how to set the HiddenInputSettings property.
1329 /// PropertyMap map = new PropertyMap();
1330 /// map.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter));
1331 /// map.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(500));
1332 /// map.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x2A));
1333 /// textField.HiddenInputSettings = map;
1336 /// <since_tizen> 3 </since_tizen>
1337 public Tizen.NUI.PropertyMap HiddenInputSettings
1341 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1345 SetValue(HiddenInputSettingsProperty, value);
1346 NotifyPropertyChanged();
1351 /// The PixelSize property.
1353 /// <since_tizen> 3 </since_tizen>
1354 public float PixelSize
1358 return (float)GetValue(PixelSizeProperty);
1362 SetValue(PixelSizeProperty, value);
1363 NotifyPropertyChanged();
1368 /// The Enable selection property.
1370 /// <since_tizen> 3 </since_tizen>
1371 public bool EnableSelection
1375 return (bool)GetValue(EnableSelectionProperty);
1379 SetValue(EnableSelectionProperty, value);
1380 NotifyPropertyChanged();
1385 /// The Enable selection property.
1387 /// <since_tizen> 6 </since_tizen>
1388 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1389 [EditorBrowsable(EditorBrowsableState.Never)]
1390 public bool EnableGrabHandle
1394 return (bool)GetValue(EnableGrabHandleProperty);
1398 SetValue(EnableGrabHandleProperty, value);
1399 NotifyPropertyChanged();
1404 /// The Enable selection property.
1406 /// <since_tizen> 6 </since_tizen>
1407 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1408 [EditorBrowsable(EditorBrowsableState.Never)]
1409 public bool EnableGrabHandlePopup
1413 return (bool)GetValue(EnableGrabHandlePopupProperty);
1417 SetValue(EnableGrabHandlePopupProperty, value);
1418 NotifyPropertyChanged();
1423 /// The Selected Text property.
1425 /// <since_tizen> 8 </since_tizen>
1426 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1427 [EditorBrowsable(EditorBrowsableState.Never)]
1428 public string SelectedText
1433 GetProperty(TextField.Property.SelectedText).Get(out temp);
1439 /// The start index for selection.
1441 /// <since_tizen> 8 </since_tizen>
1442 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1443 [EditorBrowsable(EditorBrowsableState.Never)]
1444 public int SelectedTextStart
1449 GetProperty(TextField.Property.SelectedTextStart).Get(out temp);
1454 SetProperty(TextField.Property.SelectedTextStart, new PropertyValue(value));
1455 NotifyPropertyChanged();
1460 /// The end index for selection.
1462 /// <since_tizen> 8 </since_tizen>
1463 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1464 [EditorBrowsable(EditorBrowsableState.Never)]
1465 public int SelectedTextEnd
1470 GetProperty(TextField.Property.SelectedTextEnd).Get(out temp);
1475 SetProperty(TextField.Property.SelectedTextEnd, new PropertyValue(value));
1476 NotifyPropertyChanged();
1481 /// Enable editing in text control.
1483 /// <since_tizen> 8 </since_tizen>
1484 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1485 [EditorBrowsable(EditorBrowsableState.Never)]
1486 public bool EnableEditing
1491 GetProperty(TextField.Property.EnableEditing).Get(out temp);
1496 SetProperty(TextField.Property.EnableEditing, new PropertyValue(value));
1497 NotifyPropertyChanged();
1502 /// Specify primary cursor (caret) position in text control.
1504 [EditorBrowsable(EditorBrowsableState.Never)]
1505 public int PrimaryCursorPosition
1510 using (PropertyValue propertyValue = GetProperty(TextField.Property.PrimaryCursorPosition))
1512 propertyValue.Get(out temp);
1518 using (PropertyValue propertyValue = new PropertyValue(value))
1520 SetProperty(TextField.Property.PrimaryCursorPosition, propertyValue);
1521 NotifyPropertyChanged();
1527 /// The GrabHandleColor property.
1530 /// The property cascade chaining set is possible. For example, this (textField.GrabHandleColor.X = 0.1f;) is possible.
1532 [EditorBrowsable(EditorBrowsableState.Never)]
1533 public Color GrabHandleColor
1537 Color temp = (Color)GetValue(GrabHandleColorProperty);
1538 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1542 SetValue(GrabHandleColorProperty, value);
1543 NotifyPropertyChanged();
1548 /// The ellipsis position of the text.
1549 /// The ellipsis position type when the text size over the layout size.<br />
1550 /// The ellipsis position: End, Start or Middle.<br />
1552 [EditorBrowsable(EditorBrowsableState.Never)]
1553 public EllipsisPosition EllipsisPosition
1557 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1561 SetValue(EllipsisPositionProperty, value);
1562 NotifyPropertyChanged();
1567 /// Set InputFilter to TextField. <br />
1569 /// <param name="inputFilter">The InputFilter</param>
1571 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1572 /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1573 /// If both are used, Rejected has higher priority. <br />
1574 /// The character set must follow the regular expression rules. <br />
1575 /// Behaviour can not be guaranteed for incorrect grammars. <br />
1576 /// Refer the link below for detailed rules. <br />
1577 /// The functions in std::regex library use the ECMAScript grammar: <br />
1578 /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1579 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1580 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1583 /// The following example demonstrates how to use the SetInputFilter method.
1585 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1586 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1587 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1588 /// field.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1591 [EditorBrowsable(EditorBrowsableState.Never)]
1592 public void SetInputFilter(InputFilter inputFilter)
1594 SetProperty(TextField.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1598 /// Get InputFilter from TextField. <br />
1600 /// <returns>The InputFilter</returns>
1602 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1604 [EditorBrowsable(EditorBrowsableState.Never)]
1605 public InputFilter GetInputFilter()
1607 var map = new PropertyMap();
1608 GetProperty(TextField.Property.InputFilter).Get(map);
1609 return TextUtils.GetInputFilterStruct(map);
1613 /// The Placeholder property.
1614 /// The placeholder map contains the following keys :<br />
1615 /// <list type="table">
1616 /// <item><term>text (string)</term><description>The text to display when the TextField is empty and inactive</description></item>
1617 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1618 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1619 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1620 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1621 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1622 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1623 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1627 /// The following example demonstrates how to set the Placeholder property.
1629 /// PropertyMap propertyMap = new PropertyMap();
1630 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1631 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1632 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1633 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1634 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1636 /// PropertyMap fontStyleMap = new PropertyMap();
1637 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1638 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1639 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1640 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1642 /// TextField field = new TextField();
1643 /// field.Placeholder = propertyMap;
1646 /// <since_tizen> 3 </since_tizen>
1647 public Tizen.NUI.PropertyMap Placeholder
1651 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1652 PropertyValue value = null;
1655 value = map.Find(0);
1658 value.Get(out string text);
1659 map.Add("text", new PropertyValue(text));
1663 value = map.Find(1);
1666 value.Get(out string textFocused);
1667 map.Add("textFocused", new PropertyValue(textFocused));
1671 value = map.Find(2);
1674 Color color = new Color();
1676 map.Add("color", new PropertyValue(color));
1680 value = map.Find(3);
1683 value.Get(out string fontFamily);
1684 map.Add("fontFamily", new PropertyValue(fontFamily));
1688 value = map.Find(4);
1691 PropertyMap fontStyle = new PropertyMap();
1692 value.Get(fontStyle);
1693 map.Add("fontStyle", new PropertyValue(fontStyle));
1697 value = map.Find(5);
1700 value.Get(out float pointSize);
1701 map.Add("pointSize", new PropertyValue(pointSize));
1705 value = map.Find(6);
1708 value.Get(out float pixelSize);
1709 map.Add("pixelSize", new PropertyValue(pixelSize));
1713 value = map.Find(7);
1716 value.Get(out bool ellipsis);
1717 map.Add("ellipsis", new PropertyValue(ellipsis));
1724 SetValue(PlaceholderProperty, value);
1725 NotifyPropertyChanged();
1730 /// The Ellipsis property.<br />
1731 /// Enable or disable the ellipsis.<br />
1732 /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1734 /// <since_tizen> 4 </since_tizen>
1735 public bool Ellipsis
1739 return (bool)GetValue(EllipsisProperty);
1743 SetValue(EllipsisProperty, value);
1744 NotifyPropertyChanged();
1749 /// Enables selection of the text using the Shift key.
1751 /// <since_tizen> 5 </since_tizen>
1752 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1753 [EditorBrowsable(EditorBrowsableState.Never)]
1754 public bool EnableShiftSelection
1758 return (bool)GetValue(EnableShiftSelectionProperty);
1762 SetValue(EnableShiftSelectionProperty, value);
1763 NotifyPropertyChanged();
1768 /// The text alignment to match the direction of the system language.
1770 /// <since_tizen> 6 </since_tizen>
1771 public bool MatchSystemLanguageDirection
1775 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1779 SetValue(MatchSystemLanguageDirectionProperty, value);
1780 NotifyPropertyChanged();
1785 /// The FontSizeScale property. <br />
1786 /// The default value is 1.0. <br />
1787 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1789 /// <since_tizen> 9 </since_tizen>
1790 public float FontSizeScale
1794 return fontSizeScale;
1798 float newFontSizeScale;
1800 if (fontSizeScale == value) return;
1802 fontSizeScale = value;
1803 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1805 SystemSettingsFontSize systemSettingsFontSize;
1809 systemSettingsFontSize = SystemSettings.FontSize;
1813 Console.WriteLine("{0} Exception caught.", e);
1814 systemSettingsFontSize = SystemSettingsFontSize.Normal;
1816 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1817 addFontSizeChangedCallback();
1821 newFontSizeScale = fontSizeScale;
1822 removeFontSizeChangedCallback();
1825 SetValue(FontSizeScaleProperty, newFontSizeScale);
1826 NotifyPropertyChanged();
1830 /// Only used by the IL of xaml, will never changed to not hidden.
1831 [EditorBrowsable(EditorBrowsableState.Never)]
1832 public override bool IsCreateByXaml
1836 return base.IsCreateByXaml;
1840 base.IsCreateByXaml = value;
1844 this.TextChanged += (obj, e) =>
1846 this.Text = e.TextField.Text;
1853 /// Get the InputMethodContext instance.
1855 /// <returns>The InputMethodContext instance.</returns>
1856 /// <since_tizen> 5 </since_tizen>
1857 public InputMethodContext GetInputMethodContext()
1859 if (inputMethodCotext == null)
1861 /*Avoid raising InputMethodContext reference count.*/
1862 inputMethodCotext = new InputMethodContext(Interop.TextField.GetInputMethodContext(SwigCPtr), true);
1863 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1865 return inputMethodCotext;
1869 /// Select the whole text.
1871 /// <since_tizen> 6 </since_tizen>
1872 /// This will be released at Tizen.NET API Level 5.5, so currently this would be used as inhouse API.
1873 [EditorBrowsable(EditorBrowsableState.Never)]
1874 public void SelectWholeText()
1876 Interop.TextField.SelectWholeText(SwigCPtr);
1877 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1881 /// Select text from start to end index.
1883 /// <param name="start">The start index for selection.</param>
1884 /// <param name="end">The end index for selection.</param>
1885 [EditorBrowsable(EditorBrowsableState.Never)]
1886 public void SelectText(uint start, uint end)
1888 Interop.TextField.SelectText(SwigCPtr, start, end);
1889 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1893 /// Clear selection of the text.
1895 /// <since_tizen> 8 </since_tizen>
1896 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1897 [EditorBrowsable(EditorBrowsableState.Never)]
1898 public void SelectNone()
1900 _ = Interop.TextField.SelectNone(SwigCPtr);
1901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1904 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
1906 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1909 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
1911 SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(Interop.TextField.InputStyleChangedSignal(SwigCPtr));
1912 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1919 /// <since_tizen> 3 </since_tizen>
1920 protected override void Dispose(DisposeTypes type)
1924 DisposeQueue.Instance.Add(this);
1928 if (systemlangTextFlag)
1930 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
1933 removeFontSizeChangedCallback();
1935 if (type == DisposeTypes.Explicit)
1938 //Release your own managed resources here.
1939 //You should release all of your own disposable objects here.
1942 //Release your own unmanaged resources here.
1943 //You should not access any managed member here except static instance.
1944 //because the execution order of Finalizes is non-deterministic.
1947 if (textFieldMaxLengthReachedCallbackDelegate != null)
1949 this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
1952 if (textFieldSelectionChangedCallbackDelegate != null)
1954 this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate);
1957 if (textFieldTextChangedCallbackDelegate != null)
1959 TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate);
1966 /// This will not be public opened.
1967 [EditorBrowsable(EditorBrowsableState.Never)]
1968 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1970 // In order to speed up IME hide, temporarily add
1971 GetInputMethodContext()?.DestroyContext();
1972 Interop.TextField.DeleteTextField(swigCPtr);
1975 private string SetTranslatable(string textFieldSid)
1977 string translatableText = null;
1978 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1979 if (translatableText != null)
1981 if (systemlangTextFlag == false)
1983 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
1984 systemlangTextFlag = true;
1986 return translatableText;
1990 translatableText = "";
1991 return translatableText;
1995 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1997 if (textFieldTextSid != null)
1999 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2001 if (textFieldPlaceHolderTextSid != null)
2003 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2005 if (textFieldPlaceHolderTextFocusedSid != null)
2007 PlaceholderTextFocused = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextFocusedSid, new CultureInfo(e.Value.Replace("_", "-")));
2011 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2013 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2014 SetValue(FontSizeScaleProperty, newFontSizeScale);
2015 NotifyPropertyChanged();
2018 private void addFontSizeChangedCallback()
2020 if (hasFontSizeChangedCallback != true)
2024 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2025 hasFontSizeChangedCallback = true;
2029 Console.WriteLine("{0} Exception caught.", e);
2030 hasFontSizeChangedCallback = false;
2035 private void removeFontSizeChangedCallback()
2037 if (hasFontSizeChangedCallback == true)
2041 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2042 hasFontSizeChangedCallback = false;
2046 Console.WriteLine("{0} Exception caught.", e);
2047 hasFontSizeChangedCallback = true;
2052 internal new class Property
2054 internal static readonly int TEXT = Interop.TextField.TextGet();
2055 internal static readonly int PlaceholderText = Interop.TextField.PlaceholderTextGet();
2056 internal static readonly int PlaceholderTextFocused = Interop.TextField.PlaceholderTextFocusedGet();
2057 internal static readonly int FontFamily = Interop.TextField.FontFamilyGet();
2058 internal static readonly int FontStyle = Interop.TextField.FontStyleGet();
2059 internal static readonly int PointSize = Interop.TextField.PointSizeGet();
2060 internal static readonly int MaxLength = Interop.TextField.MaxLengthGet();
2061 internal static readonly int ExceedPolicy = Interop.TextField.ExceedPolicyGet();
2062 internal static readonly int HorizontalAlignment = Interop.TextField.HorizontalAlignmentGet();
2063 internal static readonly int VerticalAlignment = Interop.TextField.VerticalAlignmentGet();
2064 internal static readonly int TextColor = Interop.TextField.TextColorGet();
2065 internal static readonly int PlaceholderTextColor = Interop.TextField.PlaceholderTextColorGet();
2066 internal static readonly int PrimaryCursorColor = Interop.TextField.PrimaryCursorColorGet();
2067 internal static readonly int SecondaryCursorColor = Interop.TextField.SecondaryCursorColorGet();
2068 internal static readonly int EnableCursorBlink = Interop.TextField.EnableCursorBlinkGet();
2069 internal static readonly int CursorBlinkInterval = Interop.TextField.CursorBlinkIntervalGet();
2070 internal static readonly int CursorBlinkDuration = Interop.TextField.CursorBlinkDurationGet();
2071 internal static readonly int CursorWidth = Interop.TextField.CursorWidthGet();
2072 internal static readonly int GrabHandleImage = Interop.TextField.GrabHandleImageGet();
2073 internal static readonly int GrabHandlePressedImage = Interop.TextField.GrabHandlePressedImageGet();
2074 internal static readonly int ScrollThreshold = Interop.TextField.ScrollThresholdGet();
2075 internal static readonly int ScrollSpeed = Interop.TextField.ScrollSpeedGet();
2076 internal static readonly int SelectionHandleImageLeft = Interop.TextField.SelectionHandleImageLeftGet();
2077 internal static readonly int SelectionHandleImageRight = Interop.TextField.SelectionHandleImageRightGet();
2078 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextField.SelectionHandlePressedImageLeftGet();
2079 internal static readonly int SelectionHandlePressedImageRight = Interop.TextField.SelectionHandlePressedImageRightGet();
2080 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextField.SelectionHandleMarkerImageLeftGet();
2081 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextField.SelectionHandleMarkerImageRightGet();
2082 internal static readonly int SelectionHighlightColor = Interop.TextField.SelectionHighlightColorGet();
2083 internal static readonly int DecorationBoundingBox = Interop.TextField.DecorationBoundingBoxGet();
2084 internal static readonly int InputMethodSettings = Interop.TextField.InputMethodSettingsGet();
2085 internal static readonly int InputColor = Interop.TextField.InputColorGet();
2086 internal static readonly int EnableMarkup = Interop.TextField.EnableMarkupGet();
2087 internal static readonly int InputFontFamily = Interop.TextField.InputFontFamilyGet();
2088 internal static readonly int InputFontStyle = Interop.TextField.InputFontStyleGet();
2089 internal static readonly int InputPointSize = Interop.TextField.InputPointSizeGet();
2090 internal static readonly int UNDERLINE = Interop.TextField.UnderlineGet();
2091 internal static readonly int InputUnderline = Interop.TextField.InputUnderlineGet();
2092 internal static readonly int SHADOW = Interop.TextField.ShadowGet();
2093 internal static readonly int InputShadow = Interop.TextField.InputShadowGet();
2094 internal static readonly int EMBOSS = Interop.TextField.EmbossGet();
2095 internal static readonly int InputEmboss = Interop.TextField.InputEmbossGet();
2096 internal static readonly int OUTLINE = Interop.TextField.OutlineGet();
2097 internal static readonly int InputOutline = Interop.TextField.InputOutlineGet();
2098 internal static readonly int HiddenInputSettings = Interop.TextField.HiddenInputSettingsGet();
2099 internal static readonly int PixelSize = Interop.TextField.PixelSizeGet();
2100 internal static readonly int EnableSelection = Interop.TextField.EnableSelectionGet();
2101 internal static readonly int PLACEHOLDER = Interop.TextField.PlaceholderGet();
2102 internal static readonly int ELLIPSIS = Interop.TextField.EllipsisGet();
2103 internal static readonly int EnableShiftSelection = Interop.TextField.EnableShiftSelectionGet();
2104 internal static readonly int MatchSystemLanguageDirection = Interop.TextField.MatchSystemLanguageDirectionGet();
2105 internal static readonly int EnableGrabHandle = Interop.TextField.EnableGrabHandleGet();
2106 internal static readonly int EnableGrabHandlePopup = Interop.TextField.EnableGrabHandlePopupGet();
2107 internal static readonly int SelectedText = Interop.TextField.SelectedTextGet();
2108 internal static readonly int SelectedTextStart = Interop.TextField.SelectedTextStartGet();
2109 internal static readonly int SelectedTextEnd = Interop.TextField.SelectedTextEndGet();
2110 internal static readonly int EnableEditing = Interop.TextField.EnableEditingGet();
2111 internal static readonly int PrimaryCursorPosition = Interop.TextField.PrimaryCursorPositionGet();
2112 internal static readonly int FontSizeScale = Interop.TextField.FontSizeScaleGet();
2113 internal static readonly int GrabHandleColor = Interop.TextField.GrabHandleColorGet();
2114 internal static readonly int EllipsisPosition = Interop.TextField.EllipsisPositionGet();
2115 internal static readonly int InputFilter = Interop.TextField.InputFilterGet();
2118 internal class InputStyle
2124 FontFamily = 0x0002,
2134 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2136 DecorationBoundingBox = new Rectangle(x, y, width, height);
2138 private void OnInputColorChanged(float x, float y, float z, float w)
2140 InputColor = new Vector4(x, y, z, w);
2142 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2144 PlaceholderTextColor = new Vector4(r, g, b, a);
2146 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2148 PrimaryCursorColor = new Vector4(x, y, z, w);
2150 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2152 SecondaryCursorColor = new Vector4(x, y, z, w);
2154 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2156 SelectionHighlightColor = new Vector4(x, y, z, w);
2158 private void OnShadowColorChanged(float x, float y, float z, float w)
2160 ShadowColor = new Vector4(x, y, z, w);
2162 private void OnShadowOffsetChanged(float x, float y)
2164 ShadowOffset = new Vector2(x, y);
2166 private void OnTextColorChanged(float r, float g, float b, float a)
2168 TextColor = new Color(r, g, b, a);
2170 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2172 GrabHandleColor = new Color(r, g, b, a);