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;
40 private bool isSettingTextInCSharp = false;
42 static TextEditor() { }
45 /// Creates the TextEditor control.
47 /// <since_tizen> 3 </since_tizen>
48 public TextEditor() : this(Interop.TextEditor.New(), true)
50 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54 /// Creates the TextEditor with specified style.
56 [EditorBrowsable(EditorBrowsableState.Never)]
57 public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
62 /// Creates the TextEditor with setting the status of shown or hidden.
64 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
65 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
69 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73 internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
75 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 TextChanged += TextEditorTextChanged;
85 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
92 TextChanged += TextEditorTextChanged;
96 /// The TranslatableText property.<br />
97 /// The text can set the SID value.<br />
99 /// <exception cref='ArgumentNullException'>
100 /// ResourceManager about multilingual is null.
102 /// <since_tizen> 4 </since_tizen>
103 public string TranslatableText
107 return textEditorTextSid;
111 if (NUIApplication.MultilingualResourceManager == null)
113 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
115 textEditorTextSid = value;
116 Text = SetTranslatable(textEditorTextSid);
117 NotifyPropertyChanged();
121 /// The TranslatablePlaceholderText property.<br />
122 /// The text can set the SID value.<br />
124 /// <exception cref='ArgumentNullException'>
125 /// ResourceManager about multilingual is null.
127 /// <since_tizen> 4 </since_tizen>
128 public string TranslatablePlaceholderText
132 return textEditorPlaceHolderTextSid;
136 if (NUIApplication.MultilingualResourceManager == null)
138 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
140 textEditorPlaceHolderTextSid = value;
141 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
142 NotifyPropertyChanged();
147 /// The Text property.
149 /// <since_tizen> 3 </since_tizen>
154 return (string)GetValue(TextProperty);
158 SetValue(TextProperty, value);
159 NotifyPropertyChanged();
164 /// The TextColor property.
167 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
169 /// <since_tizen> 3 </since_tizen>
170 public Vector4 TextColor
174 Vector4 temp = (Vector4)GetValue(TextColorProperty);
175 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
179 SetValue(TextColorProperty, value);
180 NotifyPropertyChanged();
185 /// The FontFamily property.
187 /// <since_tizen> 3 </since_tizen>
188 public string FontFamily
192 return (string)GetValue(FontFamilyProperty);
196 SetValue(FontFamilyProperty, value);
197 NotifyPropertyChanged();
202 /// The FontStyle property.
203 /// The fontStyle map contains the following keys :<br />
204 /// <list type="table">
205 /// <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>
206 /// <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>
207 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
210 /// <since_tizen> 3 </since_tizen>
211 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
212 public PropertyMap FontStyle
216 return (PropertyMap)GetValue(FontStyleProperty);
220 SetValue(FontStyleProperty, value);
221 NotifyPropertyChanged();
226 /// Set FontStyle to TextEditor. <br />
228 /// <param name="fontStyle">The FontStyle</param>
230 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
233 /// The following example demonstrates how to use the SetFontStyle method.
235 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
236 /// fontStyle.Width = FontWidthType.Expanded;
237 /// fontStyle.Weight = FontWeightType.Bold;
238 /// fontStyle.Slant = FontSlantType.Italic;
239 /// editor.SetFontStyle(fontStyle);
242 [EditorBrowsable(EditorBrowsableState.Never)]
243 public void SetFontStyle(FontStyle fontStyle)
245 SetValue(FontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
249 /// Get FontStyle from TextEditor. <br />
251 /// <returns>The FontStyle</returns>
253 /// <see cref="Tizen.NUI.Text.FontStyle"/>
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 public FontStyle GetFontStyle()
258 return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
262 /// The PointSize property.
264 /// <since_tizen> 3 </since_tizen>
265 public float PointSize
269 return (float)GetValue(PointSizeProperty);
273 SetValue(PointSizeProperty, value);
274 NotifyPropertyChanged();
279 /// The HorizontalAlignment property.
281 /// <since_tizen> 3 </since_tizen>
282 public HorizontalAlignment HorizontalAlignment
286 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
290 SetValue(HorizontalAlignmentProperty, value);
291 NotifyPropertyChanged();
296 /// The ScrollThreshold property.
298 /// <since_tizen> 3 </since_tizen>
299 public float ScrollThreshold
303 return (float)GetValue(ScrollThresholdProperty);
307 SetValue(ScrollThresholdProperty, value);
308 NotifyPropertyChanged();
313 /// The ScrollSpeed property.
315 /// <since_tizen> 3 </since_tizen>
316 public float ScrollSpeed
320 return (float)GetValue(ScrollSpeedProperty);
324 SetValue(ScrollSpeedProperty, value);
325 NotifyPropertyChanged();
330 /// The PrimaryCursorColor property.
333 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
335 /// <since_tizen> 3 </since_tizen>
336 public Vector4 PrimaryCursorColor
340 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
341 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
345 SetValue(PrimaryCursorColorProperty, value);
346 NotifyPropertyChanged();
351 /// The SecondaryCursorColor property.
354 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
356 /// <since_tizen> 3 </since_tizen>
357 public Vector4 SecondaryCursorColor
361 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
362 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
366 SetValue(SecondaryCursorColorProperty, value);
367 NotifyPropertyChanged();
372 /// The EnableCursorBlink property.
374 /// <since_tizen> 3 </since_tizen>
375 public bool EnableCursorBlink
379 return (bool)GetValue(EnableCursorBlinkProperty);
383 SetValue(EnableCursorBlinkProperty, value);
384 NotifyPropertyChanged();
389 /// The CursorBlinkInterval property.
391 /// <since_tizen> 3 </since_tizen>
392 public float CursorBlinkInterval
396 return (float)GetValue(CursorBlinkIntervalProperty);
400 SetValue(CursorBlinkIntervalProperty, value);
401 NotifyPropertyChanged();
406 /// The CursorBlinkDuration property.
408 /// <since_tizen> 3 </since_tizen>
409 public float CursorBlinkDuration
413 return (float)GetValue(CursorBlinkDurationProperty);
417 SetValue(CursorBlinkDurationProperty, value);
418 NotifyPropertyChanged();
423 /// The CursorWidth property.
425 /// <since_tizen> 3 </since_tizen>
426 public int CursorWidth
430 return (int)GetValue(CursorWidthProperty);
434 SetValue(CursorWidthProperty, value);
435 NotifyPropertyChanged();
440 /// The GrabHandleImage property.
442 /// <since_tizen> 3 </since_tizen>
443 public string GrabHandleImage
447 return (string)GetValue(GrabHandleImageProperty);
451 SetValue(GrabHandleImageProperty, value);
452 NotifyPropertyChanged();
457 /// The GrabHandlePressedImage property.
459 /// <since_tizen> 3 </since_tizen>
460 public string GrabHandlePressedImage
464 return (string)GetValue(GrabHandlePressedImageProperty);
468 SetValue(GrabHandlePressedImageProperty, value);
469 NotifyPropertyChanged();
474 /// The SelectionHandleImageLeft property.
475 /// The selectionHandleImageLeft map contains the following key :<br />
476 /// <list type="table">
477 /// <item><term>filename (string)</term><description>The path of image file</description></item>
480 /// <since_tizen> 3 </since_tizen>
481 public PropertyMap SelectionHandleImageLeft
485 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
489 SetValue(SelectionHandleImageLeftProperty, value);
490 NotifyPropertyChanged();
495 /// The SelectionHandleImageRight property.
496 /// The selectionHandleImageRight map contains the following key :<br />
497 /// <list type="table">
498 /// <item><term>filename (string)</term><description>The path of image file</description></item>
501 /// <since_tizen> 3 </since_tizen>
502 public PropertyMap SelectionHandleImageRight
506 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
510 SetValue(SelectionHandleImageRightProperty, value);
511 NotifyPropertyChanged();
516 /// Set SelectionHandleImage to TextEditor. <br />
518 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
520 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
523 /// The following example demonstrates how to use the SetSelectionHandleImage method.
525 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
526 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
527 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
528 /// editor.SetSelectionHandleImage(selectionHandleImage);
531 [EditorBrowsable(EditorBrowsableState.Never)]
532 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
534 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
536 SetValue(SelectionHandleImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl));
539 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
541 SetValue(SelectionHandleImageRightProperty, TextUtils.GetFileNameMap(selectionHandleImage.RightImageUrl));
546 /// Get SelectionHandleImage from TextEditor. <br />
548 /// <returns>The SelectionHandleImage</returns>
550 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
552 [EditorBrowsable(EditorBrowsableState.Never)]
553 public SelectionHandleImage GetSelectionHandleImage()
555 return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
559 /// The SelectionHandlePressedImageLeft property.
560 /// The selectionHandlePressedImageLeft map contains the following key :<br />
561 /// <list type="table">
562 /// <item><term>filename (string)</term><description>The path of image file</description></item>
565 /// <since_tizen> 3 </since_tizen>
566 public PropertyMap SelectionHandlePressedImageLeft
570 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
574 SetValue(SelectionHandlePressedImageLeftProperty, value);
575 NotifyPropertyChanged();
580 /// The SelectionHandlePressedImageRight property.
581 /// The selectionHandlePressedImageRight map contains the following key :<br />
582 /// <list type="table">
583 /// <item><term>filename (string)</term><description>The path of image file</description></item>
586 /// <since_tizen> 3 </since_tizen>
587 public PropertyMap SelectionHandlePressedImageRight
591 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
595 SetValue(SelectionHandlePressedImageRightProperty, value);
596 NotifyPropertyChanged();
601 /// Set SelectionHandlePressedImage to TextEditor. <br />
603 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
605 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
608 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
610 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
611 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
612 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
613 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
616 [EditorBrowsable(EditorBrowsableState.Never)]
617 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
619 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
621 SetValue(SelectionHandlePressedImageLeftProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
624 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
626 SetValue(SelectionHandlePressedImageRightProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
631 /// Get SelectionHandlePressedImage from TextEditor. <br />
633 /// <returns>The SelectionHandlePressedImage</returns>
635 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
637 [EditorBrowsable(EditorBrowsableState.Never)]
638 public SelectionHandleImage GetSelectionHandlePressedImage()
640 return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
644 /// The SelectionHandleMarkerImageLeft property.
645 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
646 /// <list type="table">
647 /// <item><term>filename (string)</term><description>The path of image file</description></item>
650 /// <since_tizen> 3 </since_tizen>
651 public PropertyMap SelectionHandleMarkerImageLeft
655 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
659 SetValue(SelectionHandleMarkerImageLeftProperty, value);
660 NotifyPropertyChanged();
665 /// The SelectionHandleMarkerImageRight property.
666 /// The selectionHandleMarkerImageRight map contains the following key :<br />
667 /// <list type="table">
668 /// <item><term>filename (string)</term><description>The path of image file</description></item>
671 /// <since_tizen> 3 </since_tizen>
672 public PropertyMap SelectionHandleMarkerImageRight
676 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
680 SetValue(SelectionHandleMarkerImageRightProperty, value);
681 NotifyPropertyChanged();
686 /// Set SelectionHandleMarkerImage to TextEditor. <br />
688 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
690 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
693 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
695 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
696 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
697 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
698 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
701 [EditorBrowsable(EditorBrowsableState.Never)]
702 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
704 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
706 SetValue(SelectionHandleMarkerImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
709 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
711 SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
716 /// Get SelectionHandleMarkerImage from TextEditor. <br />
718 /// <returns>The SelectionHandleMarkerImage</returns>
720 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
722 [EditorBrowsable(EditorBrowsableState.Never)]
723 public SelectionHandleImage GetSelectionHandleMarkerImage()
725 return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
729 /// The SelectionHighlightColor property.
732 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
734 /// <since_tizen> 3 </since_tizen>
735 public Vector4 SelectionHighlightColor
739 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
740 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
744 SetValue(SelectionHighlightColorProperty, value);
745 NotifyPropertyChanged();
750 /// The DecorationBoundingBox property.
753 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
755 /// <since_tizen> 3 </since_tizen>
756 public Rectangle DecorationBoundingBox
760 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
761 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
765 SetValue(DecorationBoundingBoxProperty, value);
766 NotifyPropertyChanged();
771 /// The EnableMarkup property.
773 /// <since_tizen> 3 </since_tizen>
774 public bool EnableMarkup
778 return (bool)GetValue(EnableMarkupProperty);
782 SetValue(EnableMarkupProperty, value);
783 NotifyPropertyChanged();
788 /// The InputColor property.
791 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
793 /// <since_tizen> 3 </since_tizen>
794 public Vector4 InputColor
798 Vector4 temp = (Vector4)GetValue(InputColorProperty);
799 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
803 SetValue(InputColorProperty, value);
804 NotifyPropertyChanged();
809 /// The InputFontFamily property.
811 /// <since_tizen> 3 </since_tizen>
812 public string InputFontFamily
816 return (string)GetValue(InputFontFamilyProperty);
820 SetValue(InputFontFamilyProperty, value);
821 NotifyPropertyChanged();
826 /// The InputFontStyle property.
827 /// The inputFontStyle map contains the following keys :<br />
828 /// <list type="table">
829 /// <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>
830 /// <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>
831 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
834 /// <since_tizen> 3 </since_tizen>
835 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
836 public PropertyMap InputFontStyle
840 return (PropertyMap)GetValue(InputFontStyleProperty);
844 SetValue(InputFontStyleProperty, value);
845 NotifyPropertyChanged();
850 /// Set InputFontStyle to TextEditor. <br />
852 /// <param name="fontStyle">The FontStyle</param>
854 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
857 /// The following example demonstrates how to use the SetInputFontStyle method.
859 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
860 /// fontStyle.Width = FontWidthType.Expanded;
861 /// fontStyle.Weight = FontWeightType.Bold;
862 /// fontStyle.Slant = FontSlantType.Italic;
863 /// editor.SetInputFontStyle(fontStyle);
866 [EditorBrowsable(EditorBrowsableState.Never)]
867 public void SetInputFontStyle(FontStyle fontStyle)
869 SetValue(InputFontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
873 /// Get InputFontStyle from TextEditor. <br />
875 /// <returns>The FontStyle</returns>
877 /// <see cref="Tizen.NUI.Text.FontStyle"/>
879 [EditorBrowsable(EditorBrowsableState.Never)]
880 public FontStyle GetInputFontStyle()
882 return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
886 /// The InputPointSize property.
888 /// <since_tizen> 3 </since_tizen>
889 public float InputPointSize
893 return (float)GetValue(InputPointSizeProperty);
897 SetValue(InputPointSizeProperty, value);
898 NotifyPropertyChanged();
903 /// The LineSpacing property.
905 /// <since_tizen> 3 </since_tizen>
906 public float LineSpacing
910 return (float)GetValue(LineSpacingProperty);
914 SetValue(LineSpacingProperty, value);
915 NotifyPropertyChanged();
920 /// The InputLineSpacing property.
922 /// <since_tizen> 3 </since_tizen>
923 public float InputLineSpacing
927 return (float)GetValue(InputLineSpacingProperty);
931 SetValue(InputLineSpacingProperty, value);
932 NotifyPropertyChanged();
937 /// The Underline property.
938 /// The underline map contains the following keys :<br />
939 /// <list type="table">
940 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
941 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
942 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
945 /// <since_tizen> 3 </since_tizen>
946 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
947 public PropertyMap Underline
951 return (PropertyMap)GetValue(UnderlineProperty);
955 SetValue(UnderlineProperty, value);
956 NotifyPropertyChanged();
961 /// Set Underline to TextEditor. <br />
963 /// <param name="underline">The Underline</param>
965 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
968 /// The following example demonstrates how to use the SetUnderline method.
970 /// var underline = new Tizen.NUI.Text.Underline();
971 /// underline.Enable = true;
972 /// underline.Color = new Color("#3498DB");
973 /// underline.Height = 2.0f;
974 /// editor.SetUnderline(underline);
977 [EditorBrowsable(EditorBrowsableState.Never)]
978 public void SetUnderline(Underline underline)
980 SetValue(UnderlineProperty, TextUtils.GetUnderlineMap(underline));
984 /// Get Underline from TextEditor. <br />
986 /// <returns>The Underline</returns>
988 /// <see cref="Tizen.NUI.Text.Underline"/>
990 [EditorBrowsable(EditorBrowsableState.Never)]
991 public Underline GetUnderline()
993 return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
997 /// The InputUnderline property.
999 /// <since_tizen> 3 </since_tizen>
1000 public string InputUnderline
1004 return (string)GetValue(InputUnderlineProperty);
1008 SetValue(InputUnderlineProperty, value);
1009 NotifyPropertyChanged();
1014 /// The Shadow property.
1015 /// The shadow map contains the following keys :<br />
1016 /// <list type="table">
1017 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1018 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1019 /// <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>
1022 /// <since_tizen> 3 </since_tizen>
1023 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1024 public PropertyMap Shadow
1028 return (PropertyMap)GetValue(ShadowProperty);
1032 SetValue(ShadowProperty, value);
1033 NotifyPropertyChanged();
1038 /// Set Shadow to TextEditor. <br />
1040 /// <param name="shadow">The Shadow</param>
1042 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1045 /// The following example demonstrates how to use the SetShadow method.
1047 /// var shadow = new Tizen.NUI.Text.Shadow();
1048 /// shadow.Offset = new Vector2(3, 3);
1049 /// shadow.Color = new Color("#F1C40F");
1050 /// editor.SetShadow(shadow);
1053 [EditorBrowsable(EditorBrowsableState.Never)]
1054 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1056 SetValue(ShadowProperty, TextUtils.GetShadowMap(shadow));
1060 /// Get Shadow from TextEditor. <br />
1062 /// <returns>The Shadow</returns>
1064 /// <see cref="Tizen.NUI.Text.Shadow"/>
1066 [EditorBrowsable(EditorBrowsableState.Never)]
1067 public Tizen.NUI.Text.Shadow GetShadow()
1069 return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
1073 /// The InputShadow property.
1075 /// <since_tizen> 3 </since_tizen>
1076 public string InputShadow
1080 return (string)GetValue(InputShadowProperty);
1084 SetValue(InputShadowProperty, value);
1085 NotifyPropertyChanged();
1090 /// The Emboss property.
1092 /// <since_tizen> 3 </since_tizen>
1093 public string Emboss
1097 return (string)GetValue(EmbossProperty);
1101 SetValue(EmbossProperty, value);
1102 NotifyPropertyChanged();
1107 /// The InputEmboss property.
1109 /// <since_tizen> 3 </since_tizen>
1110 public string InputEmboss
1114 return (string)GetValue(InputEmbossProperty);
1118 SetValue(InputEmbossProperty, value);
1119 NotifyPropertyChanged();
1124 /// The Outline property.
1125 /// The outline map contains the following keys :<br />
1126 /// <list type="table">
1127 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1128 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1131 /// <since_tizen> 3 </since_tizen>
1132 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1133 public PropertyMap Outline
1137 return (PropertyMap)GetValue(OutlineProperty);
1141 SetValue(OutlineProperty, value);
1142 NotifyPropertyChanged();
1147 /// Set Outline to TextEditor. <br />
1149 /// <param name="outline">The Outline</param>
1151 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1154 /// The following example demonstrates how to use the SetOutline method.
1156 /// var outline = new Tizen.NUI.Text.Outline();
1157 /// outline.Width = 2.0f;
1158 /// outline.Color = new Color("#45B39D");
1159 /// editor.SetOutline(outline);
1162 [EditorBrowsable(EditorBrowsableState.Never)]
1163 public void SetOutline(Outline outline)
1165 SetValue(OutlineProperty, TextUtils.GetOutlineMap(outline));
1169 /// Get Outline from TextEditor. <br />
1171 /// <returns>The Outline</returns>
1173 /// <see cref="Tizen.NUI.Text.Outline"/>
1175 [EditorBrowsable(EditorBrowsableState.Never)]
1176 public Outline GetOutline()
1178 return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
1182 /// The InputOutline property.
1184 /// <since_tizen> 3 </since_tizen>
1185 public string InputOutline
1189 return (string)GetValue(InputOutlineProperty);
1193 SetValue(InputOutlineProperty, value);
1194 NotifyPropertyChanged();
1199 /// The SmoothScroll property.
1201 /// <since_tizen> 3 </since_tizen>
1202 public bool SmoothScroll
1206 return (bool)GetValue(SmoothScrollProperty);
1210 SetValue(SmoothScrollProperty, value);
1211 NotifyPropertyChanged();
1216 /// The SmoothScrollDuration property.
1218 /// <since_tizen> 3 </since_tizen>
1219 public float SmoothScrollDuration
1223 return (float)GetValue(SmoothScrollDurationProperty);
1227 SetValue(SmoothScrollDurationProperty, value);
1228 NotifyPropertyChanged();
1233 /// The EnableScrollBar property.
1235 /// <since_tizen> 3 </since_tizen>
1236 public bool EnableScrollBar
1240 return (bool)GetValue(EnableScrollBarProperty);
1244 SetValue(EnableScrollBarProperty, value);
1245 NotifyPropertyChanged();
1250 /// The ScrollBarShowDuration property.
1252 /// <since_tizen> 3 </since_tizen>
1253 public float ScrollBarShowDuration
1257 return (float)GetValue(ScrollBarShowDurationProperty);
1261 SetValue(ScrollBarShowDurationProperty, value);
1262 NotifyPropertyChanged();
1267 /// The ScrollBarFadeDuration property.
1269 /// <since_tizen> 3 </since_tizen>
1270 public float ScrollBarFadeDuration
1274 return (float)GetValue(ScrollBarFadeDurationProperty);
1278 SetValue(ScrollBarFadeDurationProperty, value);
1279 NotifyPropertyChanged();
1284 /// The PixelSize property.
1286 /// <since_tizen> 3 </since_tizen>
1287 public float PixelSize
1291 return (float)GetValue(PixelSizeProperty);
1295 SetValue(PixelSizeProperty, value);
1296 NotifyPropertyChanged();
1301 /// The line count of the text.
1303 /// <since_tizen> 3 </since_tizen>
1304 public int LineCount
1309 GetProperty(TextEditor.Property.LineCount).Get(out temp);
1315 /// The text to display when the TextEditor is empty and inactive.
1317 /// <since_tizen> 3 </since_tizen>
1318 public string PlaceholderText
1322 return (string)GetValue(PlaceholderTextProperty);
1326 SetValue(PlaceholderTextProperty, value);
1327 NotifyPropertyChanged();
1332 /// The portion of the text that has been selected by the user.
1335 /// Empty string when nothing is selected.
1337 /// <since_tizen> 9 </since_tizen>
1338 public string SelectedText
1343 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1349 /// The Placeholder text color.
1352 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1354 /// <since_tizen> 3 </since_tizen>
1355 public Color PlaceholderTextColor
1359 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1360 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1364 SetValue(PlaceholderTextColorProperty, value);
1365 NotifyPropertyChanged();
1370 /// The EnableSelection property.
1372 /// <since_tizen> 3 </since_tizen>
1373 public bool EnableSelection
1377 return (bool)GetValue(EnableSelectionProperty);
1381 SetValue(EnableSelectionProperty, value);
1382 NotifyPropertyChanged();
1387 /// The start index for selection.
1390 /// When there is no selection, the index is current cursor position.
1392 /// <since_tizen> 9 </since_tizen>
1393 public int SelectedTextStart
1398 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1404 /// The end index for selection.
1407 /// When there is no selection, the index is current cursor position.
1409 /// <since_tizen> 9 </since_tizen>
1410 public int SelectedTextEnd
1415 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1421 /// Enable editing in text control.
1423 /// <since_tizen> 8 </since_tizen>
1424 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1425 [EditorBrowsable(EditorBrowsableState.Never)]
1426 public bool EnableEditing
1431 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1436 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1437 NotifyPropertyChanged();
1442 /// Specify horizontal scroll position in text control.
1444 [EditorBrowsable(EditorBrowsableState.Never)]
1445 public int HorizontalScrollPosition
1450 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1452 propertyValue.Get(out temp);
1458 using (PropertyValue propertyValue = new PropertyValue(value))
1460 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1461 NotifyPropertyChanged();
1467 /// Specify vertical scroll position in text control.
1469 [EditorBrowsable(EditorBrowsableState.Never)]
1470 public int VerticalScrollPosition
1475 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1477 propertyValue.Get(out temp);
1483 using (PropertyValue propertyValue = new PropertyValue(value))
1485 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1486 NotifyPropertyChanged();
1492 /// Specify primary cursor (caret) position in text control.
1494 [EditorBrowsable(EditorBrowsableState.Never)]
1495 public int PrimaryCursorPosition
1500 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1502 propertyValue.Get(out temp);
1508 using (PropertyValue propertyValue = new PropertyValue(value))
1510 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1511 NotifyPropertyChanged();
1517 /// The GrabHandleColor property.
1520 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1522 [EditorBrowsable(EditorBrowsableState.Never)]
1523 public Color GrabHandleColor
1527 Color temp = (Color)GetValue(GrabHandleColorProperty);
1528 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1532 SetValue(GrabHandleColorProperty, value);
1533 NotifyPropertyChanged();
1538 /// Set InputFilter to TextEditor.
1540 /// <param name="inputFilter">The InputFilter</param>
1542 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1543 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1544 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1547 /// The following example demonstrates how to use the SetInputFilter method.
1549 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1550 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1551 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1552 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1555 /// <since_tizen> 9 </since_tizen>
1556 public void SetInputFilter(InputFilter inputFilter)
1558 SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1562 /// Get InputFilter from TextEditor. <br />
1564 /// <returns>The InputFilter</returns>
1566 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1568 /// <since_tizen> 9 </since_tizen>
1569 public InputFilter GetInputFilter()
1571 var map = new PropertyMap();
1572 GetProperty(TextEditor.Property.InputFilter).Get(map);
1573 return TextUtils.GetInputFilterStruct(map);
1577 /// The Placeholder property.
1578 /// The placeholder map contains the following keys :<br />
1579 /// <list type="table">
1580 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1581 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1582 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1583 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1584 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1585 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1586 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1587 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1591 /// The following example demonstrates how to set the placeholder property.
1593 /// PropertyMap propertyMap = new PropertyMap();
1594 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1595 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1596 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1597 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1598 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1600 /// PropertyMap fontStyleMap = new PropertyMap();
1601 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1602 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1603 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1604 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1606 /// TextEditor editor = new TextEditor();
1607 /// editor.Placeholder = propertyMap;
1610 /// <since_tizen> 3 </since_tizen>
1611 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1612 public Tizen.NUI.PropertyMap Placeholder
1616 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1617 PropertyValue value = null;
1620 value = map.Find(0);
1623 value.Get(out string text);
1624 map.Add("text", new PropertyValue(text));
1628 value = map.Find(1);
1631 value.Get(out string textFocused);
1632 map.Add("textFocused", new PropertyValue(textFocused));
1636 value = map.Find(2);
1639 Color color = new Color();
1641 map.Add("color", new PropertyValue(color));
1645 value = map.Find(3);
1648 value.Get(out string fontFamily);
1649 map.Add("fontFamily", new PropertyValue(fontFamily));
1653 value = map.Find(4);
1656 PropertyMap fontStyle = new PropertyMap();
1657 value.Get(fontStyle);
1658 map.Add("fontStyle", new PropertyValue(fontStyle));
1662 value = map.Find(5);
1665 value.Get(out float pointSize);
1666 map.Add("pointSize", new PropertyValue(pointSize));
1670 value = map.Find(6);
1673 value.Get(out float pixelSize);
1674 map.Add("pixelSize", new PropertyValue(pixelSize));
1678 value = map.Find(7);
1681 value.Get(out bool ellipsis);
1682 map.Add("ellipsis", new PropertyValue(ellipsis));
1689 SetValue(PlaceholderProperty, value);
1690 NotifyPropertyChanged();
1695 /// Set Placeholder to TextEditor. <br />
1697 /// <param name="placeholder">The Placeholder</param>
1699 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1702 /// The following example demonstrates how to use the SetPlaceholder method.
1704 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1705 /// placeholder.Text = "placeholder text";
1706 /// placeholder.TextFocused = "placeholder textFocused";
1707 /// placeholder.Color = new Color("#45B39D");
1708 /// placeholder.FontFamily = "BreezeSans";
1709 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1711 /// Width = FontWidthType.Expanded,
1712 /// Weight = FontWeightType.ExtraLight,
1713 /// Slant = FontSlantType.Italic,
1715 /// placeholder.PointSize = 25.0f;
1716 /// //placeholder.PixelSize = 50.0f;
1717 /// placeholder.Ellipsis = true;
1718 /// editor.SetPlaceholder(placeholder);
1721 [EditorBrowsable(EditorBrowsableState.Never)]
1722 public void SetPlaceholder(Placeholder placeholder)
1724 SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
1728 /// Get Placeholder from TextEditor. <br />
1730 /// <returns>The Placeholder</returns>
1732 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1734 [EditorBrowsable(EditorBrowsableState.Never)]
1735 public Placeholder GetPlaceholder()
1737 return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1741 /// The Ellipsis property.<br />
1742 /// Enable or disable the ellipsis.<br />
1744 /// <since_tizen> 9 </since_tizen>
1745 public bool Ellipsis
1749 return (bool)GetValue(EllipsisProperty);
1753 SetValue(EllipsisProperty, value);
1754 NotifyPropertyChanged();
1760 /// The ellipsis position of the text.
1761 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1763 /// <since_tizen> 9 </since_tizen>
1764 public EllipsisPosition EllipsisPosition
1768 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1772 SetValue(EllipsisPositionProperty, value);
1773 NotifyPropertyChanged();
1778 /// The LineWrapMode property.<br />
1779 /// The line wrap mode when the text lines over the layout width.<br />
1781 /// <since_tizen> 4 </since_tizen>
1782 public LineWrapMode LineWrapMode
1786 return (LineWrapMode)GetValue(LineWrapModeProperty);
1790 SetValue(LineWrapModeProperty, value);
1791 NotifyPropertyChanged();
1796 /// Enables Text selection using Shift key.
1798 /// <since_tizen> 5 </since_tizen>
1799 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1800 [EditorBrowsable(EditorBrowsableState.Never)]
1801 public bool EnableShiftSelection
1805 return (bool)GetValue(EnableShiftSelectionProperty);
1809 SetValue(EnableShiftSelectionProperty, value);
1810 NotifyPropertyChanged();
1815 /// The text alignment to match the direction of the system language.
1817 /// <since_tizen> 6 </since_tizen>
1818 public bool MatchSystemLanguageDirection
1822 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1826 SetValue(MatchSystemLanguageDirectionProperty, value);
1827 NotifyPropertyChanged();
1832 /// The MaxLength property.
1834 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1835 [EditorBrowsable(EditorBrowsableState.Never)]
1836 public int MaxLength
1840 return (int)GetValue(MaxLengthProperty);
1844 SetValue(MaxLengthProperty, value);
1845 NotifyPropertyChanged();
1850 /// The FontSizeScale property. <br />
1851 /// The default value is 1.0. <br />
1852 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1854 /// <since_tizen> 9 </since_tizen>
1855 public float FontSizeScale
1859 return fontSizeScale;
1863 float newFontSizeScale;
1865 if (fontSizeScale == value) return;
1867 fontSizeScale = value;
1868 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1870 SystemSettingsFontSize systemSettingsFontSize;
1874 systemSettingsFontSize = SystemSettings.FontSize;
1878 Console.WriteLine("{0} Exception caught.", e);
1879 systemSettingsFontSize = SystemSettingsFontSize.Normal;
1881 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1882 addFontSizeChangedCallback();
1886 newFontSizeScale = fontSizeScale;
1887 removeFontSizeChangedCallback();
1890 SetValue(FontSizeScaleProperty, newFontSizeScale);
1891 NotifyPropertyChanged();
1896 /// The InputMethodSettings property.
1899 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1902 /// The following example demonstrates how to set the InputMethodSettings property.
1904 /// InputMethod method = new InputMethod();
1905 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1906 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1907 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1908 /// method.Variation = 1;
1909 /// textEditor.InputMethodSettings = method.OutputMap;
1912 [EditorBrowsable(EditorBrowsableState.Never)]
1913 public PropertyMap InputMethodSettings
1917 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1921 SetValue(InputMethodSettingsProperty, value);
1922 NotifyPropertyChanged();
1927 /// Scroll the text control by specific amount..
1929 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
1930 [EditorBrowsable(EditorBrowsableState.Never)]
1931 public void ScrollBy(Vector2 scroll)
1933 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
1934 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1938 /// Get the InputMethodContext instance.
1940 /// <returns>The InputMethodContext instance.</returns>
1941 /// <since_tizen> 5 </since_tizen>
1942 public InputMethodContext GetInputMethodContext()
1944 if (inputMethodContext == null)
1946 /*Avoid raising InputMethodContext reference count.*/
1947 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
1948 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1950 return inputMethodContext;
1954 /// Select the whole text.
1956 /// <since_tizen> 9 </since_tizen>
1957 public void SelectWholeText()
1959 Interop.TextEditor.SelectWholeText(SwigCPtr);
1960 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1964 /// Select text from start to end index. <br />
1965 /// The index is valid when 0 or positive.
1967 /// <param name="start">The start index for selection.</param>
1968 /// <param name="end">The end index for selection.</param>
1970 /// If the end index exceeds the maximum value, it is set to the length of the text.
1972 /// <since_tizen> 9 </since_tizen>
1973 public void SelectText(int start, int end)
1976 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
1978 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
1980 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
1981 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1985 /// Clear selection of the text. <br />
1986 /// Valid when selection is activate.
1988 /// <since_tizen> 9 </since_tizen>
1989 public void SelectNone()
1991 _ = Interop.TextEditor.SelectNone(SwigCPtr);
1992 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1996 /// Enable grab handle property.
1998 [EditorBrowsable(EditorBrowsableState.Never)]
1999 public bool EnableGrabHandle
2003 return (bool)GetValue(EnableGrabHandleProperty);
2007 SetValue(EnableGrabHandleProperty, value);
2008 NotifyPropertyChanged();
2013 /// Enable grab handle popup property.
2015 [EditorBrowsable(EditorBrowsableState.Never)]
2016 public bool EnableGrabHandlePopup
2020 return (bool)GetValue(EnableGrabHandlePopupProperty);
2024 SetValue(EnableGrabHandlePopupProperty, value);
2025 NotifyPropertyChanged();
2030 /// Minimum line size to be used.
2032 [EditorBrowsable(EditorBrowsableState.Never)]
2033 public float MinLineSize
2037 return (float)GetValue(MinLineSizeProperty);
2041 SetValue(MinLineSizeProperty, value);
2042 NotifyPropertyChanged();
2046 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2048 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));
2049 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2056 /// <since_tizen> 3 </since_tizen>
2057 protected override void Dispose(DisposeTypes type)
2064 if (systemlangTextFlag)
2066 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2069 removeFontSizeChangedCallback();
2071 //Release your own unmanaged resources here.
2072 //You should not access any managed member here except static instance.
2073 //because the execution order of Finalizes is non-deterministic.
2077 if (textEditorTextChangedCallbackDelegate != null)
2079 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2082 if (textEditorMaxLengthReachedCallbackDelegate != null)
2084 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2087 if (textEditorSelectionClearedCallbackDelegate != null)
2089 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2092 if (textEditorCursorPositionChangedCallbackDelegate != null)
2094 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2097 if (textEditorSelectionChangedCallbackDelegate != null)
2099 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2103 TextChanged -= TextEditorTextChanged;
2108 /// This will not be public opened.
2109 [EditorBrowsable(EditorBrowsableState.Never)]
2110 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2112 // In order to speed up IME hide, temporarily add
2113 GetInputMethodContext()?.DestroyContext();
2114 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2117 private string SetTranslatable(string textEditorSid)
2119 string translatableText = null;
2120 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2121 if (translatableText != null)
2123 if (systemlangTextFlag == false)
2125 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2126 systemlangTextFlag = true;
2128 return translatableText;
2132 translatableText = "";
2133 return translatableText;
2137 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2139 if (textEditorTextSid != null)
2141 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2143 if (textEditorPlaceHolderTextSid != null)
2145 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2149 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2151 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2152 SetValue(FontSizeScaleProperty, newFontSizeScale);
2153 NotifyPropertyChanged();
2156 private void addFontSizeChangedCallback()
2158 if (hasFontSizeChangedCallback != true)
2162 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2163 hasFontSizeChangedCallback = true;
2167 Console.WriteLine("{0} Exception caught.", e);
2168 hasFontSizeChangedCallback = false;
2173 private void removeFontSizeChangedCallback()
2175 if (hasFontSizeChangedCallback == true)
2179 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2180 hasFontSizeChangedCallback = false;
2184 Console.WriteLine("{0} Exception caught.", e);
2185 hasFontSizeChangedCallback = true;
2190 private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
2192 if (!isSettingTextInCSharp)
2194 EnforceNotifyBindedInstance(TextProperty);
2198 internal new class Property
2200 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2201 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2202 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2203 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2204 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2205 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2206 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2207 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2208 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2209 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2210 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2211 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2212 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2213 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2214 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2215 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2216 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2217 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2218 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2219 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2220 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2221 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2222 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2223 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2224 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2225 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2226 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2227 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2228 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2229 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2230 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2231 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2232 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2233 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2234 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2235 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2236 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2237 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2238 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2239 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2240 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2241 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2242 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2243 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2244 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2245 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2246 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2247 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2248 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2249 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2250 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2251 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2252 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2253 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2254 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2255 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2256 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2257 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2258 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2259 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2260 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2261 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2262 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2263 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2264 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2265 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2266 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2267 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2268 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2269 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2272 internal class InputStyle
2278 FontFamily = 0x0002,
2281 LineSpacing = 0x0010,
2289 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2291 DecorationBoundingBox = new Rectangle(x, y, width, height);
2293 private void OnInputColorChanged(float x, float y, float z, float w)
2295 InputColor = new Vector4(x, y, z, w);
2297 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2299 PlaceholderTextColor = new Color(r, g, b, a);
2301 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2303 PrimaryCursorColor = new Vector4(x, y, z, w);
2305 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2307 SecondaryCursorColor = new Vector4(x, y, z, w);
2309 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2311 SelectionHighlightColor = new Vector4(x, y, z, w);
2313 private void OnTextColorChanged(float x, float y, float z, float w)
2315 TextColor = new Vector4(x, y, z, w);
2317 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2319 GrabHandleColor = new Color(r, g, b, a);