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 Selected Text property (read-only).
1334 /// <since_tizen> 9 </since_tizen>
1335 public string SelectedText
1340 GetProperty(TextEditor.Property.SelectedText).Get(out temp);
1346 /// The Placeholder text color.
1349 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1351 /// <since_tizen> 3 </since_tizen>
1352 public Color PlaceholderTextColor
1356 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1357 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1361 SetValue(PlaceholderTextColorProperty, value);
1362 NotifyPropertyChanged();
1367 /// The EnableSelection property.
1369 /// <since_tizen> 3 </since_tizen>
1370 public bool EnableSelection
1374 return (bool)GetValue(EnableSelectionProperty);
1378 SetValue(EnableSelectionProperty, value);
1379 NotifyPropertyChanged();
1384 /// The start index for selection.
1386 /// <since_tizen> 9 </since_tizen>
1387 public int SelectedTextStart
1392 GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
1398 /// The end index for selection.
1400 /// <since_tizen> 9 </since_tizen>
1401 public int SelectedTextEnd
1406 GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
1412 /// Enable editing in text control.
1414 /// <since_tizen> 8 </since_tizen>
1415 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1416 [EditorBrowsable(EditorBrowsableState.Never)]
1417 public bool EnableEditing
1422 GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
1427 SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
1428 NotifyPropertyChanged();
1433 /// Specify horizontal scroll position in text control.
1435 [EditorBrowsable(EditorBrowsableState.Never)]
1436 public int HorizontalScrollPosition
1441 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1443 propertyValue.Get(out temp);
1449 using (PropertyValue propertyValue = new PropertyValue(value))
1451 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1452 NotifyPropertyChanged();
1458 /// Specify vertical scroll position in text control.
1460 [EditorBrowsable(EditorBrowsableState.Never)]
1461 public int VerticalScrollPosition
1466 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1468 propertyValue.Get(out temp);
1474 using (PropertyValue propertyValue = new PropertyValue(value))
1476 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1477 NotifyPropertyChanged();
1483 /// Specify primary cursor (caret) position in text control.
1485 [EditorBrowsable(EditorBrowsableState.Never)]
1486 public int PrimaryCursorPosition
1491 using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1493 propertyValue.Get(out temp);
1499 using (PropertyValue propertyValue = new PropertyValue(value))
1501 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1502 NotifyPropertyChanged();
1508 /// The GrabHandleColor property.
1511 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1513 [EditorBrowsable(EditorBrowsableState.Never)]
1514 public Color GrabHandleColor
1518 Color temp = (Color)GetValue(GrabHandleColorProperty);
1519 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1523 SetValue(GrabHandleColorProperty, value);
1524 NotifyPropertyChanged();
1529 /// Set InputFilter to TextEditor. <br />
1531 /// <param name="inputFilter">The InputFilter</param>
1533 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1534 /// Users can set the Accepted or Rejected regular expression set, or both. <br />
1535 /// If both are used, Rejected has higher priority. <br />
1536 /// The character set must follow the regular expression rules. <br />
1537 /// Behaviour can not be guaranteed for incorrect grammars. <br />
1538 /// Refer the link below for detailed rules. <br />
1539 /// The functions in std::regex library use the ECMAScript grammar: <br />
1540 /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
1541 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1542 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
1545 /// The following example demonstrates how to use the SetInputFilter method.
1547 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1548 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1549 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1550 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1553 [EditorBrowsable(EditorBrowsableState.Never)]
1554 public void SetInputFilter(InputFilter inputFilter)
1556 SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
1560 /// Get InputFilter from TextEditor. <br />
1562 /// <returns>The InputFilter</returns>
1564 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1566 [EditorBrowsable(EditorBrowsableState.Never)]
1567 public InputFilter GetInputFilter()
1569 var map = new PropertyMap();
1570 GetProperty(TextEditor.Property.InputFilter).Get(map);
1571 return TextUtils.GetInputFilterStruct(map);
1575 /// The Placeholder property.
1576 /// The placeholder map contains the following keys :<br />
1577 /// <list type="table">
1578 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1579 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1580 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1581 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1582 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1583 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1584 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1585 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1589 /// The following example demonstrates how to set the placeholder property.
1591 /// PropertyMap propertyMap = new PropertyMap();
1592 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1593 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1594 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1595 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1596 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1598 /// PropertyMap fontStyleMap = new PropertyMap();
1599 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1600 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1601 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1602 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1604 /// TextEditor editor = new TextEditor();
1605 /// editor.Placeholder = propertyMap;
1608 /// <since_tizen> 3 </since_tizen>
1609 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1610 public Tizen.NUI.PropertyMap Placeholder
1614 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1615 PropertyValue value = null;
1618 value = map.Find(0);
1621 value.Get(out string text);
1622 map.Add("text", new PropertyValue(text));
1626 value = map.Find(1);
1629 value.Get(out string textFocused);
1630 map.Add("textFocused", new PropertyValue(textFocused));
1634 value = map.Find(2);
1637 Color color = new Color();
1639 map.Add("color", new PropertyValue(color));
1643 value = map.Find(3);
1646 value.Get(out string fontFamily);
1647 map.Add("fontFamily", new PropertyValue(fontFamily));
1651 value = map.Find(4);
1654 PropertyMap fontStyle = new PropertyMap();
1655 value.Get(fontStyle);
1656 map.Add("fontStyle", new PropertyValue(fontStyle));
1660 value = map.Find(5);
1663 value.Get(out float pointSize);
1664 map.Add("pointSize", new PropertyValue(pointSize));
1668 value = map.Find(6);
1671 value.Get(out float pixelSize);
1672 map.Add("pixelSize", new PropertyValue(pixelSize));
1676 value = map.Find(7);
1679 value.Get(out bool ellipsis);
1680 map.Add("ellipsis", new PropertyValue(ellipsis));
1687 SetValue(PlaceholderProperty, value);
1688 NotifyPropertyChanged();
1693 /// Set Placeholder to TextEditor. <br />
1695 /// <param name="placeholder">The Placeholder</param>
1697 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1700 /// The following example demonstrates how to use the SetPlaceholder method.
1702 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1703 /// placeholder.Text = "placeholder text";
1704 /// placeholder.TextFocused = "placeholder textFocused";
1705 /// placeholder.Color = new Color("#45B39D");
1706 /// placeholder.FontFamily = "BreezeSans";
1707 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1709 /// Width = FontWidthType.Expanded,
1710 /// Weight = FontWeightType.ExtraLight,
1711 /// Slant = FontSlantType.Italic,
1713 /// placeholder.PointSize = 25.0f;
1714 /// //placeholder.PixelSize = 50.0f;
1715 /// placeholder.Ellipsis = true;
1716 /// editor.SetPlaceholder(placeholder);
1719 [EditorBrowsable(EditorBrowsableState.Never)]
1720 public void SetPlaceholder(Placeholder placeholder)
1722 SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
1726 /// Get Placeholder from TextEditor. <br />
1728 /// <returns>The Placeholder</returns>
1730 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1732 [EditorBrowsable(EditorBrowsableState.Never)]
1733 public Placeholder GetPlaceholder()
1735 return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
1739 /// The Ellipsis property.<br />
1740 /// Enable or disable the ellipsis.<br />
1742 /// <since_tizen> 9 </since_tizen>
1743 public bool Ellipsis
1747 return (bool)GetValue(EllipsisProperty);
1751 SetValue(EllipsisProperty, value);
1752 NotifyPropertyChanged();
1758 /// The ellipsis position of the text.
1759 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
1761 /// <since_tizen> 9 </since_tizen>
1762 public EllipsisPosition EllipsisPosition
1766 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
1770 SetValue(EllipsisPositionProperty, value);
1771 NotifyPropertyChanged();
1776 /// The LineWrapMode property.<br />
1777 /// The line wrap mode when the text lines over the layout width.<br />
1779 /// <since_tizen> 4 </since_tizen>
1780 public LineWrapMode LineWrapMode
1784 return (LineWrapMode)GetValue(LineWrapModeProperty);
1788 SetValue(LineWrapModeProperty, value);
1789 NotifyPropertyChanged();
1794 /// Enables Text selection using Shift key.
1796 /// <since_tizen> 5 </since_tizen>
1797 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1798 [EditorBrowsable(EditorBrowsableState.Never)]
1799 public bool EnableShiftSelection
1803 return (bool)GetValue(EnableShiftSelectionProperty);
1807 SetValue(EnableShiftSelectionProperty, value);
1808 NotifyPropertyChanged();
1813 /// The text alignment to match the direction of the system language.
1815 /// <since_tizen> 6 </since_tizen>
1816 public bool MatchSystemLanguageDirection
1820 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1824 SetValue(MatchSystemLanguageDirectionProperty, value);
1825 NotifyPropertyChanged();
1830 /// The MaxLength property.
1832 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1833 [EditorBrowsable(EditorBrowsableState.Never)]
1834 public int MaxLength
1838 return (int)GetValue(MaxLengthProperty);
1842 SetValue(MaxLengthProperty, value);
1843 NotifyPropertyChanged();
1848 /// The FontSizeScale property. <br />
1849 /// The default value is 1.0. <br />
1850 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1852 /// <since_tizen> 9 </since_tizen>
1853 public float FontSizeScale
1857 return fontSizeScale;
1861 float newFontSizeScale;
1863 if (fontSizeScale == value) return;
1865 fontSizeScale = value;
1866 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1868 SystemSettingsFontSize systemSettingsFontSize;
1872 systemSettingsFontSize = SystemSettings.FontSize;
1876 Console.WriteLine("{0} Exception caught.", e);
1877 systemSettingsFontSize = SystemSettingsFontSize.Normal;
1879 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1880 addFontSizeChangedCallback();
1884 newFontSizeScale = fontSizeScale;
1885 removeFontSizeChangedCallback();
1888 SetValue(FontSizeScaleProperty, newFontSizeScale);
1889 NotifyPropertyChanged();
1894 /// The InputMethodSettings property.
1897 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
1900 /// The following example demonstrates how to set the InputMethodSettings property.
1902 /// InputMethod method = new InputMethod();
1903 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
1904 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
1905 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
1906 /// method.Variation = 1;
1907 /// textEditor.InputMethodSettings = method.OutputMap;
1910 [EditorBrowsable(EditorBrowsableState.Never)]
1911 public PropertyMap InputMethodSettings
1915 return (PropertyMap)GetValue(InputMethodSettingsProperty);
1919 SetValue(InputMethodSettingsProperty, value);
1920 NotifyPropertyChanged();
1925 /// Scroll the text control by specific amount..
1927 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
1928 [EditorBrowsable(EditorBrowsableState.Never)]
1929 public void ScrollBy(Vector2 scroll)
1931 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
1932 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1936 /// Get the InputMethodContext instance.
1938 /// <returns>The InputMethodContext instance.</returns>
1939 /// <since_tizen> 5 </since_tizen>
1940 public InputMethodContext GetInputMethodContext()
1942 if (inputMethodContext == null)
1944 /*Avoid raising InputMethodContext reference count.*/
1945 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
1946 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1948 return inputMethodContext;
1952 /// Select the whole text.
1954 /// <since_tizen> 9 </since_tizen>
1955 public void SelectWholeText()
1957 Interop.TextEditor.SelectWholeText(SwigCPtr);
1958 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1962 /// Select text from start to end index. <br />
1963 /// The index is valid when 0 or positive. <br />
1965 /// <param name="start">The start index for selection.</param>
1966 /// <param name="end">The end index for selection.</param>
1967 /// <since_tizen> 9 </since_tizen>
1968 public void SelectText(int start, int end)
1971 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
1973 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
1975 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
1976 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1980 /// Clear selection of the text.
1982 /// <since_tizen> 9 </since_tizen>
1983 public void SelectNone()
1985 _ = Interop.TextEditor.SelectNone(SwigCPtr);
1986 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1990 /// Enable grab handle property.
1992 [EditorBrowsable(EditorBrowsableState.Never)]
1993 public bool EnableGrabHandle
1997 return (bool)GetValue(EnableGrabHandleProperty);
2001 SetValue(EnableGrabHandleProperty, value);
2002 NotifyPropertyChanged();
2007 /// Enable grab handle popup property.
2009 [EditorBrowsable(EditorBrowsableState.Never)]
2010 public bool EnableGrabHandlePopup
2014 return (bool)GetValue(EnableGrabHandlePopupProperty);
2018 SetValue(EnableGrabHandlePopupProperty, value);
2019 NotifyPropertyChanged();
2024 /// Minimum line size to be used.
2026 [EditorBrowsable(EditorBrowsableState.Never)]
2027 public float MinLineSize
2031 return (float)GetValue(MinLineSizeProperty);
2035 SetValue(MinLineSizeProperty, value);
2036 NotifyPropertyChanged();
2040 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2042 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));
2043 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2050 /// <since_tizen> 3 </since_tizen>
2051 protected override void Dispose(DisposeTypes type)
2058 if (systemlangTextFlag)
2060 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2063 removeFontSizeChangedCallback();
2065 //Release your own unmanaged resources here.
2066 //You should not access any managed member here except static instance.
2067 //because the execution order of Finalizes is non-deterministic.
2071 if (textEditorTextChangedCallbackDelegate != null)
2073 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2076 if (textEditorMaxLengthReachedCallbackDelegate != null)
2078 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2081 if (textEditorSelectionClearedCallbackDelegate != null)
2083 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2086 if (textEditorCursorPositionChangedCallbackDelegate != null)
2088 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2091 if (textEditorSelectionChangedCallbackDelegate != null)
2093 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2097 TextChanged -= TextEditorTextChanged;
2102 /// This will not be public opened.
2103 [EditorBrowsable(EditorBrowsableState.Never)]
2104 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2106 // In order to speed up IME hide, temporarily add
2107 GetInputMethodContext()?.DestroyContext();
2108 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2111 private string SetTranslatable(string textEditorSid)
2113 string translatableText = null;
2114 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2115 if (translatableText != null)
2117 if (systemlangTextFlag == false)
2119 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2120 systemlangTextFlag = true;
2122 return translatableText;
2126 translatableText = "";
2127 return translatableText;
2131 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2133 if (textEditorTextSid != null)
2135 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2137 if (textEditorPlaceHolderTextSid != null)
2139 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2143 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2145 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2146 SetValue(FontSizeScaleProperty, newFontSizeScale);
2147 NotifyPropertyChanged();
2150 private void addFontSizeChangedCallback()
2152 if (hasFontSizeChangedCallback != true)
2156 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2157 hasFontSizeChangedCallback = true;
2161 Console.WriteLine("{0} Exception caught.", e);
2162 hasFontSizeChangedCallback = false;
2167 private void removeFontSizeChangedCallback()
2169 if (hasFontSizeChangedCallback == true)
2173 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2174 hasFontSizeChangedCallback = false;
2178 Console.WriteLine("{0} Exception caught.", e);
2179 hasFontSizeChangedCallback = true;
2184 private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
2186 if (!isSettingTextInCSharp)
2188 EnforceNotifyBindedInstance(TextProperty);
2192 internal new class Property
2194 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2195 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2196 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2197 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2198 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2199 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2200 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2201 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2202 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2203 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2204 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2205 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2206 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2207 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2208 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2209 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2210 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2211 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2212 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2213 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2214 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2215 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2216 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2217 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2218 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2219 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2220 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2221 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2222 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2223 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2224 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2225 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2226 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2227 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2228 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2229 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2230 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2231 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2232 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2233 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2234 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2235 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2236 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2237 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2238 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2239 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2240 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2241 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2242 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2243 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2244 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2245 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2246 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2247 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2248 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2249 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2250 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2251 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2252 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2253 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2254 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2255 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2256 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2257 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2258 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2259 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2260 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2261 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2262 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2263 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2266 internal class InputStyle
2272 FontFamily = 0x0002,
2275 LineSpacing = 0x0010,
2283 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2285 DecorationBoundingBox = new Rectangle(x, y, width, height);
2287 private void OnInputColorChanged(float x, float y, float z, float w)
2289 InputColor = new Vector4(x, y, z, w);
2291 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2293 PlaceholderTextColor = new Color(r, g, b, a);
2295 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2297 PrimaryCursorColor = new Vector4(x, y, z, w);
2299 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2301 SecondaryCursorColor = new Vector4(x, y, z, w);
2303 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2305 SelectionHighlightColor = new Vector4(x, y, z, w);
2307 private void OnTextColorChanged(float x, float y, float z, float w)
2309 TextColor = new Vector4(x, y, z, w);
2311 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2313 GrabHandleColor = new Color(r, g, b, a);