2 * Copyright(c) 2019 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;
25 namespace Tizen.NUI.BaseComponents
28 /// A control which provides a single line editable text field.
30 /// <since_tizen> 3 </since_tizen>
31 public partial class TextField : View
33 private string textFieldTextSid = null;
34 private string textFieldPlaceHolderTextSid = null;
35 private bool systemlangTextFlag = false;
36 private InputMethodContext inputMethodCotext = null;
38 static TextField() { }
40 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
41 [EditorBrowsable(EditorBrowsableState.Never)]
42 public TextFieldStyle Style => ViewStyle as TextFieldStyle;
45 /// Creates the TextField control.
47 /// <since_tizen> 3 </since_tizen>
48 public TextField() : this(Interop.TextField.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.TextField_New(), true)
61 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 /// Get attribues, it is abstract function and must be override.
68 /// <since_tizen> 6 </since_tizen>
69 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 protected override ViewStyle GetViewStyle()
73 return new TextFieldStyle();
76 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
84 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn)
92 internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.new_TextField__SWIG_1(TextField.getCPtr(handle)), true)
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 internal enum ExceedPolicyType
104 ExceedPolicyOriginal,
109 /// The TranslatableText property.<br />
110 /// The text can set the SID value.<br />
112 /// <exception cref='ArgumentNullException'>
113 /// ResourceManager about multilingual is null.
115 /// <since_tizen> 4 </since_tizen>
116 public string TranslatableText
120 return (string)GetValue(TranslatableTextProperty);
124 SetValue(TranslatableTextProperty, value);
127 private string translatableText
131 return textFieldTextSid;
135 if (NUIApplication.MultilingualResourceManager == null)
137 throw new ArgumentNullException("ResourceManager about multilingual is null");
139 textFieldTextSid = value;
140 Text = SetTranslatable(textFieldTextSid);
141 NotifyPropertyChanged();
146 /// The TranslatablePlaceholderText property.<br />
147 /// The text can set the SID value.<br />
149 /// <exception cref='ArgumentNullException'>
150 /// ResourceManager about multilingual is null.
152 /// <since_tizen> 4 </since_tizen>
153 public string TranslatablePlaceholderText
157 return (string)GetValue(TranslatablePlaceholderTextProperty);
161 SetValue(TranslatablePlaceholderTextProperty, value);
164 private string translatablePlaceholderText
168 return textFieldPlaceHolderTextSid;
172 if (NUIApplication.MultilingualResourceManager == null)
174 throw new ArgumentNullException("ResourceManager about multilingual is null");
176 textFieldPlaceHolderTextSid = value;
177 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
178 NotifyPropertyChanged();
183 /// The Text property.
185 /// <since_tizen> 3 </since_tizen>
190 return (string)GetValue(TextProperty);
194 SetValueAndForceSendChangeSignal(TextProperty, value);
195 NotifyPropertyChanged();
200 /// The PlaceholderText property.
202 /// <since_tizen> 3 </since_tizen>
203 public string PlaceholderText
207 return (string)GetValue(PlaceholderTextProperty);
211 SetValue(PlaceholderTextProperty, value);
212 NotifyPropertyChanged();
217 /// The PlaceholderTextFocused property.
219 /// <since_tizen> 3 </since_tizen>
220 public string PlaceholderTextFocused
224 return (string)GetValue(PlaceholderTextFocusedProperty);
228 SetValue(PlaceholderTextFocusedProperty, value);
229 NotifyPropertyChanged();
234 /// The FontFamily property.
236 /// <since_tizen> 3 </since_tizen>
237 public string FontFamily
241 return (string)GetValue(FontFamilyProperty);
245 SetValue(FontFamilyProperty, value);
246 NotifyPropertyChanged();
251 /// The FontStyle property.
253 /// <since_tizen> 3 </since_tizen>
254 public PropertyMap FontStyle
258 return (PropertyMap)GetValue(FontStyleProperty);
262 SetValue(FontStyleProperty, value);
263 NotifyPropertyChanged();
268 /// The PointSize property.
270 /// <since_tizen> 3 </since_tizen>
271 public float PointSize
275 return (float)GetValue(PointSizeProperty);
279 SetValue(PointSizeProperty, value);
280 NotifyPropertyChanged();
285 /// The MaxLength property.
287 /// <since_tizen> 3 </since_tizen>
292 return (int)GetValue(MaxLengthProperty);
296 SetValue(MaxLengthProperty, value);
297 NotifyPropertyChanged();
302 /// The ExceedPolicy property.
304 /// <since_tizen> 3 </since_tizen>
305 public int ExceedPolicy
309 return (int)GetValue(ExceedPolicyProperty);
313 SetValue(ExceedPolicyProperty, value);
314 NotifyPropertyChanged();
319 /// The HorizontalAlignment property.
321 /// <since_tizen> 3 </since_tizen>
322 public HorizontalAlignment HorizontalAlignment
326 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
330 SetValue(HorizontalAlignmentProperty, value);
331 NotifyPropertyChanged();
336 /// The VerticalAlignment property.
338 /// <since_tizen> 3 </since_tizen>
339 public VerticalAlignment VerticalAlignment
343 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
347 SetValue(VerticalAlignmentProperty, value);
348 NotifyPropertyChanged();
349 NotifyPropertyChanged();
354 /// The TextColor property.
357 /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
359 /// <since_tizen> 3 </since_tizen>
360 public Color TextColor
364 Color temp = (Color)GetValue(TextColorProperty);
365 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
369 SetValue(TextColorProperty, value);
370 NotifyPropertyChanged();
375 /// The PlaceholderTextColor property.
378 /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
380 /// <since_tizen> 3 </since_tizen>
381 public Vector4 PlaceholderTextColor
385 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
386 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
390 SetValue(PlaceholderTextColorProperty, value);
391 NotifyPropertyChanged();
396 /// The ShadowOffset property.
398 /// <since_tizen> 3 </since_tizen>
400 /// Deprecated.(API Level 6) Use Shadow instead.
401 /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
403 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
404 public Vector2 ShadowOffset
408 PropertyMap map = new PropertyMap();
409 GetProperty(TextField.Property.SHADOW).Get(map);
410 Vector2 shadowOffset = new Vector2();
411 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
412 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
416 PropertyMap temp = new PropertyMap();
417 temp.Insert("offset", new PropertyValue(value));
418 SetValue(ShadowProperty, temp);
419 NotifyPropertyChanged();
424 /// The ShadowColor property.
426 /// <since_tizen> 3 </since_tizen>
428 /// Deprecated.(API Level 6) Use Shadow instead.
429 /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
431 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
432 public Vector4 ShadowColor
436 PropertyMap map = new PropertyMap();
437 GetProperty(TextField.Property.SHADOW).Get(map);
438 Vector4 shadowColor = new Vector4();
439 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
440 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
444 PropertyMap temp = new PropertyMap();
445 temp.Insert("color", new PropertyValue(value));
446 SetValue(ShadowProperty, temp);
447 NotifyPropertyChanged();
452 /// The PrimaryCursorColor property.
455 /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
457 /// <since_tizen> 3 </since_tizen>
458 public Vector4 PrimaryCursorColor
462 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
463 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
467 SetValue(PrimaryCursorColorProperty, value);
468 NotifyPropertyChanged();
473 /// The SecondaryCursorColor property.
476 /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
478 /// <since_tizen> 3 </since_tizen>
479 public Vector4 SecondaryCursorColor
483 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
484 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
488 SetValue(SecondaryCursorColorProperty, value);
489 NotifyPropertyChanged();
494 /// The EnableCursorBlink property.
496 /// <since_tizen> 3 </since_tizen>
497 public bool EnableCursorBlink
501 return (bool)GetValue(EnableCursorBlinkProperty);
505 SetValue(EnableCursorBlinkProperty, value);
506 NotifyPropertyChanged();
511 /// The CursorBlinkInterval property.
513 /// <since_tizen> 3 </since_tizen>
514 public float CursorBlinkInterval
518 return (float)GetValue(CursorBlinkIntervalProperty);
522 SetValue(CursorBlinkIntervalProperty, value);
523 NotifyPropertyChanged();
528 /// The CursorBlinkDuration property.
530 /// <since_tizen> 3 </since_tizen>
531 public float CursorBlinkDuration
535 return (float)GetValue(CursorBlinkDurationProperty);
539 SetValue(CursorBlinkDurationProperty, value);
540 NotifyPropertyChanged();
545 /// The CursorWidth property.
547 /// <since_tizen> 3 </since_tizen>
548 public int CursorWidth
552 return (int)GetValue(CursorWidthProperty);
556 SetValue(CursorWidthProperty, value);
557 NotifyPropertyChanged();
562 /// The GrabHandleImage property.
564 /// <since_tizen> 3 </since_tizen>
565 public string GrabHandleImage
569 return (string)GetValue(GrabHandleImageProperty);
573 SetValue(GrabHandleImageProperty, value);
574 NotifyPropertyChanged();
579 /// The GrabHandlePressedImage property.
581 /// <since_tizen> 3 </since_tizen>
582 public string GrabHandlePressedImage
586 return (string)GetValue(GrabHandlePressedImageProperty);
590 SetValue(GrabHandlePressedImageProperty, value);
591 NotifyPropertyChanged();
596 /// The ScrollThreshold property.
598 /// <since_tizen> 3 </since_tizen>
599 public float ScrollThreshold
603 return (float)GetValue(ScrollThresholdProperty);
607 SetValue(ScrollThresholdProperty, value);
608 NotifyPropertyChanged();
613 /// The ScrollSpeed property.
615 /// <since_tizen> 3 </since_tizen>
616 public float ScrollSpeed
620 return (float)GetValue(ScrollSpeedProperty);
624 SetValue(ScrollSpeedProperty, value);
625 NotifyPropertyChanged();
630 /// The SelectionHandleImageLeft property.
632 /// <since_tizen> 3 </since_tizen>
633 public PropertyMap SelectionHandleImageLeft
637 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
641 SetValue(SelectionHandleImageLeftProperty, value);
642 NotifyPropertyChanged();
647 /// The SelectionHandleImageRight property.
649 /// <since_tizen> 3 </since_tizen>
650 public PropertyMap SelectionHandleImageRight
654 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
658 SetValue(SelectionHandleImageRightProperty, value);
659 NotifyPropertyChanged();
664 /// The SelectionHandlePressedImageLeft property.
666 /// <since_tizen> 3 </since_tizen>
667 public PropertyMap SelectionHandlePressedImageLeft
671 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
675 SetValue(SelectionHandlePressedImageLeftProperty, value);
676 NotifyPropertyChanged();
681 /// The SelectionHandlePressedImageRight property.
683 /// <since_tizen> 3 </since_tizen>
684 public PropertyMap SelectionHandlePressedImageRight
688 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
692 SetValue(SelectionHandlePressedImageRightProperty, value);
693 NotifyPropertyChanged();
698 /// The SelectionHandleMarkerImageLeft property.
700 /// <since_tizen> 3 </since_tizen>
701 public PropertyMap SelectionHandleMarkerImageLeft
705 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
709 SetValue(SelectionHandleMarkerImageLeftProperty, value);
710 NotifyPropertyChanged();
715 /// The SelectionHandleMarkerImageRight property.
717 /// <since_tizen> 3 </since_tizen>
718 public PropertyMap SelectionHandleMarkerImageRight
722 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
726 SetValue(SelectionHandleMarkerImageRightProperty, value);
727 NotifyPropertyChanged();
732 /// The SelectionHighlightColor property.
735 /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
737 /// <since_tizen> 3 </since_tizen>
738 public Vector4 SelectionHighlightColor
742 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
743 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
747 SetValue(SelectionHighlightColorProperty, value);
748 NotifyPropertyChanged();
753 /// The DecorationBoundingBox property.
756 /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
758 /// <since_tizen> 3 </since_tizen>
759 public Rectangle DecorationBoundingBox
763 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
764 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
768 SetValue(DecorationBoundingBoxProperty, value);
769 NotifyPropertyChanged();
774 /// The InputMethodSettings property.
776 /// <since_tizen> 3 </since_tizen>
777 public PropertyMap InputMethodSettings
781 return (PropertyMap)GetValue(InputMethodSettingsProperty);
785 SetValue(InputMethodSettingsProperty, value);
786 NotifyPropertyChanged();
791 /// The InputColor property.
794 /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
796 /// <since_tizen> 3 </since_tizen>
797 public Vector4 InputColor
801 Vector4 temp = (Vector4)GetValue(InputColorProperty);
802 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
806 SetValue(InputColorProperty, value);
807 NotifyPropertyChanged();
812 /// The EnableMarkup property.
814 /// <since_tizen> 3 </since_tizen>
815 public bool EnableMarkup
819 return (bool)GetValue(EnableMarkupProperty);
823 SetValue(EnableMarkupProperty, value);
824 NotifyPropertyChanged();
829 /// The InputFontFamily property.
831 /// <since_tizen> 3 </since_tizen>
832 public string InputFontFamily
836 return (string)GetValue(InputFontFamilyProperty);
840 SetValue(InputFontFamilyProperty, value);
841 NotifyPropertyChanged();
846 /// The InputFontStyle property.
848 /// <since_tizen> 3 </since_tizen>
849 public PropertyMap InputFontStyle
853 return (PropertyMap)GetValue(InputFontStyleProperty);
857 SetValue(InputFontStyleProperty, value);
858 NotifyPropertyChanged();
863 /// The InputPointSize property.
865 /// <since_tizen> 3 </since_tizen>
866 public float InputPointSize
870 return (float)GetValue(InputPointSizeProperty);
874 SetValue(InputPointSizeProperty, value);
875 NotifyPropertyChanged();
880 /// The Underline property.
882 /// <since_tizen> 3 </since_tizen>
883 public PropertyMap Underline
887 return (PropertyMap)GetValue(UnderlineProperty);
891 SetValue(UnderlineProperty, value);
892 NotifyPropertyChanged();
897 /// The InputUnderline property.
899 /// <since_tizen> 3 </since_tizen>
900 public string InputUnderline
904 return (string)GetValue(InputUnderlineProperty);
908 SetValue(InputUnderlineProperty, value);
909 NotifyPropertyChanged();
914 /// The Shadow property.
916 /// <since_tizen> 3 </since_tizen>
917 public PropertyMap Shadow
921 return (PropertyMap)GetValue(ShadowProperty);
925 SetValue(ShadowProperty, value);
926 NotifyPropertyChanged();
931 /// The InputShadow property.
933 /// <since_tizen> 3 </since_tizen>
934 public string InputShadow
938 return (string)GetValue(InputShadowProperty);
942 SetValue(InputShadowProperty, value);
943 NotifyPropertyChanged();
948 /// The Emboss property.
950 /// <since_tizen> 3 </since_tizen>
955 return (string)GetValue(EmbossProperty);
959 SetValue(EmbossProperty, value);
960 NotifyPropertyChanged();
965 /// The InputEmboss property.
967 /// <since_tizen> 3 </since_tizen>
968 public string InputEmboss
972 return (string)GetValue(InputEmbossProperty);
976 SetValue(InputEmbossProperty, value);
977 NotifyPropertyChanged();
982 /// The Outline property.
984 /// <since_tizen> 3 </since_tizen>
985 public PropertyMap Outline
989 return (PropertyMap)GetValue(OutlineProperty);
993 SetValue(OutlineProperty, value);
994 NotifyPropertyChanged();
999 /// The InputOutline property.
1001 /// <since_tizen> 3 </since_tizen>
1002 public string InputOutline
1006 return (string)GetValue(InputOutlineProperty);
1010 SetValue(InputOutlineProperty, value);
1011 NotifyPropertyChanged();
1016 /// The HiddenInputSettings property.
1018 /// <since_tizen> 3 </since_tizen>
1019 public Tizen.NUI.PropertyMap HiddenInputSettings
1023 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1027 SetValue(HiddenInputSettingsProperty, value);
1028 NotifyPropertyChanged();
1033 /// The PixelSize property.
1035 /// <since_tizen> 3 </since_tizen>
1036 public float PixelSize
1040 return (float)GetValue(PixelSizeProperty);
1044 SetValue(PixelSizeProperty, value);
1045 NotifyPropertyChanged();
1050 /// The Enable selection property.
1052 /// <since_tizen> 3 </since_tizen>
1053 public bool EnableSelection
1057 return (bool)GetValue(EnableSelectionProperty);
1061 SetValue(EnableSelectionProperty, value);
1062 NotifyPropertyChanged();
1067 /// The Enable selection property.
1069 /// <since_tizen> 6 </since_tizen>
1070 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1071 [EditorBrowsable(EditorBrowsableState.Never)]
1072 public bool EnableGrabHandle
1076 return (bool)GetValue(EnableGrabHandleProperty);
1080 SetValue(EnableGrabHandleProperty, value);
1081 NotifyPropertyChanged();
1086 /// The Enable selection property.
1088 /// <since_tizen> 6 </since_tizen>
1089 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1090 [EditorBrowsable(EditorBrowsableState.Never)]
1091 public bool EnableGrabHandlePopup
1095 return (bool)GetValue(EnableGrabHandlePopupProperty);
1099 SetValue(EnableGrabHandlePopupProperty, value);
1100 NotifyPropertyChanged();
1105 /// The Placeholder property.
1106 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1109 /// The following example demonstrates how to set the Placeholder property.
1111 /// PropertyMap propertyMap = new PropertyMap();
1112 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1113 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1114 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1115 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1116 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1118 /// PropertyMap fontStyleMap = new PropertyMap();
1119 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1120 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1121 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1122 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1124 /// TextField field = new TextField();
1125 /// field.Placeholder = propertyMap;
1128 /// <since_tizen> 3 </since_tizen>
1129 public Tizen.NUI.PropertyMap Placeholder
1133 return (PropertyMap)GetValue(PlaceholderProperty);
1137 SetValue(PlaceholderProperty, value);
1138 NotifyPropertyChanged();
1143 /// The Ellipsis property.<br />
1144 /// Enable or disable the ellipsis.<br />
1145 /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1147 /// <since_tizen> 4 </since_tizen>
1148 public bool Ellipsis
1152 return (bool)GetValue(EllipsisProperty);
1156 SetValue(EllipsisProperty, value);
1157 NotifyPropertyChanged();
1162 /// Enables selection of the text using the Shift key.
1164 /// <since_tizen> 5 </since_tizen>
1165 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1166 [EditorBrowsable(EditorBrowsableState.Never)]
1167 public bool EnableShiftSelection
1171 return (bool)GetValue(EnableShiftSelectionProperty);
1175 SetValue(EnableShiftSelectionProperty, value);
1176 NotifyPropertyChanged();
1181 /// The text alignment to match the direction of the system language.
1183 /// <since_tizen> 6 </since_tizen>
1184 public bool MatchSystemLanguageDirection
1188 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1192 SetValue(MatchSystemLanguageDirectionProperty, value);
1193 NotifyPropertyChanged();
1197 /// Only used by the IL of xaml, will never changed to not hidden.
1198 [EditorBrowsable(EditorBrowsableState.Never)]
1199 public override bool IsCreateByXaml
1203 return base.IsCreateByXaml;
1207 base.IsCreateByXaml = value;
1211 this.TextChanged += (obj, e) =>
1213 this.Text = this.Text;
1220 /// Get the InputMethodContext instance.
1222 /// <returns>The InputMethodContext instance.</returns>
1223 /// <since_tizen> 5 </since_tizen>
1224 public InputMethodContext GetInputMethodContext()
1226 if (inputMethodCotext == null)
1228 /*Avoid raising InputMethodContext reference count.*/
1229 inputMethodCotext = new InputMethodContext(Interop.TextField.TextField_GetInputMethodContext(swigCPtr), true);
1230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1232 return inputMethodCotext;
1236 /// Select the whole text.
1238 /// <since_tizen> 6 </since_tizen>
1239 /// This will be released at Tizen.NET API Level 5.5, so currently this would be used as inhouse API.
1240 [EditorBrowsable(EditorBrowsableState.Never)]
1241 public void SelectWholeText()
1243 Interop.TextField.TextField_SelectWholeText(swigCPtr);
1244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1247 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
1249 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1252 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
1254 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.TextField_InputStyleChangedSignal(swigCPtr), false);
1255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1262 /// <since_tizen> 3 </since_tizen>
1263 protected override void Dispose(DisposeTypes type)
1267 DisposeQueue.Instance.Add(this);
1271 //Release your own unmanaged resources here.
1272 //You should not access any managed member here except static instance.
1273 //because the execution order of Finalizes is non-deterministic.
1276 if (_textFieldMaxLengthReachedCallbackDelegate != null)
1278 this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
1281 if (_textFieldTextChangedCallbackDelegate != null)
1283 TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
1290 /// This will not be public opened.
1291 [EditorBrowsable(EditorBrowsableState.Never)]
1292 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1294 // In order to speed up IME hide, temporarily add
1295 GetInputMethodContext()?.DestroyContext();
1296 Interop.TextField.delete_TextField(swigCPtr);
1299 private string SetTranslatable(string textFieldSid)
1301 string translatableText = null;
1302 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1303 if (translatableText != null)
1305 if (systemlangTextFlag == false)
1307 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
1308 systemlangTextFlag = true;
1310 return translatableText;
1314 translatableText = "";
1315 return translatableText;
1319 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1321 if (textFieldTextSid != null)
1323 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1325 if (textFieldPlaceHolderTextSid != null)
1327 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1331 internal new class Property
1333 internal static readonly int RENDERING_BACKEND = Interop.TextField.TextField_Property_RENDERING_BACKEND_get();
1334 internal static readonly int TEXT = Interop.TextField.TextField_Property_TEXT_get();
1335 internal static readonly int PLACEHOLDER_TEXT = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_get();
1336 internal static readonly int PLACEHOLDER_TEXT_FOCUSED = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_FOCUSED_get();
1337 internal static readonly int FONT_FAMILY = Interop.TextField.TextField_Property_FONT_FAMILY_get();
1338 internal static readonly int FONT_STYLE = Interop.TextField.TextField_Property_FONT_STYLE_get();
1339 internal static readonly int POINT_SIZE = Interop.TextField.TextField_Property_POINT_SIZE_get();
1340 internal static readonly int MAX_LENGTH = Interop.TextField.TextField_Property_MAX_LENGTH_get();
1341 internal static readonly int EXCEED_POLICY = Interop.TextField.TextField_Property_EXCEED_POLICY_get();
1342 internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextField.TextField_Property_HORIZONTAL_ALIGNMENT_get();
1343 internal static readonly int VERTICAL_ALIGNMENT = Interop.TextField.TextField_Property_VERTICAL_ALIGNMENT_get();
1344 internal static readonly int TEXT_COLOR = Interop.TextField.TextField_Property_TEXT_COLOR_get();
1345 internal static readonly int PLACEHOLDER_TEXT_COLOR = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_COLOR_get();
1346 internal static readonly int PRIMARY_CURSOR_COLOR = Interop.TextField.TextField_Property_PRIMARY_CURSOR_COLOR_get();
1347 internal static readonly int SECONDARY_CURSOR_COLOR = Interop.TextField.TextField_Property_SECONDARY_CURSOR_COLOR_get();
1348 internal static readonly int ENABLE_CURSOR_BLINK = Interop.TextField.TextField_Property_ENABLE_CURSOR_BLINK_get();
1349 internal static readonly int CURSOR_BLINK_INTERVAL = Interop.TextField.TextField_Property_CURSOR_BLINK_INTERVAL_get();
1350 internal static readonly int CURSOR_BLINK_DURATION = Interop.TextField.TextField_Property_CURSOR_BLINK_DURATION_get();
1351 internal static readonly int CURSOR_WIDTH = Interop.TextField.TextField_Property_CURSOR_WIDTH_get();
1352 internal static readonly int GRAB_HANDLE_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_IMAGE_get();
1353 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
1354 internal static readonly int SCROLL_THRESHOLD = Interop.TextField.TextField_Property_SCROLL_THRESHOLD_get();
1355 internal static readonly int SCROLL_SPEED = Interop.TextField.TextField_Property_SCROLL_SPEED_get();
1356 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
1357 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
1358 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
1359 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
1360 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
1361 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
1362 internal static readonly int SELECTION_HIGHLIGHT_COLOR = Interop.TextField.TextField_Property_SELECTION_HIGHLIGHT_COLOR_get();
1363 internal static readonly int DECORATION_BOUNDING_BOX = Interop.TextField.TextField_Property_DECORATION_BOUNDING_BOX_get();
1364 internal static readonly int INPUT_METHOD_SETTINGS = Interop.TextField.TextField_Property_INPUT_METHOD_SETTINGS_get();
1365 internal static readonly int INPUT_COLOR = Interop.TextField.TextField_Property_INPUT_COLOR_get();
1366 internal static readonly int ENABLE_MARKUP = Interop.TextField.TextField_Property_ENABLE_MARKUP_get();
1367 internal static readonly int INPUT_FONT_FAMILY = Interop.TextField.TextField_Property_INPUT_FONT_FAMILY_get();
1368 internal static readonly int INPUT_FONT_STYLE = Interop.TextField.TextField_Property_INPUT_FONT_STYLE_get();
1369 internal static readonly int INPUT_POINT_SIZE = Interop.TextField.TextField_Property_INPUT_POINT_SIZE_get();
1370 internal static readonly int UNDERLINE = Interop.TextField.TextField_Property_UNDERLINE_get();
1371 internal static readonly int INPUT_UNDERLINE = Interop.TextField.TextField_Property_INPUT_UNDERLINE_get();
1372 internal static readonly int SHADOW = Interop.TextField.TextField_Property_SHADOW_get();
1373 internal static readonly int INPUT_SHADOW = Interop.TextField.TextField_Property_INPUT_SHADOW_get();
1374 internal static readonly int EMBOSS = Interop.TextField.TextField_Property_EMBOSS_get();
1375 internal static readonly int INPUT_EMBOSS = Interop.TextField.TextField_Property_INPUT_EMBOSS_get();
1376 internal static readonly int OUTLINE = Interop.TextField.TextField_Property_OUTLINE_get();
1377 internal static readonly int INPUT_OUTLINE = Interop.TextField.TextField_Property_INPUT_OUTLINE_get();
1378 internal static readonly int HIDDEN_INPUT_SETTINGS = Interop.TextField.TextField_Property_HIDDEN_INPUT_SETTINGS_get();
1379 internal static readonly int PIXEL_SIZE = Interop.TextField.TextField_Property_PIXEL_SIZE_get();
1380 internal static readonly int ENABLE_SELECTION = Interop.TextField.TextField_Property_ENABLE_SELECTION_get();
1381 internal static readonly int PLACEHOLDER = Interop.TextField.TextField_Property_PLACEHOLDER_get();
1382 internal static readonly int ELLIPSIS = Interop.TextField.TextField_Property_ELLIPSIS_get();
1383 internal static readonly int ENABLE_SHIFT_SELECTION = Interop.TextField.TextField_Property_ENABLE_SHIFT_SELECTION_get();
1384 internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextField.TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1385 internal static readonly int ENABLE_GRAB_HANDLE = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_get();
1386 internal static readonly int ENABLE_GRAB_HANDLE_POPUP = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_POPUP_get();
1389 internal class InputStyle
1395 FontFamily = 0x0002,
1405 internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1407 var textField = (TextField)bindable;
1408 textField.translatableTextSelector.Clone((Selector<string>)newValue);
1410 defaultValueCreator: (bindable) =>
1412 var textField = (TextField)bindable;
1413 return textField.translatableTextSelector;
1415 internal static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1417 var textField = (TextField)bindable;
1418 textField.translatablePlaceholderTextSelector.Clone((Selector<string>)newValue);
1420 defaultValueCreator: (bindable) =>
1422 var textField = (TextField)bindable;
1423 return textField.translatablePlaceholderTextSelector;
1425 internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1427 var textField = (TextField)bindable;
1428 textField.textSelector.Clone((Selector<string>)newValue);
1430 defaultValueCreator: (bindable) =>
1432 var textField = (TextField)bindable;
1433 return textField.textSelector;
1435 internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1437 var textField = (TextField)bindable;
1438 textField.fontFamilySelector.Clone((Selector<string>)newValue);
1440 defaultValueCreator: (bindable) =>
1442 var textField = (TextField)bindable;
1443 return textField.fontFamilySelector;
1445 internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1447 var textField = (TextField)bindable;
1448 textField.pointSizeSelector.Clone((Selector<float?>)newValue);
1450 defaultValueCreator: (bindable) =>
1452 var textField = (TextField)bindable;
1453 return textField.pointSizeSelector;
1455 internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1457 var textField = (TextField)bindable;
1458 textField.textColorSelector.Clone((Selector<Color>)newValue);
1460 defaultValueCreator: (bindable) =>
1462 var textField = (TextField)bindable;
1463 return textField.textColorSelector;
1465 internal static readonly BindableProperty PlaceholderTextColorSelectorProperty = BindableProperty.Create("PlaceholderTextColorSelector", typeof(Selector<Vector4>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1467 var textField = (TextField)bindable;
1468 textField.placeholderTextColorSelector.Clone((Selector<Vector4>)newValue);
1470 defaultValueCreator: (bindable) =>
1472 var textField = (TextField)bindable;
1473 return textField.placeholderTextColorSelector;
1475 internal static readonly BindableProperty PrimaryCursorColorSelectorProperty = BindableProperty.Create("PrimaryCursorColorSelector", typeof(Selector<Vector4>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1477 var textField = (TextField)bindable;
1478 textField.primaryCursorColorSelector.Clone((Selector<Vector4>)newValue);
1480 defaultValueCreator: (bindable) =>
1482 var textField = (TextField)bindable;
1483 return textField.primaryCursorColorSelector;
1486 private TriggerableSelector<string> _translatableTextSelector;
1487 private TriggerableSelector<string> translatableTextSelector
1491 if (null == _translatableTextSelector)
1493 _translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
1495 return _translatableTextSelector;
1499 private TriggerableSelector<string> _translatablePlaceholderTextSelector;
1500 private TriggerableSelector<string> translatablePlaceholderTextSelector
1504 if (null == _translatablePlaceholderTextSelector)
1506 _translatablePlaceholderTextSelector = new TriggerableSelector<string>(this, TranslatablePlaceholderTextProperty);
1508 return _translatablePlaceholderTextSelector;
1512 private TriggerableSelector<string> _textSelector;
1513 private TriggerableSelector<string> textSelector
1517 if (null == _textSelector)
1519 _textSelector = new TriggerableSelector<string>(this, TextProperty);
1521 return _textSelector;
1525 private TriggerableSelector<string> _fontFamilySelector;
1526 private TriggerableSelector<string> fontFamilySelector
1530 if (null == _fontFamilySelector)
1532 _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
1534 return _fontFamilySelector;
1538 private TriggerableSelector<Color> _textColorSelector;
1539 private TriggerableSelector<Color> textColorSelector
1543 if (null == _textColorSelector)
1545 _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
1547 return _textColorSelector;
1551 private TriggerableSelector<float?> _pointSizeSelector;
1552 private TriggerableSelector<float?> pointSizeSelector
1556 if (null == _pointSizeSelector)
1558 _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
1560 return _pointSizeSelector;
1564 private TriggerableSelector<Vector4> _placeholderTextColorSelector;
1565 private TriggerableSelector<Vector4> placeholderTextColorSelector
1569 if (null == _placeholderTextColorSelector)
1571 _placeholderTextColorSelector = new TriggerableSelector<Vector4>(this, PlaceholderTextColorProperty);
1573 return _placeholderTextColorSelector;
1577 private TriggerableSelector<Vector4> _primaryCursorColorSelector;
1578 private TriggerableSelector<Vector4> primaryCursorColorSelector
1582 if (null == _primaryCursorColorSelector)
1584 _primaryCursorColorSelector = new TriggerableSelector<Vector4>(this, PrimaryCursorColorProperty);
1586 return _primaryCursorColorSelector;
1590 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
1592 DecorationBoundingBox = new Rectangle(x, y, width, height);
1594 private void OnInputColorChanged(float x, float y, float z, float w)
1596 InputColor = new Vector4(x, y, z, w);
1598 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
1600 PlaceholderTextColor = new Vector4(r, g, b, a);
1602 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
1604 PrimaryCursorColor = new Vector4(x, y, z, w);
1606 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
1608 SecondaryCursorColor = new Vector4(x, y, z, w);
1610 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
1612 SelectionHighlightColor = new Vector4(x, y, z, w);
1614 private void OnShadowColorChanged(float x, float y, float z, float w)
1616 ShadowColor = new Vector4(x, y, z, w);
1618 private void OnShadowOffsetChanged(float x, float y)
1620 ShadowOffset = new Vector2(x, y);
1622 private void OnTextColorChanged(float r, float g, float b, float a)
1624 TextColor = new Color(r, g, b, a);