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)
93 /// The TranslatableText property.<br />
94 /// The text can set the SID value.<br />
96 /// <exception cref='ArgumentNullException'>
97 /// ResourceManager about multilingual is null.
99 /// <since_tizen> 4 </since_tizen>
100 public string TranslatableText
104 return GetValue(TranslatableTextProperty) as string;
108 SetValue(TranslatableTextProperty, value);
112 private string InternalTranslatableText
116 return textEditorTextSid;
120 if (NUIApplication.MultilingualResourceManager == null)
122 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
124 textEditorTextSid = value;
125 Text = SetTranslatable(textEditorTextSid);
126 NotifyPropertyChanged();
130 /// The TranslatablePlaceholderText property.<br />
131 /// The text can set the SID value.<br />
133 /// <exception cref='ArgumentNullException'>
134 /// ResourceManager about multilingual is null.
136 /// <since_tizen> 4 </since_tizen>
137 public string TranslatablePlaceholderText
141 return GetValue(TranslatablePlaceholderTextProperty) as string;
145 SetValue(TranslatablePlaceholderTextProperty, value);
149 private string InternalTranslatablePlaceholderText
153 return textEditorPlaceHolderTextSid;
157 if (NUIApplication.MultilingualResourceManager == null)
159 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
161 textEditorPlaceHolderTextSid = value;
162 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
163 NotifyPropertyChanged();
168 /// The Text property.<br />
169 /// The text to display in the UTF-8 format.<br />
171 /// <since_tizen> 3 </since_tizen>
176 return (string)GetValue(TextProperty);
180 SetValueAndForceSendChangeSignal(TextProperty, value);
181 NotifyPropertyChanged();
186 /// The TextColor property.<br />
187 /// The color of the text.<br />
190 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
192 /// <since_tizen> 3 </since_tizen>
193 public Vector4 TextColor
197 Vector4 temp = (Vector4)GetValue(TextColorProperty);
198 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
202 SetValue(TextColorProperty, value);
203 NotifyPropertyChanged();
208 /// The FontFamily property.<br />
209 /// The requested font family to use.<br />
211 /// <since_tizen> 3 </since_tizen>
212 public string FontFamily
216 return (string)GetValue(FontFamilyProperty);
220 SetValue(FontFamilyProperty, value);
221 NotifyPropertyChanged();
226 /// The FontStyle property.<br />
227 /// The requested font style to use.<br />
228 /// The fontStyle map contains the following keys :<br />
229 /// <list type="table">
230 /// <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>
231 /// <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>
232 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
235 /// <since_tizen> 3 </since_tizen>
236 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
237 public PropertyMap FontStyle
241 return (PropertyMap)GetValue(FontStyleProperty);
245 SetValue(FontStyleProperty, value);
246 NotifyPropertyChanged();
251 /// Set FontStyle to TextEditor. <br />
253 /// <param name="fontStyle">The FontStyle</param>
255 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
258 /// The following example demonstrates how to use the SetFontStyle method.
260 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
261 /// fontStyle.Width = FontWidthType.Expanded;
262 /// fontStyle.Weight = FontWeightType.Bold;
263 /// fontStyle.Slant = FontSlantType.Italic;
264 /// editor.SetFontStyle(fontStyle);
267 [EditorBrowsable(EditorBrowsableState.Never)]
268 public void SetFontStyle(FontStyle fontStyle)
270 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
272 SetValue(FontStyleProperty, fontStyleMap);
277 /// Get FontStyle from TextEditor. <br />
279 /// <returns>The FontStyle</returns>
281 /// <see cref="Tizen.NUI.Text.FontStyle"/>
283 [EditorBrowsable(EditorBrowsableState.Never)]
284 public FontStyle GetFontStyle()
287 using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty))
289 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
295 /// The PointSize property.<br />
296 /// The size of font in points.<br />
298 /// <since_tizen> 3 </since_tizen>
299 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
300 public float PointSize
304 return (float)GetValue(PointSizeProperty);
308 SetValue(PointSizeProperty, value);
309 NotifyPropertyChanged();
314 /// The HorizontalAlignment property.<br />
315 /// The line horizontal alignment.<br />
317 /// <since_tizen> 3 </since_tizen>
318 public HorizontalAlignment HorizontalAlignment
322 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
326 SetValue(HorizontalAlignmentProperty, value);
327 NotifyPropertyChanged();
332 /// The VerticalAlignment property.<br />
333 /// The line vertical alignment.
335 [EditorBrowsable(EditorBrowsableState.Never)]
336 public VerticalAlignment VerticalAlignment
340 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
344 SetValue(VerticalAlignmentProperty, value);
345 NotifyPropertyChanged();
350 /// The ScrollThreshold property.<br />
351 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
353 /// <since_tizen> 3 </since_tizen>
354 public float ScrollThreshold
358 return (float)GetValue(ScrollThresholdProperty);
362 SetValue(ScrollThresholdProperty, value);
363 NotifyPropertyChanged();
368 /// The ScrollSpeed property.<br />
369 /// The scroll speed in pixels per second.<br />
371 /// <since_tizen> 3 </since_tizen>
372 public float ScrollSpeed
376 return (float)GetValue(ScrollSpeedProperty);
380 SetValue(ScrollSpeedProperty, value);
381 NotifyPropertyChanged();
386 /// The PrimaryCursorColor property.<br />
387 /// The color to apply to the primary cursor.<br />
390 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
392 /// <since_tizen> 3 </since_tizen>
393 public Vector4 PrimaryCursorColor
397 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
398 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
402 SetValue(PrimaryCursorColorProperty, value);
403 NotifyPropertyChanged();
408 /// The SecondaryCursorColor property.<br />
409 /// The color to apply to the secondary cursor.<br />
412 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
414 /// <since_tizen> 3 </since_tizen>
415 public Vector4 SecondaryCursorColor
419 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
420 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
424 SetValue(SecondaryCursorColorProperty, value);
425 NotifyPropertyChanged();
430 /// The EnableCursorBlink property.<br />
431 /// Whether the cursor should blink or not.<br />
433 /// <since_tizen> 3 </since_tizen>
434 public bool EnableCursorBlink
438 return (bool)GetValue(EnableCursorBlinkProperty);
442 SetValue(EnableCursorBlinkProperty, value);
443 NotifyPropertyChanged();
448 /// The CursorBlinkInterval property.<br />
449 /// The time interval in seconds between cursor on/off states.<br />
451 /// <since_tizen> 3 </since_tizen>
452 public float CursorBlinkInterval
456 return (float)GetValue(CursorBlinkIntervalProperty);
460 SetValue(CursorBlinkIntervalProperty, value);
461 NotifyPropertyChanged();
466 /// The CursorBlinkDuration property.<br />
467 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
469 /// <since_tizen> 3 </since_tizen>
470 public float CursorBlinkDuration
474 return (float)GetValue(CursorBlinkDurationProperty);
478 SetValue(CursorBlinkDurationProperty, value);
479 NotifyPropertyChanged();
484 /// The CursorWidth property.
486 /// <since_tizen> 3 </since_tizen>
487 public int CursorWidth
491 return (int)GetValue(CursorWidthProperty);
495 SetValue(CursorWidthProperty, value);
496 NotifyPropertyChanged();
501 /// The GrabHandleImage property.<br />
502 /// The image to display for the grab handle.<br />
504 /// <since_tizen> 3 </since_tizen>
505 public string GrabHandleImage
509 return (string)GetValue(GrabHandleImageProperty);
513 SetValue(GrabHandleImageProperty, value);
514 NotifyPropertyChanged();
519 /// The GrabHandlePressedImage property.<br />
520 /// The image to display when the grab handle is pressed.<br />
522 /// <since_tizen> 3 </since_tizen>
523 public string GrabHandlePressedImage
527 return (string)GetValue(GrabHandlePressedImageProperty);
531 SetValue(GrabHandlePressedImageProperty, value);
532 NotifyPropertyChanged();
537 /// The SelectionHandleImageLeft property.<br />
538 /// The image to display for the left selection handle.<br />
539 /// The selectionHandleImageLeft map contains the following key :<br />
540 /// <list type="table">
541 /// <item><term>filename (string)</term><description>The path of image file</description></item>
544 /// <since_tizen> 3 </since_tizen>
545 public PropertyMap SelectionHandleImageLeft
549 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
553 SetValue(SelectionHandleImageLeftProperty, value);
554 NotifyPropertyChanged();
559 /// The SelectionHandleImageRight property.<br />
560 /// The image to display for the right selection handle.<br />
561 /// The selectionHandleImageRight map contains the following key :<br />
562 /// <list type="table">
563 /// <item><term>filename (string)</term><description>The path of image file</description></item>
566 /// <since_tizen> 3 </since_tizen>
567 public PropertyMap SelectionHandleImageRight
571 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
575 SetValue(SelectionHandleImageRightProperty, value);
576 NotifyPropertyChanged();
581 /// Set SelectionHandleImage to TextEditor. <br />
583 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
585 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
588 /// The following example demonstrates how to use the SetSelectionHandleImage method.
590 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
591 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
592 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
593 /// editor.SetSelectionHandleImage(selectionHandleImage);
596 [EditorBrowsable(EditorBrowsableState.Never)]
597 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
599 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
601 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
603 SetValue(SelectionHandleImageLeftProperty, leftImageMap);
607 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
609 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
611 SetValue(SelectionHandleImageRightProperty, rightImageMap);
617 /// Get SelectionHandleImage from TextEditor. <br />
619 /// <returns>The SelectionHandleImage</returns>
621 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
623 [EditorBrowsable(EditorBrowsableState.Never)]
624 public SelectionHandleImage GetSelectionHandleImage()
626 SelectionHandleImage selectionHandleImage;
627 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
628 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
630 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
632 return selectionHandleImage;
636 /// The SelectionHandlePressedImageLeft property.<br />
637 /// The image to display when the left selection handle is pressed.<br />
638 /// The selectionHandlePressedImageLeft map contains the following key :<br />
639 /// <list type="table">
640 /// <item><term>filename (string)</term><description>The path of image file</description></item>
643 /// <since_tizen> 3 </since_tizen>
644 public PropertyMap SelectionHandlePressedImageLeft
648 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
652 SetValue(SelectionHandlePressedImageLeftProperty, value);
653 NotifyPropertyChanged();
658 /// The SelectionHandlePressedImageRight property.<br />
659 /// The image to display when the right selection handle is pressed.<br />
660 /// The selectionHandlePressedImageRight map contains the following key :<br />
661 /// <list type="table">
662 /// <item><term>filename (string)</term><description>The path of image file</description></item>
665 /// <since_tizen> 3 </since_tizen>
666 public PropertyMap SelectionHandlePressedImageRight
670 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
674 SetValue(SelectionHandlePressedImageRightProperty, value);
675 NotifyPropertyChanged();
680 /// Set SelectionHandlePressedImage to TextEditor. <br />
682 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
684 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
687 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
689 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
690 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
691 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
692 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
695 [EditorBrowsable(EditorBrowsableState.Never)]
696 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
698 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
700 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
702 SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
706 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
708 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
710 SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
716 /// Get SelectionHandlePressedImage from TextEditor. <br />
718 /// <returns>The SelectionHandlePressedImage</returns>
720 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
722 [EditorBrowsable(EditorBrowsableState.Never)]
723 public SelectionHandleImage GetSelectionHandlePressedImage()
725 SelectionHandleImage selectionHandleImage;
726 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
727 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
729 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
731 return selectionHandleImage;
735 /// The SelectionHandleMarkerImageLeft property.<br />
736 /// The image to display for the left selection handle marker.<br />
737 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
738 /// <list type="table">
739 /// <item><term>filename (string)</term><description>The path of image file</description></item>
742 /// <since_tizen> 3 </since_tizen>
743 public PropertyMap SelectionHandleMarkerImageLeft
747 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
751 SetValue(SelectionHandleMarkerImageLeftProperty, value);
752 NotifyPropertyChanged();
757 /// The SelectionHandleMarkerImageRight property.<br />
758 /// The image to display for the right selection handle marker.<br />
759 /// The selectionHandleMarkerImageRight map contains the following key :<br />
760 /// <list type="table">
761 /// <item><term>filename (string)</term><description>The path of image file</description></item>
764 /// <since_tizen> 3 </since_tizen>
765 public PropertyMap SelectionHandleMarkerImageRight
769 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
773 SetValue(SelectionHandleMarkerImageRightProperty, value);
774 NotifyPropertyChanged();
779 /// Set SelectionHandleMarkerImage to TextEditor. <br />
781 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
783 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
786 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
788 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
789 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
790 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
791 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
794 [EditorBrowsable(EditorBrowsableState.Never)]
795 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
797 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
799 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
801 SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
805 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
807 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
809 SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
815 /// Get SelectionHandleMarkerImage from TextEditor. <br />
817 /// <returns>The SelectionHandleMarkerImage</returns>
819 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
821 [EditorBrowsable(EditorBrowsableState.Never)]
822 public SelectionHandleImage GetSelectionHandleMarkerImage()
824 SelectionHandleImage selectionHandleImage;
825 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
826 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
828 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
830 return selectionHandleImage;
834 /// The SelectionHighlightColor property.<br />
835 /// The color of the selection highlight.<br />
838 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
840 /// <since_tizen> 3 </since_tizen>
841 public Vector4 SelectionHighlightColor
845 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
846 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
850 SetValue(SelectionHighlightColorProperty, value);
851 NotifyPropertyChanged();
856 /// The DecorationBoundingBox property.<br />
857 /// The decorations (handles etc) will positioned within this area on-screen.<br />
860 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
862 /// <since_tizen> 3 </since_tizen>
863 public Rectangle DecorationBoundingBox
867 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
868 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
872 SetValue(DecorationBoundingBoxProperty, value);
873 NotifyPropertyChanged();
878 /// The EnableMarkup property.<br />
879 /// Whether the mark-up processing is enabled.<br />
881 /// <since_tizen> 3 </since_tizen>
882 public bool EnableMarkup
886 return (bool)GetValue(EnableMarkupProperty);
890 SetValue(EnableMarkupProperty, value);
891 NotifyPropertyChanged();
896 /// The InputColor property.<br />
897 /// The color of the new input text.<br />
900 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
902 /// <since_tizen> 3 </since_tizen>
903 public Vector4 InputColor
907 Vector4 temp = (Vector4)GetValue(InputColorProperty);
908 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
912 SetValue(InputColorProperty, value);
913 NotifyPropertyChanged();
918 /// The InputFontFamily property.<br />
919 /// The font's family of the new input text.<br />
921 /// <since_tizen> 3 </since_tizen>
922 public string InputFontFamily
926 return (string)GetValue(InputFontFamilyProperty);
930 SetValue(InputFontFamilyProperty, value);
931 NotifyPropertyChanged();
936 /// The InputFontStyle property.<br />
937 /// The font's style of the new input text.<br />
938 /// The inputFontStyle map contains the following keys :<br />
939 /// <list type="table">
940 /// <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>
941 /// <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>
942 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</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 InputFontStyle
951 return (PropertyMap)GetValue(InputFontStyleProperty);
955 SetValue(InputFontStyleProperty, value);
956 NotifyPropertyChanged();
961 /// Set InputFontStyle to TextEditor. <br />
963 /// <param name="fontStyle">The FontStyle</param>
965 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
968 /// The following example demonstrates how to use the SetInputFontStyle method.
970 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
971 /// fontStyle.Width = FontWidthType.Expanded;
972 /// fontStyle.Weight = FontWeightType.Bold;
973 /// fontStyle.Slant = FontSlantType.Italic;
974 /// editor.SetInputFontStyle(fontStyle);
977 [EditorBrowsable(EditorBrowsableState.Never)]
978 public void SetInputFontStyle(FontStyle fontStyle)
980 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
982 SetValue(InputFontStyleProperty, fontStyleMap);
987 /// Get InputFontStyle from TextEditor. <br />
989 /// <returns>The FontStyle</returns>
991 /// <see cref="Tizen.NUI.Text.FontStyle"/>
993 [EditorBrowsable(EditorBrowsableState.Never)]
994 public FontStyle GetInputFontStyle()
997 using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
999 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
1005 /// The InputPointSize property.<br />
1006 /// The font's size of the new input text in points.<br />
1008 /// <since_tizen> 3 </since_tizen>
1009 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
1010 public float InputPointSize
1014 return (float)GetValue(InputPointSizeProperty);
1018 SetValue(InputPointSizeProperty, value);
1019 NotifyPropertyChanged();
1024 /// The LineSpacing property.<br />
1025 /// The default extra space between lines in points.<br />
1027 /// <since_tizen> 3 </since_tizen>
1028 public float LineSpacing
1032 return (float)GetValue(LineSpacingProperty);
1036 SetValue(LineSpacingProperty, value);
1037 NotifyPropertyChanged();
1042 /// The InputLineSpacing property.<br />
1043 /// The extra space between lines in points.<br />
1045 /// <since_tizen> 3 </since_tizen>
1046 public float InputLineSpacing
1050 return (float)GetValue(InputLineSpacingProperty);
1054 SetValue(InputLineSpacingProperty, value);
1055 NotifyPropertyChanged();
1060 /// The Underline property.<br />
1061 /// The default underline parameters.<br />
1062 /// The underline map contains the following keys :<br />
1063 /// <list type="table">
1064 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1065 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1066 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1069 /// <since_tizen> 3 </since_tizen>
1070 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1071 public PropertyMap Underline
1075 return (PropertyMap)GetValue(UnderlineProperty);
1079 SetValue(UnderlineProperty, value);
1080 NotifyPropertyChanged();
1085 /// Set Underline to TextEditor. <br />
1087 /// <param name="underline">The Underline</param>
1089 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1092 /// The following example demonstrates how to use the SetUnderline method.
1094 /// var underline = new Tizen.NUI.Text.Underline();
1095 /// underline.Enable = true;
1096 /// underline.Color = new Color("#3498DB");
1097 /// underline.Height = 2.0f;
1098 /// editor.SetUnderline(underline);
1101 [EditorBrowsable(EditorBrowsableState.Never)]
1102 public void SetUnderline(Underline underline)
1104 using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1106 SetValue(UnderlineProperty, underlineMap);
1111 /// Get Underline from TextEditor. <br />
1113 /// <returns>The Underline</returns>
1115 /// <see cref="Tizen.NUI.Text.Underline"/>
1117 [EditorBrowsable(EditorBrowsableState.Never)]
1118 public Underline GetUnderline()
1120 Underline underline;
1121 using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1123 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1129 /// The InputUnderline property.<br />
1130 /// The underline parameters of the new input text.<br />
1132 /// <since_tizen> 3 </since_tizen>
1133 public string InputUnderline
1137 return (string)GetValue(InputUnderlineProperty);
1141 SetValue(InputUnderlineProperty, value);
1142 NotifyPropertyChanged();
1147 /// The Shadow property.<br />
1148 /// The default shadow parameters.<br />
1149 /// The shadow map contains the following keys :<br />
1150 /// <list type="table">
1151 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1152 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1153 /// <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>
1156 /// <since_tizen> 3 </since_tizen>
1157 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1158 public PropertyMap Shadow
1162 return (PropertyMap)GetValue(ShadowProperty);
1166 SetValue(ShadowProperty, value);
1167 NotifyPropertyChanged();
1172 /// Set Shadow to TextEditor. <br />
1174 /// <param name="shadow">The Shadow</param>
1176 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1179 /// The following example demonstrates how to use the SetShadow method.
1181 /// var shadow = new Tizen.NUI.Text.Shadow();
1182 /// shadow.Offset = new Vector2(3, 3);
1183 /// shadow.Color = new Color("#F1C40F");
1184 /// editor.SetShadow(shadow);
1187 [EditorBrowsable(EditorBrowsableState.Never)]
1188 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1190 using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1192 SetValue(ShadowProperty, shadowMap);
1197 /// Get Shadow from TextEditor. <br />
1199 /// <returns>The Shadow</returns>
1201 /// <see cref="Tizen.NUI.Text.Shadow"/>
1203 [EditorBrowsable(EditorBrowsableState.Never)]
1204 public Tizen.NUI.Text.Shadow GetShadow()
1206 Tizen.NUI.Text.Shadow shadow;
1207 using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
1209 shadow = TextMapHelper.GetShadowStruct(shadowMap);
1215 /// The InputShadow property.<br />
1216 /// The shadow parameters of the new input text.<br />
1218 /// <since_tizen> 3 </since_tizen>
1219 public string InputShadow
1223 return (string)GetValue(InputShadowProperty);
1227 SetValue(InputShadowProperty, value);
1228 NotifyPropertyChanged();
1233 /// The Emboss property.<br />
1234 /// The default emboss parameters.<br />
1236 /// <since_tizen> 3 </since_tizen>
1237 public string Emboss
1241 return (string)GetValue(EmbossProperty);
1245 SetValue(EmbossProperty, value);
1246 NotifyPropertyChanged();
1251 /// The InputEmboss property.<br />
1252 /// The emboss parameters of the new input text.<br />
1254 /// <since_tizen> 3 </since_tizen>
1255 public string InputEmboss
1259 return (string)GetValue(InputEmbossProperty);
1263 SetValue(InputEmbossProperty, value);
1264 NotifyPropertyChanged();
1269 /// The Outline property.<br />
1270 /// The default outline parameters.<br />
1271 /// The outline map contains the following keys :<br />
1272 /// <list type="table">
1273 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1274 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1277 /// <since_tizen> 3 </since_tizen>
1278 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1279 public PropertyMap Outline
1283 return (PropertyMap)GetValue(OutlineProperty);
1287 SetValue(OutlineProperty, value);
1288 NotifyPropertyChanged();
1293 /// Set Outline to TextEditor. <br />
1295 /// <param name="outline">The Outline</param>
1297 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1300 /// The following example demonstrates how to use the SetOutline method.
1302 /// var outline = new Tizen.NUI.Text.Outline();
1303 /// outline.Width = 2.0f;
1304 /// outline.Color = new Color("#45B39D");
1305 /// editor.SetOutline(outline);
1308 [EditorBrowsable(EditorBrowsableState.Never)]
1309 public void SetOutline(Outline outline)
1311 using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
1313 SetValue(OutlineProperty, outlineMap);
1318 /// Get Outline from TextEditor. <br />
1320 /// <returns>The Outline</returns>
1322 /// <see cref="Tizen.NUI.Text.Outline"/>
1324 [EditorBrowsable(EditorBrowsableState.Never)]
1325 public Outline GetOutline()
1328 using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
1330 outline = TextMapHelper.GetOutlineStruct(outlineMap);
1336 /// The InputOutline property.<br />
1337 /// The outline parameters of the new input text.<br />
1339 /// <since_tizen> 3 </since_tizen>
1340 public string InputOutline
1344 return (string)GetValue(InputOutlineProperty);
1348 SetValue(InputOutlineProperty, value);
1349 NotifyPropertyChanged();
1354 /// The SmoothScroll property.<br />
1355 /// Enable or disable the smooth scroll animation.<br />
1357 /// <since_tizen> 3 </since_tizen>
1358 public bool SmoothScroll
1362 return (bool)GetValue(SmoothScrollProperty);
1366 SetValue(SmoothScrollProperty, value);
1367 NotifyPropertyChanged();
1372 /// The SmoothScrollDuration property.<br />
1373 /// Sets the duration of smooth scroll animation.<br />
1375 /// <since_tizen> 3 </since_tizen>
1376 public float SmoothScrollDuration
1380 return (float)GetValue(SmoothScrollDurationProperty);
1384 SetValue(SmoothScrollDurationProperty, value);
1385 NotifyPropertyChanged();
1390 /// The EnableScrollBar property.<br />
1391 /// Enable or disable the scroll bar.<br />
1393 /// <since_tizen> 3 </since_tizen>
1394 public bool EnableScrollBar
1398 return (bool)GetValue(EnableScrollBarProperty);
1402 SetValue(EnableScrollBarProperty, value);
1403 NotifyPropertyChanged();
1408 /// The ScrollBarShowDuration property.<br />
1409 /// Sets the duration of scroll bar to show.<br />
1411 /// <since_tizen> 3 </since_tizen>
1412 public float ScrollBarShowDuration
1416 return (float)GetValue(ScrollBarShowDurationProperty);
1420 SetValue(ScrollBarShowDurationProperty, value);
1421 NotifyPropertyChanged();
1426 /// The ScrollBarFadeDuration property.<br />
1427 /// Sets the duration of scroll bar to fade out.<br />
1429 /// <since_tizen> 3 </since_tizen>
1430 public float ScrollBarFadeDuration
1434 return (float)GetValue(ScrollBarFadeDurationProperty);
1438 SetValue(ScrollBarFadeDurationProperty, value);
1439 NotifyPropertyChanged();
1444 /// The PixelSize property.<br />
1445 /// The size of font in pixels.<br />
1447 /// <since_tizen> 3 </since_tizen>
1448 [Binding.TypeConverter(typeof(FloatGraphicsTypeConverter))]
1449 public float PixelSize
1453 return (float)GetValue(PixelSizeProperty);
1457 SetValue(PixelSizeProperty, value);
1458 NotifyPropertyChanged();
1463 /// The line count of the text.
1465 /// <since_tizen> 3 </since_tizen>
1466 public int LineCount
1471 using (var propertyValue = GetProperty(TextEditor.Property.LineCount))
1473 propertyValue.Get(out lineCount);
1480 /// The text to display when the TextEditor is empty and inactive.
1482 /// <since_tizen> 3 </since_tizen>
1483 public string PlaceholderText
1487 return (string)GetValue(PlaceholderTextProperty);
1491 SetValue(PlaceholderTextProperty, value);
1492 NotifyPropertyChanged();
1497 /// The portion of the text that has been selected by the user.
1500 /// Empty string when nothing is selected.
1502 /// <since_tizen> 9 </since_tizen>
1503 public string SelectedText
1507 string selectedText;
1508 using (var propertyValue = GetProperty(TextEditor.Property.SelectedText))
1510 propertyValue.Get(out selectedText);
1512 return selectedText;
1517 /// The Placeholder text color.
1520 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1522 /// <since_tizen> 3 </since_tizen>
1523 public Color PlaceholderTextColor
1527 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1528 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1532 SetValue(PlaceholderTextColorProperty, value);
1533 NotifyPropertyChanged();
1538 /// The Enable selection property.<br />
1539 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1541 /// <since_tizen> 3 </since_tizen>
1542 public bool EnableSelection
1546 return (bool)GetValue(EnableSelectionProperty);
1550 SetValue(EnableSelectionProperty, value);
1551 NotifyPropertyChanged();
1556 /// The start index for selection.
1559 /// When there is no selection, the index is current cursor position.
1561 /// <since_tizen> 9 </since_tizen>
1562 public int SelectedTextStart
1566 int selectedTextStart;
1567 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextStart))
1569 propertyValue.Get(out selectedTextStart);
1571 return selectedTextStart;
1576 /// The end index for selection.
1579 /// When there is no selection, the index is current cursor position.
1581 /// <since_tizen> 9 </since_tizen>
1582 public int SelectedTextEnd
1586 int selectedTextEnd;
1587 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextEnd))
1589 propertyValue.Get(out selectedTextEnd);
1591 return selectedTextEnd;
1596 /// Enable editing in text control.
1598 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1599 [EditorBrowsable(EditorBrowsableState.Never)]
1600 public bool EnableEditing
1604 return (bool)GetValue(EnableEditingProperty);
1608 SetValue(EnableEditingProperty, value);
1612 private bool InternalEnableEditing
1617 using (var propertyValue = GetProperty(TextEditor.Property.EnableEditing))
1619 propertyValue.Get(out enableEditing);
1621 return enableEditing;
1625 using (var propertyValue = new PropertyValue(value))
1627 SetProperty(TextEditor.Property.EnableEditing, propertyValue);
1628 NotifyPropertyChanged();
1634 /// Specify horizontal scroll position in text control.
1636 [EditorBrowsable(EditorBrowsableState.Never)]
1637 public int HorizontalScrollPosition
1641 return (int)GetValue(HorizontalScrollPositionProperty);
1645 SetValue(HorizontalScrollPositionProperty, value);
1649 private int InternalHorizontalScrollPosition
1653 int horizontalScrollPosition;
1654 using (var propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1656 propertyValue.Get(out horizontalScrollPosition);
1658 return horizontalScrollPosition;
1662 using (var propertyValue = new PropertyValue(value))
1664 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1665 NotifyPropertyChanged();
1671 /// Specify vertical scroll position in text control.
1673 [EditorBrowsable(EditorBrowsableState.Never)]
1674 public int VerticalScrollPosition
1678 return (int)GetValue(VerticalScrollPositionProperty);
1682 SetValue(VerticalScrollPositionProperty, value);
1686 private int InternalVerticalScrollPosition
1690 int verticalScrollPosition;
1691 using (var propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1693 propertyValue.Get(out verticalScrollPosition);
1695 return verticalScrollPosition;
1699 using (var propertyValue = new PropertyValue(value))
1701 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1702 NotifyPropertyChanged();
1708 /// Specify primary cursor (caret) position in text control.
1710 [EditorBrowsable(EditorBrowsableState.Never)]
1711 public int PrimaryCursorPosition
1715 return (int)GetValue(PrimaryCursorPositionProperty);
1719 SetValue(PrimaryCursorPositionProperty, value);
1723 private int InternalPrimaryCursorPosition
1727 int primaryCursorPosition;
1728 using (var propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1730 propertyValue.Get(out primaryCursorPosition);
1732 return primaryCursorPosition;
1736 using (var propertyValue = new PropertyValue(value))
1738 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1739 NotifyPropertyChanged();
1745 /// The GrabHandleColor property.
1748 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1750 [EditorBrowsable(EditorBrowsableState.Never)]
1751 public Color GrabHandleColor
1755 Color temp = (Color)GetValue(GrabHandleColorProperty);
1756 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1760 SetValue(GrabHandleColorProperty, value);
1761 NotifyPropertyChanged();
1766 /// Set InputFilter to TextEditor.
1768 /// <param name="inputFilter">The InputFilter</param>
1770 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1771 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1772 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1775 /// The following example demonstrates how to use the SetInputFilter method.
1777 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1778 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1779 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1780 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1783 /// <since_tizen> 9 </since_tizen>
1784 public void SetInputFilter(InputFilter inputFilter)
1786 using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1787 using (var propertyValue = new PropertyValue(map))
1789 SetProperty(TextEditor.Property.InputFilter, propertyValue);
1794 /// Get InputFilter from TextEditor. <br />
1796 /// <returns>The InputFilter</returns>
1798 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1800 /// <since_tizen> 9 </since_tizen>
1801 public InputFilter GetInputFilter()
1803 InputFilter inputFilter;
1804 using (var propertyValue = GetProperty(TextEditor.Property.InputFilter))
1805 using (var map = new PropertyMap())
1807 propertyValue.Get(map);
1808 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1814 /// Set Strikethrough to TextEditor. <br />
1816 /// <param name="strikethrough">The Strikethrough</param>
1818 /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
1821 /// The following example demonstrates how to use the SetStrikethrough method.
1823 /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
1824 /// strikethrough.Enable = true;
1825 /// strikethrough.Color = new Color("#3498DB");
1826 /// strikethrough.Height = 2.0f;
1827 /// editor.SetStrikethrough(strikethrough);
1830 [EditorBrowsable(EditorBrowsableState.Never)]
1831 public void SetStrikethrough(Strikethrough strikethrough)
1833 using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
1834 using (var propertyValue = new PropertyValue(map))
1836 SetProperty(TextEditor.Property.Strikethrough, propertyValue);
1841 /// Get Strikethrough from TextEditor. <br />
1843 /// <returns>The Strikethrough</returns>
1845 /// <see cref="Tizen.NUI.Text.Strikethrough"/>
1847 [EditorBrowsable(EditorBrowsableState.Never)]
1848 public Strikethrough GetStrikethrough()
1850 Strikethrough strikethrough;
1851 using (var propertyValue = GetProperty(TextEditor.Property.Strikethrough))
1852 using (var map = new PropertyMap())
1854 propertyValue.Get(map);
1855 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
1857 return strikethrough;
1861 /// The Placeholder property.
1862 /// The placeholder map contains the following keys :<br />
1863 /// <list type="table">
1864 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1865 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1866 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1867 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1868 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1869 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1870 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1871 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1875 /// The following example demonstrates how to set the placeholder property.
1877 /// PropertyMap propertyMap = new PropertyMap();
1878 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1879 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1880 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1881 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1882 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1884 /// PropertyMap fontStyleMap = new PropertyMap();
1885 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1886 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1887 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1888 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1890 /// TextEditor editor = new TextEditor();
1891 /// editor.Placeholder = propertyMap;
1894 /// <since_tizen> 3 </since_tizen>
1895 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1896 public Tizen.NUI.PropertyMap Placeholder
1900 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1901 string defalutText = "";
1903 if (TextMapHelper.IsValue(map, 0))
1904 map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
1906 if (TextMapHelper.IsValue(map, 1))
1907 map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
1909 if (TextMapHelper.IsValue(map, 2))
1911 using (var color = TextMapHelper.GetColorFromMap(map, 2))
1913 map.Add("color", color);
1917 if (TextMapHelper.IsValue(map, 3))
1918 map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
1920 if (TextMapHelper.IsValue(map, 4))
1922 using (var properyValue = map.Find(4))
1923 using (var fontStyle = new PropertyMap())
1925 properyValue.Get(fontStyle);
1926 using (var fontStyleValue = new PropertyValue(fontStyle))
1928 map.Add("fontStyle", fontStyleValue);
1933 if (TextMapHelper.IsValue(map, 5))
1934 map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
1936 if (TextMapHelper.IsValue(map, 6))
1937 map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
1939 if (TextMapHelper.IsValue(map, 7))
1940 map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
1946 SetValue(PlaceholderProperty, value);
1947 NotifyPropertyChanged();
1952 /// Set Placeholder to TextEditor. <br />
1954 /// <param name="placeholder">The Placeholder</param>
1956 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1959 /// The following example demonstrates how to use the SetPlaceholder method.
1961 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1962 /// placeholder.Text = "placeholder text";
1963 /// placeholder.TextFocused = "placeholder textFocused";
1964 /// placeholder.Color = new Color("#45B39D");
1965 /// placeholder.FontFamily = "BreezeSans";
1966 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
1968 /// Width = FontWidthType.Expanded,
1969 /// Weight = FontWeightType.ExtraLight,
1970 /// Slant = FontSlantType.Italic,
1972 /// placeholder.PointSize = 25.0f;
1973 /// //placeholder.PixelSize = 50.0f;
1974 /// placeholder.Ellipsis = true;
1975 /// editor.SetPlaceholder(placeholder);
1978 [EditorBrowsable(EditorBrowsableState.Never)]
1979 public void SetPlaceholder(Placeholder placeholder)
1981 using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
1983 SetValue(PlaceholderProperty, placeholderMap);
1988 /// Get Placeholder from TextEditor. <br />
1990 /// <returns>The Placeholder</returns>
1992 /// <see cref="Tizen.NUI.Text.Placeholder"/>
1994 [EditorBrowsable(EditorBrowsableState.Never)]
1995 public Placeholder GetPlaceholder()
1997 Placeholder placeholder;
1998 using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
2000 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
2006 /// The Ellipsis property.<br />
2007 /// Enable or disable the ellipsis.<br />
2009 /// <since_tizen> 9 </since_tizen>
2010 public bool Ellipsis
2014 return (bool)GetValue(EllipsisProperty);
2018 SetValue(EllipsisProperty, value);
2019 NotifyPropertyChanged();
2025 /// The ellipsis position of the text.
2026 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
2028 /// <since_tizen> 9 </since_tizen>
2029 public EllipsisPosition EllipsisPosition
2033 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
2037 SetValue(EllipsisPositionProperty, value);
2038 NotifyPropertyChanged();
2043 /// The LineWrapMode property.<br />
2044 /// The line wrap mode when the text lines over the layout width.<br />
2046 /// <since_tizen> 4 </since_tizen>
2047 public LineWrapMode LineWrapMode
2051 return (LineWrapMode)GetValue(LineWrapModeProperty);
2055 SetValue(LineWrapModeProperty, value);
2056 NotifyPropertyChanged();
2061 /// Enables Text selection using Shift key.
2063 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2064 [EditorBrowsable(EditorBrowsableState.Never)]
2065 public bool EnableShiftSelection
2069 return (bool)GetValue(EnableShiftSelectionProperty);
2073 SetValue(EnableShiftSelectionProperty, value);
2074 NotifyPropertyChanged();
2079 /// The text alignment to match the direction of the system language.
2081 /// <since_tizen> 6 </since_tizen>
2082 public bool MatchSystemLanguageDirection
2086 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2090 SetValue(MatchSystemLanguageDirectionProperty, value);
2091 NotifyPropertyChanged();
2096 /// The MaxLength property.<br />
2097 /// The maximum number of characters that can be inserted.<br />
2099 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2100 [EditorBrowsable(EditorBrowsableState.Never)]
2101 public int MaxLength
2105 return (int)GetValue(MaxLengthProperty);
2109 SetValue(MaxLengthProperty, value);
2110 NotifyPropertyChanged();
2114 /// Only used by the IL of xaml, will never changed to not hidden.
2115 [EditorBrowsable(EditorBrowsableState.Never)]
2116 public override bool IsCreateByXaml
2120 return base.IsCreateByXaml;
2124 base.IsCreateByXaml = value;
2128 this.TextChanged += (obj, e) =>
2130 this.Text = e.TextEditor.Text;
2137 /// The FontSizeScale property. <br />
2138 /// The default value is 1.0. <br />
2139 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2140 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2142 /// <since_tizen> 9 </since_tizen>
2143 public float FontSizeScale
2147 return fontSizeScale;
2151 float newFontSizeScale;
2153 if (fontSizeScale == value) return;
2155 fontSizeScale = value;
2156 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2158 SystemSettingsFontSize systemSettingsFontSize;
2162 systemSettingsFontSize = SystemSettings.FontSize;
2166 Console.WriteLine("{0} Exception caught.", e);
2167 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2169 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2170 addFontSizeChangedCallback();
2174 newFontSizeScale = fontSizeScale;
2175 removeFontSizeChangedCallback();
2178 SetValue(FontSizeScaleProperty, newFontSizeScale);
2179 NotifyPropertyChanged();
2184 /// The EnableFontSizeScale property.<br />
2185 /// Whether the font size scale is enabled. (The default value is true)
2187 [EditorBrowsable(EditorBrowsableState.Never)]
2188 public bool EnableFontSizeScale
2192 return (bool)GetValue(EnableFontSizeScaleProperty);
2196 SetValue(EnableFontSizeScaleProperty, value);
2197 NotifyPropertyChanged();
2202 /// The InputMethodSettings property.<br />
2203 /// The settings to relating to the System's Input Method, Key and Value.<br />
2206 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
2209 /// The following example demonstrates how to set the InputMethodSettings property.
2211 /// InputMethod method = new InputMethod();
2212 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2213 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2214 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2215 /// method.Variation = 1;
2216 /// textEditor.InputMethodSettings = method.OutputMap;
2219 [EditorBrowsable(EditorBrowsableState.Never)]
2220 public PropertyMap InputMethodSettings
2224 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2228 SetValue(InputMethodSettingsProperty, value);
2229 NotifyPropertyChanged();
2234 /// Scroll the text control by specific amount..
2236 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2237 [EditorBrowsable(EditorBrowsableState.Never)]
2238 public void ScrollBy(Vector2 scroll)
2240 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2245 /// Get the InputMethodContext instance.
2247 /// <returns>The InputMethodContext instance.</returns>
2248 /// <since_tizen> 5 </since_tizen>
2249 public InputMethodContext GetInputMethodContext()
2251 if (inputMethodContext == null)
2253 /*Avoid raising InputMethodContext reference count.*/
2254 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2257 return inputMethodContext;
2261 /// Select the whole text.
2263 /// <since_tizen> 9 </since_tizen>
2264 public void SelectWholeText()
2266 Interop.TextEditor.SelectWholeText(SwigCPtr);
2267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2271 /// Select text from start to end index. <br />
2272 /// The index is valid when 0 or positive.
2274 /// <param name="start">The start index for selection.</param>
2275 /// <param name="end">The end index for selection.</param>
2277 /// If the end index exceeds the maximum value, it is set to the length of the text.
2279 /// <since_tizen> 9 </since_tizen>
2280 public void SelectText(int start, int end)
2283 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2285 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2287 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2292 /// Clear selection of the text. <br />
2293 /// Valid when selection is activate.
2295 /// <since_tizen> 9 </since_tizen>
2296 public void SelectNone()
2298 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2303 /// The Enable grab handle property.<br />
2304 /// Enables the grab handles for text selection.<br />
2305 /// The default value is true, which means the grab handles are enabled by default.<br />
2307 [EditorBrowsable(EditorBrowsableState.Never)]
2308 public bool EnableGrabHandle
2312 return (bool)GetValue(EnableGrabHandleProperty);
2316 SetValue(EnableGrabHandleProperty, value);
2317 NotifyPropertyChanged();
2322 /// The Enable grab handle popup property.<br />
2323 /// Enables the grab handle popup for text selection.<br />
2324 /// The default value is true, which means the grab handle popup is enabled by default.<br />
2326 [EditorBrowsable(EditorBrowsableState.Never)]
2327 public bool EnableGrabHandlePopup
2331 return (bool)GetValue(EnableGrabHandlePopupProperty);
2335 SetValue(EnableGrabHandlePopupProperty, value);
2336 NotifyPropertyChanged();
2341 /// Minimum line size to be used.<br />
2342 /// The height of the line in points. <br />
2343 /// If the font size is larger than the line size, it works with the font size. <br />
2345 [EditorBrowsable(EditorBrowsableState.Never)]
2346 public float MinLineSize
2350 return (float)GetValue(MinLineSizeProperty);
2354 SetValue(MinLineSizeProperty, value);
2355 NotifyPropertyChanged();
2359 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2361 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));
2362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2367 /// The spaces between characters in Pixels.
2369 /// A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).<br />
2370 /// The default value is 0.f which does nothing.
2373 [EditorBrowsable(EditorBrowsableState.Never)]
2374 public float CharacterSpacing
2378 return (float)GetValue(CharacterSpacingProperty);
2382 SetValue(CharacterSpacingProperty, value);
2383 NotifyPropertyChanged();
2390 /// <since_tizen> 3 </since_tizen>
2391 protected override void Dispose(DisposeTypes type)
2398 if (systemlangTextFlag)
2400 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2403 removeFontSizeChangedCallback();
2405 //Release your own unmanaged resources here.
2406 //You should not access any managed member here except static instance.
2407 //because the execution order of Finalizes is non-deterministic.
2411 if (textEditorTextChangedCallbackDelegate != null)
2413 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2416 if (textEditorMaxLengthReachedCallbackDelegate != null)
2418 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2421 if (textEditorSelectionStartedCallbackDelegate != null)
2423 this.SelectionStartedSignal().Disconnect(textEditorSelectionStartedCallbackDelegate);
2426 if (textEditorSelectionClearedCallbackDelegate != null)
2428 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2431 if (textEditorCursorPositionChangedCallbackDelegate != null)
2433 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2436 if (textEditorSelectionChangedCallbackDelegate != null)
2438 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2445 /// This will not be public opened.
2446 [EditorBrowsable(EditorBrowsableState.Never)]
2447 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2449 // In order to speed up IME hide, temporarily add
2450 GetInputMethodContext()?.DestroyContext();
2451 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2454 internal override LayoutItem CreateDefaultLayout()
2456 return new TextEditorLayout();
2459 internal void SetTextWithoutTextChanged(string text)
2461 invokeTextChanged = false;
2462 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(text));
2463 invokeTextChanged = true;
2466 private string SetTranslatable(string textEditorSid)
2468 string translatableText = null;
2469 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2470 if (translatableText != null)
2472 if (systemlangTextFlag == false)
2474 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2475 systemlangTextFlag = true;
2477 return translatableText;
2481 translatableText = "";
2482 return translatableText;
2486 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2488 if (textEditorTextSid != null)
2490 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2492 if (textEditorPlaceHolderTextSid != null)
2494 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2498 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2500 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2501 SetValue(FontSizeScaleProperty, newFontSizeScale);
2502 NotifyPropertyChanged();
2505 private void addFontSizeChangedCallback()
2507 if (hasFontSizeChangedCallback != true)
2511 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2512 hasFontSizeChangedCallback = true;
2516 Console.WriteLine("{0} Exception caught.", e);
2517 hasFontSizeChangedCallback = false;
2522 private void removeFontSizeChangedCallback()
2524 if (hasFontSizeChangedCallback == true)
2528 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2529 hasFontSizeChangedCallback = false;
2533 Console.WriteLine("{0} Exception caught.", e);
2534 hasFontSizeChangedCallback = true;
2539 internal new class Property
2541 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2542 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2543 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2544 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2545 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2546 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2547 internal static readonly int VerticalAlignment = Interop.TextEditor.VerticalAlignmentGet();
2548 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2549 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2550 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2551 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2552 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2553 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2554 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2555 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2556 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2557 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2558 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2559 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2560 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2561 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2562 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2563 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2564 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2565 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2566 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2567 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2568 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2569 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2570 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2571 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2572 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2573 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2574 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2575 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2576 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2577 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2578 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2579 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2580 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2581 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2582 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2583 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2584 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2585 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2586 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2587 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2588 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2589 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2590 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2591 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2592 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2593 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2594 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2595 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2596 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2597 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2598 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2599 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2600 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2601 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2602 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2603 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2604 internal static readonly int EnableFontSizeScale = Interop.TextEditor.EnableFontSizeScaleGet();
2605 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2606 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2607 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2608 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2609 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2610 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2611 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2612 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2613 internal static readonly int Strikethrough = Interop.TextEditor.StrikethroughGet();
2614 internal static readonly int CharacterSpacing = Interop.TextEditor.CharacterSpacingGet();
2617 internal class InputStyle
2623 FontFamily = 0x0002,
2626 LineSpacing = 0x0010,
2634 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2636 DecorationBoundingBox = new Rectangle(x, y, width, height);
2638 private void OnInputColorChanged(float x, float y, float z, float w)
2640 InputColor = new Vector4(x, y, z, w);
2642 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2644 PlaceholderTextColor = new Color(r, g, b, a);
2646 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2648 PrimaryCursorColor = new Vector4(x, y, z, w);
2650 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2652 SecondaryCursorColor = new Vector4(x, y, z, w);
2654 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2656 SelectionHighlightColor = new Vector4(x, y, z, w);
2658 private void OnTextColorChanged(float x, float y, float z, float w)
2660 TextColor = new Vector4(x, y, z, w);
2662 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2664 GrabHandleColor = new Color(r, g, b, a);
2667 private class TextEditorLayout : LayoutItem
2669 protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
2671 // Padding will be automatically applied by DALi TextEditor.
2672 var totalWidth = widthMeasureSpec.Size.AsDecimal();
2673 var totalHeight = heightMeasureSpec.Size.AsDecimal();
2674 var minSize = Owner.MinimumSize;
2675 var maxSize = Owner.MaximumSize;
2676 var naturalSize = Owner.GetNaturalSize();
2678 if (((TextEditor)Owner).Text.Length == 0)
2680 // Calculate height of TextEditor by setting Text with " ".
2681 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2682 ((TextEditor)Owner).SetTextWithoutTextChanged(" ");
2684 // Store original WidthSpecification to restore it after setting ResizePolicy.
2685 var widthSpecification = Owner.WidthSpecification;
2687 // In DALi's Size logic, if Width or Height is set to be 0, then
2688 // ResizePolicy is not changed to Fixed.
2689 // This causes Size changes after NUI Layout's OnMeasure is finished.
2690 // e.g. TextEditor's Width fills to its parent although Text is null and
2691 // WidthSpecification is WrapContent.
2692 // To prevent the Size changes, WidthResizePolicy is set to be Fixed
2693 // in advance if Text is null.
2694 Owner.WidthResizePolicy = ResizePolicyType.Fixed;
2696 // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
2697 Owner.WidthSpecification = widthSpecification;
2699 naturalSize = Owner.GetNaturalSize();
2701 // Restore TextEditor's Text after calculating height of TextEditor.
2702 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2703 ((TextEditor)Owner).SetTextWithoutTextChanged("");
2706 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2708 totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), maxSize.Width);
2711 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2713 totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), maxSize.Height);
2716 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
2717 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
2719 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
2720 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
2722 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
2723 ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));