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, TextUtils.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 TextUtils.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, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl));
558 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
560 SetValue(SelectionHandleImageRightProperty, TextUtils.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 TextUtils.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, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
643 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
645 SetValue(SelectionHandlePressedImageRightProperty, TextUtils.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 TextUtils.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, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
728 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
730 SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.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 TextUtils.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, TextUtils.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 TextUtils.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, TextUtils.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 TextUtils.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, TextUtils.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 TextUtils.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, TextUtils.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 TextUtils.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 Selected Text property (read-only).
1353 [EditorBrowsable(EditorBrowsableState.Never)]
1354 public string SelectedText
1359 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1365 /// The Placeholder text color.
1368 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1370 /// <since_tizen> 3 </since_tizen>
1371 public Color PlaceholderTextColor
1375 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1376 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1380 SetValue(PlaceholderTextColorProperty, value);
1381 NotifyPropertyChanged();
1386 /// The EnableSelection property.
1388 /// <since_tizen> 3 </since_tizen>
1389 public bool EnableSelection
1393 return (bool)GetValue(EnableSelectionProperty);
1397 SetValue(EnableSelectionProperty, value);
1398 NotifyPropertyChanged();
1403 /// The start index for selection.
1405 /// <since_tizen> 8 </since_tizen>
1406 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1407 [EditorBrowsable(EditorBrowsableState.Never)]
1408 public int SelectedTextStart
1413 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1419 /// The end index for selection.
1421 /// <since_tizen> 8 </since_tizen>
1422 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1423 [EditorBrowsable(EditorBrowsableState.Never)]
1424 public int SelectedTextEnd
1429 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1435 /// Enable editing in text control.
1437 /// <since_tizen> 8 </since_tizen>
1438 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1439 [EditorBrowsable(EditorBrowsableState.Never)]
1440 public bool EnableEditing
1444 return (bool)GetValue(EnableEditingProperty);
1448 SetValue(EnableEditingProperty, value);
1452 private bool InternalEnableEditing
1457 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1462 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1463 NotifyPropertyChanged();
1468 /// Specify horizontal scroll position in text control.
1470 [EditorBrowsable(EditorBrowsableState.Never)]
1471 public int HorizontalScrollPosition
1475 return (int)GetValue(HorizontalScrollPositionProperty);
1479 SetValue(HorizontalScrollPositionProperty, value);
1483 private int InternalHorizontalScrollPosition
1488 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1490 propertyValue.Get(out temp);
1496 using (PropertyValue propertyValue = new PropertyValue(value))
1498 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1499 NotifyPropertyChanged();
1505 /// Specify vertical scroll position in text control.
1507 [EditorBrowsable(EditorBrowsableState.Never)]
1508 public int VerticalScrollPosition
1512 return (int)GetValue(VerticalScrollPositionProperty);
1516 SetValue(VerticalScrollPositionProperty, value);
1520 private int InternalVerticalScrollPosition
1525 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1527 propertyValue.Get(out temp);
1533 using (PropertyValue propertyValue = new PropertyValue(value))
1535 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1536 NotifyPropertyChanged();
1542 /// Specify primary cursor (caret) position in text control.
1544 [EditorBrowsable(EditorBrowsableState.Never)]
1545 public int PrimaryCursorPosition
1549 return (int)GetValue(PrimaryCursorPositionProperty);
1553 SetValue(PrimaryCursorPositionProperty, value);
1557 private int InternalPrimaryCursorPosition
1562 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1564 propertyValue.Get(out temp);
1570 using (PropertyValue propertyValue = new PropertyValue(value))
1572 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1573 NotifyPropertyChanged();
1579 /// The GrabHandleColor property.
1582 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1584 [EditorBrowsable(EditorBrowsableState.Never)]
1585 public Color GrabHandleColor
1589 Color temp = (Color)GetValue(GrabHandleColorProperty);
1590 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1594 SetValue(GrabHandleColorProperty, value);
1595 NotifyPropertyChanged();
1600 /// Set InputFilter to TextEditor. <br />
1602 /// <param name="inputFilter">The InputFilter</param>
1604 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1605 /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1606 /// If both are used, Rejected has higher priority. <br />
1607 /// The character set must follow the regular expression rules. <br />
1608 /// Behaviour can not be guaranteed for incorrect grammars. <br />
1609 /// Refer the link below for detailed rules. <br />
1610 /// The functions in std::regex library use the ECMAScript grammar: <br />
1611 /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1612 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1613 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1616 /// The following example demonstrates how to use the SetInputFilter method.
1618 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1619 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1620 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1621 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1624 [EditorBrowsable(EditorBrowsableState.Never)]
1625 public void SetInputFilter(InputFilter inputFilter)
1627 SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1631 /// Get InputFilter from TextEditor. <br />
1633 /// <returns>The InputFilter</returns>
1635 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1637 [EditorBrowsable(EditorBrowsableState.Never)]
1638 public InputFilter GetInputFilter()
1640 var map = new PropertyMap();
1641 GetProperty(TextEditor.Property.InputFilter).Get(map);
1642 return TextUtils.GetInputFilterStruct(map);
1646 /// The Placeholder property.
1647 /// The placeholder map contains the following keys :<br />
1648 /// <list type="table">
1649 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1650 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1651 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1652 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1653 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1654 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1655 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1656 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1660 /// The following example demonstrates how to set the placeholder property.
1662 /// PropertyMap propertyMap = new PropertyMap();
1663 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1664 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1665 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1666 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1667 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1669 /// PropertyMap fontStyleMap = new PropertyMap();
1670 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1671 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1672 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1673 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1675 /// TextEditor editor = new TextEditor();
1676 /// editor.Placeholder = propertyMap;
1679 /// <since_tizen> 3 </since_tizen>
1680 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1681 public Tizen.NUI.PropertyMap Placeholder
1685 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1686 PropertyValue value = null;
1689 value = map.Find(0);
1692 value.Get(out string text);
1693 map.Add("text", new PropertyValue(text));
1697 value = map.Find(1);
1700 value.Get(out string textFocused);
1701 map.Add("textFocused", new PropertyValue(textFocused));
1705 value = map.Find(2);
1708 Color color = new Color();
1710 map.Add("color", new PropertyValue(color));
1714 value = map.Find(3);
1717 value.Get(out string fontFamily);
1718 map.Add("fontFamily", new PropertyValue(fontFamily));
1722 value = map.Find(4);
1725 PropertyMap fontStyle = new PropertyMap();
1726 value.Get(fontStyle);
1727 map.Add("fontStyle", new PropertyValue(fontStyle));
1731 value = map.Find(5);
1734 value.Get(out float pointSize);
1735 map.Add("pointSize", new PropertyValue(pointSize));
1739 value = map.Find(6);
1742 value.Get(out float pixelSize);
1743 map.Add("pixelSize", new PropertyValue(pixelSize));
1747 value = map.Find(7);
1750 value.Get(out bool ellipsis);
1751 map.Add("ellipsis", new PropertyValue(ellipsis));
1758 SetValue(PlaceholderProperty, value);
1759 NotifyPropertyChanged();
1764 /// Set Placeholder to TextEditor. <br />
1766 /// <param name="placeholder">The Placeholder</param>
1768 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1771 /// The following example demonstrates how to use the SetPlaceholder method.
1773 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1774 /// placeholder.Text = "placeholder text";
1775 /// placeholder.TextFocused = "placeholder textFocused";
1776 /// placeholder.Color = new Color("#45B39D");
1777 /// placeholder.FontFamily = "BreezeSans";
1778 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1780 /// Width = FontWidthType.Expanded,
1781 /// Weight = FontWeightType.ExtraLight,
1782 /// Slant = FontSlantType.Italic,
1784 /// placeholder.PointSize = 25.0f;
1785 /// //placeholder.PixelSize = 50.0f;
1786 /// placeholder.Ellipsis = true;
1787 /// editor.SetPlaceholder(placeholder);
1790 [EditorBrowsable(EditorBrowsableState.Never)]
1791 public void SetPlaceholder(Placeholder placeholder)
1793 SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
1797 /// Get Placeholder from TextEditor. <br />
1799 /// <returns>The Placeholder</returns>
1801 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1803 [EditorBrowsable(EditorBrowsableState.Never)]
1804 public Placeholder GetPlaceholder()
1806 return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1810 /// The Ellipsis property.<br />
1811 /// Enable or disable the ellipsis.<br />
1813 /// <since_tizen> 9 </since_tizen>
1814 public bool Ellipsis
1818 return (bool)GetValue(EllipsisProperty);
1822 SetValue(EllipsisProperty, value);
1823 NotifyPropertyChanged();
1829 /// The ellipsis position of the text.
1830 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1832 /// <since_tizen> 9 </since_tizen>
1833 public EllipsisPosition EllipsisPosition
1837 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1841 SetValue(EllipsisPositionProperty, value);
1842 NotifyPropertyChanged();
1847 /// The LineWrapMode property.<br />
1848 /// The line wrap mode when the text lines over the layout width.<br />
1850 /// <since_tizen> 4 </since_tizen>
1851 public LineWrapMode LineWrapMode
1855 return (LineWrapMode)GetValue(LineWrapModeProperty);
1859 SetValue(LineWrapModeProperty, value);
1860 NotifyPropertyChanged();
1865 /// Enables Text selection using Shift key.
1867 /// <since_tizen> 5 </since_tizen>
1868 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1869 [EditorBrowsable(EditorBrowsableState.Never)]
1870 public bool EnableShiftSelection
1874 return (bool)GetValue(EnableShiftSelectionProperty);
1878 SetValue(EnableShiftSelectionProperty, value);
1879 NotifyPropertyChanged();
1884 /// The text alignment to match the direction of the system language.
1886 /// <since_tizen> 6 </since_tizen>
1887 public bool MatchSystemLanguageDirection
1891 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1895 SetValue(MatchSystemLanguageDirectionProperty, value);
1896 NotifyPropertyChanged();
1901 /// The MaxLength property.
1903 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1904 [EditorBrowsable(EditorBrowsableState.Never)]
1905 public int MaxLength
1909 return (int)GetValue(MaxLengthProperty);
1913 SetValue(MaxLengthProperty, value);
1914 NotifyPropertyChanged();
1918 /// Only used by the IL of xaml, will never changed to not hidden.
1919 [EditorBrowsable(EditorBrowsableState.Never)]
1920 public override bool IsCreateByXaml
1924 return base.IsCreateByXaml;
1928 base.IsCreateByXaml = value;
1932 this.TextChanged += (obj, e) =>
1934 this.Text = e.TextEditor.Text;
1941 /// The FontSizeScale property. <br />
1942 /// The default value is 1.0. <br />
1943 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1945 /// <since_tizen> 9 </since_tizen>
1946 public float FontSizeScale
1950 return fontSizeScale;
1954 float newFontSizeScale;
1956 if (fontSizeScale == value) return;
1958 fontSizeScale = value;
1959 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1961 SystemSettingsFontSize systemSettingsFontSize;
1965 systemSettingsFontSize = SystemSettings.FontSize;
1969 Console.WriteLine("{0} Exception caught.", e);
1970 systemSettingsFontSize = SystemSettingsFontSize.Normal;
1972 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1973 addFontSizeChangedCallback();
1977 newFontSizeScale = fontSizeScale;
1978 removeFontSizeChangedCallback();
1981 SetValue(FontSizeScaleProperty, newFontSizeScale);
1982 NotifyPropertyChanged();
1987 /// The InputMethodSettings property.
1990 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1993 /// The following example demonstrates how to set the InputMethodSettings property.
1995 /// InputMethod method = new InputMethod();
1996 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1997 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1998 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1999 /// method.Variation = 1;
2000 /// textEditor.InputMethodSettings = method.OutputMap;
2003 [EditorBrowsable(EditorBrowsableState.Never)]
2004 public PropertyMap InputMethodSettings
2008 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2012 SetValue(InputMethodSettingsProperty, value);
2013 NotifyPropertyChanged();
2018 /// Scroll the text control by specific amount..
2020 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2021 [EditorBrowsable(EditorBrowsableState.Never)]
2022 public void ScrollBy(Vector2 scroll)
2024 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2025 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2029 /// Get the InputMethodContext instance.
2031 /// <returns>The InputMethodContext instance.</returns>
2032 /// <since_tizen> 5 </since_tizen>
2033 public InputMethodContext GetInputMethodContext()
2035 if (inputMethodContext == null)
2037 /*Avoid raising InputMethodContext reference count.*/
2038 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2039 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2041 return inputMethodContext;
2045 /// Select the whole text.
2047 [EditorBrowsable(EditorBrowsableState.Never)]
2048 public void SelectWholeText()
2050 Interop.TextEditor.SelectWholeText(SwigCPtr);
2051 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2055 /// Select text from start to end index. <br />
2056 /// The index is valid when 0 or positive. <br />
2058 /// <param name="start">The start index for selection.</param>
2059 /// <param name="end">The end index for selection.</param>
2060 [EditorBrowsable(EditorBrowsableState.Never)]
2061 public void SelectText(int start, int end)
2064 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2066 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2068 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2069 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2073 /// Clear selection of the text.
2075 [EditorBrowsable(EditorBrowsableState.Never)]
2076 public void SelectNone()
2078 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2079 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2083 /// Enable grab handle property.
2085 [EditorBrowsable(EditorBrowsableState.Never)]
2086 public bool EnableGrabHandle
2090 return (bool)GetValue(EnableGrabHandleProperty);
2094 SetValue(EnableGrabHandleProperty, value);
2095 NotifyPropertyChanged();
2100 /// Enable grab handle popup property.
2102 [EditorBrowsable(EditorBrowsableState.Never)]
2103 public bool EnableGrabHandlePopup
2107 return (bool)GetValue(EnableGrabHandlePopupProperty);
2111 SetValue(EnableGrabHandlePopupProperty, value);
2112 NotifyPropertyChanged();
2117 /// Minimum line size to be used.
2119 [EditorBrowsable(EditorBrowsableState.Never)]
2120 public float MinLineSize
2124 return (float)GetValue(MinLineSizeProperty);
2128 SetValue(MinLineSizeProperty, value);
2129 NotifyPropertyChanged();
2133 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2135 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));
2136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2143 /// <since_tizen> 3 </since_tizen>
2144 protected override void Dispose(DisposeTypes type)
2151 if (systemlangTextFlag)
2153 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2156 removeFontSizeChangedCallback();
2158 //Release your own unmanaged resources here.
2159 //You should not access any managed member here except static instance.
2160 //because the execution order of Finalizes is non-deterministic.
2164 if (textEditorTextChangedCallbackDelegate != null)
2166 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2169 if (textEditorMaxLengthReachedCallbackDelegate != null)
2171 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2174 if (textEditorSelectionClearedCallbackDelegate != null)
2176 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2179 if (textEditorCursorPositionChangedCallbackDelegate != null)
2181 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2184 if (textEditorSelectionChangedCallbackDelegate != null)
2186 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2193 /// This will not be public opened.
2194 [EditorBrowsable(EditorBrowsableState.Never)]
2195 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2197 // In order to speed up IME hide, temporarily add
2198 GetInputMethodContext()?.DestroyContext();
2199 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2202 private string SetTranslatable(string textEditorSid)
2204 string translatableText = null;
2205 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2206 if (translatableText != null)
2208 if (systemlangTextFlag == false)
2210 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2211 systemlangTextFlag = true;
2213 return translatableText;
2217 translatableText = "";
2218 return translatableText;
2222 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2224 if (textEditorTextSid != null)
2226 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2228 if (textEditorPlaceHolderTextSid != null)
2230 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2234 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2236 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2237 SetValue(FontSizeScaleProperty, newFontSizeScale);
2238 NotifyPropertyChanged();
2241 private void addFontSizeChangedCallback()
2243 if (hasFontSizeChangedCallback != true)
2247 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2248 hasFontSizeChangedCallback = true;
2252 Console.WriteLine("{0} Exception caught.", e);
2253 hasFontSizeChangedCallback = false;
2258 private void removeFontSizeChangedCallback()
2260 if (hasFontSizeChangedCallback == true)
2264 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2265 hasFontSizeChangedCallback = false;
2269 Console.WriteLine("{0} Exception caught.", e);
2270 hasFontSizeChangedCallback = true;
2275 internal new class Property
2277 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2278 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2279 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2280 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2281 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2282 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2283 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2284 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2285 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2286 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2287 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2288 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2289 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2290 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2291 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2292 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2293 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2294 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2295 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2296 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2297 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2298 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2299 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2300 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2301 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2302 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2303 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2304 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2305 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2306 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2307 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2308 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2309 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2310 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2311 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2312 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2313 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2314 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2315 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2316 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2317 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2318 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2319 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2320 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2321 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2322 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2323 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2324 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2325 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2326 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2327 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2328 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2329 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2330 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2331 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2332 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2333 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2334 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2335 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2336 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2337 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2338 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2339 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2340 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2341 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2342 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2343 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2344 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2345 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2346 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2349 internal class InputStyle
2355 FontFamily = 0x0002,
2358 LineSpacing = 0x0010,
2366 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2368 DecorationBoundingBox = new Rectangle(x, y, width, height);
2370 private void OnInputColorChanged(float x, float y, float z, float w)
2372 InputColor = new Vector4(x, y, z, w);
2374 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2376 PlaceholderTextColor = new Color(r, g, b, a);
2378 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2380 PrimaryCursorColor = new Vector4(x, y, z, w);
2382 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2384 SecondaryCursorColor = new Vector4(x, y, z, w);
2386 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2388 SelectionHighlightColor = new Vector4(x, y, z, w);
2390 private void OnTextColorChanged(float x, float y, float z, float w)
2392 TextColor = new Vector4(x, y, z, w);
2394 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2396 GrabHandleColor = new Color(r, g, b, a);