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.<br />
167 /// The text to display in the UTF-8 format.<br />
169 /// <since_tizen> 3 </since_tizen>
174 return (string)GetValue(TextProperty);
178 SetValueAndForceSendChangeSignal(TextProperty, value);
179 NotifyPropertyChanged();
184 /// The TextColor property.<br />
185 /// The color of the text.<br />
188 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
190 /// <since_tizen> 3 </since_tizen>
191 public Vector4 TextColor
195 Vector4 temp = (Vector4)GetValue(TextColorProperty);
196 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
200 SetValue(TextColorProperty, value);
201 NotifyPropertyChanged();
206 /// The FontFamily property.<br />
207 /// The requested font family to use.<br />
209 /// <since_tizen> 3 </since_tizen>
210 public string FontFamily
214 return (string)GetValue(FontFamilyProperty);
218 SetValue(FontFamilyProperty, value);
219 NotifyPropertyChanged();
224 /// The FontStyle property.<br />
225 /// The requested font style to use.<br />
226 /// The fontStyle map contains the following keys :<br />
227 /// <list type="table">
228 /// <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>
229 /// <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>
230 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
233 /// <since_tizen> 3 </since_tizen>
234 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
235 public PropertyMap FontStyle
239 return (PropertyMap)GetValue(FontStyleProperty);
243 SetValue(FontStyleProperty, value);
244 NotifyPropertyChanged();
249 /// Set FontStyle to TextEditor. <br />
251 /// <param name="fontStyle">The FontStyle</param>
253 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
256 /// The following example demonstrates how to use the SetFontStyle method.
258 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
259 /// fontStyle.Width = FontWidthType.Expanded;
260 /// fontStyle.Weight = FontWeightType.Bold;
261 /// fontStyle.Slant = FontSlantType.Italic;
262 /// editor.SetFontStyle(fontStyle);
265 [EditorBrowsable(EditorBrowsableState.Never)]
266 public void SetFontStyle(FontStyle fontStyle)
268 SetValue(FontStyleProperty, TextMapHelper.GetFontStyleMap(fontStyle));
272 /// Get FontStyle from TextEditor. <br />
274 /// <returns>The FontStyle</returns>
276 /// <see cref="Tizen.NUI.Text.FontStyle"/>
278 [EditorBrowsable(EditorBrowsableState.Never)]
279 public FontStyle GetFontStyle()
281 return TextMapHelper.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
285 /// The PointSize property.<br />
286 /// The size of font in points.<br />
288 /// <since_tizen> 3 </since_tizen>
289 public float PointSize
293 return (float)GetValue(PointSizeProperty);
297 SetValue(PointSizeProperty, value);
298 NotifyPropertyChanged();
303 /// The HorizontalAlignment property.<br />
304 /// The line horizontal alignment.<br />
306 /// <since_tizen> 3 </since_tizen>
307 public HorizontalAlignment HorizontalAlignment
311 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
315 SetValue(HorizontalAlignmentProperty, value);
316 NotifyPropertyChanged();
321 /// The ScrollThreshold property.<br />
322 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
324 /// <since_tizen> 3 </since_tizen>
325 public float ScrollThreshold
329 return (float)GetValue(ScrollThresholdProperty);
333 SetValue(ScrollThresholdProperty, value);
334 NotifyPropertyChanged();
339 /// The ScrollSpeed property.<br />
340 /// The scroll speed in pixels per second.<br />
342 /// <since_tizen> 3 </since_tizen>
343 public float ScrollSpeed
347 return (float)GetValue(ScrollSpeedProperty);
351 SetValue(ScrollSpeedProperty, value);
352 NotifyPropertyChanged();
357 /// The PrimaryCursorColor property.<br />
358 /// The color to apply to the primary cursor.<br />
361 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
363 /// <since_tizen> 3 </since_tizen>
364 public Vector4 PrimaryCursorColor
368 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
369 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
373 SetValue(PrimaryCursorColorProperty, value);
374 NotifyPropertyChanged();
379 /// The SecondaryCursorColor property.<br />
380 /// The color to apply to the secondary cursor.<br />
383 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
385 /// <since_tizen> 3 </since_tizen>
386 public Vector4 SecondaryCursorColor
390 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
391 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
395 SetValue(SecondaryCursorColorProperty, value);
396 NotifyPropertyChanged();
401 /// The EnableCursorBlink property.<br />
402 /// Whether the cursor should blink or not.<br />
404 /// <since_tizen> 3 </since_tizen>
405 public bool EnableCursorBlink
409 return (bool)GetValue(EnableCursorBlinkProperty);
413 SetValue(EnableCursorBlinkProperty, value);
414 NotifyPropertyChanged();
419 /// The CursorBlinkInterval property.<br />
420 /// The time interval in seconds between cursor on/off states.<br />
422 /// <since_tizen> 3 </since_tizen>
423 public float CursorBlinkInterval
427 return (float)GetValue(CursorBlinkIntervalProperty);
431 SetValue(CursorBlinkIntervalProperty, value);
432 NotifyPropertyChanged();
437 /// The CursorBlinkDuration property.<br />
438 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
440 /// <since_tizen> 3 </since_tizen>
441 public float CursorBlinkDuration
445 return (float)GetValue(CursorBlinkDurationProperty);
449 SetValue(CursorBlinkDurationProperty, value);
450 NotifyPropertyChanged();
455 /// The CursorWidth property.
457 /// <since_tizen> 3 </since_tizen>
458 public int CursorWidth
462 return (int)GetValue(CursorWidthProperty);
466 SetValue(CursorWidthProperty, value);
467 NotifyPropertyChanged();
472 /// The GrabHandleImage property.<br />
473 /// The image to display for the grab handle.<br />
475 /// <since_tizen> 3 </since_tizen>
476 public string GrabHandleImage
480 return (string)GetValue(GrabHandleImageProperty);
484 SetValue(GrabHandleImageProperty, value);
485 NotifyPropertyChanged();
490 /// The GrabHandlePressedImage property.<br />
491 /// The image to display when the grab handle is pressed.<br />
493 /// <since_tizen> 3 </since_tizen>
494 public string GrabHandlePressedImage
498 return (string)GetValue(GrabHandlePressedImageProperty);
502 SetValue(GrabHandlePressedImageProperty, value);
503 NotifyPropertyChanged();
508 /// The SelectionHandleImageLeft property.<br />
509 /// The image to display for the left selection handle.<br />
510 /// The selectionHandleImageLeft map contains the following key :<br />
511 /// <list type="table">
512 /// <item><term>filename (string)</term><description>The path of image file</description></item>
515 /// <since_tizen> 3 </since_tizen>
516 public PropertyMap SelectionHandleImageLeft
520 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
524 SetValue(SelectionHandleImageLeftProperty, value);
525 NotifyPropertyChanged();
530 /// The SelectionHandleImageRight property.<br />
531 /// The image to display for the right selection handle.<br />
532 /// The selectionHandleImageRight map contains the following key :<br />
533 /// <list type="table">
534 /// <item><term>filename (string)</term><description>The path of image file</description></item>
537 /// <since_tizen> 3 </since_tizen>
538 public PropertyMap SelectionHandleImageRight
542 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
546 SetValue(SelectionHandleImageRightProperty, value);
547 NotifyPropertyChanged();
552 /// Set SelectionHandleImage to TextEditor. <br />
554 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
556 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
559 /// The following example demonstrates how to use the SetSelectionHandleImage method.
561 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
562 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
563 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
564 /// editor.SetSelectionHandleImage(selectionHandleImage);
567 [EditorBrowsable(EditorBrowsableState.Never)]
568 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
570 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
572 SetValue(SelectionHandleImageLeftProperty, TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl));
575 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
577 SetValue(SelectionHandleImageRightProperty, TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl));
582 /// Get SelectionHandleImage from TextEditor. <br />
584 /// <returns>The SelectionHandleImage</returns>
586 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
588 [EditorBrowsable(EditorBrowsableState.Never)]
589 public SelectionHandleImage GetSelectionHandleImage()
591 return TextMapHelper.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
595 /// The SelectionHandlePressedImageLeft property.<br />
596 /// The image to display when the left selection handle is pressed.<br />
597 /// The selectionHandlePressedImageLeft map contains the following key :<br />
598 /// <list type="table">
599 /// <item><term>filename (string)</term><description>The path of image file</description></item>
602 /// <since_tizen> 3 </since_tizen>
603 public PropertyMap SelectionHandlePressedImageLeft
607 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
611 SetValue(SelectionHandlePressedImageLeftProperty, value);
612 NotifyPropertyChanged();
617 /// The SelectionHandlePressedImageRight property.<br />
618 /// The image to display when the right selection handle is pressed.<br />
619 /// The selectionHandlePressedImageRight map contains the following key :<br />
620 /// <list type="table">
621 /// <item><term>filename (string)</term><description>The path of image file</description></item>
624 /// <since_tizen> 3 </since_tizen>
625 public PropertyMap SelectionHandlePressedImageRight
629 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
633 SetValue(SelectionHandlePressedImageRightProperty, value);
634 NotifyPropertyChanged();
639 /// Set SelectionHandlePressedImage to TextEditor. <br />
641 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
643 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
646 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
648 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
649 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
650 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
651 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
654 [EditorBrowsable(EditorBrowsableState.Never)]
655 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
657 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
659 SetValue(SelectionHandlePressedImageLeftProperty, TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
662 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
664 SetValue(SelectionHandlePressedImageRightProperty, TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
669 /// Get SelectionHandlePressedImage from TextEditor. <br />
671 /// <returns>The SelectionHandlePressedImage</returns>
673 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
675 [EditorBrowsable(EditorBrowsableState.Never)]
676 public SelectionHandleImage GetSelectionHandlePressedImage()
678 return TextMapHelper.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
682 /// The SelectionHandleMarkerImageLeft property.<br />
683 /// The image to display for the left selection handle marker.<br />
684 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
685 /// <list type="table">
686 /// <item><term>filename (string)</term><description>The path of image file</description></item>
689 /// <since_tizen> 3 </since_tizen>
690 public PropertyMap SelectionHandleMarkerImageLeft
694 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
698 SetValue(SelectionHandleMarkerImageLeftProperty, value);
699 NotifyPropertyChanged();
704 /// The SelectionHandleMarkerImageRight property.<br />
705 /// The image to display for the right selection handle marker.<br />
706 /// The selectionHandleMarkerImageRight map contains the following key :<br />
707 /// <list type="table">
708 /// <item><term>filename (string)</term><description>The path of image file</description></item>
711 /// <since_tizen> 3 </since_tizen>
712 public PropertyMap SelectionHandleMarkerImageRight
716 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
720 SetValue(SelectionHandleMarkerImageRightProperty, value);
721 NotifyPropertyChanged();
726 /// Set SelectionHandleMarkerImage to TextEditor. <br />
728 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
730 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
733 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
735 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
736 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
737 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
738 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
741 [EditorBrowsable(EditorBrowsableState.Never)]
742 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
744 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
746 SetValue(SelectionHandleMarkerImageLeftProperty, TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
749 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
751 SetValue(SelectionHandleMarkerImageRightProperty, TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
756 /// Get SelectionHandleMarkerImage from TextEditor. <br />
758 /// <returns>The SelectionHandleMarkerImage</returns>
760 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
762 [EditorBrowsable(EditorBrowsableState.Never)]
763 public SelectionHandleImage GetSelectionHandleMarkerImage()
765 return TextMapHelper.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
769 /// The SelectionHighlightColor property.<br />
770 /// The color of the selection highlight.<br />
773 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
775 /// <since_tizen> 3 </since_tizen>
776 public Vector4 SelectionHighlightColor
780 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
781 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
785 SetValue(SelectionHighlightColorProperty, value);
786 NotifyPropertyChanged();
791 /// The DecorationBoundingBox property.<br />
792 /// The decorations (handles etc) will positioned within this area on-screen.<br />
795 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
797 /// <since_tizen> 3 </since_tizen>
798 public Rectangle DecorationBoundingBox
802 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
803 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
807 SetValue(DecorationBoundingBoxProperty, value);
808 NotifyPropertyChanged();
813 /// The EnableMarkup property.<br />
814 /// Whether the mark-up processing is enabled.<br />
816 /// <since_tizen> 3 </since_tizen>
817 public bool EnableMarkup
821 return (bool)GetValue(EnableMarkupProperty);
825 SetValue(EnableMarkupProperty, value);
826 NotifyPropertyChanged();
831 /// The InputColor property.<br />
832 /// The color of the new input text.<br />
835 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
837 /// <since_tizen> 3 </since_tizen>
838 public Vector4 InputColor
842 Vector4 temp = (Vector4)GetValue(InputColorProperty);
843 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
847 SetValue(InputColorProperty, value);
848 NotifyPropertyChanged();
853 /// The InputFontFamily property.<br />
854 /// The font's family of the new input text.<br />
856 /// <since_tizen> 3 </since_tizen>
857 public string InputFontFamily
861 return (string)GetValue(InputFontFamilyProperty);
865 SetValue(InputFontFamilyProperty, value);
866 NotifyPropertyChanged();
871 /// The InputFontStyle property.<br />
872 /// The font's style of the new input text.<br />
873 /// The inputFontStyle map contains the following keys :<br />
874 /// <list type="table">
875 /// <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>
876 /// <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>
877 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
880 /// <since_tizen> 3 </since_tizen>
881 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
882 public PropertyMap InputFontStyle
886 return (PropertyMap)GetValue(InputFontStyleProperty);
890 SetValue(InputFontStyleProperty, value);
891 NotifyPropertyChanged();
896 /// Set InputFontStyle to TextEditor. <br />
898 /// <param name="fontStyle">The FontStyle</param>
900 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
903 /// The following example demonstrates how to use the SetInputFontStyle method.
905 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
906 /// fontStyle.Width = FontWidthType.Expanded;
907 /// fontStyle.Weight = FontWeightType.Bold;
908 /// fontStyle.Slant = FontSlantType.Italic;
909 /// editor.SetInputFontStyle(fontStyle);
912 [EditorBrowsable(EditorBrowsableState.Never)]
913 public void SetInputFontStyle(FontStyle fontStyle)
915 SetValue(InputFontStyleProperty, TextMapHelper.GetFontStyleMap(fontStyle));
919 /// Get InputFontStyle from TextEditor. <br />
921 /// <returns>The FontStyle</returns>
923 /// <see cref="Tizen.NUI.Text.FontStyle"/>
925 [EditorBrowsable(EditorBrowsableState.Never)]
926 public FontStyle GetInputFontStyle()
928 return TextMapHelper.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
932 /// The InputPointSize property.<br />
933 /// The font's size of the new input text in points.<br />
935 /// <since_tizen> 3 </since_tizen>
936 public float InputPointSize
940 return (float)GetValue(InputPointSizeProperty);
944 SetValue(InputPointSizeProperty, value);
945 NotifyPropertyChanged();
950 /// The LineSpacing property.<br />
951 /// The default extra space between lines in points.<br />
953 /// <since_tizen> 3 </since_tizen>
954 public float LineSpacing
958 return (float)GetValue(LineSpacingProperty);
962 SetValue(LineSpacingProperty, value);
963 NotifyPropertyChanged();
968 /// The InputLineSpacing property.<br />
969 /// The extra space between lines in points.<br />
971 /// <since_tizen> 3 </since_tizen>
972 public float InputLineSpacing
976 return (float)GetValue(InputLineSpacingProperty);
980 SetValue(InputLineSpacingProperty, value);
981 NotifyPropertyChanged();
986 /// The Underline property.<br />
987 /// The default underline parameters.<br />
988 /// The underline map contains the following keys :<br />
989 /// <list type="table">
990 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
991 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
992 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
995 /// <since_tizen> 3 </since_tizen>
996 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
997 public PropertyMap Underline
1001 return (PropertyMap)GetValue(UnderlineProperty);
1005 SetValue(UnderlineProperty, value);
1006 NotifyPropertyChanged();
1011 /// Set Underline to TextEditor. <br />
1013 /// <param name="underline">The Underline</param>
1015 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1018 /// The following example demonstrates how to use the SetUnderline method.
1020 /// var underline = new Tizen.NUI.Text.Underline();
1021 /// underline.Enable = true;
1022 /// underline.Color = new Color("#3498DB");
1023 /// underline.Height = 2.0f;
1024 /// editor.SetUnderline(underline);
1027 [EditorBrowsable(EditorBrowsableState.Never)]
1028 public void SetUnderline(Underline underline)
1030 SetValue(UnderlineProperty, TextMapHelper.GetUnderlineMap(underline));
1034 /// Get Underline from TextEditor. <br />
1036 /// <returns>The Underline</returns>
1038 /// <see cref="Tizen.NUI.Text.Underline"/>
1040 [EditorBrowsable(EditorBrowsableState.Never)]
1041 public Underline GetUnderline()
1043 return TextMapHelper.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
1047 /// The InputUnderline property.<br />
1048 /// The underline parameters of the new input text.<br />
1050 /// <since_tizen> 3 </since_tizen>
1051 public string InputUnderline
1055 return (string)GetValue(InputUnderlineProperty);
1059 SetValue(InputUnderlineProperty, value);
1060 NotifyPropertyChanged();
1065 /// The Shadow property.<br />
1066 /// The default shadow parameters.<br />
1067 /// The shadow map contains the following keys :<br />
1068 /// <list type="table">
1069 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1070 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1071 /// <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>
1074 /// <since_tizen> 3 </since_tizen>
1075 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1076 public PropertyMap Shadow
1080 return (PropertyMap)GetValue(ShadowProperty);
1084 SetValue(ShadowProperty, value);
1085 NotifyPropertyChanged();
1090 /// Set Shadow to TextEditor. <br />
1092 /// <param name="shadow">The Shadow</param>
1094 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1097 /// The following example demonstrates how to use the SetShadow method.
1099 /// var shadow = new Tizen.NUI.Text.Shadow();
1100 /// shadow.Offset = new Vector2(3, 3);
1101 /// shadow.Color = new Color("#F1C40F");
1102 /// editor.SetShadow(shadow);
1105 [EditorBrowsable(EditorBrowsableState.Never)]
1106 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1108 SetValue(ShadowProperty, TextMapHelper.GetShadowMap(shadow));
1112 /// Get Shadow from TextEditor. <br />
1114 /// <returns>The Shadow</returns>
1116 /// <see cref="Tizen.NUI.Text.Shadow"/>
1118 [EditorBrowsable(EditorBrowsableState.Never)]
1119 public Tizen.NUI.Text.Shadow GetShadow()
1121 return TextMapHelper.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
1125 /// The InputShadow property.<br />
1126 /// The shadow parameters of the new input text.<br />
1128 /// <since_tizen> 3 </since_tizen>
1129 public string InputShadow
1133 return (string)GetValue(InputShadowProperty);
1137 SetValue(InputShadowProperty, value);
1138 NotifyPropertyChanged();
1143 /// The Emboss property.<br />
1144 /// The default emboss parameters.<br />
1146 /// <since_tizen> 3 </since_tizen>
1147 public string Emboss
1151 return (string)GetValue(EmbossProperty);
1155 SetValue(EmbossProperty, value);
1156 NotifyPropertyChanged();
1161 /// The InputEmboss property.<br />
1162 /// The emboss parameters of the new input text.<br />
1164 /// <since_tizen> 3 </since_tizen>
1165 public string InputEmboss
1169 return (string)GetValue(InputEmbossProperty);
1173 SetValue(InputEmbossProperty, value);
1174 NotifyPropertyChanged();
1179 /// The Outline property.<br />
1180 /// The default outline parameters.<br />
1181 /// The outline map contains the following keys :<br />
1182 /// <list type="table">
1183 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1184 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1187 /// <since_tizen> 3 </since_tizen>
1188 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1189 public PropertyMap Outline
1193 return (PropertyMap)GetValue(OutlineProperty);
1197 SetValue(OutlineProperty, value);
1198 NotifyPropertyChanged();
1203 /// Set Outline to TextEditor. <br />
1205 /// <param name="outline">The Outline</param>
1207 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1210 /// The following example demonstrates how to use the SetOutline method.
1212 /// var outline = new Tizen.NUI.Text.Outline();
1213 /// outline.Width = 2.0f;
1214 /// outline.Color = new Color("#45B39D");
1215 /// editor.SetOutline(outline);
1218 [EditorBrowsable(EditorBrowsableState.Never)]
1219 public void SetOutline(Outline outline)
1221 SetValue(OutlineProperty, TextMapHelper.GetOutlineMap(outline));
1225 /// Get Outline from TextEditor. <br />
1227 /// <returns>The Outline</returns>
1229 /// <see cref="Tizen.NUI.Text.Outline"/>
1231 [EditorBrowsable(EditorBrowsableState.Never)]
1232 public Outline GetOutline()
1234 return TextMapHelper.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
1238 /// The InputOutline property.<br />
1239 /// The outline parameters of the new input text.<br />
1241 /// <since_tizen> 3 </since_tizen>
1242 public string InputOutline
1246 return (string)GetValue(InputOutlineProperty);
1250 SetValue(InputOutlineProperty, value);
1251 NotifyPropertyChanged();
1256 /// The SmoothScroll property.<br />
1257 /// Enable or disable the smooth scroll animation.<br />
1259 /// <since_tizen> 3 </since_tizen>
1260 public bool SmoothScroll
1264 return (bool)GetValue(SmoothScrollProperty);
1268 SetValue(SmoothScrollProperty, value);
1269 NotifyPropertyChanged();
1274 /// The SmoothScrollDuration property.<br />
1275 /// Sets the duration of smooth scroll animation.<br />
1277 /// <since_tizen> 3 </since_tizen>
1278 public float SmoothScrollDuration
1282 return (float)GetValue(SmoothScrollDurationProperty);
1286 SetValue(SmoothScrollDurationProperty, value);
1287 NotifyPropertyChanged();
1292 /// The EnableScrollBar property.<br />
1293 /// Enable or disable the scroll bar.<br />
1295 /// <since_tizen> 3 </since_tizen>
1296 public bool EnableScrollBar
1300 return (bool)GetValue(EnableScrollBarProperty);
1304 SetValue(EnableScrollBarProperty, value);
1305 NotifyPropertyChanged();
1310 /// The ScrollBarShowDuration property.<br />
1311 /// Sets the duration of scroll bar to show.<br />
1313 /// <since_tizen> 3 </since_tizen>
1314 public float ScrollBarShowDuration
1318 return (float)GetValue(ScrollBarShowDurationProperty);
1322 SetValue(ScrollBarShowDurationProperty, value);
1323 NotifyPropertyChanged();
1328 /// The ScrollBarFadeDuration property.<br />
1329 /// Sets the duration of scroll bar to fade out.<br />
1331 /// <since_tizen> 3 </since_tizen>
1332 public float ScrollBarFadeDuration
1336 return (float)GetValue(ScrollBarFadeDurationProperty);
1340 SetValue(ScrollBarFadeDurationProperty, value);
1341 NotifyPropertyChanged();
1346 /// The PixelSize property.<br />
1347 /// The size of font in pixels.<br />
1349 /// <since_tizen> 3 </since_tizen>
1350 public float PixelSize
1354 return (float)GetValue(PixelSizeProperty);
1358 SetValue(PixelSizeProperty, value);
1359 NotifyPropertyChanged();
1364 /// The line count of the text.
1366 /// <since_tizen> 3 </since_tizen>
1367 public int LineCount
1372 GetProperty(TextEditor.Property.LineCount).Get(out temp);
1378 /// The text to display when the TextEditor is empty and inactive.
1380 /// <since_tizen> 3 </since_tizen>
1381 public string PlaceholderText
1385 return (string)GetValue(PlaceholderTextProperty);
1389 SetValue(PlaceholderTextProperty, value);
1390 NotifyPropertyChanged();
1395 /// The portion of the text that has been selected by the user.
1398 /// Empty string when nothing is selected.
1400 /// <since_tizen> 9 </since_tizen>
1401 public string SelectedText
1406 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1412 /// The Placeholder text color.
1415 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1417 /// <since_tizen> 3 </since_tizen>
1418 public Color PlaceholderTextColor
1422 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1423 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1427 SetValue(PlaceholderTextColorProperty, value);
1428 NotifyPropertyChanged();
1433 /// The Enable selection property.<br />
1434 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1436 /// <since_tizen> 3 </since_tizen>
1437 public bool EnableSelection
1441 return (bool)GetValue(EnableSelectionProperty);
1445 SetValue(EnableSelectionProperty, value);
1446 NotifyPropertyChanged();
1451 /// The start index for selection.
1454 /// When there is no selection, the index is current cursor position.
1456 /// <since_tizen> 9 </since_tizen>
1457 public int SelectedTextStart
1462 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1468 /// The end index for selection.
1471 /// When there is no selection, the index is current cursor position.
1473 /// <since_tizen> 9 </since_tizen>
1474 public int SelectedTextEnd
1479 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1485 /// Enable editing in text control.
1487 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1488 [EditorBrowsable(EditorBrowsableState.Never)]
1489 public bool EnableEditing
1493 return (bool)GetValue(EnableEditingProperty);
1497 SetValue(EnableEditingProperty, value);
1501 private bool InternalEnableEditing
1506 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1511 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1512 NotifyPropertyChanged();
1517 /// Specify horizontal scroll position in text control.
1519 [EditorBrowsable(EditorBrowsableState.Never)]
1520 public int HorizontalScrollPosition
1524 return (int)GetValue(HorizontalScrollPositionProperty);
1528 SetValue(HorizontalScrollPositionProperty, value);
1532 private int InternalHorizontalScrollPosition
1537 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1539 propertyValue.Get(out temp);
1545 using (PropertyValue propertyValue = new PropertyValue(value))
1547 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1548 NotifyPropertyChanged();
1554 /// Specify vertical scroll position in text control.
1556 [EditorBrowsable(EditorBrowsableState.Never)]
1557 public int VerticalScrollPosition
1561 return (int)GetValue(VerticalScrollPositionProperty);
1565 SetValue(VerticalScrollPositionProperty, value);
1569 private int InternalVerticalScrollPosition
1574 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1576 propertyValue.Get(out temp);
1582 using (PropertyValue propertyValue = new PropertyValue(value))
1584 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1585 NotifyPropertyChanged();
1591 /// Specify primary cursor (caret) position in text control.
1593 [EditorBrowsable(EditorBrowsableState.Never)]
1594 public int PrimaryCursorPosition
1598 return (int)GetValue(PrimaryCursorPositionProperty);
1602 SetValue(PrimaryCursorPositionProperty, value);
1606 private int InternalPrimaryCursorPosition
1611 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1613 propertyValue.Get(out temp);
1619 using (PropertyValue propertyValue = new PropertyValue(value))
1621 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1622 NotifyPropertyChanged();
1628 /// The GrabHandleColor property.
1631 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1633 [EditorBrowsable(EditorBrowsableState.Never)]
1634 public Color GrabHandleColor
1638 Color temp = (Color)GetValue(GrabHandleColorProperty);
1639 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1643 SetValue(GrabHandleColorProperty, value);
1644 NotifyPropertyChanged();
1649 /// Set InputFilter to TextEditor.
1651 /// <param name="inputFilter">The InputFilter</param>
1653 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1654 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1655 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1658 /// The following example demonstrates how to use the SetInputFilter method.
1660 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1661 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1662 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1663 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1666 /// <since_tizen> 9 </since_tizen>
1667 public void SetInputFilter(InputFilter inputFilter)
1669 SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextMapHelper.GetInputFilterMap(inputFilter)));
1673 /// Get InputFilter from TextEditor. <br />
1675 /// <returns>The InputFilter</returns>
1677 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1679 /// <since_tizen> 9 </since_tizen>
1680 public InputFilter GetInputFilter()
1682 var map = new PropertyMap();
1683 GetProperty(TextEditor.Property.InputFilter).Get(map);
1684 return TextMapHelper.GetInputFilterStruct(map);
1688 /// The Placeholder property.
1689 /// The placeholder map contains the following keys :<br />
1690 /// <list type="table">
1691 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1692 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1693 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1694 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1695 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1696 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1697 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1698 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1702 /// The following example demonstrates how to set the placeholder property.
1704 /// PropertyMap propertyMap = new PropertyMap();
1705 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1706 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1707 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1708 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1709 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1711 /// PropertyMap fontStyleMap = new PropertyMap();
1712 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1713 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1714 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1715 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1717 /// TextEditor editor = new TextEditor();
1718 /// editor.Placeholder = propertyMap;
1721 /// <since_tizen> 3 </since_tizen>
1722 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1723 public Tizen.NUI.PropertyMap Placeholder
1727 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1728 PropertyValue value = null;
1731 value = map.Find(0);
1734 value.Get(out string text);
1735 map.Add("text", new PropertyValue(text));
1739 value = map.Find(1);
1742 value.Get(out string textFocused);
1743 map.Add("textFocused", new PropertyValue(textFocused));
1747 value = map.Find(2);
1750 Color color = new Color();
1752 map.Add("color", new PropertyValue(color));
1756 value = map.Find(3);
1759 value.Get(out string fontFamily);
1760 map.Add("fontFamily", new PropertyValue(fontFamily));
1764 value = map.Find(4);
1767 PropertyMap fontStyle = new PropertyMap();
1768 value.Get(fontStyle);
1769 map.Add("fontStyle", new PropertyValue(fontStyle));
1773 value = map.Find(5);
1776 value.Get(out float pointSize);
1777 map.Add("pointSize", new PropertyValue(pointSize));
1781 value = map.Find(6);
1784 value.Get(out float pixelSize);
1785 map.Add("pixelSize", new PropertyValue(pixelSize));
1789 value = map.Find(7);
1792 value.Get(out bool ellipsis);
1793 map.Add("ellipsis", new PropertyValue(ellipsis));
1800 SetValue(PlaceholderProperty, value);
1801 NotifyPropertyChanged();
1806 /// Set Placeholder to TextEditor. <br />
1808 /// <param name="placeholder">The Placeholder</param>
1810 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1813 /// The following example demonstrates how to use the SetPlaceholder method.
1815 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1816 /// placeholder.Text = "placeholder text";
1817 /// placeholder.TextFocused = "placeholder textFocused";
1818 /// placeholder.Color = new Color("#45B39D");
1819 /// placeholder.FontFamily = "BreezeSans";
1820 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1822 /// Width = FontWidthType.Expanded,
1823 /// Weight = FontWeightType.ExtraLight,
1824 /// Slant = FontSlantType.Italic,
1826 /// placeholder.PointSize = 25.0f;
1827 /// //placeholder.PixelSize = 50.0f;
1828 /// placeholder.Ellipsis = true;
1829 /// editor.SetPlaceholder(placeholder);
1832 [EditorBrowsable(EditorBrowsableState.Never)]
1833 public void SetPlaceholder(Placeholder placeholder)
1835 SetValue(PlaceholderProperty, TextMapHelper.GetPlaceholderMap(placeholder));
1839 /// Get Placeholder from TextEditor. <br />
1841 /// <returns>The Placeholder</returns>
1843 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1845 [EditorBrowsable(EditorBrowsableState.Never)]
1846 public Placeholder GetPlaceholder()
1848 return TextMapHelper.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1852 /// The Ellipsis property.<br />
1853 /// Enable or disable the ellipsis.<br />
1855 /// <since_tizen> 9 </since_tizen>
1856 public bool Ellipsis
1860 return (bool)GetValue(EllipsisProperty);
1864 SetValue(EllipsisProperty, value);
1865 NotifyPropertyChanged();
1871 /// The ellipsis position of the text.
1872 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1874 /// <since_tizen> 9 </since_tizen>
1875 public EllipsisPosition EllipsisPosition
1879 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1883 SetValue(EllipsisPositionProperty, value);
1884 NotifyPropertyChanged();
1889 /// The LineWrapMode property.<br />
1890 /// The line wrap mode when the text lines over the layout width.<br />
1892 /// <since_tizen> 4 </since_tizen>
1893 public LineWrapMode LineWrapMode
1897 return (LineWrapMode)GetValue(LineWrapModeProperty);
1901 SetValue(LineWrapModeProperty, value);
1902 NotifyPropertyChanged();
1907 /// Enables Text selection using Shift key.
1909 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1910 [EditorBrowsable(EditorBrowsableState.Never)]
1911 public bool EnableShiftSelection
1915 return (bool)GetValue(EnableShiftSelectionProperty);
1919 SetValue(EnableShiftSelectionProperty, value);
1920 NotifyPropertyChanged();
1925 /// The text alignment to match the direction of the system language.
1927 /// <since_tizen> 6 </since_tizen>
1928 public bool MatchSystemLanguageDirection
1932 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1936 SetValue(MatchSystemLanguageDirectionProperty, value);
1937 NotifyPropertyChanged();
1942 /// The MaxLength property.<br />
1943 /// The maximum number of characters that can be inserted.<br />
1945 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1946 [EditorBrowsable(EditorBrowsableState.Never)]
1947 public int MaxLength
1951 return (int)GetValue(MaxLengthProperty);
1955 SetValue(MaxLengthProperty, value);
1956 NotifyPropertyChanged();
1960 /// Only used by the IL of xaml, will never changed to not hidden.
1961 [EditorBrowsable(EditorBrowsableState.Never)]
1962 public override bool IsCreateByXaml
1966 return base.IsCreateByXaml;
1970 base.IsCreateByXaml = value;
1974 this.TextChanged += (obj, e) =>
1976 this.Text = e.TextEditor.Text;
1983 /// The FontSizeScale property. <br />
1984 /// The default value is 1.0. <br />
1985 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
1986 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1988 /// <since_tizen> 9 </since_tizen>
1989 public float FontSizeScale
1993 return fontSizeScale;
1997 float newFontSizeScale;
1999 if (fontSizeScale == value) return;
2001 fontSizeScale = value;
2002 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2004 SystemSettingsFontSize systemSettingsFontSize;
2008 systemSettingsFontSize = SystemSettings.FontSize;
2012 Console.WriteLine("{0} Exception caught.", e);
2013 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2015 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2016 addFontSizeChangedCallback();
2020 newFontSizeScale = fontSizeScale;
2021 removeFontSizeChangedCallback();
2024 SetValue(FontSizeScaleProperty, newFontSizeScale);
2025 NotifyPropertyChanged();
2030 /// The InputMethodSettings property.<br />
2031 /// The settings to relating to the System's Input Method, Key and Value.<br />
2034 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
2037 /// The following example demonstrates how to set the InputMethodSettings property.
2039 /// InputMethod method = new InputMethod();
2040 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2041 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2042 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2043 /// method.Variation = 1;
2044 /// textEditor.InputMethodSettings = method.OutputMap;
2047 [EditorBrowsable(EditorBrowsableState.Never)]
2048 public PropertyMap InputMethodSettings
2052 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2056 SetValue(InputMethodSettingsProperty, value);
2057 NotifyPropertyChanged();
2062 /// Scroll the text control by specific amount..
2064 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2065 [EditorBrowsable(EditorBrowsableState.Never)]
2066 public void ScrollBy(Vector2 scroll)
2068 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2069 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2073 /// Get the InputMethodContext instance.
2075 /// <returns>The InputMethodContext instance.</returns>
2076 /// <since_tizen> 5 </since_tizen>
2077 public InputMethodContext GetInputMethodContext()
2079 if (inputMethodContext == null)
2081 /*Avoid raising InputMethodContext reference count.*/
2082 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2083 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2085 return inputMethodContext;
2089 /// Select the whole text.
2091 /// <since_tizen> 9 </since_tizen>
2092 public void SelectWholeText()
2094 Interop.TextEditor.SelectWholeText(SwigCPtr);
2095 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2099 /// Select text from start to end index. <br />
2100 /// The index is valid when 0 or positive.
2102 /// <param name="start">The start index for selection.</param>
2103 /// <param name="end">The end index for selection.</param>
2105 /// If the end index exceeds the maximum value, it is set to the length of the text.
2107 /// <since_tizen> 9 </since_tizen>
2108 public void SelectText(int start, int end)
2111 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2113 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2115 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2120 /// Clear selection of the text. <br />
2121 /// Valid when selection is activate.
2123 /// <since_tizen> 9 </since_tizen>
2124 public void SelectNone()
2126 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2131 /// The Enable grab handle property.<br />
2132 /// Enables the grab handles for text selection.<br />
2133 /// The default value is true, which means the grab handles are enabled by default.<br />
2135 [EditorBrowsable(EditorBrowsableState.Never)]
2136 public bool EnableGrabHandle
2140 return (bool)GetValue(EnableGrabHandleProperty);
2144 SetValue(EnableGrabHandleProperty, value);
2145 NotifyPropertyChanged();
2150 /// The Enable grab handle popup property.<br />
2151 /// Enables the grab handle popup for text selection.<br />
2152 /// The default value is true, which means the grab handle popup is enabled by default.<br />
2154 [EditorBrowsable(EditorBrowsableState.Never)]
2155 public bool EnableGrabHandlePopup
2159 return (bool)GetValue(EnableGrabHandlePopupProperty);
2163 SetValue(EnableGrabHandlePopupProperty, value);
2164 NotifyPropertyChanged();
2169 /// Minimum line size to be used.<br />
2170 /// The height of the line in points. <br />
2171 /// If the font size is larger than the line size, it works with the font size. <br />
2173 [EditorBrowsable(EditorBrowsableState.Never)]
2174 public float MinLineSize
2178 return (float)GetValue(MinLineSizeProperty);
2182 SetValue(MinLineSizeProperty, value);
2183 NotifyPropertyChanged();
2187 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2189 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));
2190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2197 /// <since_tizen> 3 </since_tizen>
2198 protected override void Dispose(DisposeTypes type)
2205 if (systemlangTextFlag)
2207 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2210 removeFontSizeChangedCallback();
2212 //Release your own unmanaged resources here.
2213 //You should not access any managed member here except static instance.
2214 //because the execution order of Finalizes is non-deterministic.
2218 if (textEditorTextChangedCallbackDelegate != null)
2220 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2223 if (textEditorMaxLengthReachedCallbackDelegate != null)
2225 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2228 if (textEditorSelectionClearedCallbackDelegate != null)
2230 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2233 if (textEditorCursorPositionChangedCallbackDelegate != null)
2235 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2238 if (textEditorSelectionChangedCallbackDelegate != null)
2240 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2247 /// This will not be public opened.
2248 [EditorBrowsable(EditorBrowsableState.Never)]
2249 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2251 // In order to speed up IME hide, temporarily add
2252 GetInputMethodContext()?.DestroyContext();
2253 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2256 private string SetTranslatable(string textEditorSid)
2258 string translatableText = null;
2259 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2260 if (translatableText != null)
2262 if (systemlangTextFlag == false)
2264 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2265 systemlangTextFlag = true;
2267 return translatableText;
2271 translatableText = "";
2272 return translatableText;
2276 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2278 if (textEditorTextSid != null)
2280 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2282 if (textEditorPlaceHolderTextSid != null)
2284 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2288 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2290 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2291 SetValue(FontSizeScaleProperty, newFontSizeScale);
2292 NotifyPropertyChanged();
2295 private void addFontSizeChangedCallback()
2297 if (hasFontSizeChangedCallback != true)
2301 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2302 hasFontSizeChangedCallback = true;
2306 Console.WriteLine("{0} Exception caught.", e);
2307 hasFontSizeChangedCallback = false;
2312 private void removeFontSizeChangedCallback()
2314 if (hasFontSizeChangedCallback == true)
2318 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2319 hasFontSizeChangedCallback = false;
2323 Console.WriteLine("{0} Exception caught.", e);
2324 hasFontSizeChangedCallback = true;
2329 internal new class Property
2331 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2332 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2333 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2334 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2335 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2336 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2337 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2338 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2339 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2340 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2341 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2342 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2343 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2344 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2345 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2346 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2347 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2348 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2349 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2350 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2351 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2352 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2353 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2354 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2355 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2356 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2357 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2358 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2359 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2360 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2361 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2362 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2363 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2364 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2365 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2366 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2367 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2368 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2369 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2370 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2371 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2372 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2373 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2374 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2375 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2376 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2377 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2378 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2379 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2380 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2381 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2382 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2383 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2384 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2385 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2386 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2387 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2388 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2389 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2390 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2391 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2392 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2393 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2394 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2395 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2396 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2397 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2398 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2399 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2400 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2403 internal class InputStyle
2409 FontFamily = 0x0002,
2412 LineSpacing = 0x0010,
2420 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2422 DecorationBoundingBox = new Rectangle(x, y, width, height);
2424 private void OnInputColorChanged(float x, float y, float z, float w)
2426 InputColor = new Vector4(x, y, z, w);
2428 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2430 PlaceholderTextColor = new Color(r, g, b, a);
2432 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2434 PrimaryCursorColor = new Vector4(x, y, z, w);
2436 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2438 SecondaryCursorColor = new Vector4(x, y, z, w);
2440 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2442 SelectionHighlightColor = new Vector4(x, y, z, w);
2444 private void OnTextColorChanged(float x, float y, float z, float w)
2446 TextColor = new Vector4(x, y, z, w);
2448 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2450 GrabHandleColor = new Color(r, g, b, a);