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;
25 using Tizen.NUI.Binding;
27 namespace Tizen.NUI.BaseComponents
30 /// A control which provides a multi-line editable text editor.
32 /// <since_tizen> 3 </since_tizen>
33 public partial class TextEditor : View
35 private string textEditorTextSid = null;
36 private string textEditorPlaceHolderTextSid = null;
37 private bool systemlangTextFlag = false;
38 private InputMethodContext inputMethodContext = null;
39 private float fontSizeScale = 1.0f;
40 private bool hasFontSizeChangedCallback = 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();
83 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
92 /// The TranslatableText property.<br />
93 /// The text can set the SID value.<br />
95 /// <exception cref='ArgumentNullException'>
96 /// ResourceManager about multilingual is null.
98 /// <since_tizen> 4 </since_tizen>
99 public string TranslatableText
103 return GetValue(TranslatableTextProperty) as string;
107 SetValue(TranslatableTextProperty, value);
111 private string InternalTranslatableText
115 return textEditorTextSid;
119 if (NUIApplication.MultilingualResourceManager == null)
121 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
123 textEditorTextSid = value;
124 Text = SetTranslatable(textEditorTextSid);
125 NotifyPropertyChanged();
129 /// The TranslatablePlaceholderText property.<br />
130 /// The text can set the SID value.<br />
132 /// <exception cref='ArgumentNullException'>
133 /// ResourceManager about multilingual is null.
135 /// <since_tizen> 4 </since_tizen>
136 public string TranslatablePlaceholderText
140 return GetValue(TranslatablePlaceholderTextProperty) as string;
144 SetValue(TranslatablePlaceholderTextProperty, value);
148 private string InternalTranslatablePlaceholderText
152 return textEditorPlaceHolderTextSid;
156 if (NUIApplication.MultilingualResourceManager == null)
158 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
160 textEditorPlaceHolderTextSid = value;
161 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
162 NotifyPropertyChanged();
167 /// The Text property.<br />
168 /// The text to display in the UTF-8 format.<br />
170 /// <since_tizen> 3 </since_tizen>
175 return (string)GetValue(TextProperty);
179 SetValueAndForceSendChangeSignal(TextProperty, value);
180 NotifyPropertyChanged();
185 /// The TextColor property.<br />
186 /// The color of the text.<br />
189 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
191 /// <since_tizen> 3 </since_tizen>
192 public Vector4 TextColor
196 Vector4 temp = (Vector4)GetValue(TextColorProperty);
197 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
201 SetValue(TextColorProperty, value);
202 NotifyPropertyChanged();
207 /// The FontFamily property.<br />
208 /// The requested font family to use.<br />
210 /// <since_tizen> 3 </since_tizen>
211 public string FontFamily
215 return (string)GetValue(FontFamilyProperty);
219 SetValue(FontFamilyProperty, value);
220 NotifyPropertyChanged();
225 /// The FontStyle property.<br />
226 /// The requested font style to use.<br />
227 /// The fontStyle map contains the following keys :<br />
228 /// <list type="table">
229 /// <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>
230 /// <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>
231 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
234 /// <since_tizen> 3 </since_tizen>
235 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
236 public PropertyMap FontStyle
240 return (PropertyMap)GetValue(FontStyleProperty);
244 SetValue(FontStyleProperty, value);
245 NotifyPropertyChanged();
250 /// Set FontStyle to TextEditor. <br />
252 /// <param name="fontStyle">The FontStyle</param>
254 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
257 /// The following example demonstrates how to use the SetFontStyle method.
259 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
260 /// fontStyle.Width = FontWidthType.Expanded;
261 /// fontStyle.Weight = FontWeightType.Bold;
262 /// fontStyle.Slant = FontSlantType.Italic;
263 /// editor.SetFontStyle(fontStyle);
266 [EditorBrowsable(EditorBrowsableState.Never)]
267 public void SetFontStyle(FontStyle fontStyle)
269 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
271 SetValue(FontStyleProperty, fontStyleMap);
276 /// Get FontStyle from TextEditor. <br />
278 /// <returns>The FontStyle</returns>
280 /// <see cref="Tizen.NUI.Text.FontStyle"/>
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public FontStyle GetFontStyle()
286 using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty))
288 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
294 /// The PointSize property.<br />
295 /// The size of font in points.<br />
297 /// <since_tizen> 3 </since_tizen>
298 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
299 public float PointSize
303 return (float)GetValue(PointSizeProperty);
307 SetValue(PointSizeProperty, value);
308 NotifyPropertyChanged();
313 /// The HorizontalAlignment property.<br />
314 /// The line horizontal alignment.<br />
316 /// <since_tizen> 3 </since_tizen>
317 public HorizontalAlignment HorizontalAlignment
321 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
325 SetValue(HorizontalAlignmentProperty, value);
326 NotifyPropertyChanged();
331 /// The ScrollThreshold property.<br />
332 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
334 /// <since_tizen> 3 </since_tizen>
335 public float ScrollThreshold
339 return (float)GetValue(ScrollThresholdProperty);
343 SetValue(ScrollThresholdProperty, value);
344 NotifyPropertyChanged();
349 /// The ScrollSpeed property.<br />
350 /// The scroll speed in pixels per second.<br />
352 /// <since_tizen> 3 </since_tizen>
353 public float ScrollSpeed
357 return (float)GetValue(ScrollSpeedProperty);
361 SetValue(ScrollSpeedProperty, value);
362 NotifyPropertyChanged();
367 /// The PrimaryCursorColor property.<br />
368 /// The color to apply to the primary cursor.<br />
371 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
373 /// <since_tizen> 3 </since_tizen>
374 public Vector4 PrimaryCursorColor
378 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
379 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
383 SetValue(PrimaryCursorColorProperty, value);
384 NotifyPropertyChanged();
389 /// The SecondaryCursorColor property.<br />
390 /// The color to apply to the secondary cursor.<br />
393 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
395 /// <since_tizen> 3 </since_tizen>
396 public Vector4 SecondaryCursorColor
400 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
401 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
405 SetValue(SecondaryCursorColorProperty, value);
406 NotifyPropertyChanged();
411 /// The EnableCursorBlink property.<br />
412 /// Whether the cursor should blink or not.<br />
414 /// <since_tizen> 3 </since_tizen>
415 public bool EnableCursorBlink
419 return (bool)GetValue(EnableCursorBlinkProperty);
423 SetValue(EnableCursorBlinkProperty, value);
424 NotifyPropertyChanged();
429 /// The CursorBlinkInterval property.<br />
430 /// The time interval in seconds between cursor on/off states.<br />
432 /// <since_tizen> 3 </since_tizen>
433 public float CursorBlinkInterval
437 return (float)GetValue(CursorBlinkIntervalProperty);
441 SetValue(CursorBlinkIntervalProperty, value);
442 NotifyPropertyChanged();
447 /// The CursorBlinkDuration property.<br />
448 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
450 /// <since_tizen> 3 </since_tizen>
451 public float CursorBlinkDuration
455 return (float)GetValue(CursorBlinkDurationProperty);
459 SetValue(CursorBlinkDurationProperty, value);
460 NotifyPropertyChanged();
465 /// The CursorWidth property.
467 /// <since_tizen> 3 </since_tizen>
468 public int CursorWidth
472 return (int)GetValue(CursorWidthProperty);
476 SetValue(CursorWidthProperty, value);
477 NotifyPropertyChanged();
482 /// The GrabHandleImage property.<br />
483 /// The image to display for the grab handle.<br />
485 /// <since_tizen> 3 </since_tizen>
486 public string GrabHandleImage
490 return (string)GetValue(GrabHandleImageProperty);
494 SetValue(GrabHandleImageProperty, value);
495 NotifyPropertyChanged();
500 /// The GrabHandlePressedImage property.<br />
501 /// The image to display when the grab handle is pressed.<br />
503 /// <since_tizen> 3 </since_tizen>
504 public string GrabHandlePressedImage
508 return (string)GetValue(GrabHandlePressedImageProperty);
512 SetValue(GrabHandlePressedImageProperty, value);
513 NotifyPropertyChanged();
518 /// The SelectionHandleImageLeft property.<br />
519 /// The image to display for the left selection handle.<br />
520 /// The selectionHandleImageLeft map contains the following key :<br />
521 /// <list type="table">
522 /// <item><term>filename (string)</term><description>The path of image file</description></item>
525 /// <since_tizen> 3 </since_tizen>
526 public PropertyMap SelectionHandleImageLeft
530 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
534 SetValue(SelectionHandleImageLeftProperty, value);
535 NotifyPropertyChanged();
540 /// The SelectionHandleImageRight property.<br />
541 /// The image to display for the right selection handle.<br />
542 /// The selectionHandleImageRight map contains the following key :<br />
543 /// <list type="table">
544 /// <item><term>filename (string)</term><description>The path of image file</description></item>
547 /// <since_tizen> 3 </since_tizen>
548 public PropertyMap SelectionHandleImageRight
552 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
556 SetValue(SelectionHandleImageRightProperty, value);
557 NotifyPropertyChanged();
562 /// Set SelectionHandleImage to TextEditor. <br />
564 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
566 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
569 /// The following example demonstrates how to use the SetSelectionHandleImage method.
571 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
572 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
573 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
574 /// editor.SetSelectionHandleImage(selectionHandleImage);
577 [EditorBrowsable(EditorBrowsableState.Never)]
578 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
580 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
582 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
584 SetValue(SelectionHandleImageLeftProperty, leftImageMap);
588 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
590 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
592 SetValue(SelectionHandleImageRightProperty, rightImageMap);
598 /// Get SelectionHandleImage from TextEditor. <br />
600 /// <returns>The SelectionHandleImage</returns>
602 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
604 [EditorBrowsable(EditorBrowsableState.Never)]
605 public SelectionHandleImage GetSelectionHandleImage()
607 SelectionHandleImage selectionHandleImage;
608 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
609 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
611 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
613 return selectionHandleImage;
617 /// The SelectionHandlePressedImageLeft property.<br />
618 /// The image to display when the left selection handle is pressed.<br />
619 /// The selectionHandlePressedImageLeft map contains the following key :<br />
620 /// <list type="table">
621 /// <item><term>filename (string)</term><description>The path of image file</description></item>
624 /// <since_tizen> 3 </since_tizen>
625 public PropertyMap SelectionHandlePressedImageLeft
629 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
633 SetValue(SelectionHandlePressedImageLeftProperty, value);
634 NotifyPropertyChanged();
639 /// The SelectionHandlePressedImageRight property.<br />
640 /// The image to display when the right selection handle is pressed.<br />
641 /// The selectionHandlePressedImageRight map contains the following key :<br />
642 /// <list type="table">
643 /// <item><term>filename (string)</term><description>The path of image file</description></item>
646 /// <since_tizen> 3 </since_tizen>
647 public PropertyMap SelectionHandlePressedImageRight
651 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
655 SetValue(SelectionHandlePressedImageRightProperty, value);
656 NotifyPropertyChanged();
661 /// Set SelectionHandlePressedImage to TextEditor. <br />
663 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
665 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
668 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
670 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
671 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
672 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
673 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
676 [EditorBrowsable(EditorBrowsableState.Never)]
677 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
679 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
681 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
683 SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
687 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
689 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
691 SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
697 /// Get SelectionHandlePressedImage from TextEditor. <br />
699 /// <returns>The SelectionHandlePressedImage</returns>
701 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
703 [EditorBrowsable(EditorBrowsableState.Never)]
704 public SelectionHandleImage GetSelectionHandlePressedImage()
706 SelectionHandleImage selectionHandleImage;
707 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
708 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
710 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
712 return selectionHandleImage;
716 /// The SelectionHandleMarkerImageLeft property.<br />
717 /// The image to display for the left selection handle marker.<br />
718 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
719 /// <list type="table">
720 /// <item><term>filename (string)</term><description>The path of image file</description></item>
723 /// <since_tizen> 3 </since_tizen>
724 public PropertyMap SelectionHandleMarkerImageLeft
728 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
732 SetValue(SelectionHandleMarkerImageLeftProperty, value);
733 NotifyPropertyChanged();
738 /// The SelectionHandleMarkerImageRight property.<br />
739 /// The image to display for the right selection handle marker.<br />
740 /// The selectionHandleMarkerImageRight map contains the following key :<br />
741 /// <list type="table">
742 /// <item><term>filename (string)</term><description>The path of image file</description></item>
745 /// <since_tizen> 3 </since_tizen>
746 public PropertyMap SelectionHandleMarkerImageRight
750 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
754 SetValue(SelectionHandleMarkerImageRightProperty, value);
755 NotifyPropertyChanged();
760 /// Set SelectionHandleMarkerImage to TextEditor. <br />
762 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
764 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
767 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
769 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
770 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
771 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
772 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
775 [EditorBrowsable(EditorBrowsableState.Never)]
776 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
778 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
780 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
782 SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
786 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
788 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
790 SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
796 /// Get SelectionHandleMarkerImage from TextEditor. <br />
798 /// <returns>The SelectionHandleMarkerImage</returns>
800 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
802 [EditorBrowsable(EditorBrowsableState.Never)]
803 public SelectionHandleImage GetSelectionHandleMarkerImage()
805 SelectionHandleImage selectionHandleImage;
806 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
807 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
809 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
811 return selectionHandleImage;
815 /// The SelectionHighlightColor property.<br />
816 /// The color of the selection highlight.<br />
819 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
821 /// <since_tizen> 3 </since_tizen>
822 public Vector4 SelectionHighlightColor
826 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
827 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
831 SetValue(SelectionHighlightColorProperty, value);
832 NotifyPropertyChanged();
837 /// The DecorationBoundingBox property.<br />
838 /// The decorations (handles etc) will positioned within this area on-screen.<br />
841 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
843 /// <since_tizen> 3 </since_tizen>
844 public Rectangle DecorationBoundingBox
848 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
849 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
853 SetValue(DecorationBoundingBoxProperty, value);
854 NotifyPropertyChanged();
859 /// The EnableMarkup property.<br />
860 /// Whether the mark-up processing is enabled.<br />
862 /// <since_tizen> 3 </since_tizen>
863 public bool EnableMarkup
867 return (bool)GetValue(EnableMarkupProperty);
871 SetValue(EnableMarkupProperty, value);
872 NotifyPropertyChanged();
877 /// The InputColor property.<br />
878 /// The color of the new input text.<br />
881 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
883 /// <since_tizen> 3 </since_tizen>
884 public Vector4 InputColor
888 Vector4 temp = (Vector4)GetValue(InputColorProperty);
889 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
893 SetValue(InputColorProperty, value);
894 NotifyPropertyChanged();
899 /// The InputFontFamily property.<br />
900 /// The font's family of the new input text.<br />
902 /// <since_tizen> 3 </since_tizen>
903 public string InputFontFamily
907 return (string)GetValue(InputFontFamilyProperty);
911 SetValue(InputFontFamilyProperty, value);
912 NotifyPropertyChanged();
917 /// The InputFontStyle property.<br />
918 /// The font's style of the new input text.<br />
919 /// The inputFontStyle map contains the following keys :<br />
920 /// <list type="table">
921 /// <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>
922 /// <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>
923 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
926 /// <since_tizen> 3 </since_tizen>
927 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
928 public PropertyMap InputFontStyle
932 return (PropertyMap)GetValue(InputFontStyleProperty);
936 SetValue(InputFontStyleProperty, value);
937 NotifyPropertyChanged();
942 /// Set InputFontStyle to TextEditor. <br />
944 /// <param name="fontStyle">The FontStyle</param>
946 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
949 /// The following example demonstrates how to use the SetInputFontStyle method.
951 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
952 /// fontStyle.Width = FontWidthType.Expanded;
953 /// fontStyle.Weight = FontWeightType.Bold;
954 /// fontStyle.Slant = FontSlantType.Italic;
955 /// editor.SetInputFontStyle(fontStyle);
958 [EditorBrowsable(EditorBrowsableState.Never)]
959 public void SetInputFontStyle(FontStyle fontStyle)
961 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
963 SetValue(InputFontStyleProperty, fontStyleMap);
968 /// Get InputFontStyle from TextEditor. <br />
970 /// <returns>The FontStyle</returns>
972 /// <see cref="Tizen.NUI.Text.FontStyle"/>
974 [EditorBrowsable(EditorBrowsableState.Never)]
975 public FontStyle GetInputFontStyle()
978 using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
980 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
986 /// The InputPointSize property.<br />
987 /// The font's size of the new input text in points.<br />
989 /// <since_tizen> 3 </since_tizen>
990 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
991 public float InputPointSize
995 return (float)GetValue(InputPointSizeProperty);
999 SetValue(InputPointSizeProperty, value);
1000 NotifyPropertyChanged();
1005 /// The LineSpacing property.<br />
1006 /// The default extra space between lines in points.<br />
1008 /// <since_tizen> 3 </since_tizen>
1009 public float LineSpacing
1013 return (float)GetValue(LineSpacingProperty);
1017 SetValue(LineSpacingProperty, value);
1018 NotifyPropertyChanged();
1023 /// The InputLineSpacing property.<br />
1024 /// The extra space between lines in points.<br />
1026 /// <since_tizen> 3 </since_tizen>
1027 public float InputLineSpacing
1031 return (float)GetValue(InputLineSpacingProperty);
1035 SetValue(InputLineSpacingProperty, value);
1036 NotifyPropertyChanged();
1041 /// The Underline property.<br />
1042 /// The default underline parameters.<br />
1043 /// The underline map contains the following keys :<br />
1044 /// <list type="table">
1045 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1046 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1047 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1050 /// <since_tizen> 3 </since_tizen>
1051 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1052 public PropertyMap Underline
1056 return (PropertyMap)GetValue(UnderlineProperty);
1060 SetValue(UnderlineProperty, value);
1061 NotifyPropertyChanged();
1066 /// Set Underline to TextEditor. <br />
1068 /// <param name="underline">The Underline</param>
1070 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1073 /// The following example demonstrates how to use the SetUnderline method.
1075 /// var underline = new Tizen.NUI.Text.Underline();
1076 /// underline.Enable = true;
1077 /// underline.Color = new Color("#3498DB");
1078 /// underline.Height = 2.0f;
1079 /// editor.SetUnderline(underline);
1082 [EditorBrowsable(EditorBrowsableState.Never)]
1083 public void SetUnderline(Underline underline)
1085 using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1087 SetValue(UnderlineProperty, underlineMap);
1092 /// Get Underline from TextEditor. <br />
1094 /// <returns>The Underline</returns>
1096 /// <see cref="Tizen.NUI.Text.Underline"/>
1098 [EditorBrowsable(EditorBrowsableState.Never)]
1099 public Underline GetUnderline()
1101 Underline underline;
1102 using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1104 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1110 /// The InputUnderline property.<br />
1111 /// The underline parameters of the new input text.<br />
1113 /// <since_tizen> 3 </since_tizen>
1114 public string InputUnderline
1118 return (string)GetValue(InputUnderlineProperty);
1122 SetValue(InputUnderlineProperty, value);
1123 NotifyPropertyChanged();
1128 /// The Shadow property.<br />
1129 /// The default shadow parameters.<br />
1130 /// The shadow map contains the following keys :<br />
1131 /// <list type="table">
1132 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1133 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1134 /// <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>
1137 /// <since_tizen> 3 </since_tizen>
1138 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1139 public PropertyMap Shadow
1143 return (PropertyMap)GetValue(ShadowProperty);
1147 SetValue(ShadowProperty, value);
1148 NotifyPropertyChanged();
1153 /// Set Shadow to TextEditor. <br />
1155 /// <param name="shadow">The Shadow</param>
1157 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1160 /// The following example demonstrates how to use the SetShadow method.
1162 /// var shadow = new Tizen.NUI.Text.Shadow();
1163 /// shadow.Offset = new Vector2(3, 3);
1164 /// shadow.Color = new Color("#F1C40F");
1165 /// editor.SetShadow(shadow);
1168 [EditorBrowsable(EditorBrowsableState.Never)]
1169 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1171 using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1173 SetValue(ShadowProperty, shadowMap);
1178 /// Get Shadow from TextEditor. <br />
1180 /// <returns>The Shadow</returns>
1182 /// <see cref="Tizen.NUI.Text.Shadow"/>
1184 [EditorBrowsable(EditorBrowsableState.Never)]
1185 public Tizen.NUI.Text.Shadow GetShadow()
1187 Tizen.NUI.Text.Shadow shadow;
1188 using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
1190 shadow = TextMapHelper.GetShadowStruct(shadowMap);
1196 /// The InputShadow property.<br />
1197 /// The shadow parameters of the new input text.<br />
1199 /// <since_tizen> 3 </since_tizen>
1200 public string InputShadow
1204 return (string)GetValue(InputShadowProperty);
1208 SetValue(InputShadowProperty, value);
1209 NotifyPropertyChanged();
1214 /// The Emboss property.<br />
1215 /// The default emboss parameters.<br />
1217 /// <since_tizen> 3 </since_tizen>
1218 public string Emboss
1222 return (string)GetValue(EmbossProperty);
1226 SetValue(EmbossProperty, value);
1227 NotifyPropertyChanged();
1232 /// The InputEmboss property.<br />
1233 /// The emboss parameters of the new input text.<br />
1235 /// <since_tizen> 3 </since_tizen>
1236 public string InputEmboss
1240 return (string)GetValue(InputEmbossProperty);
1244 SetValue(InputEmbossProperty, value);
1245 NotifyPropertyChanged();
1250 /// The Outline property.<br />
1251 /// The default outline parameters.<br />
1252 /// The outline map contains the following keys :<br />
1253 /// <list type="table">
1254 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1255 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1258 /// <since_tizen> 3 </since_tizen>
1259 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1260 public PropertyMap Outline
1264 return (PropertyMap)GetValue(OutlineProperty);
1268 SetValue(OutlineProperty, value);
1269 NotifyPropertyChanged();
1274 /// Set Outline to TextEditor. <br />
1276 /// <param name="outline">The Outline</param>
1278 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1281 /// The following example demonstrates how to use the SetOutline method.
1283 /// var outline = new Tizen.NUI.Text.Outline();
1284 /// outline.Width = 2.0f;
1285 /// outline.Color = new Color("#45B39D");
1286 /// editor.SetOutline(outline);
1289 [EditorBrowsable(EditorBrowsableState.Never)]
1290 public void SetOutline(Outline outline)
1292 using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
1294 SetValue(OutlineProperty, outlineMap);
1299 /// Get Outline from TextEditor. <br />
1301 /// <returns>The Outline</returns>
1303 /// <see cref="Tizen.NUI.Text.Outline"/>
1305 [EditorBrowsable(EditorBrowsableState.Never)]
1306 public Outline GetOutline()
1309 using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
1311 outline = TextMapHelper.GetOutlineStruct(outlineMap);
1317 /// The InputOutline property.<br />
1318 /// The outline parameters of the new input text.<br />
1320 /// <since_tizen> 3 </since_tizen>
1321 public string InputOutline
1325 return (string)GetValue(InputOutlineProperty);
1329 SetValue(InputOutlineProperty, value);
1330 NotifyPropertyChanged();
1335 /// The SmoothScroll property.<br />
1336 /// Enable or disable the smooth scroll animation.<br />
1338 /// <since_tizen> 3 </since_tizen>
1339 public bool SmoothScroll
1343 return (bool)GetValue(SmoothScrollProperty);
1347 SetValue(SmoothScrollProperty, value);
1348 NotifyPropertyChanged();
1353 /// The SmoothScrollDuration property.<br />
1354 /// Sets the duration of smooth scroll animation.<br />
1356 /// <since_tizen> 3 </since_tizen>
1357 public float SmoothScrollDuration
1361 return (float)GetValue(SmoothScrollDurationProperty);
1365 SetValue(SmoothScrollDurationProperty, value);
1366 NotifyPropertyChanged();
1371 /// The EnableScrollBar property.<br />
1372 /// Enable or disable the scroll bar.<br />
1374 /// <since_tizen> 3 </since_tizen>
1375 public bool EnableScrollBar
1379 return (bool)GetValue(EnableScrollBarProperty);
1383 SetValue(EnableScrollBarProperty, value);
1384 NotifyPropertyChanged();
1389 /// The ScrollBarShowDuration property.<br />
1390 /// Sets the duration of scroll bar to show.<br />
1392 /// <since_tizen> 3 </since_tizen>
1393 public float ScrollBarShowDuration
1397 return (float)GetValue(ScrollBarShowDurationProperty);
1401 SetValue(ScrollBarShowDurationProperty, value);
1402 NotifyPropertyChanged();
1407 /// The ScrollBarFadeDuration property.<br />
1408 /// Sets the duration of scroll bar to fade out.<br />
1410 /// <since_tizen> 3 </since_tizen>
1411 public float ScrollBarFadeDuration
1415 return (float)GetValue(ScrollBarFadeDurationProperty);
1419 SetValue(ScrollBarFadeDurationProperty, value);
1420 NotifyPropertyChanged();
1425 /// The PixelSize property.<br />
1426 /// The size of font in pixels.<br />
1428 /// <since_tizen> 3 </since_tizen>
1429 public float PixelSize
1433 return (float)GetValue(PixelSizeProperty);
1437 SetValue(PixelSizeProperty, value);
1438 NotifyPropertyChanged();
1443 /// The line count of the text.
1445 /// <since_tizen> 3 </since_tizen>
1446 public int LineCount
1451 using (var propertyValue = GetProperty(TextEditor.Property.LineCount))
1453 propertyValue.Get(out lineCount);
1460 /// The text to display when the TextEditor is empty and inactive.
1462 /// <since_tizen> 3 </since_tizen>
1463 public string PlaceholderText
1467 return (string)GetValue(PlaceholderTextProperty);
1471 SetValue(PlaceholderTextProperty, value);
1472 NotifyPropertyChanged();
1477 /// The portion of the text that has been selected by the user.
1480 /// Empty string when nothing is selected.
1482 /// <since_tizen> 9 </since_tizen>
1483 public string SelectedText
1487 string selectedText;
1488 using (var propertyValue = GetProperty(TextEditor.Property.SelectedText))
1490 propertyValue.Get(out selectedText);
1492 return selectedText;
1497 /// The Placeholder text color.
1500 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1502 /// <since_tizen> 3 </since_tizen>
1503 public Color PlaceholderTextColor
1507 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1508 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1512 SetValue(PlaceholderTextColorProperty, value);
1513 NotifyPropertyChanged();
1518 /// The Enable selection property.<br />
1519 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1521 /// <since_tizen> 3 </since_tizen>
1522 public bool EnableSelection
1526 return (bool)GetValue(EnableSelectionProperty);
1530 SetValue(EnableSelectionProperty, value);
1531 NotifyPropertyChanged();
1536 /// The start index for selection.
1539 /// When there is no selection, the index is current cursor position.
1541 /// <since_tizen> 9 </since_tizen>
1542 public int SelectedTextStart
1546 int selectedTextStart;
1547 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextStart))
1549 propertyValue.Get(out selectedTextStart);
1551 return selectedTextStart;
1556 /// The end index for selection.
1559 /// When there is no selection, the index is current cursor position.
1561 /// <since_tizen> 9 </since_tizen>
1562 public int SelectedTextEnd
1566 int selectedTextEnd;
1567 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextEnd))
1569 propertyValue.Get(out selectedTextEnd);
1571 return selectedTextEnd;
1576 /// Enable editing in text control.
1578 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1579 [EditorBrowsable(EditorBrowsableState.Never)]
1580 public bool EnableEditing
1584 return (bool)GetValue(EnableEditingProperty);
1588 SetValue(EnableEditingProperty, value);
1592 private bool InternalEnableEditing
1597 using (var propertyValue = GetProperty(TextEditor.Property.EnableEditing))
1599 propertyValue.Get(out enableEditing);
1601 return enableEditing;
1605 using (var propertyValue = new PropertyValue(value))
1607 SetProperty(TextEditor.Property.EnableEditing, propertyValue);
1608 NotifyPropertyChanged();
1614 /// Specify horizontal scroll position in text control.
1616 [EditorBrowsable(EditorBrowsableState.Never)]
1617 public int HorizontalScrollPosition
1621 return (int)GetValue(HorizontalScrollPositionProperty);
1625 SetValue(HorizontalScrollPositionProperty, value);
1629 private int InternalHorizontalScrollPosition
1633 int horizontalScrollPosition;
1634 using (var propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1636 propertyValue.Get(out horizontalScrollPosition);
1638 return horizontalScrollPosition;
1642 using (var propertyValue = new PropertyValue(value))
1644 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1645 NotifyPropertyChanged();
1651 /// Specify vertical scroll position in text control.
1653 [EditorBrowsable(EditorBrowsableState.Never)]
1654 public int VerticalScrollPosition
1658 return (int)GetValue(VerticalScrollPositionProperty);
1662 SetValue(VerticalScrollPositionProperty, value);
1666 private int InternalVerticalScrollPosition
1670 int verticalScrollPosition;
1671 using (var propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1673 propertyValue.Get(out verticalScrollPosition);
1675 return verticalScrollPosition;
1679 using (var propertyValue = new PropertyValue(value))
1681 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1682 NotifyPropertyChanged();
1688 /// Specify primary cursor (caret) position in text control.
1690 [EditorBrowsable(EditorBrowsableState.Never)]
1691 public int PrimaryCursorPosition
1695 return (int)GetValue(PrimaryCursorPositionProperty);
1699 SetValue(PrimaryCursorPositionProperty, value);
1703 private int InternalPrimaryCursorPosition
1707 int primaryCursorPosition;
1708 using (var propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1710 propertyValue.Get(out primaryCursorPosition);
1712 return primaryCursorPosition;
1716 using (var propertyValue = new PropertyValue(value))
1718 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1719 NotifyPropertyChanged();
1725 /// The GrabHandleColor property.
1728 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1730 [EditorBrowsable(EditorBrowsableState.Never)]
1731 public Color GrabHandleColor
1735 Color temp = (Color)GetValue(GrabHandleColorProperty);
1736 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1740 SetValue(GrabHandleColorProperty, value);
1741 NotifyPropertyChanged();
1746 /// Set InputFilter to TextEditor.
1748 /// <param name="inputFilter">The InputFilter</param>
1750 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1751 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1752 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1755 /// The following example demonstrates how to use the SetInputFilter method.
1757 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1758 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1759 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1760 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1763 /// <since_tizen> 9 </since_tizen>
1764 public void SetInputFilter(InputFilter inputFilter)
1766 using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1767 using (var propertyValue = new PropertyValue(map))
1769 SetProperty(TextEditor.Property.InputFilter, propertyValue);
1774 /// Get InputFilter from TextEditor. <br />
1776 /// <returns>The InputFilter</returns>
1778 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1780 /// <since_tizen> 9 </since_tizen>
1781 public InputFilter GetInputFilter()
1783 InputFilter inputFilter;
1784 using (var propertyValue = GetProperty(TextEditor.Property.InputFilter))
1785 using (var map = new PropertyMap())
1787 propertyValue.Get(map);
1788 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1794 /// Set Strikethrough to TextEditor. <br />
1796 /// <param name="strikethrough">The Strikethrough</param>
1798 /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
1801 /// The following example demonstrates how to use the SetStrikethrough method.
1803 /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
1804 /// strikethrough.Enable = true;
1805 /// strikethrough.Color = new Color("#3498DB");
1806 /// strikethrough.Height = 2.0f;
1807 /// editor.SetStrikethrough(strikethrough);
1810 [EditorBrowsable(EditorBrowsableState.Never)]
1811 public void SetStrikethrough(Strikethrough strikethrough)
1813 using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
1814 using (var propertyValue = new PropertyValue(map))
1816 SetProperty(TextEditor.Property.Strikethrough, propertyValue);
1821 /// Get Strikethrough from TextEditor. <br />
1823 /// <returns>The Strikethrough</returns>
1825 /// <see cref="Tizen.NUI.Text.Strikethrough"/>
1827 [EditorBrowsable(EditorBrowsableState.Never)]
1828 public Strikethrough GetStrikethrough()
1830 Strikethrough strikethrough;
1831 using (var propertyValue = GetProperty(TextEditor.Property.Strikethrough))
1832 using (var map = new PropertyMap())
1834 propertyValue.Get(map);
1835 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
1837 return strikethrough;
1841 /// The Placeholder property.
1842 /// The placeholder map contains the following keys :<br />
1843 /// <list type="table">
1844 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1845 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1846 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1847 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1848 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1849 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1850 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1851 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1855 /// The following example demonstrates how to set the placeholder property.
1857 /// PropertyMap propertyMap = new PropertyMap();
1858 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1859 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1860 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1861 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1862 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1864 /// PropertyMap fontStyleMap = new PropertyMap();
1865 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1866 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1867 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1868 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1870 /// TextEditor editor = new TextEditor();
1871 /// editor.Placeholder = propertyMap;
1874 /// <since_tizen> 3 </since_tizen>
1875 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1876 public Tizen.NUI.PropertyMap Placeholder
1880 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1881 string defalutText = "";
1883 if (TextMapHelper.IsValue(map, 0))
1884 map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
1886 if (TextMapHelper.IsValue(map, 1))
1887 map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
1889 if (TextMapHelper.IsValue(map, 2))
1891 using (var color = TextMapHelper.GetColorFromMap(map, 2))
1893 map.Add("color", color);
1897 if (TextMapHelper.IsValue(map, 3))
1898 map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
1900 if (TextMapHelper.IsValue(map, 4))
1902 using (var properyValue = map.Find(4))
1903 using (var fontStyle = new PropertyMap())
1905 properyValue.Get(fontStyle);
1906 using (var fontStyleValue = new PropertyValue(fontStyle))
1908 map.Add("fontStyle", fontStyleValue);
1913 if (TextMapHelper.IsValue(map, 5))
1914 map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
1916 if (TextMapHelper.IsValue(map, 6))
1917 map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
1919 if (TextMapHelper.IsValue(map, 7))
1920 map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
1926 SetValue(PlaceholderProperty, value);
1927 NotifyPropertyChanged();
1932 /// Set Placeholder to TextEditor. <br />
1934 /// <param name="placeholder">The Placeholder</param>
1936 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1939 /// The following example demonstrates how to use the SetPlaceholder method.
1941 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1942 /// placeholder.Text = "placeholder text";
1943 /// placeholder.TextFocused = "placeholder textFocused";
1944 /// placeholder.Color = new Color("#45B39D");
1945 /// placeholder.FontFamily = "BreezeSans";
1946 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1948 /// Width = FontWidthType.Expanded,
1949 /// Weight = FontWeightType.ExtraLight,
1950 /// Slant = FontSlantType.Italic,
1952 /// placeholder.PointSize = 25.0f;
1953 /// //placeholder.PixelSize = 50.0f;
1954 /// placeholder.Ellipsis = true;
1955 /// editor.SetPlaceholder(placeholder);
1958 [EditorBrowsable(EditorBrowsableState.Never)]
1959 public void SetPlaceholder(Placeholder placeholder)
1961 using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
1963 SetValue(PlaceholderProperty, placeholderMap);
1968 /// Get Placeholder from TextEditor. <br />
1970 /// <returns>The Placeholder</returns>
1972 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1974 [EditorBrowsable(EditorBrowsableState.Never)]
1975 public Placeholder GetPlaceholder()
1977 Placeholder placeholder;
1978 using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
1980 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
1986 /// The Ellipsis property.<br />
1987 /// Enable or disable the ellipsis.<br />
1989 /// <since_tizen> 9 </since_tizen>
1990 public bool Ellipsis
1994 return (bool)GetValue(EllipsisProperty);
1998 SetValue(EllipsisProperty, value);
1999 NotifyPropertyChanged();
2005 /// The ellipsis position of the text.
2006 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
2008 /// <since_tizen> 9 </since_tizen>
2009 public EllipsisPosition EllipsisPosition
2013 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
2017 SetValue(EllipsisPositionProperty, value);
2018 NotifyPropertyChanged();
2023 /// The LineWrapMode property.<br />
2024 /// The line wrap mode when the text lines over the layout width.<br />
2026 /// <since_tizen> 4 </since_tizen>
2027 public LineWrapMode LineWrapMode
2031 return (LineWrapMode)GetValue(LineWrapModeProperty);
2035 SetValue(LineWrapModeProperty, value);
2036 NotifyPropertyChanged();
2041 /// Enables Text selection using Shift key.
2043 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2044 [EditorBrowsable(EditorBrowsableState.Never)]
2045 public bool EnableShiftSelection
2049 return (bool)GetValue(EnableShiftSelectionProperty);
2053 SetValue(EnableShiftSelectionProperty, value);
2054 NotifyPropertyChanged();
2059 /// The text alignment to match the direction of the system language.
2061 /// <since_tizen> 6 </since_tizen>
2062 public bool MatchSystemLanguageDirection
2066 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2070 SetValue(MatchSystemLanguageDirectionProperty, value);
2071 NotifyPropertyChanged();
2076 /// The MaxLength property.<br />
2077 /// The maximum number of characters that can be inserted.<br />
2079 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2080 [EditorBrowsable(EditorBrowsableState.Never)]
2081 public int MaxLength
2085 return (int)GetValue(MaxLengthProperty);
2089 SetValue(MaxLengthProperty, value);
2090 NotifyPropertyChanged();
2094 /// Only used by the IL of xaml, will never changed to not hidden.
2095 [EditorBrowsable(EditorBrowsableState.Never)]
2096 public override bool IsCreateByXaml
2100 return base.IsCreateByXaml;
2104 base.IsCreateByXaml = value;
2108 this.TextChanged += (obj, e) =>
2110 this.Text = e.TextEditor.Text;
2117 /// The FontSizeScale property. <br />
2118 /// The default value is 1.0. <br />
2119 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2120 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2122 /// <since_tizen> 9 </since_tizen>
2123 public float FontSizeScale
2127 return fontSizeScale;
2131 float newFontSizeScale;
2133 if (fontSizeScale == value) return;
2135 fontSizeScale = value;
2136 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2138 SystemSettingsFontSize systemSettingsFontSize;
2142 systemSettingsFontSize = SystemSettings.FontSize;
2146 Console.WriteLine("{0} Exception caught.", e);
2147 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2149 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2150 addFontSizeChangedCallback();
2154 newFontSizeScale = fontSizeScale;
2155 removeFontSizeChangedCallback();
2158 SetValue(FontSizeScaleProperty, newFontSizeScale);
2159 NotifyPropertyChanged();
2164 /// The EnableFontSizeScale property.<br />
2165 /// Whether the font size scale is enabled. (The default value is true)
2167 [EditorBrowsable(EditorBrowsableState.Never)]
2168 public bool EnableFontSizeScale
2172 return (bool)GetValue(EnableFontSizeScaleProperty);
2176 SetValue(EnableFontSizeScaleProperty, value);
2177 NotifyPropertyChanged();
2182 /// The InputMethodSettings property.<br />
2183 /// The settings to relating to the System's Input Method, Key and Value.<br />
2186 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
2189 /// The following example demonstrates how to set the InputMethodSettings property.
2191 /// InputMethod method = new InputMethod();
2192 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2193 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2194 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2195 /// method.Variation = 1;
2196 /// textEditor.InputMethodSettings = method.OutputMap;
2199 [EditorBrowsable(EditorBrowsableState.Never)]
2200 public PropertyMap InputMethodSettings
2204 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2208 SetValue(InputMethodSettingsProperty, value);
2209 NotifyPropertyChanged();
2214 /// Scroll the text control by specific amount..
2216 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2217 [EditorBrowsable(EditorBrowsableState.Never)]
2218 public void ScrollBy(Vector2 scroll)
2220 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2225 /// Get the InputMethodContext instance.
2227 /// <returns>The InputMethodContext instance.</returns>
2228 /// <since_tizen> 5 </since_tizen>
2229 public InputMethodContext GetInputMethodContext()
2231 if (inputMethodContext == null)
2233 /*Avoid raising InputMethodContext reference count.*/
2234 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2237 return inputMethodContext;
2241 /// Select the whole text.
2243 /// <since_tizen> 9 </since_tizen>
2244 public void SelectWholeText()
2246 Interop.TextEditor.SelectWholeText(SwigCPtr);
2247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2251 /// Select text from start to end index. <br />
2252 /// The index is valid when 0 or positive.
2254 /// <param name="start">The start index for selection.</param>
2255 /// <param name="end">The end index for selection.</param>
2257 /// If the end index exceeds the maximum value, it is set to the length of the text.
2259 /// <since_tizen> 9 </since_tizen>
2260 public void SelectText(int start, int end)
2263 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2265 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2267 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2272 /// Clear selection of the text. <br />
2273 /// Valid when selection is activate.
2275 /// <since_tizen> 9 </since_tizen>
2276 public void SelectNone()
2278 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2283 /// The Enable grab handle property.<br />
2284 /// Enables the grab handles for text selection.<br />
2285 /// The default value is true, which means the grab handles are enabled by default.<br />
2287 [EditorBrowsable(EditorBrowsableState.Never)]
2288 public bool EnableGrabHandle
2292 return (bool)GetValue(EnableGrabHandleProperty);
2296 SetValue(EnableGrabHandleProperty, value);
2297 NotifyPropertyChanged();
2302 /// The Enable grab handle popup property.<br />
2303 /// Enables the grab handle popup for text selection.<br />
2304 /// The default value is true, which means the grab handle popup is enabled by default.<br />
2306 [EditorBrowsable(EditorBrowsableState.Never)]
2307 public bool EnableGrabHandlePopup
2311 return (bool)GetValue(EnableGrabHandlePopupProperty);
2315 SetValue(EnableGrabHandlePopupProperty, value);
2316 NotifyPropertyChanged();
2321 /// Minimum line size to be used.<br />
2322 /// The height of the line in points. <br />
2323 /// If the font size is larger than the line size, it works with the font size. <br />
2325 [EditorBrowsable(EditorBrowsableState.Never)]
2326 public float MinLineSize
2330 return (float)GetValue(MinLineSizeProperty);
2334 SetValue(MinLineSizeProperty, value);
2335 NotifyPropertyChanged();
2339 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2341 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));
2342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2349 /// <since_tizen> 3 </since_tizen>
2350 protected override void Dispose(DisposeTypes type)
2357 if (systemlangTextFlag)
2359 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2362 removeFontSizeChangedCallback();
2364 //Release your own unmanaged resources here.
2365 //You should not access any managed member here except static instance.
2366 //because the execution order of Finalizes is non-deterministic.
2370 if (textEditorTextChangedCallbackDelegate != null)
2372 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2375 if (textEditorMaxLengthReachedCallbackDelegate != null)
2377 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2380 if (textEditorSelectionClearedCallbackDelegate != null)
2382 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2385 if (textEditorCursorPositionChangedCallbackDelegate != null)
2387 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2390 if (textEditorSelectionChangedCallbackDelegate != null)
2392 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2399 /// This will not be public opened.
2400 [EditorBrowsable(EditorBrowsableState.Never)]
2401 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2403 // In order to speed up IME hide, temporarily add
2404 GetInputMethodContext()?.DestroyContext();
2405 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2408 internal override LayoutItem CreateDefaultLayout()
2410 return new TextEditorLayout();
2413 internal void SetTextWithoutTextChanged(string text)
2415 invokeTextChanged = false;
2416 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(text));
2417 invokeTextChanged = true;
2420 private string SetTranslatable(string textEditorSid)
2422 string translatableText = null;
2423 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2424 if (translatableText != null)
2426 if (systemlangTextFlag == false)
2428 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2429 systemlangTextFlag = true;
2431 return translatableText;
2435 translatableText = "";
2436 return translatableText;
2440 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2442 if (textEditorTextSid != null)
2444 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2446 if (textEditorPlaceHolderTextSid != null)
2448 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2452 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2454 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2455 SetValue(FontSizeScaleProperty, newFontSizeScale);
2456 NotifyPropertyChanged();
2459 private void addFontSizeChangedCallback()
2461 if (hasFontSizeChangedCallback != true)
2465 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2466 hasFontSizeChangedCallback = true;
2470 Console.WriteLine("{0} Exception caught.", e);
2471 hasFontSizeChangedCallback = false;
2476 private void removeFontSizeChangedCallback()
2478 if (hasFontSizeChangedCallback == true)
2482 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2483 hasFontSizeChangedCallback = false;
2487 Console.WriteLine("{0} Exception caught.", e);
2488 hasFontSizeChangedCallback = true;
2493 internal new class Property
2495 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2496 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2497 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2498 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2499 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2500 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2501 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2502 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2503 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2504 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2505 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2506 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2507 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2508 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2509 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2510 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2511 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2512 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2513 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2514 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2515 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2516 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2517 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2518 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2519 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2520 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2521 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2522 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2523 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2524 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2525 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2526 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2527 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2528 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2529 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2530 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2531 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2532 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2533 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2534 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2535 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2536 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2537 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2538 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2539 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2540 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2541 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2542 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2543 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2544 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2545 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2546 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2547 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2548 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2549 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2550 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2551 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2552 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2553 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2554 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2555 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2556 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2557 internal static readonly int EnableFontSizeScale = Interop.TextEditor.EnableFontSizeScaleGet();
2558 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2559 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2560 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2561 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2562 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2563 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2564 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2565 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2566 internal static readonly int Strikethrough = Interop.TextEditor.StrikethroughGet();
2569 internal class InputStyle
2575 FontFamily = 0x0002,
2578 LineSpacing = 0x0010,
2586 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2588 DecorationBoundingBox = new Rectangle(x, y, width, height);
2590 private void OnInputColorChanged(float x, float y, float z, float w)
2592 InputColor = new Vector4(x, y, z, w);
2594 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2596 PlaceholderTextColor = new Color(r, g, b, a);
2598 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2600 PrimaryCursorColor = new Vector4(x, y, z, w);
2602 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2604 SecondaryCursorColor = new Vector4(x, y, z, w);
2606 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2608 SelectionHighlightColor = new Vector4(x, y, z, w);
2610 private void OnTextColorChanged(float x, float y, float z, float w)
2612 TextColor = new Vector4(x, y, z, w);
2614 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2616 GrabHandleColor = new Color(r, g, b, a);
2619 private class TextEditorLayout : LayoutItem
2621 protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
2623 // Padding will be automatically applied by DALi TextEditor.
2624 var totalWidth = widthMeasureSpec.Size.AsDecimal();
2625 var totalHeight = heightMeasureSpec.Size.AsDecimal();
2626 var minSize = Owner.MinimumSize;
2627 var maxSize = Owner.MaximumSize;
2628 var naturalSize = Owner.GetNaturalSize();
2630 if (((TextEditor)Owner).Text.Length == 0)
2632 // Calculate height of TextEditor by setting Text with " ".
2633 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2634 ((TextEditor)Owner).SetTextWithoutTextChanged(" ");
2636 // Store original WidthSpecification to restore it after setting ResizePolicy.
2637 var widthSpecification = Owner.WidthSpecification;
2639 // In DALi's Size logic, if Width or Height is set to be 0, then
2640 // ResizePolicy is not changed to Fixed.
2641 // This causes Size changes after NUI Layout's OnMeasure is finished.
2642 // e.g. TextEditor's Width fills to its parent although Text is null and
2643 // WidthSpecification is WrapContent.
2644 // To prevent the Size changes, WidthResizePolicy is set to be Fixed
2645 // in advance if Text is null.
2646 Owner.WidthResizePolicy = ResizePolicyType.Fixed;
2648 // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
2649 Owner.WidthSpecification = widthSpecification;
2651 naturalSize = Owner.GetNaturalSize();
2653 // Restore TextEditor's Text after calculating height of TextEditor.
2654 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2655 ((TextEditor)Owner).SetTextWithoutTextChanged("");
2658 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2660 totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), maxSize.Width);
2663 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2665 totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), maxSize.Height);
2668 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
2669 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
2671 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
2672 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
2674 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
2675 ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));