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.
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
22 using System.Globalization;
23 using System.ComponentModel;
26 namespace Tizen.NUI.BaseComponents
29 /// A control which provides a multi-line editable text editor.
31 /// <since_tizen> 3 </since_tizen>
32 public partial class TextEditor : View
34 private string textEditorTextSid = null;
35 private string textEditorPlaceHolderTextSid = null;
36 private bool systemlangTextFlag = false;
37 private InputMethodContext inputMethodContext = null;
38 private float fontSizeScale = 1.0f;
39 private bool hasFontSizeChangedCallback = false;
41 static TextEditor() { }
44 /// Creates the TextEditor control.
46 /// <since_tizen> 3 </since_tizen>
47 public TextEditor() : this(Interop.TextEditor.New(), true)
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53 /// Creates the TextEditor with specified style.
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
61 /// Creates the TextEditor with setting the status of shown or hidden.
63 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
64 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
65 [EditorBrowsable(EditorBrowsableState.Never)]
66 public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
68 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72 internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
74 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
91 /// The TranslatableText property.<br />
92 /// The text can set the SID value.<br />
94 /// <exception cref='ArgumentNullException'>
95 /// ResourceManager about multilingual is null.
97 /// <since_tizen> 4 </since_tizen>
98 public string TranslatableText
102 return GetValue(TranslatableTextProperty) as string;
106 SetValue(TranslatableTextProperty, value);
110 private string InternalTranslatableText
114 return textEditorTextSid;
118 if (NUIApplication.MultilingualResourceManager == null)
120 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
122 textEditorTextSid = value;
123 Text = SetTranslatable(textEditorTextSid);
124 NotifyPropertyChanged();
128 /// The TranslatablePlaceholderText property.<br />
129 /// The text can set the SID value.<br />
131 /// <exception cref='ArgumentNullException'>
132 /// ResourceManager about multilingual is null.
134 /// <since_tizen> 4 </since_tizen>
135 public string TranslatablePlaceholderText
139 return GetValue(TranslatablePlaceholderTextProperty) as string;
143 SetValue(TranslatablePlaceholderTextProperty, value);
147 private string InternalTranslatablePlaceholderText
151 return textEditorPlaceHolderTextSid;
155 if (NUIApplication.MultilingualResourceManager == null)
157 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
159 textEditorPlaceHolderTextSid = value;
160 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
161 NotifyPropertyChanged();
166 /// The Text property.
168 /// <since_tizen> 3 </since_tizen>
173 return (string)GetValue(TextProperty);
177 SetValueAndForceSendChangeSignal(TextProperty, value);
178 NotifyPropertyChanged();
183 /// The TextColor property.
186 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
188 /// <since_tizen> 3 </since_tizen>
189 public Vector4 TextColor
193 Vector4 temp = (Vector4)GetValue(TextColorProperty);
194 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
198 SetValue(TextColorProperty, value);
199 NotifyPropertyChanged();
204 /// The FontFamily property.
206 /// <since_tizen> 3 </since_tizen>
207 public string FontFamily
211 return (string)GetValue(FontFamilyProperty);
215 SetValue(FontFamilyProperty, value);
216 NotifyPropertyChanged();
221 /// The FontStyle property.
222 /// The fontStyle map contains the following keys :<br />
223 /// <list type="table">
224 /// <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>
225 /// <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>
226 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
229 /// <since_tizen> 3 </since_tizen>
230 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
231 public PropertyMap FontStyle
235 return (PropertyMap)GetValue(FontStyleProperty);
239 SetValue(FontStyleProperty, value);
240 NotifyPropertyChanged();
245 /// Set FontStyle to TextEditor. <br />
247 /// <param name="fontStyle">The FontStyle</param>
249 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
252 /// The following example demonstrates how to use the SetFontStyle method.
254 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
255 /// fontStyle.Width = FontWidthType.Expanded;
256 /// fontStyle.Weight = FontWeightType.Bold;
257 /// fontStyle.Slant = FontSlantType.Italic;
258 /// editor.SetFontStyle(fontStyle);
261 [EditorBrowsable(EditorBrowsableState.Never)]
262 public void SetFontStyle(FontStyle fontStyle)
264 SetValue(FontStyleProperty, TextMapHelper.GetFontStyleMap(fontStyle));
268 /// Get FontStyle from TextEditor. <br />
270 /// <returns>The FontStyle</returns>
272 /// <see cref="Tizen.NUI.Text.FontStyle"/>
274 [EditorBrowsable(EditorBrowsableState.Never)]
275 public FontStyle GetFontStyle()
277 return TextMapHelper.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
281 /// The PointSize property.
283 /// <since_tizen> 3 </since_tizen>
284 public float PointSize
288 return (float)GetValue(PointSizeProperty);
292 SetValue(PointSizeProperty, value);
293 NotifyPropertyChanged();
298 /// The HorizontalAlignment property.
300 /// <since_tizen> 3 </since_tizen>
301 public HorizontalAlignment HorizontalAlignment
305 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
309 SetValue(HorizontalAlignmentProperty, value);
310 NotifyPropertyChanged();
315 /// The ScrollThreshold property.
317 /// <since_tizen> 3 </since_tizen>
318 public float ScrollThreshold
322 return (float)GetValue(ScrollThresholdProperty);
326 SetValue(ScrollThresholdProperty, value);
327 NotifyPropertyChanged();
332 /// The ScrollSpeed property.
334 /// <since_tizen> 3 </since_tizen>
335 public float ScrollSpeed
339 return (float)GetValue(ScrollSpeedProperty);
343 SetValue(ScrollSpeedProperty, value);
344 NotifyPropertyChanged();
349 /// The PrimaryCursorColor property.
352 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
354 /// <since_tizen> 3 </since_tizen>
355 public Vector4 PrimaryCursorColor
359 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
360 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
364 SetValue(PrimaryCursorColorProperty, value);
365 NotifyPropertyChanged();
370 /// The SecondaryCursorColor property.
373 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
375 /// <since_tizen> 3 </since_tizen>
376 public Vector4 SecondaryCursorColor
380 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
381 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
385 SetValue(SecondaryCursorColorProperty, value);
386 NotifyPropertyChanged();
391 /// The EnableCursorBlink property.
393 /// <since_tizen> 3 </since_tizen>
394 public bool EnableCursorBlink
398 return (bool)GetValue(EnableCursorBlinkProperty);
402 SetValue(EnableCursorBlinkProperty, value);
403 NotifyPropertyChanged();
408 /// The CursorBlinkInterval property.
410 /// <since_tizen> 3 </since_tizen>
411 public float CursorBlinkInterval
415 return (float)GetValue(CursorBlinkIntervalProperty);
419 SetValue(CursorBlinkIntervalProperty, value);
420 NotifyPropertyChanged();
425 /// The CursorBlinkDuration property.
427 /// <since_tizen> 3 </since_tizen>
428 public float CursorBlinkDuration
432 return (float)GetValue(CursorBlinkDurationProperty);
436 SetValue(CursorBlinkDurationProperty, value);
437 NotifyPropertyChanged();
442 /// The CursorWidth property.
444 /// <since_tizen> 3 </since_tizen>
445 public int CursorWidth
449 return (int)GetValue(CursorWidthProperty);
453 SetValue(CursorWidthProperty, value);
454 NotifyPropertyChanged();
459 /// The GrabHandleImage property.
461 /// <since_tizen> 3 </since_tizen>
462 public string GrabHandleImage
466 return (string)GetValue(GrabHandleImageProperty);
470 SetValue(GrabHandleImageProperty, value);
471 NotifyPropertyChanged();
476 /// The GrabHandlePressedImage property.
478 /// <since_tizen> 3 </since_tizen>
479 public string GrabHandlePressedImage
483 return (string)GetValue(GrabHandlePressedImageProperty);
487 SetValue(GrabHandlePressedImageProperty, value);
488 NotifyPropertyChanged();
493 /// The SelectionHandleImageLeft property.
494 /// The selectionHandleImageLeft map contains the following key :<br />
495 /// <list type="table">
496 /// <item><term>filename (string)</term><description>The path of image file</description></item>
499 /// <since_tizen> 3 </since_tizen>
500 public PropertyMap SelectionHandleImageLeft
504 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
508 SetValue(SelectionHandleImageLeftProperty, value);
509 NotifyPropertyChanged();
514 /// The SelectionHandleImageRight property.
515 /// The selectionHandleImageRight map contains the following key :<br />
516 /// <list type="table">
517 /// <item><term>filename (string)</term><description>The path of image file</description></item>
520 /// <since_tizen> 3 </since_tizen>
521 public PropertyMap SelectionHandleImageRight
525 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
529 SetValue(SelectionHandleImageRightProperty, value);
530 NotifyPropertyChanged();
535 /// Set SelectionHandleImage to TextEditor. <br />
537 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
539 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
542 /// The following example demonstrates how to use the SetSelectionHandleImage method.
544 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
545 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
546 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
547 /// editor.SetSelectionHandleImage(selectionHandleImage);
550 [EditorBrowsable(EditorBrowsableState.Never)]
551 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
553 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
555 SetValue(SelectionHandleImageLeftProperty, TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl));
558 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
560 SetValue(SelectionHandleImageRightProperty, TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl));
565 /// Get SelectionHandleImage from TextEditor. <br />
567 /// <returns>The SelectionHandleImage</returns>
569 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
571 [EditorBrowsable(EditorBrowsableState.Never)]
572 public SelectionHandleImage GetSelectionHandleImage()
574 return TextMapHelper.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
578 /// The SelectionHandlePressedImageLeft property.
579 /// The selectionHandlePressedImageLeft map contains the following key :<br />
580 /// <list type="table">
581 /// <item><term>filename (string)</term><description>The path of image file</description></item>
584 /// <since_tizen> 3 </since_tizen>
585 public PropertyMap SelectionHandlePressedImageLeft
589 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
593 SetValue(SelectionHandlePressedImageLeftProperty, value);
594 NotifyPropertyChanged();
599 /// The SelectionHandlePressedImageRight property.
600 /// The selectionHandlePressedImageRight map contains the following key :<br />
601 /// <list type="table">
602 /// <item><term>filename (string)</term><description>The path of image file</description></item>
605 /// <since_tizen> 3 </since_tizen>
606 public PropertyMap SelectionHandlePressedImageRight
610 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
614 SetValue(SelectionHandlePressedImageRightProperty, value);
615 NotifyPropertyChanged();
620 /// Set SelectionHandlePressedImage to TextEditor. <br />
622 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
624 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
627 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
629 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
630 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
631 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
632 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
635 [EditorBrowsable(EditorBrowsableState.Never)]
636 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
638 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
640 SetValue(SelectionHandlePressedImageLeftProperty, TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
643 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
645 SetValue(SelectionHandlePressedImageRightProperty, TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
650 /// Get SelectionHandlePressedImage from TextEditor. <br />
652 /// <returns>The SelectionHandlePressedImage</returns>
654 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
656 [EditorBrowsable(EditorBrowsableState.Never)]
657 public SelectionHandleImage GetSelectionHandlePressedImage()
659 return TextMapHelper.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
663 /// The SelectionHandleMarkerImageLeft property.
664 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
665 /// <list type="table">
666 /// <item><term>filename (string)</term><description>The path of image file</description></item>
669 /// <since_tizen> 3 </since_tizen>
670 public PropertyMap SelectionHandleMarkerImageLeft
674 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
678 SetValue(SelectionHandleMarkerImageLeftProperty, value);
679 NotifyPropertyChanged();
684 /// The SelectionHandleMarkerImageRight property.
685 /// The selectionHandleMarkerImageRight map contains the following key :<br />
686 /// <list type="table">
687 /// <item><term>filename (string)</term><description>The path of image file</description></item>
690 /// <since_tizen> 3 </since_tizen>
691 public PropertyMap SelectionHandleMarkerImageRight
695 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
699 SetValue(SelectionHandleMarkerImageRightProperty, value);
700 NotifyPropertyChanged();
705 /// Set SelectionHandleMarkerImage to TextEditor. <br />
707 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
709 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
712 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
714 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
715 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
716 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
717 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
720 [EditorBrowsable(EditorBrowsableState.Never)]
721 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
723 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
725 SetValue(SelectionHandleMarkerImageLeftProperty, TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
728 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
730 SetValue(SelectionHandleMarkerImageRightProperty, TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
735 /// Get SelectionHandleMarkerImage from TextEditor. <br />
737 /// <returns>The SelectionHandleMarkerImage</returns>
739 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
741 [EditorBrowsable(EditorBrowsableState.Never)]
742 public SelectionHandleImage GetSelectionHandleMarkerImage()
744 return TextMapHelper.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
748 /// The SelectionHighlightColor property.
751 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
753 /// <since_tizen> 3 </since_tizen>
754 public Vector4 SelectionHighlightColor
758 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
759 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
763 SetValue(SelectionHighlightColorProperty, value);
764 NotifyPropertyChanged();
769 /// The DecorationBoundingBox property.
772 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
774 /// <since_tizen> 3 </since_tizen>
775 public Rectangle DecorationBoundingBox
779 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
780 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
784 SetValue(DecorationBoundingBoxProperty, value);
785 NotifyPropertyChanged();
790 /// The EnableMarkup property.
792 /// <since_tizen> 3 </since_tizen>
793 public bool EnableMarkup
797 return (bool)GetValue(EnableMarkupProperty);
801 SetValue(EnableMarkupProperty, value);
802 NotifyPropertyChanged();
807 /// The InputColor property.
810 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
812 /// <since_tizen> 3 </since_tizen>
813 public Vector4 InputColor
817 Vector4 temp = (Vector4)GetValue(InputColorProperty);
818 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
822 SetValue(InputColorProperty, value);
823 NotifyPropertyChanged();
828 /// The InputFontFamily property.
830 /// <since_tizen> 3 </since_tizen>
831 public string InputFontFamily
835 return (string)GetValue(InputFontFamilyProperty);
839 SetValue(InputFontFamilyProperty, value);
840 NotifyPropertyChanged();
845 /// The InputFontStyle property.
846 /// The inputFontStyle map contains the following keys :<br />
847 /// <list type="table">
848 /// <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>
849 /// <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>
850 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
853 /// <since_tizen> 3 </since_tizen>
854 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
855 public PropertyMap InputFontStyle
859 return (PropertyMap)GetValue(InputFontStyleProperty);
863 SetValue(InputFontStyleProperty, value);
864 NotifyPropertyChanged();
869 /// Set InputFontStyle to TextEditor. <br />
871 /// <param name="fontStyle">The FontStyle</param>
873 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
876 /// The following example demonstrates how to use the SetInputFontStyle method.
878 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
879 /// fontStyle.Width = FontWidthType.Expanded;
880 /// fontStyle.Weight = FontWeightType.Bold;
881 /// fontStyle.Slant = FontSlantType.Italic;
882 /// editor.SetInputFontStyle(fontStyle);
885 [EditorBrowsable(EditorBrowsableState.Never)]
886 public void SetInputFontStyle(FontStyle fontStyle)
888 SetValue(InputFontStyleProperty, TextMapHelper.GetFontStyleMap(fontStyle));
892 /// Get InputFontStyle from TextEditor. <br />
894 /// <returns>The FontStyle</returns>
896 /// <see cref="Tizen.NUI.Text.FontStyle"/>
898 [EditorBrowsable(EditorBrowsableState.Never)]
899 public FontStyle GetInputFontStyle()
901 return TextMapHelper.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
905 /// The InputPointSize property.
907 /// <since_tizen> 3 </since_tizen>
908 public float InputPointSize
912 return (float)GetValue(InputPointSizeProperty);
916 SetValue(InputPointSizeProperty, value);
917 NotifyPropertyChanged();
922 /// The LineSpacing property.
924 /// <since_tizen> 3 </since_tizen>
925 public float LineSpacing
929 return (float)GetValue(LineSpacingProperty);
933 SetValue(LineSpacingProperty, value);
934 NotifyPropertyChanged();
939 /// The InputLineSpacing property.
941 /// <since_tizen> 3 </since_tizen>
942 public float InputLineSpacing
946 return (float)GetValue(InputLineSpacingProperty);
950 SetValue(InputLineSpacingProperty, value);
951 NotifyPropertyChanged();
956 /// The Underline property.
957 /// The underline map contains the following keys :<br />
958 /// <list type="table">
959 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
960 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
961 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
964 /// <since_tizen> 3 </since_tizen>
965 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
966 public PropertyMap Underline
970 return (PropertyMap)GetValue(UnderlineProperty);
974 SetValue(UnderlineProperty, value);
975 NotifyPropertyChanged();
980 /// Set Underline to TextEditor. <br />
982 /// <param name="underline">The Underline</param>
984 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
987 /// The following example demonstrates how to use the SetUnderline method.
989 /// var underline = new Tizen.NUI.Text.Underline();
990 /// underline.Enable = true;
991 /// underline.Color = new Color("#3498DB");
992 /// underline.Height = 2.0f;
993 /// editor.SetUnderline(underline);
996 [EditorBrowsable(EditorBrowsableState.Never)]
997 public void SetUnderline(Underline underline)
999 SetValue(UnderlineProperty, TextMapHelper.GetUnderlineMap(underline));
1003 /// Get Underline from TextEditor. <br />
1005 /// <returns>The Underline</returns>
1007 /// <see cref="Tizen.NUI.Text.Underline"/>
1009 [EditorBrowsable(EditorBrowsableState.Never)]
1010 public Underline GetUnderline()
1012 return TextMapHelper.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
1016 /// The InputUnderline property.
1018 /// <since_tizen> 3 </since_tizen>
1019 public string InputUnderline
1023 return (string)GetValue(InputUnderlineProperty);
1027 SetValue(InputUnderlineProperty, value);
1028 NotifyPropertyChanged();
1033 /// The Shadow property.
1034 /// The shadow map contains the following keys :<br />
1035 /// <list type="table">
1036 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1037 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1038 /// <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>
1041 /// <since_tizen> 3 </since_tizen>
1042 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1043 public PropertyMap Shadow
1047 return (PropertyMap)GetValue(ShadowProperty);
1051 SetValue(ShadowProperty, value);
1052 NotifyPropertyChanged();
1057 /// Set Shadow to TextEditor. <br />
1059 /// <param name="shadow">The Shadow</param>
1061 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1064 /// The following example demonstrates how to use the SetShadow method.
1066 /// var shadow = new Tizen.NUI.Text.Shadow();
1067 /// shadow.Offset = new Vector2(3, 3);
1068 /// shadow.Color = new Color("#F1C40F");
1069 /// editor.SetShadow(shadow);
1072 [EditorBrowsable(EditorBrowsableState.Never)]
1073 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1075 SetValue(ShadowProperty, TextMapHelper.GetShadowMap(shadow));
1079 /// Get Shadow from TextEditor. <br />
1081 /// <returns>The Shadow</returns>
1083 /// <see cref="Tizen.NUI.Text.Shadow"/>
1085 [EditorBrowsable(EditorBrowsableState.Never)]
1086 public Tizen.NUI.Text.Shadow GetShadow()
1088 return TextMapHelper.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
1092 /// The InputShadow property.
1094 /// <since_tizen> 3 </since_tizen>
1095 public string InputShadow
1099 return (string)GetValue(InputShadowProperty);
1103 SetValue(InputShadowProperty, value);
1104 NotifyPropertyChanged();
1109 /// The Emboss property.
1111 /// <since_tizen> 3 </since_tizen>
1112 public string Emboss
1116 return (string)GetValue(EmbossProperty);
1120 SetValue(EmbossProperty, value);
1121 NotifyPropertyChanged();
1126 /// The InputEmboss property.
1128 /// <since_tizen> 3 </since_tizen>
1129 public string InputEmboss
1133 return (string)GetValue(InputEmbossProperty);
1137 SetValue(InputEmbossProperty, value);
1138 NotifyPropertyChanged();
1143 /// The Outline property.
1144 /// The outline map contains the following keys :<br />
1145 /// <list type="table">
1146 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1147 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1150 /// <since_tizen> 3 </since_tizen>
1151 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1152 public PropertyMap Outline
1156 return (PropertyMap)GetValue(OutlineProperty);
1160 SetValue(OutlineProperty, value);
1161 NotifyPropertyChanged();
1166 /// Set Outline to TextEditor. <br />
1168 /// <param name="outline">The Outline</param>
1170 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1173 /// The following example demonstrates how to use the SetOutline method.
1175 /// var outline = new Tizen.NUI.Text.Outline();
1176 /// outline.Width = 2.0f;
1177 /// outline.Color = new Color("#45B39D");
1178 /// editor.SetOutline(outline);
1181 [EditorBrowsable(EditorBrowsableState.Never)]
1182 public void SetOutline(Outline outline)
1184 SetValue(OutlineProperty, TextMapHelper.GetOutlineMap(outline));
1188 /// Get Outline from TextEditor. <br />
1190 /// <returns>The Outline</returns>
1192 /// <see cref="Tizen.NUI.Text.Outline"/>
1194 [EditorBrowsable(EditorBrowsableState.Never)]
1195 public Outline GetOutline()
1197 return TextMapHelper.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
1201 /// The InputOutline property.
1203 /// <since_tizen> 3 </since_tizen>
1204 public string InputOutline
1208 return (string)GetValue(InputOutlineProperty);
1212 SetValue(InputOutlineProperty, value);
1213 NotifyPropertyChanged();
1218 /// The SmoothScroll property.
1220 /// <since_tizen> 3 </since_tizen>
1221 public bool SmoothScroll
1225 return (bool)GetValue(SmoothScrollProperty);
1229 SetValue(SmoothScrollProperty, value);
1230 NotifyPropertyChanged();
1235 /// The SmoothScrollDuration property.
1237 /// <since_tizen> 3 </since_tizen>
1238 public float SmoothScrollDuration
1242 return (float)GetValue(SmoothScrollDurationProperty);
1246 SetValue(SmoothScrollDurationProperty, value);
1247 NotifyPropertyChanged();
1252 /// The EnableScrollBar property.
1254 /// <since_tizen> 3 </since_tizen>
1255 public bool EnableScrollBar
1259 return (bool)GetValue(EnableScrollBarProperty);
1263 SetValue(EnableScrollBarProperty, value);
1264 NotifyPropertyChanged();
1269 /// The ScrollBarShowDuration property.
1271 /// <since_tizen> 3 </since_tizen>
1272 public float ScrollBarShowDuration
1276 return (float)GetValue(ScrollBarShowDurationProperty);
1280 SetValue(ScrollBarShowDurationProperty, value);
1281 NotifyPropertyChanged();
1286 /// The ScrollBarFadeDuration property.
1288 /// <since_tizen> 3 </since_tizen>
1289 public float ScrollBarFadeDuration
1293 return (float)GetValue(ScrollBarFadeDurationProperty);
1297 SetValue(ScrollBarFadeDurationProperty, value);
1298 NotifyPropertyChanged();
1303 /// The PixelSize property.
1305 /// <since_tizen> 3 </since_tizen>
1306 public float PixelSize
1310 return (float)GetValue(PixelSizeProperty);
1314 SetValue(PixelSizeProperty, value);
1315 NotifyPropertyChanged();
1320 /// The line count of the text.
1322 /// <since_tizen> 3 </since_tizen>
1323 public int LineCount
1328 GetProperty(TextEditor.Property.LineCount).Get(out temp);
1334 /// The text to display when the TextEditor is empty and inactive.
1336 /// <since_tizen> 3 </since_tizen>
1337 public string PlaceholderText
1341 return (string)GetValue(PlaceholderTextProperty);
1345 SetValue(PlaceholderTextProperty, value);
1346 NotifyPropertyChanged();
1351 /// The portion of the text that has been selected by the user.
1354 /// Empty string when nothing is selected.
1356 /// <since_tizen> 9 </since_tizen>
1357 public string SelectedText
1362 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1368 /// The Placeholder text color.
1371 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1373 /// <since_tizen> 3 </since_tizen>
1374 public Color PlaceholderTextColor
1378 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1379 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1383 SetValue(PlaceholderTextColorProperty, value);
1384 NotifyPropertyChanged();
1389 /// The EnableSelection property.
1391 /// <since_tizen> 3 </since_tizen>
1392 public bool EnableSelection
1396 return (bool)GetValue(EnableSelectionProperty);
1400 SetValue(EnableSelectionProperty, value);
1401 NotifyPropertyChanged();
1406 /// The start index for selection.
1409 /// When there is no selection, the index is current cursor position.
1411 /// <since_tizen> 9 </since_tizen>
1412 public int SelectedTextStart
1417 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1423 /// The end index for selection.
1426 /// When there is no selection, the index is current cursor position.
1428 /// <since_tizen> 9 </since_tizen>
1429 public int SelectedTextEnd
1434 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1440 /// Enable editing in text control.
1442 /// <since_tizen> 8 </since_tizen>
1443 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1444 [EditorBrowsable(EditorBrowsableState.Never)]
1445 public bool EnableEditing
1449 return (bool)GetValue(EnableEditingProperty);
1453 SetValue(EnableEditingProperty, value);
1457 private bool InternalEnableEditing
1462 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1467 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1468 NotifyPropertyChanged();
1473 /// Specify horizontal scroll position in text control.
1475 [EditorBrowsable(EditorBrowsableState.Never)]
1476 public int HorizontalScrollPosition
1480 return (int)GetValue(HorizontalScrollPositionProperty);
1484 SetValue(HorizontalScrollPositionProperty, value);
1488 private int InternalHorizontalScrollPosition
1493 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1495 propertyValue.Get(out temp);
1501 using (PropertyValue propertyValue = new PropertyValue(value))
1503 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1504 NotifyPropertyChanged();
1510 /// Specify vertical scroll position in text control.
1512 [EditorBrowsable(EditorBrowsableState.Never)]
1513 public int VerticalScrollPosition
1517 return (int)GetValue(VerticalScrollPositionProperty);
1521 SetValue(VerticalScrollPositionProperty, value);
1525 private int InternalVerticalScrollPosition
1530 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1532 propertyValue.Get(out temp);
1538 using (PropertyValue propertyValue = new PropertyValue(value))
1540 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1541 NotifyPropertyChanged();
1547 /// Specify primary cursor (caret) position in text control.
1549 [EditorBrowsable(EditorBrowsableState.Never)]
1550 public int PrimaryCursorPosition
1554 return (int)GetValue(PrimaryCursorPositionProperty);
1558 SetValue(PrimaryCursorPositionProperty, value);
1562 private int InternalPrimaryCursorPosition
1567 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1569 propertyValue.Get(out temp);
1575 using (PropertyValue propertyValue = new PropertyValue(value))
1577 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1578 NotifyPropertyChanged();
1584 /// The GrabHandleColor property.
1587 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1589 [EditorBrowsable(EditorBrowsableState.Never)]
1590 public Color GrabHandleColor
1594 Color temp = (Color)GetValue(GrabHandleColorProperty);
1595 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1599 SetValue(GrabHandleColorProperty, value);
1600 NotifyPropertyChanged();
1605 /// Set InputFilter to TextEditor. <br />
1607 /// <param name="inputFilter">The InputFilter</param>
1609 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1610 /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1611 /// If both are used, Rejected has higher priority. <br />
1612 /// The character set must follow the regular expression rules. <br />
1613 /// Behaviour can not be guaranteed for incorrect grammars. <br />
1614 /// Refer the link below for detailed rules. <br />
1615 /// The functions in std::regex library use the ECMAScript grammar: <br />
1616 /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1617 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1618 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1621 /// The following example demonstrates how to use the SetInputFilter method.
1623 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1624 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1625 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1626 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1629 [EditorBrowsable(EditorBrowsableState.Never)]
1630 public void SetInputFilter(InputFilter inputFilter)
1632 SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextMapHelper.GetInputFilterMap(inputFilter)));
1636 /// Get InputFilter from TextEditor. <br />
1638 /// <returns>The InputFilter</returns>
1640 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1642 [EditorBrowsable(EditorBrowsableState.Never)]
1643 public InputFilter GetInputFilter()
1645 var map = new PropertyMap();
1646 GetProperty(TextEditor.Property.InputFilter).Get(map);
1647 return TextMapHelper.GetInputFilterStruct(map);
1651 /// The Placeholder property.
1652 /// The placeholder map contains the following keys :<br />
1653 /// <list type="table">
1654 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1655 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1656 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1657 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1658 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1659 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1660 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1661 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1665 /// The following example demonstrates how to set the placeholder property.
1667 /// PropertyMap propertyMap = new PropertyMap();
1668 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1669 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1670 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1671 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1672 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1674 /// PropertyMap fontStyleMap = new PropertyMap();
1675 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1676 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1677 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1678 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1680 /// TextEditor editor = new TextEditor();
1681 /// editor.Placeholder = propertyMap;
1684 /// <since_tizen> 3 </since_tizen>
1685 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1686 public Tizen.NUI.PropertyMap Placeholder
1690 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1691 PropertyValue value = null;
1694 value = map.Find(0);
1697 value.Get(out string text);
1698 map.Add("text", new PropertyValue(text));
1702 value = map.Find(1);
1705 value.Get(out string textFocused);
1706 map.Add("textFocused", new PropertyValue(textFocused));
1710 value = map.Find(2);
1713 Color color = new Color();
1715 map.Add("color", new PropertyValue(color));
1719 value = map.Find(3);
1722 value.Get(out string fontFamily);
1723 map.Add("fontFamily", new PropertyValue(fontFamily));
1727 value = map.Find(4);
1730 PropertyMap fontStyle = new PropertyMap();
1731 value.Get(fontStyle);
1732 map.Add("fontStyle", new PropertyValue(fontStyle));
1736 value = map.Find(5);
1739 value.Get(out float pointSize);
1740 map.Add("pointSize", new PropertyValue(pointSize));
1744 value = map.Find(6);
1747 value.Get(out float pixelSize);
1748 map.Add("pixelSize", new PropertyValue(pixelSize));
1752 value = map.Find(7);
1755 value.Get(out bool ellipsis);
1756 map.Add("ellipsis", new PropertyValue(ellipsis));
1763 SetValue(PlaceholderProperty, value);
1764 NotifyPropertyChanged();
1769 /// Set Placeholder to TextEditor. <br />
1771 /// <param name="placeholder">The Placeholder</param>
1773 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1776 /// The following example demonstrates how to use the SetPlaceholder method.
1778 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1779 /// placeholder.Text = "placeholder text";
1780 /// placeholder.TextFocused = "placeholder textFocused";
1781 /// placeholder.Color = new Color("#45B39D");
1782 /// placeholder.FontFamily = "BreezeSans";
1783 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1785 /// Width = FontWidthType.Expanded,
1786 /// Weight = FontWeightType.ExtraLight,
1787 /// Slant = FontSlantType.Italic,
1789 /// placeholder.PointSize = 25.0f;
1790 /// //placeholder.PixelSize = 50.0f;
1791 /// placeholder.Ellipsis = true;
1792 /// editor.SetPlaceholder(placeholder);
1795 [EditorBrowsable(EditorBrowsableState.Never)]
1796 public void SetPlaceholder(Placeholder placeholder)
1798 SetValue(PlaceholderProperty, TextMapHelper.GetPlaceholderMap(placeholder));
1802 /// Get Placeholder from TextEditor. <br />
1804 /// <returns>The Placeholder</returns>
1806 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1808 [EditorBrowsable(EditorBrowsableState.Never)]
1809 public Placeholder GetPlaceholder()
1811 return TextMapHelper.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1815 /// The Ellipsis property.<br />
1816 /// Enable or disable the ellipsis.<br />
1818 /// <since_tizen> 9 </since_tizen>
1819 public bool Ellipsis
1823 return (bool)GetValue(EllipsisProperty);
1827 SetValue(EllipsisProperty, value);
1828 NotifyPropertyChanged();
1834 /// The ellipsis position of the text.
1835 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1837 /// <since_tizen> 9 </since_tizen>
1838 public EllipsisPosition EllipsisPosition
1842 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1846 SetValue(EllipsisPositionProperty, value);
1847 NotifyPropertyChanged();
1852 /// The LineWrapMode property.<br />
1853 /// The line wrap mode when the text lines over the layout width.<br />
1855 /// <since_tizen> 4 </since_tizen>
1856 public LineWrapMode LineWrapMode
1860 return (LineWrapMode)GetValue(LineWrapModeProperty);
1864 SetValue(LineWrapModeProperty, value);
1865 NotifyPropertyChanged();
1870 /// Enables Text selection using Shift key.
1872 /// <since_tizen> 5 </since_tizen>
1873 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1874 [EditorBrowsable(EditorBrowsableState.Never)]
1875 public bool EnableShiftSelection
1879 return (bool)GetValue(EnableShiftSelectionProperty);
1883 SetValue(EnableShiftSelectionProperty, value);
1884 NotifyPropertyChanged();
1889 /// The text alignment to match the direction of the system language.
1891 /// <since_tizen> 6 </since_tizen>
1892 public bool MatchSystemLanguageDirection
1896 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1900 SetValue(MatchSystemLanguageDirectionProperty, value);
1901 NotifyPropertyChanged();
1906 /// The MaxLength property.
1908 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1909 [EditorBrowsable(EditorBrowsableState.Never)]
1910 public int MaxLength
1914 return (int)GetValue(MaxLengthProperty);
1918 SetValue(MaxLengthProperty, value);
1919 NotifyPropertyChanged();
1923 /// Only used by the IL of xaml, will never changed to not hidden.
1924 [EditorBrowsable(EditorBrowsableState.Never)]
1925 public override bool IsCreateByXaml
1929 return base.IsCreateByXaml;
1933 base.IsCreateByXaml = value;
1937 this.TextChanged += (obj, e) =>
1939 this.Text = e.TextEditor.Text;
1946 /// The FontSizeScale property. <br />
1947 /// The default value is 1.0. <br />
1948 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1950 /// <since_tizen> 9 </since_tizen>
1951 public float FontSizeScale
1955 return fontSizeScale;
1959 float newFontSizeScale;
1961 if (fontSizeScale == value) return;
1963 fontSizeScale = value;
1964 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1966 SystemSettingsFontSize systemSettingsFontSize;
1970 systemSettingsFontSize = SystemSettings.FontSize;
1974 Console.WriteLine("{0} Exception caught.", e);
1975 systemSettingsFontSize = SystemSettingsFontSize.Normal;
1977 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1978 addFontSizeChangedCallback();
1982 newFontSizeScale = fontSizeScale;
1983 removeFontSizeChangedCallback();
1986 SetValue(FontSizeScaleProperty, newFontSizeScale);
1987 NotifyPropertyChanged();
1992 /// The InputMethodSettings property.
1995 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1998 /// The following example demonstrates how to set the InputMethodSettings property.
2000 /// InputMethod method = new InputMethod();
2001 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2002 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2003 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2004 /// method.Variation = 1;
2005 /// textEditor.InputMethodSettings = method.OutputMap;
2008 [EditorBrowsable(EditorBrowsableState.Never)]
2009 public PropertyMap InputMethodSettings
2013 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2017 SetValue(InputMethodSettingsProperty, value);
2018 NotifyPropertyChanged();
2023 /// Scroll the text control by specific amount..
2025 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2026 [EditorBrowsable(EditorBrowsableState.Never)]
2027 public void ScrollBy(Vector2 scroll)
2029 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2030 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2034 /// Get the InputMethodContext instance.
2036 /// <returns>The InputMethodContext instance.</returns>
2037 /// <since_tizen> 5 </since_tizen>
2038 public InputMethodContext GetInputMethodContext()
2040 if (inputMethodContext == null)
2042 /*Avoid raising InputMethodContext reference count.*/
2043 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2044 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2046 return inputMethodContext;
2050 /// Select the whole text.
2052 /// <since_tizen> 9 </since_tizen>
2053 public void SelectWholeText()
2055 Interop.TextEditor.SelectWholeText(SwigCPtr);
2056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2060 /// Select text from start to end index. <br />
2061 /// The index is valid when 0 or positive.
2063 /// <param name="start">The start index for selection.</param>
2064 /// <param name="end">The end index for selection.</param>
2066 /// If the end index exceeds the maximum value, it is set to the length of the text.
2068 /// <since_tizen> 9 </since_tizen>
2069 public void SelectText(int start, int end)
2072 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2074 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2076 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2077 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2081 /// Clear selection of the text. <br />
2082 /// Valid when selection is activate.
2084 /// <since_tizen> 9 </since_tizen>
2085 public void SelectNone()
2087 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2088 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2092 /// Enable grab handle property.
2094 [EditorBrowsable(EditorBrowsableState.Never)]
2095 public bool EnableGrabHandle
2099 return (bool)GetValue(EnableGrabHandleProperty);
2103 SetValue(EnableGrabHandleProperty, value);
2104 NotifyPropertyChanged();
2109 /// Enable grab handle popup property.
2111 [EditorBrowsable(EditorBrowsableState.Never)]
2112 public bool EnableGrabHandlePopup
2116 return (bool)GetValue(EnableGrabHandlePopupProperty);
2120 SetValue(EnableGrabHandlePopupProperty, value);
2121 NotifyPropertyChanged();
2126 /// Minimum line size to be used.
2128 [EditorBrowsable(EditorBrowsableState.Never)]
2129 public float MinLineSize
2133 return (float)GetValue(MinLineSizeProperty);
2137 SetValue(MinLineSizeProperty, value);
2138 NotifyPropertyChanged();
2142 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2144 SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(Interop.TextEditor.InputStyleChangedSignal(SwigCPtr));
2145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2152 /// <since_tizen> 3 </since_tizen>
2153 protected override void Dispose(DisposeTypes type)
2160 if (systemlangTextFlag)
2162 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2165 removeFontSizeChangedCallback();
2167 //Release your own unmanaged resources here.
2168 //You should not access any managed member here except static instance.
2169 //because the execution order of Finalizes is non-deterministic.
2173 if (textEditorTextChangedCallbackDelegate != null)
2175 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2178 if (textEditorMaxLengthReachedCallbackDelegate != null)
2180 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2183 if (textEditorSelectionClearedCallbackDelegate != null)
2185 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2188 if (textEditorCursorPositionChangedCallbackDelegate != null)
2190 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2193 if (textEditorSelectionChangedCallbackDelegate != null)
2195 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2202 /// This will not be public opened.
2203 [EditorBrowsable(EditorBrowsableState.Never)]
2204 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2206 // In order to speed up IME hide, temporarily add
2207 GetInputMethodContext()?.DestroyContext();
2208 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2211 private string SetTranslatable(string textEditorSid)
2213 string translatableText = null;
2214 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2215 if (translatableText != null)
2217 if (systemlangTextFlag == false)
2219 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2220 systemlangTextFlag = true;
2222 return translatableText;
2226 translatableText = "";
2227 return translatableText;
2231 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2233 if (textEditorTextSid != null)
2235 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2237 if (textEditorPlaceHolderTextSid != null)
2239 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2243 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2245 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2246 SetValue(FontSizeScaleProperty, newFontSizeScale);
2247 NotifyPropertyChanged();
2250 private void addFontSizeChangedCallback()
2252 if (hasFontSizeChangedCallback != true)
2256 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2257 hasFontSizeChangedCallback = true;
2261 Console.WriteLine("{0} Exception caught.", e);
2262 hasFontSizeChangedCallback = false;
2267 private void removeFontSizeChangedCallback()
2269 if (hasFontSizeChangedCallback == true)
2273 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2274 hasFontSizeChangedCallback = false;
2278 Console.WriteLine("{0} Exception caught.", e);
2279 hasFontSizeChangedCallback = true;
2284 internal new class Property
2286 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2287 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2288 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2289 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2290 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2291 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2292 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2293 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2294 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2295 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2296 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2297 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2298 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2299 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2300 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2301 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2302 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2303 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2304 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2305 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2306 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2307 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2308 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2309 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2310 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2311 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2312 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2313 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2314 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2315 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2316 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2317 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2318 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2319 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2320 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2321 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2322 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2323 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2324 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2325 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2326 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2327 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2328 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2329 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2330 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2331 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2332 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2333 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2334 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2335 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2336 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2337 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2338 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2339 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2340 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2341 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2342 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2343 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2344 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2345 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2346 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2347 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2348 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2349 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2350 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2351 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2352 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2353 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2354 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2355 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2358 internal class InputStyle
2364 FontFamily = 0x0002,
2367 LineSpacing = 0x0010,
2375 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2377 DecorationBoundingBox = new Rectangle(x, y, width, height);
2379 private void OnInputColorChanged(float x, float y, float z, float w)
2381 InputColor = new Vector4(x, y, z, w);
2383 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2385 PlaceholderTextColor = new Color(r, g, b, a);
2387 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2389 PrimaryCursorColor = new Vector4(x, y, z, w);
2391 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2393 SecondaryCursorColor = new Vector4(x, y, z, w);
2395 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2397 SelectionHighlightColor = new Vector4(x, y, z, w);
2399 private void OnTextColorChanged(float x, float y, float z, float w)
2401 TextColor = new Vector4(x, y, z, w);
2403 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2405 GrabHandleColor = new Color(r, g, b, a);