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. <br />
1651 /// <param name="inputFilter">The InputFilter</param>
1653 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1654 /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1655 /// If both are used, Rejected has higher priority. <br />
1656 /// The character set must follow the regular expression rules. <br />
1657 /// Behaviour can not be guaranteed for incorrect grammars. <br />
1658 /// Refer the link below for detailed rules. <br />
1659 /// The functions in std::regex library use the ECMAScript grammar: <br />
1660 /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1661 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1662 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1665 /// The following example demonstrates how to use the SetInputFilter method.
1667 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1668 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1669 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1670 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1673 [EditorBrowsable(EditorBrowsableState.Never)]
1674 public void SetInputFilter(InputFilter inputFilter)
1676 SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextMapHelper.GetInputFilterMap(inputFilter)));
1680 /// Get InputFilter from TextEditor. <br />
1682 /// <returns>The InputFilter</returns>
1684 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1686 [EditorBrowsable(EditorBrowsableState.Never)]
1687 public InputFilter GetInputFilter()
1689 var map = new PropertyMap();
1690 GetProperty(TextEditor.Property.InputFilter).Get(map);
1691 return TextMapHelper.GetInputFilterStruct(map);
1695 /// The Placeholder property.
1696 /// The placeholder map contains the following keys :<br />
1697 /// <list type="table">
1698 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1699 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1700 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1701 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1702 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1703 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1704 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1705 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1709 /// The following example demonstrates how to set the placeholder property.
1711 /// PropertyMap propertyMap = new PropertyMap();
1712 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1713 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1714 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1715 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1716 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1718 /// PropertyMap fontStyleMap = new PropertyMap();
1719 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1720 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1721 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1722 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1724 /// TextEditor editor = new TextEditor();
1725 /// editor.Placeholder = propertyMap;
1728 /// <since_tizen> 3 </since_tizen>
1729 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1730 public Tizen.NUI.PropertyMap Placeholder
1734 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1735 PropertyValue value = null;
1738 value = map.Find(0);
1741 value.Get(out string text);
1742 map.Add("text", new PropertyValue(text));
1746 value = map.Find(1);
1749 value.Get(out string textFocused);
1750 map.Add("textFocused", new PropertyValue(textFocused));
1754 value = map.Find(2);
1757 Color color = new Color();
1759 map.Add("color", new PropertyValue(color));
1763 value = map.Find(3);
1766 value.Get(out string fontFamily);
1767 map.Add("fontFamily", new PropertyValue(fontFamily));
1771 value = map.Find(4);
1774 PropertyMap fontStyle = new PropertyMap();
1775 value.Get(fontStyle);
1776 map.Add("fontStyle", new PropertyValue(fontStyle));
1780 value = map.Find(5);
1783 value.Get(out float pointSize);
1784 map.Add("pointSize", new PropertyValue(pointSize));
1788 value = map.Find(6);
1791 value.Get(out float pixelSize);
1792 map.Add("pixelSize", new PropertyValue(pixelSize));
1796 value = map.Find(7);
1799 value.Get(out bool ellipsis);
1800 map.Add("ellipsis", new PropertyValue(ellipsis));
1807 SetValue(PlaceholderProperty, value);
1808 NotifyPropertyChanged();
1813 /// Set Placeholder to TextEditor. <br />
1815 /// <param name="placeholder">The Placeholder</param>
1817 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1820 /// The following example demonstrates how to use the SetPlaceholder method.
1822 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1823 /// placeholder.Text = "placeholder text";
1824 /// placeholder.TextFocused = "placeholder textFocused";
1825 /// placeholder.Color = new Color("#45B39D");
1826 /// placeholder.FontFamily = "BreezeSans";
1827 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1829 /// Width = FontWidthType.Expanded,
1830 /// Weight = FontWeightType.ExtraLight,
1831 /// Slant = FontSlantType.Italic,
1833 /// placeholder.PointSize = 25.0f;
1834 /// //placeholder.PixelSize = 50.0f;
1835 /// placeholder.Ellipsis = true;
1836 /// editor.SetPlaceholder(placeholder);
1839 [EditorBrowsable(EditorBrowsableState.Never)]
1840 public void SetPlaceholder(Placeholder placeholder)
1842 SetValue(PlaceholderProperty, TextMapHelper.GetPlaceholderMap(placeholder));
1846 /// Get Placeholder from TextEditor. <br />
1848 /// <returns>The Placeholder</returns>
1850 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1852 [EditorBrowsable(EditorBrowsableState.Never)]
1853 public Placeholder GetPlaceholder()
1855 return TextMapHelper.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1859 /// The Ellipsis property.<br />
1860 /// Enable or disable the ellipsis.<br />
1862 /// <since_tizen> 9 </since_tizen>
1863 public bool Ellipsis
1867 return (bool)GetValue(EllipsisProperty);
1871 SetValue(EllipsisProperty, value);
1872 NotifyPropertyChanged();
1878 /// The ellipsis position of the text.
1879 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1881 /// <since_tizen> 9 </since_tizen>
1882 public EllipsisPosition EllipsisPosition
1886 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1890 SetValue(EllipsisPositionProperty, value);
1891 NotifyPropertyChanged();
1896 /// The LineWrapMode property.<br />
1897 /// The line wrap mode when the text lines over the layout width.<br />
1899 /// <since_tizen> 4 </since_tizen>
1900 public LineWrapMode LineWrapMode
1904 return (LineWrapMode)GetValue(LineWrapModeProperty);
1908 SetValue(LineWrapModeProperty, value);
1909 NotifyPropertyChanged();
1914 /// Enables Text selection using Shift key.
1916 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1917 [EditorBrowsable(EditorBrowsableState.Never)]
1918 public bool EnableShiftSelection
1922 return (bool)GetValue(EnableShiftSelectionProperty);
1926 SetValue(EnableShiftSelectionProperty, value);
1927 NotifyPropertyChanged();
1932 /// The text alignment to match the direction of the system language.
1934 /// <since_tizen> 6 </since_tizen>
1935 public bool MatchSystemLanguageDirection
1939 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1943 SetValue(MatchSystemLanguageDirectionProperty, value);
1944 NotifyPropertyChanged();
1949 /// The MaxLength property.<br />
1950 /// The maximum number of characters that can be inserted.<br />
1952 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1953 [EditorBrowsable(EditorBrowsableState.Never)]
1954 public int MaxLength
1958 return (int)GetValue(MaxLengthProperty);
1962 SetValue(MaxLengthProperty, value);
1963 NotifyPropertyChanged();
1967 /// Only used by the IL of xaml, will never changed to not hidden.
1968 [EditorBrowsable(EditorBrowsableState.Never)]
1969 public override bool IsCreateByXaml
1973 return base.IsCreateByXaml;
1977 base.IsCreateByXaml = value;
1981 this.TextChanged += (obj, e) =>
1983 this.Text = e.TextEditor.Text;
1990 /// The FontSizeScale property. <br />
1991 /// The default value is 1.0. <br />
1992 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
1993 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1995 /// <since_tizen> 9 </since_tizen>
1996 public float FontSizeScale
2000 return fontSizeScale;
2004 float newFontSizeScale;
2006 if (fontSizeScale == value) return;
2008 fontSizeScale = value;
2009 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2011 SystemSettingsFontSize systemSettingsFontSize;
2015 systemSettingsFontSize = SystemSettings.FontSize;
2019 Console.WriteLine("{0} Exception caught.", e);
2020 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2022 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2023 addFontSizeChangedCallback();
2027 newFontSizeScale = fontSizeScale;
2028 removeFontSizeChangedCallback();
2031 SetValue(FontSizeScaleProperty, newFontSizeScale);
2032 NotifyPropertyChanged();
2037 /// The InputMethodSettings property.<br />
2038 /// The settings to relating to the System's Input Method, Key and Value.<br />
2041 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
2044 /// The following example demonstrates how to set the InputMethodSettings property.
2046 /// InputMethod method = new InputMethod();
2047 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2048 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2049 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2050 /// method.Variation = 1;
2051 /// textEditor.InputMethodSettings = method.OutputMap;
2054 [EditorBrowsable(EditorBrowsableState.Never)]
2055 public PropertyMap InputMethodSettings
2059 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2063 SetValue(InputMethodSettingsProperty, value);
2064 NotifyPropertyChanged();
2069 /// Scroll the text control by specific amount..
2071 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2072 [EditorBrowsable(EditorBrowsableState.Never)]
2073 public void ScrollBy(Vector2 scroll)
2075 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2076 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2080 /// Get the InputMethodContext instance.
2082 /// <returns>The InputMethodContext instance.</returns>
2083 /// <since_tizen> 5 </since_tizen>
2084 public InputMethodContext GetInputMethodContext()
2086 if (inputMethodContext == null)
2088 /*Avoid raising InputMethodContext reference count.*/
2089 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2090 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2092 return inputMethodContext;
2096 /// Select the whole text.
2098 /// <since_tizen> 9 </since_tizen>
2099 public void SelectWholeText()
2101 Interop.TextEditor.SelectWholeText(SwigCPtr);
2102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2106 /// Select text from start to end index. <br />
2107 /// The index is valid when 0 or positive.
2109 /// <param name="start">The start index for selection.</param>
2110 /// <param name="end">The end index for selection.</param>
2112 /// If the end index exceeds the maximum value, it is set to the length of the text.
2114 /// <since_tizen> 9 </since_tizen>
2115 public void SelectText(int start, int end)
2118 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2120 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2122 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2127 /// Clear selection of the text. <br />
2128 /// Valid when selection is activate.
2130 /// <since_tizen> 9 </since_tizen>
2131 public void SelectNone()
2133 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2138 /// The Enable grab handle property.<br />
2139 /// Enables the grab handles for text selection.<br />
2140 /// The default value is true, which means the grab handles are enabled by default.<br />
2142 [EditorBrowsable(EditorBrowsableState.Never)]
2143 public bool EnableGrabHandle
2147 return (bool)GetValue(EnableGrabHandleProperty);
2151 SetValue(EnableGrabHandleProperty, value);
2152 NotifyPropertyChanged();
2157 /// The Enable grab handle popup property.<br />
2158 /// Enables the grab handle popup for text selection.<br />
2159 /// The default value is true, which means the grab handle popup is enabled by default.<br />
2161 [EditorBrowsable(EditorBrowsableState.Never)]
2162 public bool EnableGrabHandlePopup
2166 return (bool)GetValue(EnableGrabHandlePopupProperty);
2170 SetValue(EnableGrabHandlePopupProperty, value);
2171 NotifyPropertyChanged();
2176 /// Minimum line size to be used.<br />
2177 /// The height of the line in points. <br />
2178 /// If the font size is larger than the line size, it works with the font size. <br />
2180 [EditorBrowsable(EditorBrowsableState.Never)]
2181 public float MinLineSize
2185 return (float)GetValue(MinLineSizeProperty);
2189 SetValue(MinLineSizeProperty, value);
2190 NotifyPropertyChanged();
2194 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2196 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));
2197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2204 /// <since_tizen> 3 </since_tizen>
2205 protected override void Dispose(DisposeTypes type)
2212 if (systemlangTextFlag)
2214 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2217 removeFontSizeChangedCallback();
2219 //Release your own unmanaged resources here.
2220 //You should not access any managed member here except static instance.
2221 //because the execution order of Finalizes is non-deterministic.
2225 if (textEditorTextChangedCallbackDelegate != null)
2227 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2230 if (textEditorMaxLengthReachedCallbackDelegate != null)
2232 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2235 if (textEditorSelectionClearedCallbackDelegate != null)
2237 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2240 if (textEditorCursorPositionChangedCallbackDelegate != null)
2242 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2245 if (textEditorSelectionChangedCallbackDelegate != null)
2247 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2254 /// This will not be public opened.
2255 [EditorBrowsable(EditorBrowsableState.Never)]
2256 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2258 // In order to speed up IME hide, temporarily add
2259 GetInputMethodContext()?.DestroyContext();
2260 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2263 private string SetTranslatable(string textEditorSid)
2265 string translatableText = null;
2266 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2267 if (translatableText != null)
2269 if (systemlangTextFlag == false)
2271 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2272 systemlangTextFlag = true;
2274 return translatableText;
2278 translatableText = "";
2279 return translatableText;
2283 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2285 if (textEditorTextSid != null)
2287 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2289 if (textEditorPlaceHolderTextSid != null)
2291 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2295 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2297 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2298 SetValue(FontSizeScaleProperty, newFontSizeScale);
2299 NotifyPropertyChanged();
2302 private void addFontSizeChangedCallback()
2304 if (hasFontSizeChangedCallback != true)
2308 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2309 hasFontSizeChangedCallback = true;
2313 Console.WriteLine("{0} Exception caught.", e);
2314 hasFontSizeChangedCallback = false;
2319 private void removeFontSizeChangedCallback()
2321 if (hasFontSizeChangedCallback == true)
2325 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2326 hasFontSizeChangedCallback = false;
2330 Console.WriteLine("{0} Exception caught.", e);
2331 hasFontSizeChangedCallback = true;
2336 internal new class Property
2338 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2339 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2340 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2341 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2342 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2343 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2344 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2345 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2346 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2347 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2348 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2349 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2350 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2351 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2352 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2353 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2354 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2355 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2356 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2357 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2358 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2359 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2360 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2361 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2362 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2363 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2364 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2365 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2366 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2367 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2368 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2369 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2370 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2371 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2372 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2373 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2374 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2375 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2376 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2377 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2378 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2379 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2380 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2381 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2382 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2383 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2384 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2385 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2386 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2387 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2388 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2389 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2390 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2391 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2392 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2393 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2394 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2395 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2396 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2397 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2398 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2399 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2400 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2401 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2402 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2403 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2404 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2405 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2406 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2407 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2410 internal class InputStyle
2416 FontFamily = 0x0002,
2419 LineSpacing = 0x0010,
2427 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2429 DecorationBoundingBox = new Rectangle(x, y, width, height);
2431 private void OnInputColorChanged(float x, float y, float z, float w)
2433 InputColor = new Vector4(x, y, z, w);
2435 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2437 PlaceholderTextColor = new Color(r, g, b, a);
2439 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2441 PrimaryCursorColor = new Vector4(x, y, z, w);
2443 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2445 SecondaryCursorColor = new Vector4(x, y, z, w);
2447 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2449 SelectionHighlightColor = new Vector4(x, y, z, w);
2451 private void OnTextColorChanged(float x, float y, float z, float w)
2453 TextColor = new Vector4(x, y, z, w);
2455 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2457 GrabHandleColor = new Color(r, g, b, a);