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 global::System.Runtime.InteropServices.HandleRef swigCPtr;
34 private string textFieldTextSid = null;
35 private string textFieldPlaceHolderTextSid = null;
36 private bool systemlangTextFlag = false;
37 private InputMethodContext inputMethodCotext = null;
39 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 public TextFieldStyle Style => ViewStyle as TextFieldStyle;
44 /// Creates the TextField control.
46 /// <since_tizen> 3 </since_tizen>
47 public TextField() : this(Interop.TextField.TextField_New(), true)
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53 /// Creates the TextField with setting the status of shown or hidden.
55 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
56 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
57 [EditorBrowsable(EditorBrowsableState.Never)]
58 public TextField(bool shown) : this(Interop.TextField.TextField_New(), true)
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65 /// Get attribues, it is abstract function and must be override.
67 /// <since_tizen> 6 </since_tizen>
68 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 protected override ViewStyle GetViewStyle()
72 return new TextFieldStyle();
75 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
83 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn)
85 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
93 internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.new_TextField__SWIG_1(TextField.getCPtr(handle)), true)
95 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103 internal enum ExceedPolicyType
105 ExceedPolicyOriginal,
110 /// The TranslatableText property.<br />
111 /// The text can set the SID value.<br />
113 /// <exception cref='ArgumentNullException'>
114 /// ResourceManager about multilingual is null.
116 /// <since_tizen> 4 </since_tizen>
117 public string TranslatableText
121 return (string)GetValue(TranslatableTextProperty);
125 SetValue(TranslatableTextProperty, value);
128 private string translatableText
132 return textFieldTextSid;
136 if (NUIApplication.MultilingualResourceManager == null)
138 throw new ArgumentNullException("ResourceManager about multilingual is null");
140 textFieldTextSid = value;
141 Text = SetTranslatable(textFieldTextSid);
142 NotifyPropertyChanged();
147 /// The TranslatablePlaceholderText property.<br />
148 /// The text can set the SID value.<br />
150 /// <exception cref='ArgumentNullException'>
151 /// ResourceManager about multilingual is null.
153 /// <since_tizen> 4 </since_tizen>
154 public string TranslatablePlaceholderText
158 return (string)GetValue(TranslatablePlaceholderTextProperty);
162 SetValue(TranslatablePlaceholderTextProperty, value);
165 private string translatablePlaceholderText
169 return textFieldPlaceHolderTextSid;
173 if (NUIApplication.MultilingualResourceManager == null)
175 throw new ArgumentNullException("ResourceManager about multilingual is null");
177 textFieldPlaceHolderTextSid = value;
178 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
179 NotifyPropertyChanged();
184 /// The Text property.
186 /// <since_tizen> 3 </since_tizen>
191 return (string)GetValue(TextProperty);
195 SetValueAndForceSendChangeSignal(TextProperty, value);
196 NotifyPropertyChanged();
201 /// The PlaceholderText property.
203 /// <since_tizen> 3 </since_tizen>
204 public string PlaceholderText
208 return (string)GetValue(PlaceholderTextProperty);
212 SetValue(PlaceholderTextProperty, value);
213 NotifyPropertyChanged();
218 /// The PlaceholderTextFocused property.
220 /// <since_tizen> 3 </since_tizen>
221 public string PlaceholderTextFocused
225 return (string)GetValue(PlaceholderTextFocusedProperty);
229 SetValue(PlaceholderTextFocusedProperty, value);
230 NotifyPropertyChanged();
235 /// The FontFamily property.
237 /// <since_tizen> 3 </since_tizen>
238 public string FontFamily
242 return (string)GetValue(FontFamilyProperty);
246 SetValue(FontFamilyProperty, value);
247 NotifyPropertyChanged();
252 /// The FontStyle property.
254 /// <since_tizen> 3 </since_tizen>
255 public PropertyMap FontStyle
259 return (PropertyMap)GetValue(FontStyleProperty);
263 SetValue(FontStyleProperty, value);
264 NotifyPropertyChanged();
269 /// The PointSize property.
271 /// <since_tizen> 3 </since_tizen>
272 public float PointSize
276 return (float)GetValue(PointSizeProperty);
280 SetValue(PointSizeProperty, value);
281 NotifyPropertyChanged();
286 /// The MaxLength property.
288 /// <since_tizen> 3 </since_tizen>
293 return (int)GetValue(MaxLengthProperty);
297 SetValue(MaxLengthProperty, value);
298 NotifyPropertyChanged();
303 /// The ExceedPolicy property.
305 /// <since_tizen> 3 </since_tizen>
306 public int ExceedPolicy
310 return (int)GetValue(ExceedPolicyProperty);
314 SetValue(ExceedPolicyProperty, value);
315 NotifyPropertyChanged();
320 /// The HorizontalAlignment property.
322 /// <since_tizen> 3 </since_tizen>
323 public HorizontalAlignment HorizontalAlignment
327 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
331 SetValue(HorizontalAlignmentProperty, value);
332 NotifyPropertyChanged();
337 /// The VerticalAlignment property.
339 /// <since_tizen> 3 </since_tizen>
340 public VerticalAlignment VerticalAlignment
344 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
348 SetValue(VerticalAlignmentProperty, value);
349 NotifyPropertyChanged();
350 NotifyPropertyChanged();
355 /// The TextColor property.
358 /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
360 /// <since_tizen> 3 </since_tizen>
361 public Color TextColor
365 Color temp = (Color)GetValue(TextColorProperty);
366 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
370 SetValue(TextColorProperty, value);
371 NotifyPropertyChanged();
376 /// The PlaceholderTextColor property.
379 /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
381 /// <since_tizen> 3 </since_tizen>
382 public Vector4 PlaceholderTextColor
386 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
387 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
391 SetValue(PlaceholderTextColorProperty, value);
392 NotifyPropertyChanged();
397 /// The ShadowOffset property.
399 /// <since_tizen> 3 </since_tizen>
401 /// Deprecated.(API Level 6) Use Shadow instead.
402 /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
404 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
405 public Vector2 ShadowOffset
409 PropertyMap map = new PropertyMap();
410 GetProperty(TextField.Property.SHADOW).Get(map);
411 Vector2 shadowOffset = new Vector2();
412 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
413 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
417 PropertyMap temp = new PropertyMap();
418 temp.Insert("offset", new PropertyValue(value));
419 SetValue(ShadowProperty, temp);
420 NotifyPropertyChanged();
425 /// The ShadowColor property.
427 /// <since_tizen> 3 </since_tizen>
429 /// Deprecated.(API Level 6) Use Shadow instead.
430 /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
432 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
433 public Vector4 ShadowColor
437 PropertyMap map = new PropertyMap();
438 GetProperty(TextField.Property.SHADOW).Get(map);
439 Vector4 shadowColor = new Vector4();
440 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
441 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
445 PropertyMap temp = new PropertyMap();
446 temp.Insert("color", new PropertyValue(value));
447 SetValue(ShadowProperty, temp);
448 NotifyPropertyChanged();
453 /// The PrimaryCursorColor property.
456 /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
458 /// <since_tizen> 3 </since_tizen>
459 public Vector4 PrimaryCursorColor
463 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
464 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
468 SetValue(PrimaryCursorColorProperty, value);
469 NotifyPropertyChanged();
474 /// The SecondaryCursorColor property.
477 /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
479 /// <since_tizen> 3 </since_tizen>
480 public Vector4 SecondaryCursorColor
484 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
485 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
489 SetValue(SecondaryCursorColorProperty, value);
490 NotifyPropertyChanged();
495 /// The EnableCursorBlink property.
497 /// <since_tizen> 3 </since_tizen>
498 public bool EnableCursorBlink
502 return (bool)GetValue(EnableCursorBlinkProperty);
506 SetValue(EnableCursorBlinkProperty, value);
507 NotifyPropertyChanged();
512 /// The CursorBlinkInterval property.
514 /// <since_tizen> 3 </since_tizen>
515 public float CursorBlinkInterval
519 return (float)GetValue(CursorBlinkIntervalProperty);
523 SetValue(CursorBlinkIntervalProperty, value);
524 NotifyPropertyChanged();
529 /// The CursorBlinkDuration property.
531 /// <since_tizen> 3 </since_tizen>
532 public float CursorBlinkDuration
536 return (float)GetValue(CursorBlinkDurationProperty);
540 SetValue(CursorBlinkDurationProperty, value);
541 NotifyPropertyChanged();
546 /// The CursorWidth property.
548 /// <since_tizen> 3 </since_tizen>
549 public int CursorWidth
553 return (int)GetValue(CursorWidthProperty);
557 SetValue(CursorWidthProperty, value);
558 NotifyPropertyChanged();
563 /// The GrabHandleImage property.
565 /// <since_tizen> 3 </since_tizen>
566 public string GrabHandleImage
570 return (string)GetValue(GrabHandleImageProperty);
574 SetValue(GrabHandleImageProperty, value);
575 NotifyPropertyChanged();
580 /// The GrabHandlePressedImage property.
582 /// <since_tizen> 3 </since_tizen>
583 public string GrabHandlePressedImage
587 return (string)GetValue(GrabHandlePressedImageProperty);
591 SetValue(GrabHandlePressedImageProperty, value);
592 NotifyPropertyChanged();
597 /// The ScrollThreshold property.
599 /// <since_tizen> 3 </since_tizen>
600 public float ScrollThreshold
604 return (float)GetValue(ScrollThresholdProperty);
608 SetValue(ScrollThresholdProperty, value);
609 NotifyPropertyChanged();
614 /// The ScrollSpeed property.
616 /// <since_tizen> 3 </since_tizen>
617 public float ScrollSpeed
621 return (float)GetValue(ScrollSpeedProperty);
625 SetValue(ScrollSpeedProperty, value);
626 NotifyPropertyChanged();
631 /// The SelectionHandleImageLeft property.
633 /// <since_tizen> 3 </since_tizen>
634 public PropertyMap SelectionHandleImageLeft
638 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
642 SetValue(SelectionHandleImageLeftProperty, value);
643 NotifyPropertyChanged();
648 /// The SelectionHandleImageRight property.
650 /// <since_tizen> 3 </since_tizen>
651 public PropertyMap SelectionHandleImageRight
655 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
659 SetValue(SelectionHandleImageRightProperty, value);
660 NotifyPropertyChanged();
665 /// The SelectionHandlePressedImageLeft property.
667 /// <since_tizen> 3 </since_tizen>
668 public PropertyMap SelectionHandlePressedImageLeft
672 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
676 SetValue(SelectionHandlePressedImageLeftProperty, value);
677 NotifyPropertyChanged();
682 /// The SelectionHandlePressedImageRight property.
684 /// <since_tizen> 3 </since_tizen>
685 public PropertyMap SelectionHandlePressedImageRight
689 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
693 SetValue(SelectionHandlePressedImageRightProperty, value);
694 NotifyPropertyChanged();
699 /// The SelectionHandleMarkerImageLeft property.
701 /// <since_tizen> 3 </since_tizen>
702 public PropertyMap SelectionHandleMarkerImageLeft
706 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
710 SetValue(SelectionHandleMarkerImageLeftProperty, value);
711 NotifyPropertyChanged();
716 /// The SelectionHandleMarkerImageRight property.
718 /// <since_tizen> 3 </since_tizen>
719 public PropertyMap SelectionHandleMarkerImageRight
723 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
727 SetValue(SelectionHandleMarkerImageRightProperty, value);
728 NotifyPropertyChanged();
733 /// The SelectionHighlightColor property.
736 /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
738 /// <since_tizen> 3 </since_tizen>
739 public Vector4 SelectionHighlightColor
743 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
744 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
748 SetValue(SelectionHighlightColorProperty, value);
749 NotifyPropertyChanged();
754 /// The DecorationBoundingBox property.
757 /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
759 /// <since_tizen> 3 </since_tizen>
760 public Rectangle DecorationBoundingBox
764 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
765 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
769 SetValue(DecorationBoundingBoxProperty, value);
770 NotifyPropertyChanged();
775 /// The InputMethodSettings property.
777 /// <since_tizen> 3 </since_tizen>
778 public PropertyMap InputMethodSettings
782 return (PropertyMap)GetValue(InputMethodSettingsProperty);
786 SetValue(InputMethodSettingsProperty, value);
787 NotifyPropertyChanged();
792 /// The InputColor property.
795 /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
797 /// <since_tizen> 3 </since_tizen>
798 public Vector4 InputColor
802 Vector4 temp = (Vector4)GetValue(InputColorProperty);
803 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
807 SetValue(InputColorProperty, value);
808 NotifyPropertyChanged();
813 /// The EnableMarkup property.
815 /// <since_tizen> 3 </since_tizen>
816 public bool EnableMarkup
820 return (bool)GetValue(EnableMarkupProperty);
824 SetValue(EnableMarkupProperty, value);
825 NotifyPropertyChanged();
830 /// The InputFontFamily property.
832 /// <since_tizen> 3 </since_tizen>
833 public string InputFontFamily
837 return (string)GetValue(InputFontFamilyProperty);
841 SetValue(InputFontFamilyProperty, value);
842 NotifyPropertyChanged();
847 /// The InputFontStyle property.
849 /// <since_tizen> 3 </since_tizen>
850 public PropertyMap InputFontStyle
854 return (PropertyMap)GetValue(InputFontStyleProperty);
858 SetValue(InputFontStyleProperty, value);
859 NotifyPropertyChanged();
864 /// The InputPointSize property.
866 /// <since_tizen> 3 </since_tizen>
867 public float InputPointSize
871 return (float)GetValue(InputPointSizeProperty);
875 SetValue(InputPointSizeProperty, value);
876 NotifyPropertyChanged();
881 /// The Underline property.
883 /// <since_tizen> 3 </since_tizen>
884 public PropertyMap Underline
888 return (PropertyMap)GetValue(UnderlineProperty);
892 SetValue(UnderlineProperty, value);
893 NotifyPropertyChanged();
898 /// The InputUnderline property.
900 /// <since_tizen> 3 </since_tizen>
901 public string InputUnderline
905 return (string)GetValue(InputUnderlineProperty);
909 SetValue(InputUnderlineProperty, value);
910 NotifyPropertyChanged();
915 /// The Shadow property.
917 /// <since_tizen> 3 </since_tizen>
918 public PropertyMap Shadow
922 return (PropertyMap)GetValue(ShadowProperty);
926 SetValue(ShadowProperty, value);
927 NotifyPropertyChanged();
932 /// The InputShadow property.
934 /// <since_tizen> 3 </since_tizen>
935 public string InputShadow
939 return (string)GetValue(InputShadowProperty);
943 SetValue(InputShadowProperty, value);
944 NotifyPropertyChanged();
949 /// The Emboss property.
951 /// <since_tizen> 3 </since_tizen>
956 return (string)GetValue(EmbossProperty);
960 SetValue(EmbossProperty, value);
961 NotifyPropertyChanged();
966 /// The InputEmboss property.
968 /// <since_tizen> 3 </since_tizen>
969 public string InputEmboss
973 return (string)GetValue(InputEmbossProperty);
977 SetValue(InputEmbossProperty, value);
978 NotifyPropertyChanged();
983 /// The Outline property.
985 /// <since_tizen> 3 </since_tizen>
986 public PropertyMap Outline
990 return (PropertyMap)GetValue(OutlineProperty);
994 SetValue(OutlineProperty, value);
995 NotifyPropertyChanged();
1000 /// The InputOutline property.
1002 /// <since_tizen> 3 </since_tizen>
1003 public string InputOutline
1007 return (string)GetValue(InputOutlineProperty);
1011 SetValue(InputOutlineProperty, value);
1012 NotifyPropertyChanged();
1017 /// The HiddenInputSettings property.
1019 /// <since_tizen> 3 </since_tizen>
1020 public Tizen.NUI.PropertyMap HiddenInputSettings
1024 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1028 SetValue(HiddenInputSettingsProperty, value);
1029 NotifyPropertyChanged();
1034 /// The PixelSize property.
1036 /// <since_tizen> 3 </since_tizen>
1037 public float PixelSize
1041 return (float)GetValue(PixelSizeProperty);
1045 SetValue(PixelSizeProperty, value);
1046 NotifyPropertyChanged();
1051 /// The Enable selection property.
1053 /// <since_tizen> 3 </since_tizen>
1054 public bool EnableSelection
1058 return (bool)GetValue(EnableSelectionProperty);
1062 SetValue(EnableSelectionProperty, value);
1063 NotifyPropertyChanged();
1068 /// The Enable selection property.
1070 /// <since_tizen> 6 </since_tizen>
1071 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1072 [EditorBrowsable(EditorBrowsableState.Never)]
1073 public bool EnableGrabHandle
1077 return (bool)GetValue(EnableGrabHandleProperty);
1081 SetValue(EnableGrabHandleProperty, value);
1082 NotifyPropertyChanged();
1087 /// The Enable selection property.
1089 /// <since_tizen> 6 </since_tizen>
1090 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1091 [EditorBrowsable(EditorBrowsableState.Never)]
1092 public bool EnableGrabHandlePopup
1096 return (bool)GetValue(EnableGrabHandlePopupProperty);
1100 SetValue(EnableGrabHandlePopupProperty, value);
1101 NotifyPropertyChanged();
1106 /// The Placeholder property.
1107 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1110 /// The following example demonstrates how to set the Placeholder property.
1112 /// PropertyMap propertyMap = new PropertyMap();
1113 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1114 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1115 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1116 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1117 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1119 /// PropertyMap fontStyleMap = new PropertyMap();
1120 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1121 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1122 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1123 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1125 /// TextField field = new TextField();
1126 /// field.Placeholder = propertyMap;
1129 /// <since_tizen> 3 </since_tizen>
1130 public Tizen.NUI.PropertyMap Placeholder
1134 return (PropertyMap)GetValue(PlaceholderProperty);
1138 SetValue(PlaceholderProperty, value);
1139 NotifyPropertyChanged();
1144 /// The Ellipsis property.<br />
1145 /// Enable or disable the ellipsis.<br />
1146 /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1148 /// <since_tizen> 4 </since_tizen>
1149 public bool Ellipsis
1153 return (bool)GetValue(EllipsisProperty);
1157 SetValue(EllipsisProperty, value);
1158 NotifyPropertyChanged();
1163 /// Enables selection of the text using the Shift key.
1165 /// <since_tizen> 5 </since_tizen>
1166 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1167 [EditorBrowsable(EditorBrowsableState.Never)]
1168 public bool EnableShiftSelection
1172 return (bool)GetValue(EnableShiftSelectionProperty);
1176 SetValue(EnableShiftSelectionProperty, value);
1177 NotifyPropertyChanged();
1182 /// The text alignment to match the direction of the system language.
1184 /// <since_tizen> 6 </since_tizen>
1185 public bool MatchSystemLanguageDirection
1189 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1193 SetValue(MatchSystemLanguageDirectionProperty, value);
1194 NotifyPropertyChanged();
1198 /// Only used by the IL of xaml, will never changed to not hidden.
1199 [EditorBrowsable(EditorBrowsableState.Never)]
1200 public override bool IsCreateByXaml
1204 return base.IsCreateByXaml;
1208 base.IsCreateByXaml = value;
1212 this.TextChanged += (obj, e) =>
1214 this.Text = this.Text;
1221 /// Get the InputMethodContext instance.
1223 /// <returns>The InputMethodContext instance.</returns>
1224 /// <since_tizen> 5 </since_tizen>
1225 public InputMethodContext GetInputMethodContext()
1227 if (inputMethodCotext == null)
1229 /*Avoid raising InputMethodContext reference count.*/
1230 inputMethodCotext = new InputMethodContext(Interop.TextField.TextField_GetInputMethodContext(swigCPtr), true);
1231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1233 return inputMethodCotext;
1237 /// Select the whole text.
1239 /// <since_tizen> 6 </since_tizen>
1240 /// This will be released at Tizen.NET API Level 5.5, so currently this would be used as inhouse API.
1241 [EditorBrowsable(EditorBrowsableState.Never)]
1242 public void SelectWholeText()
1244 Interop.TextField.TextField_SelectWholeText(swigCPtr);
1245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1248 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
1250 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1253 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
1255 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);
1256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1263 /// <since_tizen> 3 </since_tizen>
1264 protected override void Dispose(DisposeTypes type)
1268 DisposeQueue.Instance.Add(this);
1272 //Release your own unmanaged resources here.
1273 //You should not access any managed member here except static instance.
1274 //because the execution order of Finalizes is non-deterministic.
1277 if (_textFieldMaxLengthReachedCallbackDelegate != null)
1279 this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
1282 if (_textFieldTextChangedCallbackDelegate != null)
1284 TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
1288 if (swigCPtr.Handle != global::System.IntPtr.Zero)
1292 swigCMemOwn = false;
1293 // In order to speed up IME hide, temporarily add
1294 GetInputMethodContext()?.DestroyContext();
1295 Interop.TextField.delete_TextField(swigCPtr);
1297 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1303 private string SetTranslatable(string textFieldSid)
1305 string translatableText = null;
1306 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1307 if (translatableText != null)
1309 if (systemlangTextFlag == false)
1311 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
1312 systemlangTextFlag = true;
1314 return translatableText;
1318 translatableText = "";
1319 return translatableText;
1323 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1325 if (textFieldTextSid != null)
1327 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1329 if (textFieldPlaceHolderTextSid != null)
1331 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1335 internal new class Property
1337 internal static readonly int RENDERING_BACKEND = Interop.TextField.TextField_Property_RENDERING_BACKEND_get();
1338 internal static readonly int TEXT = Interop.TextField.TextField_Property_TEXT_get();
1339 internal static readonly int PLACEHOLDER_TEXT = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_get();
1340 internal static readonly int PLACEHOLDER_TEXT_FOCUSED = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_FOCUSED_get();
1341 internal static readonly int FONT_FAMILY = Interop.TextField.TextField_Property_FONT_FAMILY_get();
1342 internal static readonly int FONT_STYLE = Interop.TextField.TextField_Property_FONT_STYLE_get();
1343 internal static readonly int POINT_SIZE = Interop.TextField.TextField_Property_POINT_SIZE_get();
1344 internal static readonly int MAX_LENGTH = Interop.TextField.TextField_Property_MAX_LENGTH_get();
1345 internal static readonly int EXCEED_POLICY = Interop.TextField.TextField_Property_EXCEED_POLICY_get();
1346 internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextField.TextField_Property_HORIZONTAL_ALIGNMENT_get();
1347 internal static readonly int VERTICAL_ALIGNMENT = Interop.TextField.TextField_Property_VERTICAL_ALIGNMENT_get();
1348 internal static readonly int TEXT_COLOR = Interop.TextField.TextField_Property_TEXT_COLOR_get();
1349 internal static readonly int PLACEHOLDER_TEXT_COLOR = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_COLOR_get();
1350 internal static readonly int PRIMARY_CURSOR_COLOR = Interop.TextField.TextField_Property_PRIMARY_CURSOR_COLOR_get();
1351 internal static readonly int SECONDARY_CURSOR_COLOR = Interop.TextField.TextField_Property_SECONDARY_CURSOR_COLOR_get();
1352 internal static readonly int ENABLE_CURSOR_BLINK = Interop.TextField.TextField_Property_ENABLE_CURSOR_BLINK_get();
1353 internal static readonly int CURSOR_BLINK_INTERVAL = Interop.TextField.TextField_Property_CURSOR_BLINK_INTERVAL_get();
1354 internal static readonly int CURSOR_BLINK_DURATION = Interop.TextField.TextField_Property_CURSOR_BLINK_DURATION_get();
1355 internal static readonly int CURSOR_WIDTH = Interop.TextField.TextField_Property_CURSOR_WIDTH_get();
1356 internal static readonly int GRAB_HANDLE_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_IMAGE_get();
1357 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
1358 internal static readonly int SCROLL_THRESHOLD = Interop.TextField.TextField_Property_SCROLL_THRESHOLD_get();
1359 internal static readonly int SCROLL_SPEED = Interop.TextField.TextField_Property_SCROLL_SPEED_get();
1360 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
1361 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
1362 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
1363 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
1364 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
1365 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
1366 internal static readonly int SELECTION_HIGHLIGHT_COLOR = Interop.TextField.TextField_Property_SELECTION_HIGHLIGHT_COLOR_get();
1367 internal static readonly int DECORATION_BOUNDING_BOX = Interop.TextField.TextField_Property_DECORATION_BOUNDING_BOX_get();
1368 internal static readonly int INPUT_METHOD_SETTINGS = Interop.TextField.TextField_Property_INPUT_METHOD_SETTINGS_get();
1369 internal static readonly int INPUT_COLOR = Interop.TextField.TextField_Property_INPUT_COLOR_get();
1370 internal static readonly int ENABLE_MARKUP = Interop.TextField.TextField_Property_ENABLE_MARKUP_get();
1371 internal static readonly int INPUT_FONT_FAMILY = Interop.TextField.TextField_Property_INPUT_FONT_FAMILY_get();
1372 internal static readonly int INPUT_FONT_STYLE = Interop.TextField.TextField_Property_INPUT_FONT_STYLE_get();
1373 internal static readonly int INPUT_POINT_SIZE = Interop.TextField.TextField_Property_INPUT_POINT_SIZE_get();
1374 internal static readonly int UNDERLINE = Interop.TextField.TextField_Property_UNDERLINE_get();
1375 internal static readonly int INPUT_UNDERLINE = Interop.TextField.TextField_Property_INPUT_UNDERLINE_get();
1376 internal static readonly int SHADOW = Interop.TextField.TextField_Property_SHADOW_get();
1377 internal static readonly int INPUT_SHADOW = Interop.TextField.TextField_Property_INPUT_SHADOW_get();
1378 internal static readonly int EMBOSS = Interop.TextField.TextField_Property_EMBOSS_get();
1379 internal static readonly int INPUT_EMBOSS = Interop.TextField.TextField_Property_INPUT_EMBOSS_get();
1380 internal static readonly int OUTLINE = Interop.TextField.TextField_Property_OUTLINE_get();
1381 internal static readonly int INPUT_OUTLINE = Interop.TextField.TextField_Property_INPUT_OUTLINE_get();
1382 internal static readonly int HIDDEN_INPUT_SETTINGS = Interop.TextField.TextField_Property_HIDDEN_INPUT_SETTINGS_get();
1383 internal static readonly int PIXEL_SIZE = Interop.TextField.TextField_Property_PIXEL_SIZE_get();
1384 internal static readonly int ENABLE_SELECTION = Interop.TextField.TextField_Property_ENABLE_SELECTION_get();
1385 internal static readonly int PLACEHOLDER = Interop.TextField.TextField_Property_PLACEHOLDER_get();
1386 internal static readonly int ELLIPSIS = Interop.TextField.TextField_Property_ELLIPSIS_get();
1387 internal static readonly int ENABLE_SHIFT_SELECTION = Interop.TextField.TextField_Property_ENABLE_SHIFT_SELECTION_get();
1388 internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextField.TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1389 internal static readonly int ENABLE_GRAB_HANDLE = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_get();
1390 internal static readonly int ENABLE_GRAB_HANDLE_POPUP = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_POPUP_get();
1393 internal class InputStyle
1399 FontFamily = 0x0002,
1409 internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1411 var textField = (TextField)bindable;
1412 textField.translatableTextSelector.Clone((Selector<string>)newValue);
1414 defaultValueCreator: (bindable) =>
1416 var textField = (TextField)bindable;
1417 return textField.translatableTextSelector;
1419 internal static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1421 var textField = (TextField)bindable;
1422 textField.translatablePlaceholderTextSelector.Clone((Selector<string>)newValue);
1424 defaultValueCreator: (bindable) =>
1426 var textField = (TextField)bindable;
1427 return textField.translatablePlaceholderTextSelector;
1429 internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1431 var textField = (TextField)bindable;
1432 textField.textSelector.Clone((Selector<string>)newValue);
1434 defaultValueCreator: (bindable) =>
1436 var textField = (TextField)bindable;
1437 return textField.textSelector;
1439 internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1441 var textField = (TextField)bindable;
1442 textField.fontFamilySelector.Clone((Selector<string>)newValue);
1444 defaultValueCreator: (bindable) =>
1446 var textField = (TextField)bindable;
1447 return textField.fontFamilySelector;
1449 internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1451 var textField = (TextField)bindable;
1452 textField.pointSizeSelector.Clone((Selector<float?>)newValue);
1454 defaultValueCreator: (bindable) =>
1456 var textField = (TextField)bindable;
1457 return textField.pointSizeSelector;
1459 internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1461 var textField = (TextField)bindable;
1462 textField.textColorSelector.Clone((Selector<Color>)newValue);
1464 defaultValueCreator: (bindable) =>
1466 var textField = (TextField)bindable;
1467 return textField.textColorSelector;
1469 internal static readonly BindableProperty PlaceholderTextColorSelectorProperty = BindableProperty.Create("PlaceholderTextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1471 var textField = (TextField)bindable;
1472 textField.placeholderTextColorSelector.Clone((Selector<Color>)newValue);
1474 defaultValueCreator: (bindable) =>
1476 var textField = (TextField)bindable;
1477 return textField.placeholderTextColorSelector;
1479 internal static readonly BindableProperty PrimaryCursorColorSelectorProperty = BindableProperty.Create("PrimaryCursorColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1481 var textField = (TextField)bindable;
1482 textField.primaryCursorColorSelector.Clone((Selector<Color>)newValue);
1484 defaultValueCreator: (bindable) =>
1486 var textField = (TextField)bindable;
1487 return textField.primaryCursorColorSelector;
1490 private TriggerableSelector<string> _translatableTextSelector;
1491 private TriggerableSelector<string> translatableTextSelector
1495 if (null == _translatableTextSelector)
1497 _translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
1499 return _translatableTextSelector;
1503 private TriggerableSelector<string> _translatablePlaceholderTextSelector;
1504 private TriggerableSelector<string> translatablePlaceholderTextSelector
1508 if (null == _translatablePlaceholderTextSelector)
1510 _translatablePlaceholderTextSelector = new TriggerableSelector<string>(this, TranslatablePlaceholderTextProperty);
1512 return _translatablePlaceholderTextSelector;
1516 private TriggerableSelector<string> _textSelector;
1517 private TriggerableSelector<string> textSelector
1521 if (null == _textSelector)
1523 _textSelector = new TriggerableSelector<string>(this, TextProperty);
1525 return _textSelector;
1529 private TriggerableSelector<string> _fontFamilySelector;
1530 private TriggerableSelector<string> fontFamilySelector
1534 if (null == _fontFamilySelector)
1536 _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
1538 return _fontFamilySelector;
1542 private TriggerableSelector<Color> _textColorSelector;
1543 private TriggerableSelector<Color> textColorSelector
1547 if (null == _textColorSelector)
1549 _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
1551 return _textColorSelector;
1555 private TriggerableSelector<float?> _pointSizeSelector;
1556 private TriggerableSelector<float?> pointSizeSelector
1560 if (null == _pointSizeSelector)
1562 _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
1564 return _pointSizeSelector;
1568 private TriggerableSelector<Color> _placeholderTextColorSelector;
1569 private TriggerableSelector<Color> placeholderTextColorSelector
1573 if (null == _placeholderTextColorSelector)
1575 _placeholderTextColorSelector = new TriggerableSelector<Color>(this, PlaceholderTextColorProperty);
1577 return _placeholderTextColorSelector;
1581 private TriggerableSelector<Color> _primaryCursorColorSelector;
1582 private TriggerableSelector<Color> primaryCursorColorSelector
1586 if (null == _primaryCursorColorSelector)
1588 _primaryCursorColorSelector = new TriggerableSelector<Color>(this, PrimaryCursorColorProperty);
1590 return _primaryCursorColorSelector;
1594 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
1596 DecorationBoundingBox = new Rectangle(x, y, width, height);
1598 private void OnInputColorChanged(float x, float y, float z, float w)
1600 InputColor = new Vector4(x, y, z, w);
1602 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
1604 PlaceholderTextColor = new Vector4(r, g, b, a);
1606 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
1608 PrimaryCursorColor = new Vector4(x, y, z, w);
1610 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
1612 SecondaryCursorColor = new Vector4(x, y, z, w);
1614 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
1616 SelectionHighlightColor = new Vector4(x, y, z, w);
1618 private void OnShadowColorChanged(float x, float y, float z, float w)
1620 ShadowColor = new Vector4(x, y, z, w);
1622 private void OnShadowOffsetChanged(float x, float y)
1624 ShadowOffset = new Vector2(x, y);
1626 private void OnTextColorChanged(float r, float g, float b, float a)
1628 TextColor = new Color(r, g, b, a);