2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 extern alias TizenSystemSettings;
18 using TizenSystemSettings.Tizen.System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
26 namespace Tizen.NUI.BaseComponents
29 /// A control which provides a single line editable text field.
31 /// <since_tizen> 3 </since_tizen>
32 public partial class TextField : View
34 private string textFieldTextSid = null;
35 private string textFieldPlaceHolderTextSid = null;
36 private string textFieldPlaceHolderTextFocusedSid = null;
37 private bool systemlangTextFlag = false;
38 private InputMethodContext inputMethodCotext = null;
39 private float fontSizeScale = 1.0f;
40 private bool hasFontSizeChangedCallback = false;
42 static TextField() { }
45 /// Creates the TextField control.
47 /// <since_tizen> 3 </since_tizen>
48 public TextField() : this(Interop.TextField.New(), true)
50 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54 /// Creates the TextField with setting the status of shown or hidden.
56 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
57 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
58 [EditorBrowsable(EditorBrowsableState.Never)]
59 public TextField(bool shown) : this(Interop.TextField.New(), true)
61 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 /// Get attributes, it is abstract function and must be override.
68 [EditorBrowsable(EditorBrowsableState.Never)]
69 protected override ViewStyle CreateViewStyle()
71 return new TextFieldStyle();
74 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(cPtr, cMemoryOwn, viewStyle)
82 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null)
90 internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.NewTextField(TextField.getCPtr(handle)), true)
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100 internal enum ExceedPolicyType
102 ExceedPolicyOriginal,
107 /// The TranslatableText property.<br />
108 /// The text can set the SID value.<br />
110 /// <exception cref='ArgumentNullException'>
111 /// ResourceManager about multilingual is null.
113 /// <since_tizen> 4 </since_tizen>
114 public string TranslatableText
118 return (string)GetValue(TranslatableTextProperty);
122 SetValue(TranslatableTextProperty, value);
125 private string translatableText
129 return textFieldTextSid;
133 if (NUIApplication.MultilingualResourceManager == null)
135 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
137 textFieldTextSid = value;
138 Text = SetTranslatable(textFieldTextSid);
139 NotifyPropertyChanged();
144 /// The TranslatablePlaceholderText property.<br />
145 /// The text can set the SID value.<br />
147 /// <exception cref='ArgumentNullException'>
148 /// ResourceManager about multilingual is null.
150 /// <since_tizen> 4 </since_tizen>
151 public string TranslatablePlaceholderText
155 return (string)GetValue(TranslatablePlaceholderTextProperty);
159 SetValue(TranslatablePlaceholderTextProperty, value);
162 private string translatablePlaceholderText
166 return textFieldPlaceHolderTextSid;
170 if (NUIApplication.MultilingualResourceManager == null)
172 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
174 textFieldPlaceHolderTextSid = value;
175 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
176 NotifyPropertyChanged();
181 /// The TranslatablePlaceholderTextFocused property.<br />
182 /// The text can set the SID value.<br />
184 /// <exception cref='ArgumentNullException'>
185 /// ResourceManager about multilingual is null.
187 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
188 [EditorBrowsable(EditorBrowsableState.Never)]
189 public string TranslatablePlaceholderTextFocused
193 return (string)GetValue(TranslatablePlaceholderTextFocusedProperty);
197 SetValue(TranslatablePlaceholderTextFocusedProperty, value);
200 private string translatablePlaceholderTextFocused
204 return textFieldPlaceHolderTextFocusedSid;
208 if (NUIApplication.MultilingualResourceManager == null)
210 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
212 textFieldPlaceHolderTextFocusedSid = value;
213 PlaceholderTextFocused = SetTranslatable(textFieldPlaceHolderTextFocusedSid);
214 NotifyPropertyChanged();
219 /// The Text property.<br />
220 /// The text to display in the UTF-8 format.<br />
222 /// <since_tizen> 3 </since_tizen>
227 return (string)GetValue(TextProperty);
231 SetValueAndForceSendChangeSignal(TextProperty, value);
232 NotifyPropertyChanged();
237 /// The PlaceholderText property.<br />
238 /// The text to display when the TextField is empty and inactive. <br />
240 /// <since_tizen> 3 </since_tizen>
241 public string PlaceholderText
245 return (string)GetValue(PlaceholderTextProperty);
249 SetValue(PlaceholderTextProperty, value);
250 NotifyPropertyChanged();
255 /// The PlaceholderTextFocused property. <br />
256 /// The text to display when the TextField is empty with input focus. <br />
258 /// <since_tizen> 3 </since_tizen>
259 public string PlaceholderTextFocused
263 return (string)GetValue(PlaceholderTextFocusedProperty);
267 SetValue(PlaceholderTextFocusedProperty, value);
268 NotifyPropertyChanged();
273 /// The FontFamily property.<br />
274 /// The requested font family to use.<br />
276 /// <since_tizen> 3 </since_tizen>
277 public string FontFamily
281 return (string)GetValue(FontFamilyProperty);
285 SetValue(FontFamilyProperty, value);
286 NotifyPropertyChanged();
291 /// The FontStyle property.<br />
292 /// The requested font style to use.<br />
293 /// The fontStyle map contains the following keys :<br />
294 /// <list type="table">
295 /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
296 /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
297 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
300 /// <since_tizen> 3 </since_tizen>
301 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
302 public PropertyMap FontStyle
306 return (PropertyMap)GetValue(FontStyleProperty);
310 SetValue(FontStyleProperty, value);
311 NotifyPropertyChanged();
316 /// Set FontStyle to TextField. <br />
318 /// <param name="fontStyle">The FontStyle</param>
320 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
323 /// The following example demonstrates how to use the SetFontStyle method.
325 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
326 /// fontStyle.Width = FontWidthType.Expanded;
327 /// fontStyle.Weight = FontWeightType.Bold;
328 /// fontStyle.Slant = FontSlantType.Italic;
329 /// field.SetFontStyle(fontStyle);
332 [EditorBrowsable(EditorBrowsableState.Never)]
333 public void SetFontStyle(FontStyle fontStyle)
335 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
337 SetValue(FontStyleProperty, fontStyleMap);
342 /// Get FontStyle from TextField. <br />
344 /// <returns>The FontStyle</returns>
346 /// <see cref="Tizen.NUI.Text.FontStyle"/>
348 [EditorBrowsable(EditorBrowsableState.Never)]
349 public FontStyle GetFontStyle()
352 using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty))
354 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
360 /// The PointSize property.<br />
361 /// The size of font in points.<br />
363 /// <since_tizen> 3 </since_tizen>
364 public float PointSize
368 return (float)GetValue(PointSizeProperty);
372 SetValue(PointSizeProperty, value);
373 NotifyPropertyChanged();
378 /// The MaxLength property.<br />
379 /// The maximum number of characters that can be inserted.<br />
381 /// <since_tizen> 3 </since_tizen>
386 return (int)GetValue(MaxLengthProperty);
390 SetValue(MaxLengthProperty, value);
391 NotifyPropertyChanged();
396 /// The ExceedPolicy property.<br />
397 /// Specifies how the text is truncated when it does not fit.<br />
399 /// <since_tizen> 3 </since_tizen>
400 public int ExceedPolicy
404 return (int)GetValue(ExceedPolicyProperty);
408 SetValue(ExceedPolicyProperty, value);
409 NotifyPropertyChanged();
414 /// The HorizontalAlignment property.<br />
415 /// The line horizontal alignment.<br />
417 /// <since_tizen> 3 </since_tizen>
418 public HorizontalAlignment HorizontalAlignment
422 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
426 SetValue(HorizontalAlignmentProperty, value);
427 NotifyPropertyChanged();
432 /// The VerticalAlignment property.<br />
433 /// The line vertical alignment.<br />
435 /// <since_tizen> 3 </since_tizen>
436 public VerticalAlignment VerticalAlignment
440 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
444 SetValue(VerticalAlignmentProperty, value);
445 NotifyPropertyChanged();
446 NotifyPropertyChanged();
451 /// The TextColor property.<br />
452 /// The color of the text.<br />
455 /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
457 /// <since_tizen> 3 </since_tizen>
458 public Color TextColor
462 Color temp = (Color)GetValue(TextColorProperty);
463 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
467 SetValue(TextColorProperty, value);
468 NotifyPropertyChanged();
473 /// The PlaceholderTextColor property.
476 /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
478 /// <since_tizen> 3 </since_tizen>
479 public Vector4 PlaceholderTextColor
483 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
484 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
488 SetValue(PlaceholderTextColorProperty, value);
489 NotifyPropertyChanged();
494 /// The ShadowOffset property.
496 /// <since_tizen> 3 </since_tizen>
498 /// Deprecated.(API Level 6) Use Shadow instead.
499 /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
501 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
502 public Vector2 ShadowOffset
506 return GetValue(ShadowOffsetProperty) as Vector2;
510 SetValue(ShadowOffsetProperty, value);
514 private Vector2 InternalShadowOffset
518 float x = 0.0f, y = 0.0f;
519 using (var propertyValue = Shadow.Find(TextField.Property.SHADOW, "offset"))
520 using (var shadowOffset = new Vector2())
522 if (null != propertyValue)
524 propertyValue.Get(shadowOffset);
529 return new Vector2(OnShadowOffsetChanged, x, y);
533 using (var map = new PropertyMap())
535 map.Add("offset", value);
536 var shadowMap = Shadow;
537 shadowMap.Merge(map);
538 SetValue(ShadowProperty, shadowMap);
539 NotifyPropertyChanged();
545 /// The ShadowColor property.
547 /// <since_tizen> 3 </since_tizen>
549 /// Deprecated.(API Level 6) Use Shadow instead.
550 /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
552 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
553 public Vector4 ShadowColor
557 return GetValue(ShadowColorProperty) as Vector4;
561 SetValue(ShadowColorProperty, value);
565 private Vector4 InternalShadowColor
569 float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f;
570 using (var propertyValue = Shadow.Find(TextField.Property.SHADOW, "color"))
571 using (var shadowColor = new Vector4())
573 if (null != propertyValue)
575 propertyValue.Get(shadowColor);
582 return new Vector4(OnShadowColorChanged, x, y, z, w);
586 using (var map = new PropertyMap())
588 map.Add("color", value);
589 var shadowMap = Shadow;
590 shadowMap.Merge(map);
591 SetValue(ShadowProperty, shadowMap);
592 NotifyPropertyChanged();
598 /// The PrimaryCursorColor property.<br />
599 /// The color to apply to the primary cursor.<br />
602 /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
604 /// <since_tizen> 3 </since_tizen>
605 public Vector4 PrimaryCursorColor
609 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
610 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
614 SetValue(PrimaryCursorColorProperty, value);
615 NotifyPropertyChanged();
620 /// The SecondaryCursorColor property.<br />
621 /// The color to apply to the secondary cursor.<br />
624 /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
626 /// <since_tizen> 3 </since_tizen>
627 public Vector4 SecondaryCursorColor
631 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
632 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
636 SetValue(SecondaryCursorColorProperty, value);
637 NotifyPropertyChanged();
642 /// The EnableCursorBlink property.<br />
643 /// Whether the cursor should blink or not.<br />
645 /// <since_tizen> 3 </since_tizen>
646 public bool EnableCursorBlink
650 return (bool)GetValue(EnableCursorBlinkProperty);
654 SetValue(EnableCursorBlinkProperty, value);
655 NotifyPropertyChanged();
660 /// The CursorBlinkInterval property.<br />
661 /// The time interval in seconds between cursor on/off states.<br />
663 /// <since_tizen> 3 </since_tizen>
664 public float CursorBlinkInterval
668 return (float)GetValue(CursorBlinkIntervalProperty);
672 SetValue(CursorBlinkIntervalProperty, value);
673 NotifyPropertyChanged();
678 /// The CursorBlinkDuration property.<br />
679 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
681 /// <since_tizen> 3 </since_tizen>
682 public float CursorBlinkDuration
686 return (float)GetValue(CursorBlinkDurationProperty);
690 SetValue(CursorBlinkDurationProperty, value);
691 NotifyPropertyChanged();
696 /// The CursorWidth property.
698 /// <since_tizen> 3 </since_tizen>
699 public int CursorWidth
703 return (int)GetValue(CursorWidthProperty);
707 SetValue(CursorWidthProperty, value);
708 NotifyPropertyChanged();
713 /// The GrabHandleImage property.<br />
714 /// The image to display for the grab handle.<br />
716 /// <since_tizen> 3 </since_tizen>
717 public string GrabHandleImage
721 return (string)GetValue(GrabHandleImageProperty);
725 SetValue(GrabHandleImageProperty, value);
726 NotifyPropertyChanged();
731 /// The GrabHandlePressedImage property.<br />
732 /// The image to display when the grab handle is pressed.<br />
734 /// <since_tizen> 3 </since_tizen>
735 public string GrabHandlePressedImage
739 return (string)GetValue(GrabHandlePressedImageProperty);
743 SetValue(GrabHandlePressedImageProperty, value);
744 NotifyPropertyChanged();
749 /// The ScrollThreshold property.<br />
750 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
752 /// <since_tizen> 3 </since_tizen>
753 public float ScrollThreshold
757 return (float)GetValue(ScrollThresholdProperty);
761 SetValue(ScrollThresholdProperty, value);
762 NotifyPropertyChanged();
767 /// The ScrollSpeed property.<br />
768 /// The scroll speed in pixels per second.<br />
770 /// <since_tizen> 3 </since_tizen>
771 public float ScrollSpeed
775 return (float)GetValue(ScrollSpeedProperty);
779 SetValue(ScrollSpeedProperty, value);
780 NotifyPropertyChanged();
785 /// The SelectionHandleImageLeft property.<br />
786 /// The image to display for the left selection handle.<br />
787 /// The selectionHandleImageLeft map contains the following key :<br />
788 /// <list type="table">
789 /// <item><term>filename (string)</term><description>The path of image file</description></item>
792 /// <since_tizen> 3 </since_tizen>
793 public PropertyMap SelectionHandleImageLeft
797 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
801 SetValue(SelectionHandleImageLeftProperty, value);
802 NotifyPropertyChanged();
807 /// The SelectionHandleImageRight property.<br />
808 /// The image to display for the right selection handle.<br />
809 /// The selectionHandleImageRight map contains the following key :<br />
810 /// <list type="table">
811 /// <item><term>filename (string)</term><description>The path of image file</description></item>
814 /// <since_tizen> 3 </since_tizen>
815 public PropertyMap SelectionHandleImageRight
819 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
823 SetValue(SelectionHandleImageRightProperty, value);
824 NotifyPropertyChanged();
829 /// Set SelectionHandleImage to TextField. <br />
831 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
833 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
836 /// The following example demonstrates how to use the SetSelectionHandleImage method.
838 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
839 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
840 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
841 /// field.SetSelectionHandleImage(selectionHandleImage);
844 [EditorBrowsable(EditorBrowsableState.Never)]
845 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
847 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
849 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
851 SetValue(SelectionHandleImageLeftProperty, leftImageMap);
855 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
857 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
859 SetValue(SelectionHandleImageRightProperty, rightImageMap);
865 /// Get SelectionHandleImage from TextField. <br />
867 /// <returns>The SelectionHandleImage</returns>
869 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
871 [EditorBrowsable(EditorBrowsableState.Never)]
872 public SelectionHandleImage GetSelectionHandleImage()
874 SelectionHandleImage selectionHandleImage;
875 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
876 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
878 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
880 return selectionHandleImage;
884 /// The SelectionHandlePressedImageLeft property.<br />
885 /// The image to display when the left selection handle is pressed.<br />
886 /// The selectionHandlePressedImageLeft map contains the following key :<br />
887 /// <list type="table">
888 /// <item><term>filename (string)</term><description>The path of image file</description></item>
891 /// <since_tizen> 3 </since_tizen>
892 public PropertyMap SelectionHandlePressedImageLeft
896 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
900 SetValue(SelectionHandlePressedImageLeftProperty, value);
901 NotifyPropertyChanged();
906 /// The SelectionHandlePressedImageRight property.<br />
907 /// The image to display when the right selection handle is pressed.<br />
908 /// The selectionHandlePressedImageRight map contains the following key :<br />
909 /// <list type="table">
910 /// <item><term>filename (string)</term><description>The path of image file</description></item>
913 /// <since_tizen> 3 </since_tizen>
914 public PropertyMap SelectionHandlePressedImageRight
918 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
922 SetValue(SelectionHandlePressedImageRightProperty, value);
923 NotifyPropertyChanged();
928 /// Set SelectionHandlePressedImage to TextField. <br />
930 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
932 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
935 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
937 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
938 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
939 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
940 /// field.SetSelectionHandlePressedImage(selectionHandlePressedImage);
943 [EditorBrowsable(EditorBrowsableState.Never)]
944 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
946 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
948 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
950 SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
954 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
956 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
958 SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
964 /// Get SelectionHandlePressedImage from TextField. <br />
966 /// <returns>The SelectionHandlePressedImage</returns>
968 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
970 [EditorBrowsable(EditorBrowsableState.Never)]
971 public SelectionHandleImage GetSelectionHandlePressedImage()
973 SelectionHandleImage selectionHandleImage;
974 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
975 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
977 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
979 return selectionHandleImage;
983 /// The SelectionHandleMarkerImageLeft property.<br />
984 /// The image to display for the left selection handle marker.<br />
985 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
986 /// <list type="table">
987 /// <item><term>filename (string)</term><description>The path of image file</description></item>
990 /// <since_tizen> 3 </since_tizen>
991 public PropertyMap SelectionHandleMarkerImageLeft
995 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
999 SetValue(SelectionHandleMarkerImageLeftProperty, value);
1000 NotifyPropertyChanged();
1005 /// The SelectionHandleMarkerImageRight property.<br />
1006 /// The image to display for the right selection handle marker.<br />
1007 /// The selectionHandleMarkerImageRight map contains the following key :<br />
1008 /// <list type="table">
1009 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1012 /// <since_tizen> 3 </since_tizen>
1013 public PropertyMap SelectionHandleMarkerImageRight
1017 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
1021 SetValue(SelectionHandleMarkerImageRightProperty, value);
1022 NotifyPropertyChanged();
1027 /// Set SelectionHandleMarkerImage to TextField. <br />
1029 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
1031 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
1034 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
1036 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
1037 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
1038 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
1039 /// field.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
1042 [EditorBrowsable(EditorBrowsableState.Never)]
1043 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
1045 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
1047 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
1049 SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
1053 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
1055 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
1057 SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
1063 /// Get SelectionHandleMarkerImage from TextField. <br />
1065 /// <returns>The SelectionHandleMarkerImage</returns>
1067 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
1069 [EditorBrowsable(EditorBrowsableState.Never)]
1070 public SelectionHandleImage GetSelectionHandleMarkerImage()
1072 SelectionHandleImage selectionHandleImage;
1073 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
1074 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
1076 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
1078 return selectionHandleImage;
1082 /// The SelectionHighlightColor property.<br />
1083 /// The color of the selection highlight.<br />
1086 /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
1088 /// <since_tizen> 3 </since_tizen>
1089 public Vector4 SelectionHighlightColor
1093 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
1094 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1098 SetValue(SelectionHighlightColorProperty, value);
1099 NotifyPropertyChanged();
1104 /// The DecorationBoundingBox property.<br />
1105 /// The decorations (handles etc) will positioned within this area on-screen.<br />
1108 /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
1110 /// <since_tizen> 3 </since_tizen>
1111 public Rectangle DecorationBoundingBox
1115 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
1116 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
1120 SetValue(DecorationBoundingBoxProperty, value);
1121 NotifyPropertyChanged();
1126 /// The InputMethodSettings property.<br />
1127 /// The settings to relating to the System's Input Method, Key and Value.<br />
1130 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1133 /// The following example demonstrates how to set the InputMethodSettings property.
1135 /// InputMethod method = new InputMethod();
1136 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1137 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1138 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1139 /// method.Variation = 1;
1140 /// textField.InputMethodSettings = method.OutputMap;
1143 /// <since_tizen> 3 </since_tizen>
1144 public PropertyMap InputMethodSettings
1148 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1152 SetValue(InputMethodSettingsProperty, value);
1153 NotifyPropertyChanged();
1158 /// The InputColor property.<br />
1159 /// The color of the new input text.<br />
1162 /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
1164 /// <since_tizen> 3 </since_tizen>
1165 public Vector4 InputColor
1169 Vector4 temp = (Vector4)GetValue(InputColorProperty);
1170 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1174 SetValue(InputColorProperty, value);
1175 NotifyPropertyChanged();
1180 /// The EnableMarkup property.<br />
1181 /// Whether the mark-up processing is enabled.<br />
1183 /// <since_tizen> 3 </since_tizen>
1184 public bool EnableMarkup
1188 return (bool)GetValue(EnableMarkupProperty);
1192 SetValue(EnableMarkupProperty, value);
1193 NotifyPropertyChanged();
1198 /// The InputFontFamily property.<br />
1199 /// The font's family of the new input text.<br />
1201 /// <since_tizen> 3 </since_tizen>
1202 public string InputFontFamily
1206 return (string)GetValue(InputFontFamilyProperty);
1210 SetValue(InputFontFamilyProperty, value);
1211 NotifyPropertyChanged();
1216 /// The InputFontStyle property.<br />
1217 /// The font's style of the new input text.<br />
1218 /// The inputFontStyle map contains the following keys :<br />
1219 /// <list type="table">
1220 /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
1221 /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
1222 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
1225 /// <since_tizen> 3 </since_tizen>
1226 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1227 public PropertyMap InputFontStyle
1231 return (PropertyMap)GetValue(InputFontStyleProperty);
1235 SetValue(InputFontStyleProperty, value);
1236 NotifyPropertyChanged();
1241 /// Set InputFontStyle to TextField. <br />
1243 /// <param name="fontStyle">The FontStyle</param>
1245 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
1248 /// The following example demonstrates how to use the SetInputFontStyle method.
1250 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
1251 /// fontStyle.Width = FontWidthType.Expanded;
1252 /// fontStyle.Weight = FontWeightType.Bold;
1253 /// fontStyle.Slant = FontSlantType.Italic;
1254 /// field.SetInputFontStyle(fontStyle);
1257 [EditorBrowsable(EditorBrowsableState.Never)]
1258 public void SetInputFontStyle(FontStyle fontStyle)
1260 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
1262 SetValue(InputFontStyleProperty, fontStyleMap);
1267 /// Get InputFontStyle from TextField. <br />
1269 /// <returns>The FontStyle</returns>
1271 /// <see cref="Tizen.NUI.Text.FontStyle"/>
1273 [EditorBrowsable(EditorBrowsableState.Never)]
1274 public FontStyle GetInputFontStyle()
1276 FontStyle fontStyle;
1277 using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
1279 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
1285 /// The InputPointSize property.<br />
1286 /// The font's size of the new input text in points.<br />
1288 /// <since_tizen> 3 </since_tizen>
1289 public float InputPointSize
1293 return (float)GetValue(InputPointSizeProperty);
1297 SetValue(InputPointSizeProperty, value);
1298 NotifyPropertyChanged();
1303 /// The Underline property.<br />
1304 /// The default underline parameters.<br />
1305 /// The underline map contains the following keys :<br />
1306 /// <list type="table">
1307 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1308 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1309 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1312 /// <since_tizen> 3 </since_tizen>
1313 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1314 public PropertyMap Underline
1318 return (PropertyMap)GetValue(UnderlineProperty);
1322 SetValue(UnderlineProperty, value);
1323 NotifyPropertyChanged();
1328 /// Set Underline to TextField. <br />
1330 /// <param name="underline">The Underline</param>
1332 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1335 /// The following example demonstrates how to use the SetUnderline method.
1337 /// var underline = new Tizen.NUI.Text.Underline();
1338 /// underline.Enable = true;
1339 /// underline.Color = new Color("#3498DB");
1340 /// underline.Height = 2.0f;
1341 /// field.SetUnderline(underline);
1344 [EditorBrowsable(EditorBrowsableState.Never)]
1345 public void SetUnderline(Underline underline)
1347 using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1349 SetValue(UnderlineProperty, underlineMap);
1354 /// Get Underline from TextField. <br />
1356 /// <returns>The Underline</returns>
1358 /// <see cref="Tizen.NUI.Text.Underline"/>
1360 [EditorBrowsable(EditorBrowsableState.Never)]
1361 public Underline GetUnderline()
1363 Underline underline;
1364 using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1366 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1372 /// The InputUnderline property.<br />
1373 /// The underline parameters of the new input text.<br />
1375 /// <since_tizen> 3 </since_tizen>
1376 public string InputUnderline
1380 return (string)GetValue(InputUnderlineProperty);
1384 SetValue(InputUnderlineProperty, value);
1385 NotifyPropertyChanged();
1390 /// The Shadow property.<br />
1391 /// The default shadow parameters.<br />
1392 /// The shadow map contains the following keys :<br />
1393 /// <list type="table">
1394 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1395 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1396 /// <item><term>blurRadius (float)</term><description>The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled)</description></item>
1399 /// <since_tizen> 3 </since_tizen>
1400 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1401 public PropertyMap Shadow
1405 return (PropertyMap)GetValue(ShadowProperty);
1409 SetValue(ShadowProperty, value);
1410 NotifyPropertyChanged();
1415 /// Set Shadow to TextField. <br />
1417 /// <param name="shadow">The Shadow</param>
1419 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1422 /// The following example demonstrates how to use the SetShadow method.
1424 /// var shadow = new Tizen.NUI.Text.Shadow();
1425 /// shadow.Offset = new Vector2(3, 3);
1426 /// shadow.Color = new Color("#F1C40F");
1427 /// field.SetShadow(shadow);
1430 [EditorBrowsable(EditorBrowsableState.Never)]
1431 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1433 using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1435 SetValue(ShadowProperty, shadowMap);
1440 /// Get Shadow from TextField. <br />
1442 /// <returns>The Shadow</returns>
1444 /// <see cref="Tizen.NUI.Text.Shadow"/>
1446 [EditorBrowsable(EditorBrowsableState.Never)]
1447 public Tizen.NUI.Text.Shadow GetShadow()
1449 Tizen.NUI.Text.Shadow shadow;
1450 using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
1452 shadow = TextMapHelper.GetShadowStruct(shadowMap);
1458 /// The InputShadow property.<br />
1459 /// The shadow parameters of the new input text.<br />
1461 /// <since_tizen> 3 </since_tizen>
1462 public string InputShadow
1466 return (string)GetValue(InputShadowProperty);
1470 SetValue(InputShadowProperty, value);
1471 NotifyPropertyChanged();
1476 /// The Emboss property.<br />
1477 /// The default emboss parameters.<br />
1479 /// <since_tizen> 3 </since_tizen>
1480 public string Emboss
1484 return (string)GetValue(EmbossProperty);
1488 SetValue(EmbossProperty, value);
1489 NotifyPropertyChanged();
1494 /// The InputEmboss property.<br />
1495 /// The emboss parameters of the new input text.<br />
1497 /// <since_tizen> 3 </since_tizen>
1498 public string InputEmboss
1502 return (string)GetValue(InputEmbossProperty);
1506 SetValue(InputEmbossProperty, value);
1507 NotifyPropertyChanged();
1512 /// The Outline property.<br />
1513 /// The default outline parameters.<br />
1514 /// The outline map contains the following keys :<br />
1515 /// <list type="table">
1516 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1517 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1520 /// <since_tizen> 3 </since_tizen>
1521 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1522 public PropertyMap Outline
1526 return (PropertyMap)GetValue(OutlineProperty);
1530 SetValue(OutlineProperty, value);
1531 NotifyPropertyChanged();
1536 /// Set Outline to TextField. <br />
1538 /// <param name="outline">The Outline</param>
1540 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1543 /// The following example demonstrates how to use the SetOutline method.
1545 /// var outline = new Tizen.NUI.Text.Outline();
1546 /// outline.Width = 2.0f;
1547 /// outline.Color = new Color("#45B39D");
1548 /// field.SetOutline(outline);
1551 [EditorBrowsable(EditorBrowsableState.Never)]
1552 public void SetOutline(Outline outline)
1554 using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
1556 SetValue(OutlineProperty, outlineMap);
1561 /// Get Outline from TextField. <br />
1563 /// <returns>The Outline</returns>
1565 /// <see cref="Tizen.NUI.Text.Outline"/>
1567 [EditorBrowsable(EditorBrowsableState.Never)]
1568 public Outline GetOutline()
1571 using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
1573 outline = TextMapHelper.GetOutlineStruct(outlineMap);
1579 /// The InputOutline property.<br />
1580 /// The outline parameters of the new input text.<br />
1582 /// <since_tizen> 3 </since_tizen>
1583 public string InputOutline
1587 return (string)GetValue(InputOutlineProperty);
1591 SetValue(InputOutlineProperty, value);
1592 NotifyPropertyChanged();
1597 /// The HiddenInputSettings property.<br />
1598 /// Hides the input characters and instead shows a default character for password or pin entry.<br />
1599 /// The hiddenInputSettings map contains the following keys :<br />
1600 /// <list type="table">
1601 /// <item><term>HiddenInputProperty.Mode (int)</term><description>The mode for input text display (Use HiddenInputModeType)</description></item>
1602 /// <item><term>HiddenInputProperty.SubstituteCharacter (int)</term><description>All input characters are substituted by this character</description></item>
1603 /// <item><term>HiddenInputProperty.SubstituteCount (int)</term><description>Length of text to show or hide, available when HideCount/ShowCount mode is used</description></item>
1604 /// <item><term>HiddenInputProperty.ShowLastCharacterDuration (int)</term><description>Hide last character after this duration, available when ShowLastCharacter mode</description></item>
1608 /// See <see cref="HiddenInputProperty"/> and <see cref="HiddenInputModeType"/> for a detailed description.
1611 /// The following example demonstrates how to set the HiddenInputSettings property.
1613 /// PropertyMap map = new PropertyMap();
1614 /// map.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter));
1615 /// map.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(500));
1616 /// map.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x2A));
1617 /// textField.HiddenInputSettings = map;
1620 /// <since_tizen> 3 </since_tizen>
1621 public Tizen.NUI.PropertyMap HiddenInputSettings
1625 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1629 SetValue(HiddenInputSettingsProperty, value);
1630 NotifyPropertyChanged();
1635 /// Set HiddenInput to TextField. <br />
1637 /// <param name="hiddenInput">The HiddenInput</param>
1639 /// SetHiddenInput specifies the requested font style through <see cref="Tizen.NUI.Text.HiddenInput"/>. <br />
1642 /// The following example demonstrates how to use the SetHiddenInput method.
1644 /// var hiddenInput = new Tizen.NUI.Text.HiddenInput();
1645 /// hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
1646 /// hiddenInput.SubstituteCharacter = '★';
1647 /// hiddenInput.SubstituteCount = 0;
1648 /// hiddenInput.ShowLastCharacterDuration = 1000;
1649 /// field.SetHiddenInput(hiddenInput);
1652 [EditorBrowsable(EditorBrowsableState.Never)]
1653 public void SetHiddenInput(HiddenInput hiddenInput)
1655 using (var hiddenInputMap = TextMapHelper.GetHiddenInputMap(hiddenInput))
1657 SetValue(HiddenInputSettingsProperty, hiddenInputMap);
1662 /// Get HiddenInput from TextField. <br />
1664 /// <returns>The HiddenInput</returns>
1666 /// <see cref="Tizen.NUI.Text.HiddenInput"/>
1668 [EditorBrowsable(EditorBrowsableState.Never)]
1669 public HiddenInput GetHiddenInput()
1671 HiddenInput hiddenInput;
1672 using (var hiddenInputMap = (PropertyMap)GetValue(HiddenInputSettingsProperty))
1674 hiddenInput = TextMapHelper.GetHiddenInputStruct(hiddenInputMap);
1680 /// The PixelSize property.<br />
1681 /// The size of font in pixels.<br />
1683 /// <since_tizen> 3 </since_tizen>
1684 public float PixelSize
1688 return (float)GetValue(PixelSizeProperty);
1692 SetValue(PixelSizeProperty, value);
1693 NotifyPropertyChanged();
1698 /// The Enable selection property.<br />
1699 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1701 /// <since_tizen> 3 </since_tizen>
1702 public bool EnableSelection
1706 return (bool)GetValue(EnableSelectionProperty);
1710 SetValue(EnableSelectionProperty, value);
1711 NotifyPropertyChanged();
1716 /// The Enable grab handle property.<br />
1717 /// Enables the grab handles for text selection.<br />
1718 /// The default value is true, which means the grab handles are enabled by default.<br />
1720 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1721 [EditorBrowsable(EditorBrowsableState.Never)]
1722 public bool EnableGrabHandle
1726 return (bool)GetValue(EnableGrabHandleProperty);
1730 SetValue(EnableGrabHandleProperty, value);
1731 NotifyPropertyChanged();
1736 /// The Enable grab handle popup property.<br />
1737 /// Enables the grab handle popup for text selection.<br />
1738 /// The default value is true, which means the grab handle popup is enabled by default.<br />
1740 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1741 [EditorBrowsable(EditorBrowsableState.Never)]
1742 public bool EnableGrabHandlePopup
1746 return (bool)GetValue(EnableGrabHandlePopupProperty);
1750 SetValue(EnableGrabHandlePopupProperty, value);
1751 NotifyPropertyChanged();
1756 /// The portion of the text that has been selected by the user.
1759 /// Empty string when nothing is selected.
1761 /// <since_tizen> 9 </since_tizen>
1762 public string SelectedText
1766 string selectedText;
1767 using (var propertyValue = GetProperty(TextField.Property.SelectedText))
1769 propertyValue.Get(out selectedText);
1771 return selectedText;
1776 /// The start index for selection.
1779 /// When there is no selection, the index is current cursor position.
1781 /// <since_tizen> 9 </since_tizen>
1782 public int SelectedTextStart
1786 int selectedTextStart;
1787 using (var propertyValue = GetProperty(TextField.Property.SelectedTextStart))
1789 propertyValue.Get(out selectedTextStart);
1791 return selectedTextStart;
1796 /// The end index for selection.
1799 /// When there is no selection, the index is current cursor position.
1801 /// <since_tizen> 9 </since_tizen>
1802 public int SelectedTextEnd
1806 int selectedTextEnd;
1807 using (var propertyValue = GetProperty(TextField.Property.SelectedTextEnd))
1809 propertyValue.Get(out selectedTextEnd);
1811 return selectedTextEnd;
1816 /// Enable editing in text control.
1818 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1819 [EditorBrowsable(EditorBrowsableState.Never)]
1820 public bool EnableEditing
1824 return (bool)GetValue(EnableEditingProperty);
1828 SetValue(EnableEditingProperty, value);
1832 private bool InternalEnableEditing
1837 using (var propertyValue = GetProperty(TextField.Property.EnableEditing))
1839 propertyValue.Get(out enableEditing);
1841 return enableEditing;
1845 using (var propertyValue = new PropertyValue(value))
1847 SetProperty(TextField.Property.EnableEditing, propertyValue);
1848 NotifyPropertyChanged();
1854 /// Specify primary cursor (caret) position in text control.
1856 [EditorBrowsable(EditorBrowsableState.Never)]
1857 public int PrimaryCursorPosition
1861 return (int)GetValue(PrimaryCursorPositionProperty);
1865 SetValue(PrimaryCursorPositionProperty, value);
1869 private int InternalPrimaryCursorPosition
1873 int primaryCursorPosition;
1874 using (var propertyValue = GetProperty(TextField.Property.PrimaryCursorPosition))
1876 propertyValue.Get(out primaryCursorPosition);
1878 return primaryCursorPosition;
1882 using (PropertyValue propertyValue = new PropertyValue(value))
1884 SetProperty(TextField.Property.PrimaryCursorPosition, propertyValue);
1885 NotifyPropertyChanged();
1891 /// The GrabHandleColor property.
1894 /// The property cascade chaining set is possible. For example, this (textField.GrabHandleColor.X = 0.1f;) is possible.
1896 [EditorBrowsable(EditorBrowsableState.Never)]
1897 public Color GrabHandleColor
1901 Color temp = (Color)GetValue(GrabHandleColorProperty);
1902 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1906 SetValue(GrabHandleColorProperty, value);
1907 NotifyPropertyChanged();
1912 /// The ellipsis position of the text.
1913 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1915 /// <since_tizen> 9 </since_tizen>
1916 public EllipsisPosition EllipsisPosition
1920 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1924 SetValue(EllipsisPositionProperty, value);
1925 NotifyPropertyChanged();
1930 /// Set InputFilter to TextField.
1932 /// <param name="inputFilter">The InputFilter</param>
1934 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1935 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1936 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1939 /// The following example demonstrates how to use the SetInputFilter method.
1941 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1942 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1943 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1944 /// field.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1947 /// <since_tizen> 9 </since_tizen>
1948 public void SetInputFilter(InputFilter inputFilter)
1950 using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1951 using (var propertyValue = new PropertyValue(map))
1953 SetProperty(TextField.Property.InputFilter, propertyValue);
1958 /// Get InputFilter from TextField.
1960 /// <returns>The InputFilter</returns>
1962 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1964 /// <since_tizen> 9 </since_tizen>
1965 public InputFilter GetInputFilter()
1967 InputFilter inputFilter;
1968 using (var propertyValue = GetProperty(TextField.Property.InputFilter))
1969 using (var map = new PropertyMap())
1971 propertyValue.Get(map);
1972 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1978 /// The Placeholder property.
1979 /// The placeholder map contains the following keys :<br />
1980 /// <list type="table">
1981 /// <item><term>text (string)</term><description>The text to display when the TextField is empty and inactive</description></item>
1982 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1983 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1984 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1985 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1986 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1987 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1988 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1992 /// The following example demonstrates how to set the Placeholder property.
1994 /// PropertyMap propertyMap = new PropertyMap();
1995 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1996 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1997 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1998 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1999 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
2001 /// PropertyMap fontStyleMap = new PropertyMap();
2002 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
2003 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
2004 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
2005 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
2007 /// TextField field = new TextField();
2008 /// field.Placeholder = propertyMap;
2011 /// <since_tizen> 3 </since_tizen>
2012 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
2013 public Tizen.NUI.PropertyMap Placeholder
2017 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
2018 string defalutText = "";
2020 if (TextMapHelper.IsValue(map, 0))
2021 map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
2023 if (TextMapHelper.IsValue(map, 1))
2024 map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
2026 if (TextMapHelper.IsValue(map, 2))
2028 using (var color = TextMapHelper.GetColorFromMap(map, 2))
2030 map.Add("color", color);
2034 if (TextMapHelper.IsValue(map, 3))
2035 map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
2037 if (TextMapHelper.IsValue(map, 4))
2039 using (var properyValue = map.Find(4))
2040 using (var fontStyle = new PropertyMap())
2042 properyValue.Get(fontStyle);
2043 using (var fontStyleValue = new PropertyValue(fontStyle))
2045 map.Add("fontStyle", fontStyleValue);
2050 if (TextMapHelper.IsValue(map, 5))
2051 map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
2053 if (TextMapHelper.IsValue(map, 6))
2054 map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
2056 if (TextMapHelper.IsValue(map, 7))
2057 map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
2063 SetValue(PlaceholderProperty, value);
2064 NotifyPropertyChanged();
2069 /// Set Placeholder to TextField. <br />
2071 /// <param name="placeholder">The Placeholder</param>
2073 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
2076 /// The following example demonstrates how to use the SetPlaceholder method.
2078 /// var placeholder = new Tizen.NUI.Text.Placeholder();
2079 /// placeholder.Text = "placeholder text";
2080 /// placeholder.TextFocused = "placeholder textFocused";
2081 /// placeholder.Color = new Color("#45B39D");
2082 /// placeholder.FontFamily = "BreezeSans";
2083 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
2085 /// Width = FontWidthType.Expanded,
2086 /// Weight = FontWeightType.ExtraLight,
2087 /// Slant = FontSlantType.Italic,
2089 /// placeholder.PointSize = 25.0f;
2090 /// //placeholder.PixelSize = 50.0f;
2091 /// placeholder.Ellipsis = true;
2092 /// field.SetPlaceholder(placeholder);
2095 [EditorBrowsable(EditorBrowsableState.Never)]
2096 public void SetPlaceholder(Placeholder placeholder)
2098 using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
2100 SetValue(PlaceholderProperty, placeholderMap);
2105 /// Get Placeholder from TextField. <br />
2107 /// <returns>The Placeholder</returns>
2109 /// <see cref="Tizen.NUI.Text.Placeholder"/>
2111 [EditorBrowsable(EditorBrowsableState.Never)]
2112 public Placeholder GetPlaceholder()
2114 Placeholder placeholder;
2115 using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
2117 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
2123 /// The Ellipsis property.<br />
2124 /// Enable or disable the ellipsis.<br />
2125 /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
2127 /// <since_tizen> 4 </since_tizen>
2128 public bool Ellipsis
2132 return (bool)GetValue(EllipsisProperty);
2136 SetValue(EllipsisProperty, value);
2137 NotifyPropertyChanged();
2142 /// Enables selection of the text using the Shift key.
2144 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2145 [EditorBrowsable(EditorBrowsableState.Never)]
2146 public bool EnableShiftSelection
2150 return (bool)GetValue(EnableShiftSelectionProperty);
2154 SetValue(EnableShiftSelectionProperty, value);
2155 NotifyPropertyChanged();
2160 /// The text alignment to match the direction of the system language.<br />
2161 /// The default value is true.<br />
2163 /// <since_tizen> 6 </since_tizen>
2164 public bool MatchSystemLanguageDirection
2168 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2172 SetValue(MatchSystemLanguageDirectionProperty, value);
2173 NotifyPropertyChanged();
2178 /// The FontSizeScale property. <br />
2179 /// The default value is 1.0. <br />
2180 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2181 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2183 /// <since_tizen> 9 </since_tizen>
2184 public float FontSizeScale
2188 return fontSizeScale;
2192 float newFontSizeScale;
2194 if (fontSizeScale == value) return;
2196 fontSizeScale = value;
2197 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2199 SystemSettingsFontSize systemSettingsFontSize;
2203 systemSettingsFontSize = SystemSettings.FontSize;
2207 Console.WriteLine("{0} Exception caught.", e);
2208 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2210 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2211 addFontSizeChangedCallback();
2215 newFontSizeScale = fontSizeScale;
2216 removeFontSizeChangedCallback();
2219 SetValue(FontSizeScaleProperty, newFontSizeScale);
2220 NotifyPropertyChanged();
2224 /// Only used by the IL of xaml, will never changed to not hidden.
2225 [EditorBrowsable(EditorBrowsableState.Never)]
2226 public override bool IsCreateByXaml
2230 return base.IsCreateByXaml;
2234 base.IsCreateByXaml = value;
2238 this.TextChanged += (obj, e) =>
2240 this.Text = e.TextField.Text;
2247 /// Get the InputMethodContext instance.
2249 /// <returns>The InputMethodContext instance.</returns>
2250 /// <since_tizen> 5 </since_tizen>
2251 public InputMethodContext GetInputMethodContext()
2253 if (inputMethodCotext == null)
2255 /*Avoid raising InputMethodContext reference count.*/
2256 inputMethodCotext = new InputMethodContext(Interop.TextField.GetInputMethodContext(SwigCPtr), true);
2257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2259 return inputMethodCotext;
2263 /// Select the whole text.
2265 /// <since_tizen> 9 </since_tizen>
2266 public void SelectWholeText()
2268 Interop.TextField.SelectWholeText(SwigCPtr);
2269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2273 /// Select text from start to end index. <br />
2274 /// The index is valid when 0 or positive.
2276 /// <param name="start">The start index for selection.</param>
2277 /// <param name="end">The end index for selection.</param>
2279 /// If the end index exceeds the maximum value, it is set to the length of the text.
2281 /// <since_tizen> 9 </since_tizen>
2282 public void SelectText(int start, int end)
2285 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2287 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2289 Interop.TextField.SelectText(SwigCPtr, (uint)start, (uint)end);
2290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2294 /// Clear selection of the text. <br />
2295 /// Valid when selection is activate.
2297 /// <since_tizen> 9 </since_tizen>
2298 public void SelectNone()
2300 _ = Interop.TextField.SelectNone(SwigCPtr);
2301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2304 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
2306 SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(Interop.TextField.InputStyleChangedSignal(SwigCPtr));
2307 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2314 /// <since_tizen> 3 </since_tizen>
2315 protected override void Dispose(DisposeTypes type)
2319 DisposeQueue.Instance.Add(this);
2323 if (systemlangTextFlag)
2325 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2328 removeFontSizeChangedCallback();
2330 if (type == DisposeTypes.Explicit)
2333 //Release your own managed resources here.
2334 //You should release all of your own disposable objects here.
2337 //Release your own unmanaged resources here.
2338 //You should not access any managed member here except static instance.
2339 //because the execution order of Finalizes is non-deterministic.
2342 if (textFieldCursorPositionChangedCallbackDelegate != null)
2344 this.CursorPositionChangedSignal().Disconnect(textFieldCursorPositionChangedCallbackDelegate);
2347 if (textFieldMaxLengthReachedCallbackDelegate != null)
2349 this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
2352 if (textFieldSelectionClearedCallbackDelegate != null)
2354 this.SelectionClearedSignal().Disconnect(textFieldSelectionClearedCallbackDelegate);
2357 if (textFieldSelectionChangedCallbackDelegate != null)
2359 this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate);
2362 if (textFieldTextChangedCallbackDelegate != null)
2364 TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate);
2371 /// This will not be public opened.
2372 [EditorBrowsable(EditorBrowsableState.Never)]
2373 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2375 // In order to speed up IME hide, temporarily add
2376 GetInputMethodContext()?.DestroyContext();
2377 Interop.TextField.DeleteTextField(swigCPtr);
2380 private string SetTranslatable(string textFieldSid)
2382 string translatableText = null;
2383 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2384 if (translatableText != null)
2386 if (systemlangTextFlag == false)
2388 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2389 systemlangTextFlag = true;
2391 return translatableText;
2395 translatableText = "";
2396 return translatableText;
2400 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2402 if (textFieldTextSid != null)
2404 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2406 if (textFieldPlaceHolderTextSid != null)
2408 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2410 if (textFieldPlaceHolderTextFocusedSid != null)
2412 PlaceholderTextFocused = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextFocusedSid, new CultureInfo(e.Value.Replace("_", "-")));
2416 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2418 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2419 SetValue(FontSizeScaleProperty, newFontSizeScale);
2420 NotifyPropertyChanged();
2423 private void addFontSizeChangedCallback()
2425 if (hasFontSizeChangedCallback != true)
2429 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2430 hasFontSizeChangedCallback = true;
2434 Console.WriteLine("{0} Exception caught.", e);
2435 hasFontSizeChangedCallback = false;
2440 private void removeFontSizeChangedCallback()
2442 if (hasFontSizeChangedCallback == true)
2446 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2447 hasFontSizeChangedCallback = false;
2451 Console.WriteLine("{0} Exception caught.", e);
2452 hasFontSizeChangedCallback = true;
2457 internal new class Property
2459 internal static readonly int TEXT = Interop.TextField.TextGet();
2460 internal static readonly int PlaceholderText = Interop.TextField.PlaceholderTextGet();
2461 internal static readonly int PlaceholderTextFocused = Interop.TextField.PlaceholderTextFocusedGet();
2462 internal static readonly int FontFamily = Interop.TextField.FontFamilyGet();
2463 internal static readonly int FontStyle = Interop.TextField.FontStyleGet();
2464 internal static readonly int PointSize = Interop.TextField.PointSizeGet();
2465 internal static readonly int MaxLength = Interop.TextField.MaxLengthGet();
2466 internal static readonly int ExceedPolicy = Interop.TextField.ExceedPolicyGet();
2467 internal static readonly int HorizontalAlignment = Interop.TextField.HorizontalAlignmentGet();
2468 internal static readonly int VerticalAlignment = Interop.TextField.VerticalAlignmentGet();
2469 internal static readonly int TextColor = Interop.TextField.TextColorGet();
2470 internal static readonly int PlaceholderTextColor = Interop.TextField.PlaceholderTextColorGet();
2471 internal static readonly int PrimaryCursorColor = Interop.TextField.PrimaryCursorColorGet();
2472 internal static readonly int SecondaryCursorColor = Interop.TextField.SecondaryCursorColorGet();
2473 internal static readonly int EnableCursorBlink = Interop.TextField.EnableCursorBlinkGet();
2474 internal static readonly int CursorBlinkInterval = Interop.TextField.CursorBlinkIntervalGet();
2475 internal static readonly int CursorBlinkDuration = Interop.TextField.CursorBlinkDurationGet();
2476 internal static readonly int CursorWidth = Interop.TextField.CursorWidthGet();
2477 internal static readonly int GrabHandleImage = Interop.TextField.GrabHandleImageGet();
2478 internal static readonly int GrabHandlePressedImage = Interop.TextField.GrabHandlePressedImageGet();
2479 internal static readonly int ScrollThreshold = Interop.TextField.ScrollThresholdGet();
2480 internal static readonly int ScrollSpeed = Interop.TextField.ScrollSpeedGet();
2481 internal static readonly int SelectionHandleImageLeft = Interop.TextField.SelectionHandleImageLeftGet();
2482 internal static readonly int SelectionHandleImageRight = Interop.TextField.SelectionHandleImageRightGet();
2483 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextField.SelectionHandlePressedImageLeftGet();
2484 internal static readonly int SelectionHandlePressedImageRight = Interop.TextField.SelectionHandlePressedImageRightGet();
2485 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextField.SelectionHandleMarkerImageLeftGet();
2486 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextField.SelectionHandleMarkerImageRightGet();
2487 internal static readonly int SelectionHighlightColor = Interop.TextField.SelectionHighlightColorGet();
2488 internal static readonly int DecorationBoundingBox = Interop.TextField.DecorationBoundingBoxGet();
2489 internal static readonly int InputMethodSettings = Interop.TextField.InputMethodSettingsGet();
2490 internal static readonly int InputColor = Interop.TextField.InputColorGet();
2491 internal static readonly int EnableMarkup = Interop.TextField.EnableMarkupGet();
2492 internal static readonly int InputFontFamily = Interop.TextField.InputFontFamilyGet();
2493 internal static readonly int InputFontStyle = Interop.TextField.InputFontStyleGet();
2494 internal static readonly int InputPointSize = Interop.TextField.InputPointSizeGet();
2495 internal static readonly int UNDERLINE = Interop.TextField.UnderlineGet();
2496 internal static readonly int InputUnderline = Interop.TextField.InputUnderlineGet();
2497 internal static readonly int SHADOW = Interop.TextField.ShadowGet();
2498 internal static readonly int InputShadow = Interop.TextField.InputShadowGet();
2499 internal static readonly int EMBOSS = Interop.TextField.EmbossGet();
2500 internal static readonly int InputEmboss = Interop.TextField.InputEmbossGet();
2501 internal static readonly int OUTLINE = Interop.TextField.OutlineGet();
2502 internal static readonly int InputOutline = Interop.TextField.InputOutlineGet();
2503 internal static readonly int HiddenInputSettings = Interop.TextField.HiddenInputSettingsGet();
2504 internal static readonly int PixelSize = Interop.TextField.PixelSizeGet();
2505 internal static readonly int EnableSelection = Interop.TextField.EnableSelectionGet();
2506 internal static readonly int PLACEHOLDER = Interop.TextField.PlaceholderGet();
2507 internal static readonly int ELLIPSIS = Interop.TextField.EllipsisGet();
2508 internal static readonly int EnableShiftSelection = Interop.TextField.EnableShiftSelectionGet();
2509 internal static readonly int MatchSystemLanguageDirection = Interop.TextField.MatchSystemLanguageDirectionGet();
2510 internal static readonly int EnableGrabHandle = Interop.TextField.EnableGrabHandleGet();
2511 internal static readonly int EnableGrabHandlePopup = Interop.TextField.EnableGrabHandlePopupGet();
2512 internal static readonly int SelectedText = Interop.TextField.SelectedTextGet();
2513 internal static readonly int SelectedTextStart = Interop.TextField.SelectedTextStartGet();
2514 internal static readonly int SelectedTextEnd = Interop.TextField.SelectedTextEndGet();
2515 internal static readonly int EnableEditing = Interop.TextField.EnableEditingGet();
2516 internal static readonly int PrimaryCursorPosition = Interop.TextField.PrimaryCursorPositionGet();
2517 internal static readonly int FontSizeScale = Interop.TextField.FontSizeScaleGet();
2518 internal static readonly int GrabHandleColor = Interop.TextField.GrabHandleColorGet();
2519 internal static readonly int EllipsisPosition = Interop.TextField.EllipsisPositionGet();
2520 internal static readonly int InputFilter = Interop.TextField.InputFilterGet();
2523 internal class InputStyle
2529 FontFamily = 0x0002,
2539 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2541 DecorationBoundingBox = new Rectangle(x, y, width, height);
2543 private void OnInputColorChanged(float x, float y, float z, float w)
2545 InputColor = new Vector4(x, y, z, w);
2547 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2549 PlaceholderTextColor = new Vector4(r, g, b, a);
2551 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2553 PrimaryCursorColor = new Vector4(x, y, z, w);
2555 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2557 SecondaryCursorColor = new Vector4(x, y, z, w);
2559 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2561 SelectionHighlightColor = new Vector4(x, y, z, w);
2563 private void OnShadowColorChanged(float x, float y, float z, float w)
2565 ShadowColor = new Vector4(x, y, z, w);
2567 private void OnShadowOffsetChanged(float x, float y)
2569 ShadowOffset = new Vector2(x, y);
2571 private void OnTextColorChanged(float r, float g, float b, float a)
2573 TextColor = new Color(r, g, b, a);
2575 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2577 GrabHandleColor = new Color(r, g, b, a);