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;
41 private bool isSettingTextInCSharp = false;
43 static TextField() { }
46 /// Creates the TextField control.
48 /// <since_tizen> 3 </since_tizen>
49 public TextField() : this(Interop.TextField.New(), true)
51 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
55 /// Creates the TextField with setting the status of shown or hidden.
57 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
58 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
59 [EditorBrowsable(EditorBrowsableState.Never)]
60 public TextField(bool shown) : this(Interop.TextField.New(), true)
62 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67 /// Get attributes, it is abstract function and must be override.
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 protected override ViewStyle CreateViewStyle()
72 return new TextFieldStyle();
75 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(cPtr, cMemoryOwn, viewStyle)
82 TextChanged += TextEditorTextChanged;
85 internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null)
92 TextChanged += TextEditorTextChanged;
95 internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.NewTextField(TextField.getCPtr(handle)), true)
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 TextChanged += TextEditorTextChanged;
107 internal enum ExceedPolicyType
109 ExceedPolicyOriginal,
114 /// The TranslatableText property.<br />
115 /// The text can set the SID value.<br />
117 /// <exception cref='ArgumentNullException'>
118 /// ResourceManager about multilingual is null.
120 /// <since_tizen> 4 </since_tizen>
121 public string TranslatableText
125 return (string)GetValue(TranslatableTextProperty);
129 SetValue(TranslatableTextProperty, value);
132 private string translatableText
136 return textFieldTextSid;
140 if (NUIApplication.MultilingualResourceManager == null)
142 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
144 textFieldTextSid = value;
145 Text = SetTranslatable(textFieldTextSid);
146 NotifyPropertyChanged();
151 /// The TranslatablePlaceholderText property.<br />
152 /// The text can set the SID value.<br />
154 /// <exception cref='ArgumentNullException'>
155 /// ResourceManager about multilingual is null.
157 /// <since_tizen> 4 </since_tizen>
158 public string TranslatablePlaceholderText
162 return (string)GetValue(TranslatablePlaceholderTextProperty);
166 SetValue(TranslatablePlaceholderTextProperty, value);
169 private string translatablePlaceholderText
173 return textFieldPlaceHolderTextSid;
177 if (NUIApplication.MultilingualResourceManager == null)
179 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
181 textFieldPlaceHolderTextSid = value;
182 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
183 NotifyPropertyChanged();
188 /// The TranslatablePlaceholderTextFocused property.<br />
189 /// The text can set the SID value.<br />
191 /// <exception cref='ArgumentNullException'>
192 /// ResourceManager about multilingual is null.
194 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
195 [EditorBrowsable(EditorBrowsableState.Never)]
196 public string TranslatablePlaceholderTextFocused
200 return (string)GetValue(TranslatablePlaceholderTextFocusedProperty);
204 SetValue(TranslatablePlaceholderTextFocusedProperty, value);
207 private string translatablePlaceholderTextFocused
211 return textFieldPlaceHolderTextFocusedSid;
215 if (NUIApplication.MultilingualResourceManager == null)
217 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
219 textFieldPlaceHolderTextFocusedSid = value;
220 PlaceholderTextFocused = SetTranslatable(textFieldPlaceHolderTextFocusedSid);
221 NotifyPropertyChanged();
226 /// The Text property.
228 /// <since_tizen> 3 </since_tizen>
233 return (string)GetValue(TextProperty);
237 SetValue(TextProperty, value);
238 NotifyPropertyChanged();
243 /// The PlaceholderText property.
245 /// <since_tizen> 3 </since_tizen>
246 public string PlaceholderText
250 return (string)GetValue(PlaceholderTextProperty);
254 SetValue(PlaceholderTextProperty, value);
255 NotifyPropertyChanged();
260 /// The PlaceholderTextFocused property.
262 /// <since_tizen> 3 </since_tizen>
263 public string PlaceholderTextFocused
267 return (string)GetValue(PlaceholderTextFocusedProperty);
271 SetValue(PlaceholderTextFocusedProperty, value);
272 NotifyPropertyChanged();
277 /// The FontFamily property.
279 /// <since_tizen> 3 </since_tizen>
280 public string FontFamily
284 return (string)GetValue(FontFamilyProperty);
288 SetValue(FontFamilyProperty, value);
289 NotifyPropertyChanged();
294 /// The FontStyle property.
295 /// The fontStyle map contains the following keys :<br />
296 /// <list type="table">
297 /// <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>
298 /// <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>
299 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
302 /// <since_tizen> 3 </since_tizen>
303 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
304 public PropertyMap FontStyle
308 return (PropertyMap)GetValue(FontStyleProperty);
312 SetValue(FontStyleProperty, value);
313 NotifyPropertyChanged();
318 /// Set FontStyle to TextField. <br />
320 /// <param name="fontStyle">The FontStyle</param>
322 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
325 /// The following example demonstrates how to use the SetFontStyle method.
327 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
328 /// fontStyle.Width = FontWidthType.Expanded;
329 /// fontStyle.Weight = FontWeightType.Bold;
330 /// fontStyle.Slant = FontSlantType.Italic;
331 /// field.SetFontStyle(fontStyle);
334 [EditorBrowsable(EditorBrowsableState.Never)]
335 public void SetFontStyle(FontStyle fontStyle)
337 SetValue(FontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
341 /// Get FontStyle from TextField. <br />
343 /// <returns>The FontStyle</returns>
345 /// <see cref="Tizen.NUI.Text.FontStyle"/>
347 [EditorBrowsable(EditorBrowsableState.Never)]
348 public FontStyle GetFontStyle()
350 return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
354 /// The PointSize property.
356 /// <since_tizen> 3 </since_tizen>
357 public float PointSize
361 return (float)GetValue(PointSizeProperty);
365 SetValue(PointSizeProperty, value);
366 NotifyPropertyChanged();
371 /// The MaxLength property.
373 /// <since_tizen> 3 </since_tizen>
378 return (int)GetValue(MaxLengthProperty);
382 SetValue(MaxLengthProperty, value);
383 NotifyPropertyChanged();
388 /// The ExceedPolicy property.
390 /// <since_tizen> 3 </since_tizen>
391 public int ExceedPolicy
395 return (int)GetValue(ExceedPolicyProperty);
399 SetValue(ExceedPolicyProperty, value);
400 NotifyPropertyChanged();
405 /// The HorizontalAlignment property.
407 /// <since_tizen> 3 </since_tizen>
408 public HorizontalAlignment HorizontalAlignment
412 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
416 SetValue(HorizontalAlignmentProperty, value);
417 NotifyPropertyChanged();
422 /// The VerticalAlignment property.
424 /// <since_tizen> 3 </since_tizen>
425 public VerticalAlignment VerticalAlignment
429 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
433 SetValue(VerticalAlignmentProperty, value);
434 NotifyPropertyChanged();
435 NotifyPropertyChanged();
440 /// The TextColor property.
443 /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
445 /// <since_tizen> 3 </since_tizen>
446 public Color TextColor
450 Color temp = (Color)GetValue(TextColorProperty);
451 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
455 SetValue(TextColorProperty, value);
456 NotifyPropertyChanged();
461 /// The PlaceholderTextColor property.
464 /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
466 /// <since_tizen> 3 </since_tizen>
467 public Vector4 PlaceholderTextColor
471 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
472 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
476 SetValue(PlaceholderTextColorProperty, value);
477 NotifyPropertyChanged();
482 /// The ShadowOffset property.
484 /// <since_tizen> 3 </since_tizen>
486 /// Deprecated.(API Level 6) Use Shadow instead.
487 /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
489 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
490 public Vector2 ShadowOffset
494 PropertyMap map = new PropertyMap();
495 GetProperty(TextField.Property.SHADOW).Get(map);
496 Vector2 shadowOffset = new Vector2();
497 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
498 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
502 PropertyMap temp = new PropertyMap();
503 temp.Insert("offset", new PropertyValue(value));
504 SetValue(ShadowProperty, temp);
505 NotifyPropertyChanged();
510 /// The ShadowColor property.
512 /// <since_tizen> 3 </since_tizen>
514 /// Deprecated.(API Level 6) Use Shadow instead.
515 /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
517 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
518 public Vector4 ShadowColor
522 PropertyMap map = new PropertyMap();
523 GetProperty(TextField.Property.SHADOW).Get(map);
524 Vector4 shadowColor = new Vector4();
525 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
526 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
530 PropertyMap temp = new PropertyMap();
531 temp.Insert("color", new PropertyValue(value));
532 SetValue(ShadowProperty, temp);
533 NotifyPropertyChanged();
538 /// The PrimaryCursorColor property.
541 /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
543 /// <since_tizen> 3 </since_tizen>
544 public Vector4 PrimaryCursorColor
548 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
549 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
553 SetValue(PrimaryCursorColorProperty, value);
554 NotifyPropertyChanged();
559 /// The SecondaryCursorColor property.
562 /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
564 /// <since_tizen> 3 </since_tizen>
565 public Vector4 SecondaryCursorColor
569 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
570 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
574 SetValue(SecondaryCursorColorProperty, value);
575 NotifyPropertyChanged();
580 /// The EnableCursorBlink property.
582 /// <since_tizen> 3 </since_tizen>
583 public bool EnableCursorBlink
587 return (bool)GetValue(EnableCursorBlinkProperty);
591 SetValue(EnableCursorBlinkProperty, value);
592 NotifyPropertyChanged();
597 /// The CursorBlinkInterval property.
599 /// <since_tizen> 3 </since_tizen>
600 public float CursorBlinkInterval
604 return (float)GetValue(CursorBlinkIntervalProperty);
608 SetValue(CursorBlinkIntervalProperty, value);
609 NotifyPropertyChanged();
614 /// The CursorBlinkDuration property.
616 /// <since_tizen> 3 </since_tizen>
617 public float CursorBlinkDuration
621 return (float)GetValue(CursorBlinkDurationProperty);
625 SetValue(CursorBlinkDurationProperty, value);
626 NotifyPropertyChanged();
631 /// The CursorWidth property.
633 /// <since_tizen> 3 </since_tizen>
634 public int CursorWidth
638 return (int)GetValue(CursorWidthProperty);
642 SetValue(CursorWidthProperty, value);
643 NotifyPropertyChanged();
648 /// The GrabHandleImage property.
650 /// <since_tizen> 3 </since_tizen>
651 public string GrabHandleImage
655 return (string)GetValue(GrabHandleImageProperty);
659 SetValue(GrabHandleImageProperty, value);
660 NotifyPropertyChanged();
665 /// The GrabHandlePressedImage property.
667 /// <since_tizen> 3 </since_tizen>
668 public string GrabHandlePressedImage
672 return (string)GetValue(GrabHandlePressedImageProperty);
676 SetValue(GrabHandlePressedImageProperty, value);
677 NotifyPropertyChanged();
682 /// The ScrollThreshold property.
684 /// <since_tizen> 3 </since_tizen>
685 public float ScrollThreshold
689 return (float)GetValue(ScrollThresholdProperty);
693 SetValue(ScrollThresholdProperty, value);
694 NotifyPropertyChanged();
699 /// The ScrollSpeed property.
701 /// <since_tizen> 3 </since_tizen>
702 public float ScrollSpeed
706 return (float)GetValue(ScrollSpeedProperty);
710 SetValue(ScrollSpeedProperty, value);
711 NotifyPropertyChanged();
716 /// The SelectionHandleImageLeft property.
717 /// The selectionHandleImageLeft map contains the following key :<br />
718 /// <list type="table">
719 /// <item><term>filename (string)</term><description>The path of image file</description></item>
722 /// <since_tizen> 3 </since_tizen>
723 public PropertyMap SelectionHandleImageLeft
727 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
731 SetValue(SelectionHandleImageLeftProperty, value);
732 NotifyPropertyChanged();
737 /// The SelectionHandleImageRight property.
738 /// The selectionHandleImageRight map contains the following key :<br />
739 /// <list type="table">
740 /// <item><term>filename (string)</term><description>The path of image file</description></item>
743 /// <since_tizen> 3 </since_tizen>
744 public PropertyMap SelectionHandleImageRight
748 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
752 SetValue(SelectionHandleImageRightProperty, value);
753 NotifyPropertyChanged();
758 /// Set SelectionHandleImage to TextField. <br />
760 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
762 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
765 /// The following example demonstrates how to use the SetSelectionHandleImage method.
767 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
768 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
769 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
770 /// field.SetSelectionHandleImage(selectionHandleImage);
773 [EditorBrowsable(EditorBrowsableState.Never)]
774 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
776 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
778 SetValue(SelectionHandleImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl));
781 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
783 SetValue(SelectionHandleImageRightProperty, TextUtils.GetFileNameMap(selectionHandleImage.RightImageUrl));
788 /// Get SelectionHandleImage from TextField. <br />
790 /// <returns>The SelectionHandleImage</returns>
792 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
794 [EditorBrowsable(EditorBrowsableState.Never)]
795 public SelectionHandleImage GetSelectionHandleImage()
797 return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
801 /// The SelectionHandlePressedImageLeft property.
802 /// The selectionHandlePressedImageLeft map contains the following key :<br />
803 /// <list type="table">
804 /// <item><term>filename (string)</term><description>The path of image file</description></item>
807 /// <since_tizen> 3 </since_tizen>
808 public PropertyMap SelectionHandlePressedImageLeft
812 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
816 SetValue(SelectionHandlePressedImageLeftProperty, value);
817 NotifyPropertyChanged();
822 /// The SelectionHandlePressedImageRight property.
823 /// The selectionHandlePressedImageRight map contains the following key :<br />
824 /// <list type="table">
825 /// <item><term>filename (string)</term><description>The path of image file</description></item>
828 /// <since_tizen> 3 </since_tizen>
829 public PropertyMap SelectionHandlePressedImageRight
833 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
837 SetValue(SelectionHandlePressedImageRightProperty, value);
838 NotifyPropertyChanged();
843 /// Set SelectionHandlePressedImage to TextField. <br />
845 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
847 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
850 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
852 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
853 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
854 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
855 /// field.SetSelectionHandlePressedImage(selectionHandlePressedImage);
858 [EditorBrowsable(EditorBrowsableState.Never)]
859 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
861 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
863 SetValue(SelectionHandlePressedImageLeftProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
866 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
868 SetValue(SelectionHandlePressedImageRightProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
873 /// Get SelectionHandlePressedImage from TextField. <br />
875 /// <returns>The SelectionHandlePressedImage</returns>
877 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
879 [EditorBrowsable(EditorBrowsableState.Never)]
880 public SelectionHandleImage GetSelectionHandlePressedImage()
882 return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
886 /// The SelectionHandleMarkerImageLeft property.
887 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
888 /// <list type="table">
889 /// <item><term>filename (string)</term><description>The path of image file</description></item>
892 /// <since_tizen> 3 </since_tizen>
893 public PropertyMap SelectionHandleMarkerImageLeft
897 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
901 SetValue(SelectionHandleMarkerImageLeftProperty, value);
902 NotifyPropertyChanged();
907 /// The SelectionHandleMarkerImageRight property.
908 /// The selectionHandleMarkerImageRight 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 SelectionHandleMarkerImageRight
918 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
922 SetValue(SelectionHandleMarkerImageRightProperty, value);
923 NotifyPropertyChanged();
928 /// Set SelectionHandleMarkerImage to TextField. <br />
930 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
932 /// SetSelectionHandleMarkerImage 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 SetSelectionHandleMarkerImage method.
937 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
938 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
939 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
940 /// field.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
943 [EditorBrowsable(EditorBrowsableState.Never)]
944 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
946 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
948 SetValue(SelectionHandleMarkerImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
951 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
953 SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
958 /// Get SelectionHandleMarkerImage from TextField. <br />
960 /// <returns>The SelectionHandleMarkerImage</returns>
962 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
964 [EditorBrowsable(EditorBrowsableState.Never)]
965 public SelectionHandleImage GetSelectionHandleMarkerImage()
967 return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
971 /// The SelectionHighlightColor property.
974 /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
976 /// <since_tizen> 3 </since_tizen>
977 public Vector4 SelectionHighlightColor
981 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
982 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
986 SetValue(SelectionHighlightColorProperty, value);
987 NotifyPropertyChanged();
992 /// The DecorationBoundingBox property.
995 /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
997 /// <since_tizen> 3 </since_tizen>
998 public Rectangle DecorationBoundingBox
1002 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
1003 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
1007 SetValue(DecorationBoundingBoxProperty, value);
1008 NotifyPropertyChanged();
1013 /// The InputMethodSettings property.
1016 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1019 /// The following example demonstrates how to set the InputMethodSettings property.
1021 /// InputMethod method = new InputMethod();
1022 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1023 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1024 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1025 /// method.Variation = 1;
1026 /// textField.InputMethodSettings = method.OutputMap;
1029 /// <since_tizen> 3 </since_tizen>
1030 public PropertyMap InputMethodSettings
1034 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1038 SetValue(InputMethodSettingsProperty, value);
1039 NotifyPropertyChanged();
1044 /// The InputColor property.
1047 /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
1049 /// <since_tizen> 3 </since_tizen>
1050 public Vector4 InputColor
1054 Vector4 temp = (Vector4)GetValue(InputColorProperty);
1055 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1059 SetValue(InputColorProperty, value);
1060 NotifyPropertyChanged();
1065 /// The EnableMarkup property.
1067 /// <since_tizen> 3 </since_tizen>
1068 public bool EnableMarkup
1072 return (bool)GetValue(EnableMarkupProperty);
1076 SetValue(EnableMarkupProperty, value);
1077 NotifyPropertyChanged();
1082 /// The InputFontFamily property.
1084 /// <since_tizen> 3 </since_tizen>
1085 public string InputFontFamily
1089 return (string)GetValue(InputFontFamilyProperty);
1093 SetValue(InputFontFamilyProperty, value);
1094 NotifyPropertyChanged();
1099 /// The InputFontStyle property.
1100 /// The inputFontStyle map contains the following keys :<br />
1101 /// <list type="table">
1102 /// <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>
1103 /// <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>
1104 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
1107 /// <since_tizen> 3 </since_tizen>
1108 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1109 public PropertyMap InputFontStyle
1113 return (PropertyMap)GetValue(InputFontStyleProperty);
1117 SetValue(InputFontStyleProperty, value);
1118 NotifyPropertyChanged();
1123 /// Set InputFontStyle to TextField. <br />
1125 /// <param name="fontStyle">The FontStyle</param>
1127 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
1130 /// The following example demonstrates how to use the SetInputFontStyle method.
1132 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
1133 /// fontStyle.Width = FontWidthType.Expanded;
1134 /// fontStyle.Weight = FontWeightType.Bold;
1135 /// fontStyle.Slant = FontSlantType.Italic;
1136 /// field.SetInputFontStyle(fontStyle);
1139 [EditorBrowsable(EditorBrowsableState.Never)]
1140 public void SetInputFontStyle(FontStyle fontStyle)
1142 SetValue(InputFontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
1146 /// Get InputFontStyle from TextField. <br />
1148 /// <returns>The FontStyle</returns>
1150 /// <see cref="Tizen.NUI.Text.FontStyle"/>
1152 [EditorBrowsable(EditorBrowsableState.Never)]
1153 public FontStyle GetInputFontStyle()
1155 return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
1159 /// The InputPointSize property.
1161 /// <since_tizen> 3 </since_tizen>
1162 public float InputPointSize
1166 return (float)GetValue(InputPointSizeProperty);
1170 SetValue(InputPointSizeProperty, value);
1171 NotifyPropertyChanged();
1176 /// The Underline property.
1177 /// The underline map contains the following keys :<br />
1178 /// <list type="table">
1179 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1180 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1181 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1184 /// <since_tizen> 3 </since_tizen>
1185 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1186 public PropertyMap Underline
1190 return (PropertyMap)GetValue(UnderlineProperty);
1194 SetValue(UnderlineProperty, value);
1195 NotifyPropertyChanged();
1200 /// Set Underline to TextField. <br />
1202 /// <param name="underline">The Underline</param>
1204 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1207 /// The following example demonstrates how to use the SetUnderline method.
1209 /// var underline = new Tizen.NUI.Text.Underline();
1210 /// underline.Enable = true;
1211 /// underline.Color = new Color("#3498DB");
1212 /// underline.Height = 2.0f;
1213 /// field.SetUnderline(underline);
1216 [EditorBrowsable(EditorBrowsableState.Never)]
1217 public void SetUnderline(Underline underline)
1219 SetValue(UnderlineProperty, TextUtils.GetUnderlineMap(underline));
1223 /// Get Underline from TextField. <br />
1225 /// <returns>The Underline</returns>
1227 /// <see cref="Tizen.NUI.Text.Underline"/>
1229 [EditorBrowsable(EditorBrowsableState.Never)]
1230 public Underline GetUnderline()
1232 return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
1236 /// The InputUnderline property.
1238 /// <since_tizen> 3 </since_tizen>
1239 public string InputUnderline
1243 return (string)GetValue(InputUnderlineProperty);
1247 SetValue(InputUnderlineProperty, value);
1248 NotifyPropertyChanged();
1253 /// The Shadow property.
1254 /// The shadow map contains the following keys :<br />
1255 /// <list type="table">
1256 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1257 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1258 /// <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>
1261 /// <since_tizen> 3 </since_tizen>
1262 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1263 public PropertyMap Shadow
1267 return (PropertyMap)GetValue(ShadowProperty);
1271 SetValue(ShadowProperty, value);
1272 NotifyPropertyChanged();
1277 /// Set Shadow to TextField. <br />
1279 /// <param name="shadow">The Shadow</param>
1281 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1284 /// The following example demonstrates how to use the SetShadow method.
1286 /// var shadow = new Tizen.NUI.Text.Shadow();
1287 /// shadow.Offset = new Vector2(3, 3);
1288 /// shadow.Color = new Color("#F1C40F");
1289 /// field.SetShadow(shadow);
1292 [EditorBrowsable(EditorBrowsableState.Never)]
1293 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1295 SetValue(ShadowProperty, TextUtils.GetShadowMap(shadow));
1299 /// Get Shadow from TextField. <br />
1301 /// <returns>The Shadow</returns>
1303 /// <see cref="Tizen.NUI.Text.Shadow"/>
1305 [EditorBrowsable(EditorBrowsableState.Never)]
1306 public Tizen.NUI.Text.Shadow GetShadow()
1308 return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
1312 /// The InputShadow property.
1314 /// <since_tizen> 3 </since_tizen>
1315 public string InputShadow
1319 return (string)GetValue(InputShadowProperty);
1323 SetValue(InputShadowProperty, value);
1324 NotifyPropertyChanged();
1329 /// The Emboss property.
1331 /// <since_tizen> 3 </since_tizen>
1332 public string Emboss
1336 return (string)GetValue(EmbossProperty);
1340 SetValue(EmbossProperty, value);
1341 NotifyPropertyChanged();
1346 /// The InputEmboss property.
1348 /// <since_tizen> 3 </since_tizen>
1349 public string InputEmboss
1353 return (string)GetValue(InputEmbossProperty);
1357 SetValue(InputEmbossProperty, value);
1358 NotifyPropertyChanged();
1363 /// The Outline property.
1364 /// The outline map contains the following keys :<br />
1365 /// <list type="table">
1366 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1367 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1370 /// <since_tizen> 3 </since_tizen>
1371 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1372 public PropertyMap Outline
1376 return (PropertyMap)GetValue(OutlineProperty);
1380 SetValue(OutlineProperty, value);
1381 NotifyPropertyChanged();
1386 /// Set Outline to TextField. <br />
1388 /// <param name="outline">The Outline</param>
1390 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1393 /// The following example demonstrates how to use the SetOutline method.
1395 /// var outline = new Tizen.NUI.Text.Outline();
1396 /// outline.Width = 2.0f;
1397 /// outline.Color = new Color("#45B39D");
1398 /// field.SetOutline(outline);
1401 [EditorBrowsable(EditorBrowsableState.Never)]
1402 public void SetOutline(Outline outline)
1404 SetValue(OutlineProperty, TextUtils.GetOutlineMap(outline));
1408 /// Get Outline from TextField. <br />
1410 /// <returns>The Outline</returns>
1412 /// <see cref="Tizen.NUI.Text.Outline"/>
1414 [EditorBrowsable(EditorBrowsableState.Never)]
1415 public Outline GetOutline()
1417 return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
1421 /// The InputOutline property.
1423 /// <since_tizen> 3 </since_tizen>
1424 public string InputOutline
1428 return (string)GetValue(InputOutlineProperty);
1432 SetValue(InputOutlineProperty, value);
1433 NotifyPropertyChanged();
1438 /// The HiddenInputSettings property.
1439 /// The hiddenInputSettings map contains the following keys :<br />
1440 /// <list type="table">
1441 /// <item><term>HiddenInputProperty.Mode (int)</term><description>The mode for input text display (Use HiddenInputModeType)</description></item>
1442 /// <item><term>HiddenInputProperty.SubstituteCharacter (int)</term><description>All input characters are substituted by this character</description></item>
1443 /// <item><term>HiddenInputProperty.SubstituteCount (int)</term><description>Length of text to show or hide, available when HideCount/ShowCount mode is used</description></item>
1444 /// <item><term>HiddenInputProperty.ShowLastCharacterDuration (int)</term><description>Hide last character after this duration, available when ShowLastCharacter mode</description></item>
1448 /// See <see cref="HiddenInputProperty"/> and <see cref="HiddenInputModeType"/> for a detailed description.
1451 /// The following example demonstrates how to set the HiddenInputSettings property.
1453 /// PropertyMap map = new PropertyMap();
1454 /// map.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter));
1455 /// map.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(500));
1456 /// map.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x2A));
1457 /// textField.HiddenInputSettings = map;
1460 /// <since_tizen> 3 </since_tizen>
1461 public Tizen.NUI.PropertyMap HiddenInputSettings
1465 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1469 SetValue(HiddenInputSettingsProperty, value);
1470 NotifyPropertyChanged();
1475 /// Set HiddenInput to TextField. <br />
1477 /// <param name="hiddenInput">The HiddenInput</param>
1479 /// SetHiddenInput specifies the requested font style through <see cref="Tizen.NUI.Text.HiddenInput"/>. <br />
1482 /// The following example demonstrates how to use the SetHiddenInput method.
1484 /// var hiddenInput = new Tizen.NUI.Text.HiddenInput();
1485 /// hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
1486 /// hiddenInput.SubstituteCharacter = '★';
1487 /// hiddenInput.SubstituteCount = 0;
1488 /// hiddenInput.ShowLastCharacterDuration = 1000;
1489 /// field.SetHiddenInput(hiddenInput);
1492 [EditorBrowsable(EditorBrowsableState.Never)]
1493 public void SetHiddenInput(HiddenInput hiddenInput)
1495 SetValue(HiddenInputSettingsProperty, TextUtils.GetHiddenInputMap(hiddenInput));
1499 /// Get HiddenInput from TextField. <br />
1501 /// <returns>The HiddenInput</returns>
1503 /// <see cref="Tizen.NUI.Text.HiddenInput"/>
1505 [EditorBrowsable(EditorBrowsableState.Never)]
1506 public HiddenInput GetHiddenInput()
1508 return TextUtils.GetHiddenInputStruct((PropertyMap)GetValue(HiddenInputSettingsProperty));
1512 /// The PixelSize property.
1514 /// <since_tizen> 3 </since_tizen>
1515 public float PixelSize
1519 return (float)GetValue(PixelSizeProperty);
1523 SetValue(PixelSizeProperty, value);
1524 NotifyPropertyChanged();
1529 /// The Enable selection property.
1531 /// <since_tizen> 3 </since_tizen>
1532 public bool EnableSelection
1536 return (bool)GetValue(EnableSelectionProperty);
1540 SetValue(EnableSelectionProperty, value);
1541 NotifyPropertyChanged();
1546 /// The Enable selection property.
1548 /// <since_tizen> 6 </since_tizen>
1549 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1550 [EditorBrowsable(EditorBrowsableState.Never)]
1551 public bool EnableGrabHandle
1555 return (bool)GetValue(EnableGrabHandleProperty);
1559 SetValue(EnableGrabHandleProperty, value);
1560 NotifyPropertyChanged();
1565 /// The Enable selection property.
1567 /// <since_tizen> 6 </since_tizen>
1568 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1569 [EditorBrowsable(EditorBrowsableState.Never)]
1570 public bool EnableGrabHandlePopup
1574 return (bool)GetValue(EnableGrabHandlePopupProperty);
1578 SetValue(EnableGrabHandlePopupProperty, value);
1579 NotifyPropertyChanged();
1584 /// The Selected Text property.
1586 /// <since_tizen> 9 </since_tizen>
1587 public string SelectedText
1592 GetProperty(TextField.Property.SelectedText).Get(out temp);
1598 /// The start index for selection.
1600 /// <since_tizen> 9 </since_tizen>
1601 public int SelectedTextStart
1606 GetProperty(TextField.Property.SelectedTextStart).Get(out temp);
1612 /// The end index for selection.
1614 /// <since_tizen> 9 </since_tizen>
1615 public int SelectedTextEnd
1620 GetProperty(TextField.Property.SelectedTextEnd).Get(out temp);
1626 /// Enable editing in text control.
1628 /// <since_tizen> 8 </since_tizen>
1629 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1630 [EditorBrowsable(EditorBrowsableState.Never)]
1631 public bool EnableEditing
1636 GetProperty(TextField.Property.EnableEditing).Get(out temp);
1641 SetProperty(TextField.Property.EnableEditing, new PropertyValue(value));
1642 NotifyPropertyChanged();
1647 /// Specify primary cursor (caret) position in text control.
1649 [EditorBrowsable(EditorBrowsableState.Never)]
1650 public int PrimaryCursorPosition
1655 using (PropertyValue propertyValue = GetProperty(TextField.Property.PrimaryCursorPosition))
1657 propertyValue.Get(out temp);
1663 using (PropertyValue propertyValue = new PropertyValue(value))
1665 SetProperty(TextField.Property.PrimaryCursorPosition, propertyValue);
1666 NotifyPropertyChanged();
1672 /// The GrabHandleColor property.
1675 /// The property cascade chaining set is possible. For example, this (textField.GrabHandleColor.X = 0.1f;) is possible.
1677 [EditorBrowsable(EditorBrowsableState.Never)]
1678 public Color GrabHandleColor
1682 Color temp = (Color)GetValue(GrabHandleColorProperty);
1683 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1687 SetValue(GrabHandleColorProperty, value);
1688 NotifyPropertyChanged();
1693 /// The ellipsis position of the text.
1694 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1696 /// <since_tizen> 9 </since_tizen>
1697 public EllipsisPosition EllipsisPosition
1701 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1705 SetValue(EllipsisPositionProperty, value);
1706 NotifyPropertyChanged();
1711 /// Set InputFilter to TextField. <br />
1713 /// <param name="inputFilter">The InputFilter</param>
1715 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1716 /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1717 /// If both are used, Rejected has higher priority. <br />
1718 /// The character set must follow the regular expression rules. <br />
1719 /// Behaviour can not be guaranteed for incorrect grammars. <br />
1720 /// Refer the link below for detailed rules. <br />
1721 /// The functions in std::regex library use the ECMAScript grammar: <br />
1722 /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1723 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1724 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1727 /// The following example demonstrates how to use the SetInputFilter method.
1729 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1730 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1731 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1732 /// field.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1735 [EditorBrowsable(EditorBrowsableState.Never)]
1736 public void SetInputFilter(InputFilter inputFilter)
1738 SetProperty(TextField.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1742 /// Get InputFilter from TextField. <br />
1744 /// <returns>The InputFilter</returns>
1746 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1748 [EditorBrowsable(EditorBrowsableState.Never)]
1749 public InputFilter GetInputFilter()
1751 var map = new PropertyMap();
1752 GetProperty(TextField.Property.InputFilter).Get(map);
1753 return TextUtils.GetInputFilterStruct(map);
1757 /// The Placeholder property.
1758 /// The placeholder map contains the following keys :<br />
1759 /// <list type="table">
1760 /// <item><term>text (string)</term><description>The text to display when the TextField is empty and inactive</description></item>
1761 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1762 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1763 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1764 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1765 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1766 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1767 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1771 /// The following example demonstrates how to set the Placeholder property.
1773 /// PropertyMap propertyMap = new PropertyMap();
1774 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1775 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1776 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1777 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1778 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1780 /// PropertyMap fontStyleMap = new PropertyMap();
1781 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1782 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1783 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1784 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1786 /// TextField field = new TextField();
1787 /// field.Placeholder = propertyMap;
1790 /// <since_tizen> 3 </since_tizen>
1791 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1792 public Tizen.NUI.PropertyMap Placeholder
1796 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1797 PropertyValue value = null;
1800 value = map.Find(0);
1803 value.Get(out string text);
1804 map.Add("text", new PropertyValue(text));
1808 value = map.Find(1);
1811 value.Get(out string textFocused);
1812 map.Add("textFocused", new PropertyValue(textFocused));
1816 value = map.Find(2);
1819 Color color = new Color();
1821 map.Add("color", new PropertyValue(color));
1825 value = map.Find(3);
1828 value.Get(out string fontFamily);
1829 map.Add("fontFamily", new PropertyValue(fontFamily));
1833 value = map.Find(4);
1836 PropertyMap fontStyle = new PropertyMap();
1837 value.Get(fontStyle);
1838 map.Add("fontStyle", new PropertyValue(fontStyle));
1842 value = map.Find(5);
1845 value.Get(out float pointSize);
1846 map.Add("pointSize", new PropertyValue(pointSize));
1850 value = map.Find(6);
1853 value.Get(out float pixelSize);
1854 map.Add("pixelSize", new PropertyValue(pixelSize));
1858 value = map.Find(7);
1861 value.Get(out bool ellipsis);
1862 map.Add("ellipsis", new PropertyValue(ellipsis));
1869 SetValue(PlaceholderProperty, value);
1870 NotifyPropertyChanged();
1875 /// Set Placeholder to TextField. <br />
1877 /// <param name="placeholder">The Placeholder</param>
1879 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1882 /// The following example demonstrates how to use the SetPlaceholder method.
1884 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1885 /// placeholder.Text = "placeholder text";
1886 /// placeholder.TextFocused = "placeholder textFocused";
1887 /// placeholder.Color = new Color("#45B39D");
1888 /// placeholder.FontFamily = "BreezeSans";
1889 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1891 /// Width = FontWidthType.Expanded,
1892 /// Weight = FontWeightType.ExtraLight,
1893 /// Slant = FontSlantType.Italic,
1895 /// placeholder.PointSize = 25.0f;
1896 /// //placeholder.PixelSize = 50.0f;
1897 /// placeholder.Ellipsis = true;
1898 /// field.SetPlaceholder(placeholder);
1901 [EditorBrowsable(EditorBrowsableState.Never)]
1902 public void SetPlaceholder(Placeholder placeholder)
1904 SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
1908 /// Get Placeholder from TextField. <br />
1910 /// <returns>The Placeholder</returns>
1912 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1914 [EditorBrowsable(EditorBrowsableState.Never)]
1915 public Placeholder GetPlaceholder()
1917 return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1921 /// The Ellipsis property.<br />
1922 /// Enable or disable the ellipsis.<br />
1923 /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1925 /// <since_tizen> 4 </since_tizen>
1926 public bool Ellipsis
1930 return (bool)GetValue(EllipsisProperty);
1934 SetValue(EllipsisProperty, value);
1935 NotifyPropertyChanged();
1940 /// Enables selection of the text using the Shift key.
1942 /// <since_tizen> 5 </since_tizen>
1943 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1944 [EditorBrowsable(EditorBrowsableState.Never)]
1945 public bool EnableShiftSelection
1949 return (bool)GetValue(EnableShiftSelectionProperty);
1953 SetValue(EnableShiftSelectionProperty, value);
1954 NotifyPropertyChanged();
1959 /// The text alignment to match the direction of the system language.
1961 /// <since_tizen> 6 </since_tizen>
1962 public bool MatchSystemLanguageDirection
1966 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1970 SetValue(MatchSystemLanguageDirectionProperty, value);
1971 NotifyPropertyChanged();
1976 /// The FontSizeScale property. <br />
1977 /// The default value is 1.0. <br />
1978 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1980 /// <since_tizen> 9 </since_tizen>
1981 public float FontSizeScale
1985 return fontSizeScale;
1989 float newFontSizeScale;
1991 if (fontSizeScale == value) return;
1993 fontSizeScale = value;
1994 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1996 SystemSettingsFontSize systemSettingsFontSize;
2000 systemSettingsFontSize = SystemSettings.FontSize;
2004 Console.WriteLine("{0} Exception caught.", e);
2005 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2007 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2008 addFontSizeChangedCallback();
2012 newFontSizeScale = fontSizeScale;
2013 removeFontSizeChangedCallback();
2016 SetValue(FontSizeScaleProperty, newFontSizeScale);
2017 NotifyPropertyChanged();
2022 /// Get the InputMethodContext instance.
2024 /// <returns>The InputMethodContext instance.</returns>
2025 /// <since_tizen> 5 </since_tizen>
2026 public InputMethodContext GetInputMethodContext()
2028 if (inputMethodCotext == null)
2030 /*Avoid raising InputMethodContext reference count.*/
2031 inputMethodCotext = new InputMethodContext(Interop.TextField.GetInputMethodContext(SwigCPtr), true);
2032 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2034 return inputMethodCotext;
2038 /// Select the whole text.
2040 /// <since_tizen> 9 </since_tizen>
2041 public void SelectWholeText()
2043 Interop.TextField.SelectWholeText(SwigCPtr);
2044 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2048 /// Select text from start to end index. <br />
2049 /// The index is valid when 0 or positive. <br />
2051 /// <param name="start">The start index for selection.</param>
2052 /// <param name="end">The end index for selection.</param>
2053 /// <since_tizen> 9 </since_tizen>
2054 public void SelectText(int start, int end)
2057 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2059 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2061 Interop.TextField.SelectText(SwigCPtr, (uint)start, (uint)end);
2062 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2066 /// Clear selection of the text.
2068 /// <since_tizen> 9 </since_tizen>
2069 public void SelectNone()
2071 _ = Interop.TextField.SelectNone(SwigCPtr);
2072 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2075 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
2077 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));
2078 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2085 /// <since_tizen> 3 </since_tizen>
2086 protected override void Dispose(DisposeTypes type)
2090 DisposeQueue.Instance.Add(this);
2094 if (systemlangTextFlag)
2096 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2099 removeFontSizeChangedCallback();
2101 if (type == DisposeTypes.Explicit)
2104 //Release your own managed resources here.
2105 //You should release all of your own disposable objects here.
2108 //Release your own unmanaged resources here.
2109 //You should not access any managed member here except static instance.
2110 //because the execution order of Finalizes is non-deterministic.
2113 if (textFieldCursorPositionChangedCallbackDelegate != null)
2115 this.CursorPositionChangedSignal().Disconnect(textFieldCursorPositionChangedCallbackDelegate);
2118 if (textFieldMaxLengthReachedCallbackDelegate != null)
2120 this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
2123 if (textFieldSelectionClearedCallbackDelegate != null)
2125 this.SelectionClearedSignal().Disconnect(textFieldSelectionClearedCallbackDelegate);
2128 if (textFieldSelectionChangedCallbackDelegate != null)
2130 this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate);
2133 if (textFieldTextChangedCallbackDelegate != null)
2135 TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate);
2139 TextChanged -= TextEditorTextChanged;
2144 /// This will not be public opened.
2145 [EditorBrowsable(EditorBrowsableState.Never)]
2146 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2148 // In order to speed up IME hide, temporarily add
2149 GetInputMethodContext()?.DestroyContext();
2150 Interop.TextField.DeleteTextField(swigCPtr);
2153 private string SetTranslatable(string textFieldSid)
2155 string translatableText = null;
2156 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2157 if (translatableText != null)
2159 if (systemlangTextFlag == false)
2161 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2162 systemlangTextFlag = true;
2164 return translatableText;
2168 translatableText = "";
2169 return translatableText;
2173 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2175 if (textFieldTextSid != null)
2177 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2179 if (textFieldPlaceHolderTextSid != null)
2181 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2183 if (textFieldPlaceHolderTextFocusedSid != null)
2185 PlaceholderTextFocused = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextFocusedSid, new CultureInfo(e.Value.Replace("_", "-")));
2189 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2191 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2192 SetValue(FontSizeScaleProperty, newFontSizeScale);
2193 NotifyPropertyChanged();
2196 private void addFontSizeChangedCallback()
2198 if (hasFontSizeChangedCallback != true)
2202 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2203 hasFontSizeChangedCallback = true;
2207 Console.WriteLine("{0} Exception caught.", e);
2208 hasFontSizeChangedCallback = false;
2213 private void removeFontSizeChangedCallback()
2215 if (hasFontSizeChangedCallback == true)
2219 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2220 hasFontSizeChangedCallback = false;
2224 Console.WriteLine("{0} Exception caught.", e);
2225 hasFontSizeChangedCallback = true;
2230 private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
2232 if (!isSettingTextInCSharp)
2234 EnforceNotifyBindedInstance(TextProperty);
2238 internal new class Property
2240 internal static readonly int TEXT = Interop.TextField.TextGet();
2241 internal static readonly int PlaceholderText = Interop.TextField.PlaceholderTextGet();
2242 internal static readonly int PlaceholderTextFocused = Interop.TextField.PlaceholderTextFocusedGet();
2243 internal static readonly int FontFamily = Interop.TextField.FontFamilyGet();
2244 internal static readonly int FontStyle = Interop.TextField.FontStyleGet();
2245 internal static readonly int PointSize = Interop.TextField.PointSizeGet();
2246 internal static readonly int MaxLength = Interop.TextField.MaxLengthGet();
2247 internal static readonly int ExceedPolicy = Interop.TextField.ExceedPolicyGet();
2248 internal static readonly int HorizontalAlignment = Interop.TextField.HorizontalAlignmentGet();
2249 internal static readonly int VerticalAlignment = Interop.TextField.VerticalAlignmentGet();
2250 internal static readonly int TextColor = Interop.TextField.TextColorGet();
2251 internal static readonly int PlaceholderTextColor = Interop.TextField.PlaceholderTextColorGet();
2252 internal static readonly int PrimaryCursorColor = Interop.TextField.PrimaryCursorColorGet();
2253 internal static readonly int SecondaryCursorColor = Interop.TextField.SecondaryCursorColorGet();
2254 internal static readonly int EnableCursorBlink = Interop.TextField.EnableCursorBlinkGet();
2255 internal static readonly int CursorBlinkInterval = Interop.TextField.CursorBlinkIntervalGet();
2256 internal static readonly int CursorBlinkDuration = Interop.TextField.CursorBlinkDurationGet();
2257 internal static readonly int CursorWidth = Interop.TextField.CursorWidthGet();
2258 internal static readonly int GrabHandleImage = Interop.TextField.GrabHandleImageGet();
2259 internal static readonly int GrabHandlePressedImage = Interop.TextField.GrabHandlePressedImageGet();
2260 internal static readonly int ScrollThreshold = Interop.TextField.ScrollThresholdGet();
2261 internal static readonly int ScrollSpeed = Interop.TextField.ScrollSpeedGet();
2262 internal static readonly int SelectionHandleImageLeft = Interop.TextField.SelectionHandleImageLeftGet();
2263 internal static readonly int SelectionHandleImageRight = Interop.TextField.SelectionHandleImageRightGet();
2264 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextField.SelectionHandlePressedImageLeftGet();
2265 internal static readonly int SelectionHandlePressedImageRight = Interop.TextField.SelectionHandlePressedImageRightGet();
2266 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextField.SelectionHandleMarkerImageLeftGet();
2267 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextField.SelectionHandleMarkerImageRightGet();
2268 internal static readonly int SelectionHighlightColor = Interop.TextField.SelectionHighlightColorGet();
2269 internal static readonly int DecorationBoundingBox = Interop.TextField.DecorationBoundingBoxGet();
2270 internal static readonly int InputMethodSettings = Interop.TextField.InputMethodSettingsGet();
2271 internal static readonly int InputColor = Interop.TextField.InputColorGet();
2272 internal static readonly int EnableMarkup = Interop.TextField.EnableMarkupGet();
2273 internal static readonly int InputFontFamily = Interop.TextField.InputFontFamilyGet();
2274 internal static readonly int InputFontStyle = Interop.TextField.InputFontStyleGet();
2275 internal static readonly int InputPointSize = Interop.TextField.InputPointSizeGet();
2276 internal static readonly int UNDERLINE = Interop.TextField.UnderlineGet();
2277 internal static readonly int InputUnderline = Interop.TextField.InputUnderlineGet();
2278 internal static readonly int SHADOW = Interop.TextField.ShadowGet();
2279 internal static readonly int InputShadow = Interop.TextField.InputShadowGet();
2280 internal static readonly int EMBOSS = Interop.TextField.EmbossGet();
2281 internal static readonly int InputEmboss = Interop.TextField.InputEmbossGet();
2282 internal static readonly int OUTLINE = Interop.TextField.OutlineGet();
2283 internal static readonly int InputOutline = Interop.TextField.InputOutlineGet();
2284 internal static readonly int HiddenInputSettings = Interop.TextField.HiddenInputSettingsGet();
2285 internal static readonly int PixelSize = Interop.TextField.PixelSizeGet();
2286 internal static readonly int EnableSelection = Interop.TextField.EnableSelectionGet();
2287 internal static readonly int PLACEHOLDER = Interop.TextField.PlaceholderGet();
2288 internal static readonly int ELLIPSIS = Interop.TextField.EllipsisGet();
2289 internal static readonly int EnableShiftSelection = Interop.TextField.EnableShiftSelectionGet();
2290 internal static readonly int MatchSystemLanguageDirection = Interop.TextField.MatchSystemLanguageDirectionGet();
2291 internal static readonly int EnableGrabHandle = Interop.TextField.EnableGrabHandleGet();
2292 internal static readonly int EnableGrabHandlePopup = Interop.TextField.EnableGrabHandlePopupGet();
2293 internal static readonly int SelectedText = Interop.TextField.SelectedTextGet();
2294 internal static readonly int SelectedTextStart = Interop.TextField.SelectedTextStartGet();
2295 internal static readonly int SelectedTextEnd = Interop.TextField.SelectedTextEndGet();
2296 internal static readonly int EnableEditing = Interop.TextField.EnableEditingGet();
2297 internal static readonly int PrimaryCursorPosition = Interop.TextField.PrimaryCursorPositionGet();
2298 internal static readonly int FontSizeScale = Interop.TextField.FontSizeScaleGet();
2299 internal static readonly int GrabHandleColor = Interop.TextField.GrabHandleColorGet();
2300 internal static readonly int EllipsisPosition = Interop.TextField.EllipsisPositionGet();
2301 internal static readonly int InputFilter = Interop.TextField.InputFilterGet();
2304 internal class InputStyle
2310 FontFamily = 0x0002,
2320 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2322 DecorationBoundingBox = new Rectangle(x, y, width, height);
2324 private void OnInputColorChanged(float x, float y, float z, float w)
2326 InputColor = new Vector4(x, y, z, w);
2328 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2330 PlaceholderTextColor = new Vector4(r, g, b, a);
2332 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2334 PrimaryCursorColor = new Vector4(x, y, z, w);
2336 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2338 SecondaryCursorColor = new Vector4(x, y, z, w);
2340 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2342 SelectionHighlightColor = new Vector4(x, y, z, w);
2344 private void OnShadowColorChanged(float x, float y, float z, float w)
2346 ShadowColor = new Vector4(x, y, z, w);
2348 private void OnShadowOffsetChanged(float x, float y)
2350 ShadowOffset = new Vector2(x, y);
2352 private void OnTextColorChanged(float r, float g, float b, float a)
2354 TextColor = new Color(r, g, b, a);
2356 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2358 GrabHandleColor = new Color(r, g, b, a);