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;
24 namespace Tizen.NUI.BaseComponents
27 /// A control which provides a single line editable text field.
29 /// <since_tizen> 3 </since_tizen>
30 public partial class TextField : View
32 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33 private string textFieldTextSid = null;
34 private string textFieldPlaceHolderTextSid = null;
35 private bool systemlangTextFlag = false;
36 private InputMethodContext inputMethodCotext = null;
39 /// Creates the TextField control.
41 /// <since_tizen> 3 </since_tizen>
42 public TextField() : this(Interop.TextField.TextField_New(), true)
44 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
48 /// Creates the TextField with setting the status of shown or hidden.
50 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
51 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
52 [EditorBrowsable(EditorBrowsableState.Never)]
53 public TextField(bool shown) : this(Interop.TextField.TextField_New(), true)
55 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn)
61 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
69 internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.new_TextField__SWIG_1(TextField.getCPtr(handle)), true)
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79 internal enum ExceedPolicyType
86 /// The TranslatableText property.<br />
87 /// The text can set the SID value.<br />
89 /// <exception cref='ArgumentNullException'>
90 /// ResourceManager about multilingual is null.
92 /// <since_tizen> 4 </since_tizen>
93 public string TranslatableText
97 return textFieldTextSid;
101 if (NUIApplication.MultilingualResourceManager == null)
103 throw new ArgumentNullException("ResourceManager about multilingual is null");
105 textFieldTextSid = value;
106 Text = SetTranslatable(textFieldTextSid);
107 NotifyPropertyChanged();
112 /// The TranslatablePlaceholderText property.<br />
113 /// The text can set the SID value.<br />
115 /// <exception cref='ArgumentNullException'>
116 /// ResourceManager about multilingual is null.
118 /// <since_tizen> 4 </since_tizen>
119 public string TranslatablePlaceholderText
123 return textFieldPlaceHolderTextSid;
127 if (NUIApplication.MultilingualResourceManager == null)
129 throw new ArgumentNullException("ResourceManager about multilingual is null");
131 textFieldPlaceHolderTextSid = value;
132 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
133 NotifyPropertyChanged();
138 /// The Text property.
140 /// <since_tizen> 3 </since_tizen>
145 return (string)GetValue(TextProperty);
149 SetValueAndForceSendChangeSignal(TextProperty, value);
150 NotifyPropertyChanged();
155 /// The PlaceholderText property.
157 /// <since_tizen> 3 </since_tizen>
158 public string PlaceholderText
162 return (string)GetValue(PlaceholderTextProperty);
166 SetValue(PlaceholderTextProperty, value);
167 NotifyPropertyChanged();
172 /// The PlaceholderTextFocused property.
174 /// <since_tizen> 3 </since_tizen>
175 public string PlaceholderTextFocused
179 return (string)GetValue(PlaceholderTextFocusedProperty);
183 SetValue(PlaceholderTextFocusedProperty, value);
184 NotifyPropertyChanged();
189 /// The FontFamily property.
191 /// <since_tizen> 3 </since_tizen>
192 public string FontFamily
196 return (string)GetValue(FontFamilyProperty);
200 SetValue(FontFamilyProperty, value);
201 NotifyPropertyChanged();
206 /// The FontStyle property.
208 /// <since_tizen> 3 </since_tizen>
209 public PropertyMap FontStyle
213 return (PropertyMap)GetValue(FontStyleProperty);
217 SetValue(FontStyleProperty, value);
218 NotifyPropertyChanged();
223 /// The PointSize property.
225 /// <since_tizen> 3 </since_tizen>
226 public float PointSize
230 return (float)GetValue(PointSizeProperty);
234 SetValue(PointSizeProperty, value);
235 NotifyPropertyChanged();
240 /// The MaxLength property.
242 /// <since_tizen> 3 </since_tizen>
247 return (int)GetValue(MaxLengthProperty);
251 SetValue(MaxLengthProperty, value);
252 NotifyPropertyChanged();
257 /// The ExceedPolicy property.
259 /// <since_tizen> 3 </since_tizen>
260 public int ExceedPolicy
264 return (int)GetValue(ExceedPolicyProperty);
268 SetValue(ExceedPolicyProperty, value);
269 NotifyPropertyChanged();
274 /// The HorizontalAlignment property.
276 /// <since_tizen> 3 </since_tizen>
277 public HorizontalAlignment HorizontalAlignment
281 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
285 SetValue(HorizontalAlignmentProperty, value);
286 NotifyPropertyChanged();
291 /// The VerticalAlignment property.
293 /// <since_tizen> 3 </since_tizen>
294 public VerticalAlignment VerticalAlignment
298 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
302 SetValue(VerticalAlignmentProperty, value);
303 NotifyPropertyChanged();
304 NotifyPropertyChanged();
309 /// The TextColor property.
312 /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
314 /// <since_tizen> 3 </since_tizen>
315 public Color TextColor
319 Color temp = (Color)GetValue(TextColorProperty);
320 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
324 SetValue(TextColorProperty, value);
325 NotifyPropertyChanged();
330 /// The PlaceholderTextColor property.
333 /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
335 /// <since_tizen> 3 </since_tizen>
336 public Vector4 PlaceholderTextColor
340 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
341 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
345 SetValue(PlaceholderTextColorProperty, value);
346 NotifyPropertyChanged();
351 /// The ShadowOffset property.
353 /// <since_tizen> 3 </since_tizen>
355 /// Deprecated.(API Level 6) Use Shadow instead.
356 /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
358 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
359 public Vector2 ShadowOffset
363 PropertyMap map = new PropertyMap();
364 GetProperty(TextField.Property.SHADOW).Get(map);
365 Vector2 shadowOffset = new Vector2();
366 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
367 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
371 PropertyMap temp = new PropertyMap();
372 temp.Insert("offset", new PropertyValue(value));
373 SetValue(ShadowProperty, temp);
374 NotifyPropertyChanged();
379 /// The ShadowColor property.
381 /// <since_tizen> 3 </since_tizen>
383 /// Deprecated.(API Level 6) Use Shadow instead.
384 /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
386 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
387 public Vector4 ShadowColor
391 PropertyMap map = new PropertyMap();
392 GetProperty(TextField.Property.SHADOW).Get(map);
393 Vector4 shadowColor = new Vector4();
394 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
395 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
399 PropertyMap temp = new PropertyMap();
400 temp.Insert("color", new PropertyValue(value));
401 SetValue(ShadowProperty, temp);
402 NotifyPropertyChanged();
407 /// The PrimaryCursorColor property.
410 /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
412 /// <since_tizen> 3 </since_tizen>
413 public Vector4 PrimaryCursorColor
417 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
418 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
422 SetValue(PrimaryCursorColorProperty, value);
423 NotifyPropertyChanged();
428 /// The SecondaryCursorColor property.
431 /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
433 /// <since_tizen> 3 </since_tizen>
434 public Vector4 SecondaryCursorColor
438 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
439 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
443 SetValue(SecondaryCursorColorProperty, value);
444 NotifyPropertyChanged();
449 /// The EnableCursorBlink property.
451 /// <since_tizen> 3 </since_tizen>
452 public bool EnableCursorBlink
456 return (bool)GetValue(EnableCursorBlinkProperty);
460 SetValue(EnableCursorBlinkProperty, value);
461 NotifyPropertyChanged();
466 /// The CursorBlinkInterval property.
468 /// <since_tizen> 3 </since_tizen>
469 public float CursorBlinkInterval
473 return (float)GetValue(CursorBlinkIntervalProperty);
477 SetValue(CursorBlinkIntervalProperty, value);
478 NotifyPropertyChanged();
483 /// The CursorBlinkDuration property.
485 /// <since_tizen> 3 </since_tizen>
486 public float CursorBlinkDuration
490 return (float)GetValue(CursorBlinkDurationProperty);
494 SetValue(CursorBlinkDurationProperty, value);
495 NotifyPropertyChanged();
500 /// The CursorWidth property.
502 /// <since_tizen> 3 </since_tizen>
503 public int CursorWidth
507 return (int)GetValue(CursorWidthProperty);
511 SetValue(CursorWidthProperty, value);
512 NotifyPropertyChanged();
517 /// The GrabHandleImage property.
519 /// <since_tizen> 3 </since_tizen>
520 public string GrabHandleImage
524 return (string)GetValue(GrabHandleImageProperty);
528 SetValue(GrabHandleImageProperty, value);
529 NotifyPropertyChanged();
534 /// The GrabHandlePressedImage property.
536 /// <since_tizen> 3 </since_tizen>
537 public string GrabHandlePressedImage
541 return (string)GetValue(GrabHandlePressedImageProperty);
545 SetValue(GrabHandlePressedImageProperty, value);
546 NotifyPropertyChanged();
551 /// The ScrollThreshold property.
553 /// <since_tizen> 3 </since_tizen>
554 public float ScrollThreshold
558 return (float)GetValue(ScrollThresholdProperty);
562 SetValue(ScrollThresholdProperty, value);
563 NotifyPropertyChanged();
568 /// The ScrollSpeed property.
570 /// <since_tizen> 3 </since_tizen>
571 public float ScrollSpeed
575 return (float)GetValue(ScrollSpeedProperty);
579 SetValue(ScrollSpeedProperty, value);
580 NotifyPropertyChanged();
585 /// The SelectionHandleImageLeft property.
587 /// <since_tizen> 3 </since_tizen>
588 public PropertyMap SelectionHandleImageLeft
592 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
596 SetValue(SelectionHandleImageLeftProperty, value);
597 NotifyPropertyChanged();
602 /// The SelectionHandleImageRight property.
604 /// <since_tizen> 3 </since_tizen>
605 public PropertyMap SelectionHandleImageRight
609 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
613 SetValue(SelectionHandleImageRightProperty, value);
614 NotifyPropertyChanged();
619 /// The SelectionHandlePressedImageLeft property.
621 /// <since_tizen> 3 </since_tizen>
622 public PropertyMap SelectionHandlePressedImageLeft
626 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
630 SetValue(SelectionHandlePressedImageLeftProperty, value);
631 NotifyPropertyChanged();
636 /// The SelectionHandlePressedImageRight property.
638 /// <since_tizen> 3 </since_tizen>
639 public PropertyMap SelectionHandlePressedImageRight
643 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
647 SetValue(SelectionHandlePressedImageRightProperty, value);
648 NotifyPropertyChanged();
653 /// The SelectionHandleMarkerImageLeft property.
655 /// <since_tizen> 3 </since_tizen>
656 public PropertyMap SelectionHandleMarkerImageLeft
660 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
664 SetValue(SelectionHandleMarkerImageLeftProperty, value);
665 NotifyPropertyChanged();
670 /// The SelectionHandleMarkerImageRight property.
672 /// <since_tizen> 3 </since_tizen>
673 public PropertyMap SelectionHandleMarkerImageRight
677 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
681 SetValue(SelectionHandleMarkerImageRightProperty, value);
682 NotifyPropertyChanged();
687 /// The SelectionHighlightColor property.
690 /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
692 /// <since_tizen> 3 </since_tizen>
693 public Vector4 SelectionHighlightColor
697 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
698 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
702 SetValue(SelectionHighlightColorProperty, value);
703 NotifyPropertyChanged();
708 /// The DecorationBoundingBox property.
711 /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
713 /// <since_tizen> 3 </since_tizen>
714 public Rectangle DecorationBoundingBox
718 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
719 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
723 SetValue(DecorationBoundingBoxProperty, value);
724 NotifyPropertyChanged();
729 /// The InputMethodSettings property.
731 /// <since_tizen> 3 </since_tizen>
732 public PropertyMap InputMethodSettings
736 return (PropertyMap)GetValue(InputMethodSettingsProperty);
740 SetValue(InputMethodSettingsProperty, value);
741 NotifyPropertyChanged();
746 /// The InputColor property.
749 /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
751 /// <since_tizen> 3 </since_tizen>
752 public Vector4 InputColor
756 Vector4 temp = (Vector4)GetValue(InputColorProperty);
757 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
761 SetValue(InputColorProperty, value);
762 NotifyPropertyChanged();
767 /// The EnableMarkup property.
769 /// <since_tizen> 3 </since_tizen>
770 public bool EnableMarkup
774 return (bool)GetValue(EnableMarkupProperty);
778 SetValue(EnableMarkupProperty, value);
779 NotifyPropertyChanged();
784 /// The InputFontFamily property.
786 /// <since_tizen> 3 </since_tizen>
787 public string InputFontFamily
791 return (string)GetValue(InputFontFamilyProperty);
795 SetValue(InputFontFamilyProperty, value);
796 NotifyPropertyChanged();
801 /// The InputFontStyle property.
803 /// <since_tizen> 3 </since_tizen>
804 public PropertyMap InputFontStyle
808 return (PropertyMap)GetValue(InputFontStyleProperty);
812 SetValue(InputFontStyleProperty, value);
813 NotifyPropertyChanged();
818 /// The InputPointSize property.
820 /// <since_tizen> 3 </since_tizen>
821 public float InputPointSize
825 return (float)GetValue(InputPointSizeProperty);
829 SetValue(InputPointSizeProperty, value);
830 NotifyPropertyChanged();
835 /// The Underline property.
837 /// <since_tizen> 3 </since_tizen>
838 public PropertyMap Underline
842 return (PropertyMap)GetValue(UnderlineProperty);
846 SetValue(UnderlineProperty, value);
847 NotifyPropertyChanged();
852 /// The InputUnderline property.
854 /// <since_tizen> 3 </since_tizen>
855 public string InputUnderline
859 return (string)GetValue(InputUnderlineProperty);
863 SetValue(InputUnderlineProperty, value);
864 NotifyPropertyChanged();
869 /// The Shadow property.
871 /// <since_tizen> 3 </since_tizen>
872 public PropertyMap Shadow
876 return (PropertyMap)GetValue(ShadowProperty);
880 SetValue(ShadowProperty, value);
881 NotifyPropertyChanged();
886 /// The InputShadow property.
888 /// <since_tizen> 3 </since_tizen>
889 public string InputShadow
893 return (string)GetValue(InputShadowProperty);
897 SetValue(InputShadowProperty, value);
898 NotifyPropertyChanged();
903 /// The Emboss property.
905 /// <since_tizen> 3 </since_tizen>
910 return (string)GetValue(EmbossProperty);
914 SetValue(EmbossProperty, value);
915 NotifyPropertyChanged();
920 /// The InputEmboss property.
922 /// <since_tizen> 3 </since_tizen>
923 public string InputEmboss
927 return (string)GetValue(InputEmbossProperty);
931 SetValue(InputEmbossProperty, value);
932 NotifyPropertyChanged();
937 /// The Outline property.
939 /// <since_tizen> 3 </since_tizen>
940 public PropertyMap Outline
944 return (PropertyMap)GetValue(OutlineProperty);
948 SetValue(OutlineProperty, value);
949 NotifyPropertyChanged();
954 /// The InputOutline property.
956 /// <since_tizen> 3 </since_tizen>
957 public string InputOutline
961 return (string)GetValue(InputOutlineProperty);
965 SetValue(InputOutlineProperty, value);
966 NotifyPropertyChanged();
971 /// The HiddenInputSettings property.
973 /// <since_tizen> 3 </since_tizen>
974 public Tizen.NUI.PropertyMap HiddenInputSettings
978 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
982 SetValue(HiddenInputSettingsProperty, value);
983 NotifyPropertyChanged();
988 /// The PixelSize property.
990 /// <since_tizen> 3 </since_tizen>
991 public float PixelSize
995 return (float)GetValue(PixelSizeProperty);
999 SetValue(PixelSizeProperty, value);
1000 NotifyPropertyChanged();
1005 /// The Enable selection property.
1007 /// <since_tizen> 3 </since_tizen>
1008 public bool EnableSelection
1012 return (bool)GetValue(EnableSelectionProperty);
1016 SetValue(EnableSelectionProperty, value);
1017 NotifyPropertyChanged();
1022 /// The Enable selection property.
1024 /// <since_tizen> 6 </since_tizen>
1025 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1026 [EditorBrowsable(EditorBrowsableState.Never)]
1027 public bool EnableGrabHandle
1031 return (bool)GetValue(EnableGrabHandleProperty);
1035 SetValue(EnableGrabHandleProperty, value);
1036 NotifyPropertyChanged();
1041 /// The Enable selection property.
1043 /// <since_tizen> 6 </since_tizen>
1044 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1045 [EditorBrowsable(EditorBrowsableState.Never)]
1046 public bool EnableGrabHandlePopup
1050 return (bool)GetValue(EnableGrabHandlePopupProperty);
1054 SetValue(EnableGrabHandlePopupProperty, value);
1055 NotifyPropertyChanged();
1060 /// The Placeholder property.
1061 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1064 /// The following example demonstrates how to set the Placeholder property.
1066 /// PropertyMap propertyMap = new PropertyMap();
1067 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1068 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1069 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1070 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1071 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1073 /// PropertyMap fontStyleMap = new PropertyMap();
1074 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1075 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1076 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1077 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1079 /// TextField field = new TextField();
1080 /// field.Placeholder = propertyMap;
1083 /// <since_tizen> 3 </since_tizen>
1084 public Tizen.NUI.PropertyMap Placeholder
1088 return (PropertyMap)GetValue(PlaceholderProperty);
1092 SetValue(PlaceholderProperty, value);
1093 NotifyPropertyChanged();
1098 /// The Ellipsis property.<br />
1099 /// Enable or disable the ellipsis.<br />
1100 /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1102 /// <since_tizen> 4 </since_tizen>
1103 public bool Ellipsis
1107 return (bool)GetValue(EllipsisProperty);
1111 SetValue(EllipsisProperty, value);
1112 NotifyPropertyChanged();
1117 /// Enables selection of the text using the Shift key.
1119 /// <since_tizen> 5 </since_tizen>
1120 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1121 [EditorBrowsable(EditorBrowsableState.Never)]
1122 public bool EnableShiftSelection
1126 return (bool)GetValue(EnableShiftSelectionProperty);
1130 SetValue(EnableShiftSelectionProperty, value);
1131 NotifyPropertyChanged();
1136 /// The text alignment to match the direction of the system language.
1138 /// <since_tizen> 6 </since_tizen>
1139 public bool MatchSystemLanguageDirection
1143 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1147 SetValue(MatchSystemLanguageDirectionProperty, value);
1148 NotifyPropertyChanged();
1152 /// Only used by the IL of xaml, will never changed to not hidden.
1153 [EditorBrowsable(EditorBrowsableState.Never)]
1154 public override bool IsCreateByXaml
1158 return base.IsCreateByXaml;
1162 base.IsCreateByXaml = value;
1166 this.TextChanged += (obj, e) =>
1168 this.Text = this.Text;
1175 /// Get the InputMethodContext instance.
1177 /// <returns>The InputMethodContext instance.</returns>
1178 /// <since_tizen> 5 </since_tizen>
1179 public InputMethodContext GetInputMethodContext()
1181 if (inputMethodCotext == null)
1183 /*Avoid raising InputMethodContext reference count.*/
1184 inputMethodCotext = new InputMethodContext(Interop.TextField.TextField_GetInputMethodContext(swigCPtr), true);
1185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1187 return inputMethodCotext;
1191 /// Select the whole text.
1193 /// <since_tizen> 6 </since_tizen>
1194 /// This will be released at Tizen.NET API Level 5.5, so currently this would be used as inhouse API.
1195 [EditorBrowsable(EditorBrowsableState.Never)]
1196 public void SelectWholeText()
1198 Interop.TextField.TextField_SelectWholeText(swigCPtr);
1199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1202 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
1204 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1207 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
1209 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);
1210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1217 /// <since_tizen> 3 </since_tizen>
1218 protected override void Dispose(DisposeTypes type)
1222 DisposeQueue.Instance.Add(this);
1226 //Release your own unmanaged resources here.
1227 //You should not access any managed member here except static instance.
1228 //because the execution order of Finalizes is non-deterministic.
1231 if (_textFieldMaxLengthReachedCallbackDelegate != null)
1233 this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
1236 if (_textFieldTextChangedCallbackDelegate != null)
1238 TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
1242 if (swigCPtr.Handle != global::System.IntPtr.Zero)
1246 swigCMemOwn = false;
1247 // In order to speed up IME hide, temporarily add
1248 GetInputMethodContext()?.DestroyContext();
1249 Interop.TextField.delete_TextField(swigCPtr);
1251 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1257 private string SetTranslatable(string textFieldSid)
1259 string translatableText = null;
1260 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1261 if (translatableText != null)
1263 if (systemlangTextFlag == false)
1265 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
1266 systemlangTextFlag = true;
1268 return translatableText;
1272 translatableText = "";
1273 return translatableText;
1277 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1279 if (textFieldTextSid != null)
1281 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1283 if (textFieldPlaceHolderTextSid != null)
1285 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1289 internal new class Property
1291 internal static readonly int RENDERING_BACKEND = Interop.TextField.TextField_Property_RENDERING_BACKEND_get();
1292 internal static readonly int TEXT = Interop.TextField.TextField_Property_TEXT_get();
1293 internal static readonly int PLACEHOLDER_TEXT = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_get();
1294 internal static readonly int PLACEHOLDER_TEXT_FOCUSED = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_FOCUSED_get();
1295 internal static readonly int FONT_FAMILY = Interop.TextField.TextField_Property_FONT_FAMILY_get();
1296 internal static readonly int FONT_STYLE = Interop.TextField.TextField_Property_FONT_STYLE_get();
1297 internal static readonly int POINT_SIZE = Interop.TextField.TextField_Property_POINT_SIZE_get();
1298 internal static readonly int MAX_LENGTH = Interop.TextField.TextField_Property_MAX_LENGTH_get();
1299 internal static readonly int EXCEED_POLICY = Interop.TextField.TextField_Property_EXCEED_POLICY_get();
1300 internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextField.TextField_Property_HORIZONTAL_ALIGNMENT_get();
1301 internal static readonly int VERTICAL_ALIGNMENT = Interop.TextField.TextField_Property_VERTICAL_ALIGNMENT_get();
1302 internal static readonly int TEXT_COLOR = Interop.TextField.TextField_Property_TEXT_COLOR_get();
1303 internal static readonly int PLACEHOLDER_TEXT_COLOR = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_COLOR_get();
1304 internal static readonly int PRIMARY_CURSOR_COLOR = Interop.TextField.TextField_Property_PRIMARY_CURSOR_COLOR_get();
1305 internal static readonly int SECONDARY_CURSOR_COLOR = Interop.TextField.TextField_Property_SECONDARY_CURSOR_COLOR_get();
1306 internal static readonly int ENABLE_CURSOR_BLINK = Interop.TextField.TextField_Property_ENABLE_CURSOR_BLINK_get();
1307 internal static readonly int CURSOR_BLINK_INTERVAL = Interop.TextField.TextField_Property_CURSOR_BLINK_INTERVAL_get();
1308 internal static readonly int CURSOR_BLINK_DURATION = Interop.TextField.TextField_Property_CURSOR_BLINK_DURATION_get();
1309 internal static readonly int CURSOR_WIDTH = Interop.TextField.TextField_Property_CURSOR_WIDTH_get();
1310 internal static readonly int GRAB_HANDLE_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_IMAGE_get();
1311 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
1312 internal static readonly int SCROLL_THRESHOLD = Interop.TextField.TextField_Property_SCROLL_THRESHOLD_get();
1313 internal static readonly int SCROLL_SPEED = Interop.TextField.TextField_Property_SCROLL_SPEED_get();
1314 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
1315 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
1316 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
1317 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
1318 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
1319 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
1320 internal static readonly int SELECTION_HIGHLIGHT_COLOR = Interop.TextField.TextField_Property_SELECTION_HIGHLIGHT_COLOR_get();
1321 internal static readonly int DECORATION_BOUNDING_BOX = Interop.TextField.TextField_Property_DECORATION_BOUNDING_BOX_get();
1322 internal static readonly int INPUT_METHOD_SETTINGS = Interop.TextField.TextField_Property_INPUT_METHOD_SETTINGS_get();
1323 internal static readonly int INPUT_COLOR = Interop.TextField.TextField_Property_INPUT_COLOR_get();
1324 internal static readonly int ENABLE_MARKUP = Interop.TextField.TextField_Property_ENABLE_MARKUP_get();
1325 internal static readonly int INPUT_FONT_FAMILY = Interop.TextField.TextField_Property_INPUT_FONT_FAMILY_get();
1326 internal static readonly int INPUT_FONT_STYLE = Interop.TextField.TextField_Property_INPUT_FONT_STYLE_get();
1327 internal static readonly int INPUT_POINT_SIZE = Interop.TextField.TextField_Property_INPUT_POINT_SIZE_get();
1328 internal static readonly int UNDERLINE = Interop.TextField.TextField_Property_UNDERLINE_get();
1329 internal static readonly int INPUT_UNDERLINE = Interop.TextField.TextField_Property_INPUT_UNDERLINE_get();
1330 internal static readonly int SHADOW = Interop.TextField.TextField_Property_SHADOW_get();
1331 internal static readonly int INPUT_SHADOW = Interop.TextField.TextField_Property_INPUT_SHADOW_get();
1332 internal static readonly int EMBOSS = Interop.TextField.TextField_Property_EMBOSS_get();
1333 internal static readonly int INPUT_EMBOSS = Interop.TextField.TextField_Property_INPUT_EMBOSS_get();
1334 internal static readonly int OUTLINE = Interop.TextField.TextField_Property_OUTLINE_get();
1335 internal static readonly int INPUT_OUTLINE = Interop.TextField.TextField_Property_INPUT_OUTLINE_get();
1336 internal static readonly int HIDDEN_INPUT_SETTINGS = Interop.TextField.TextField_Property_HIDDEN_INPUT_SETTINGS_get();
1337 internal static readonly int PIXEL_SIZE = Interop.TextField.TextField_Property_PIXEL_SIZE_get();
1338 internal static readonly int ENABLE_SELECTION = Interop.TextField.TextField_Property_ENABLE_SELECTION_get();
1339 internal static readonly int PLACEHOLDER = Interop.TextField.TextField_Property_PLACEHOLDER_get();
1340 internal static readonly int ELLIPSIS = Interop.TextField.TextField_Property_ELLIPSIS_get();
1341 internal static readonly int ENABLE_SHIFT_SELECTION = Interop.TextField.TextField_Property_ENABLE_SHIFT_SELECTION_get();
1342 internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextField.TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1343 internal static readonly int ENABLE_GRAB_HANDLE = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_get();
1344 internal static readonly int ENABLE_GRAB_HANDLE_POPUP = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_POPUP_get();
1347 internal class InputStyle
1353 FontFamily = 0x0002,
1363 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
1365 DecorationBoundingBox = new Rectangle(x, y, width, height);
1367 private void OnInputColorChanged(float x, float y, float z, float w)
1369 InputColor = new Vector4(x, y, z, w);
1371 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
1373 PlaceholderTextColor = new Vector4(r, g, b, a);
1375 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
1377 PrimaryCursorColor = new Vector4(x, y, z, w);
1379 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
1381 SecondaryCursorColor = new Vector4(x, y, z, w);
1383 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
1385 SelectionHighlightColor = new Vector4(x, y, z, w);
1387 private void OnShadowColorChanged(float x, float y, float z, float w)
1389 ShadowColor = new Vector4(x, y, z, w);
1391 private void OnShadowOffsetChanged(float x, float y)
1393 ShadowOffset = new Vector2(x, y);
1395 private void OnTextColorChanged(float r, float g, float b, float a)
1397 TextColor = new Color(r, g, b, a);