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;
41 private bool isSettingTextInCSharp = false;
43 #if NUI_PROPERTY_CHANGE_2
44 private Color internalPlaceholderTextColor = null;
45 private Vector4 internalPrimaryCursorColor = null;
46 private Vector4 internalSecondaryCursorColor = null;
47 private Vector4 internalSelectionHighlightColor = null;
48 private Vector4 internalInputColor = null;
49 private Vector4 internalTextColor = null;
50 private Color internalGrabHandleColor = null;
54 static TextEditor() { }
57 /// Creates the TextEditor control.
59 /// <since_tizen> 3 </since_tizen>
60 public TextEditor() : this(Interop.TextEditor.New(), true)
62 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 /// Creates the TextEditor with specified style.
68 [EditorBrowsable(EditorBrowsableState.Never)]
69 public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
74 /// Creates the TextEditor with setting the status of shown or hidden.
76 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
77 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
81 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85 internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
87 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
97 TextChanged += TextEditorTextChanged;
101 /// The TranslatableText property.<br />
102 /// The text can set the SID value.<br />
104 /// <exception cref='ArgumentNullException'>
105 /// ResourceManager about multilingual is null.
107 /// <since_tizen> 4 </since_tizen>
108 public string TranslatableText
112 return GetValue(TranslatableTextProperty) as string;
116 SetValue(TranslatableTextProperty, value);
120 private string InternalTranslatableText
124 return textEditorTextSid;
128 if (NUIApplication.MultilingualResourceManager == null)
130 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
132 textEditorTextSid = value;
133 Text = SetTranslatable(textEditorTextSid);
134 NotifyPropertyChanged();
138 /// The TranslatablePlaceholderText property.<br />
139 /// The text can set the SID value.<br />
141 /// <exception cref='ArgumentNullException'>
142 /// ResourceManager about multilingual is null.
144 /// <since_tizen> 4 </since_tizen>
145 public string TranslatablePlaceholderText
149 return GetValue(TranslatablePlaceholderTextProperty) as string;
153 SetValue(TranslatablePlaceholderTextProperty, value);
157 private string InternalTranslatablePlaceholderText
161 return textEditorPlaceHolderTextSid;
165 if (NUIApplication.MultilingualResourceManager == null)
167 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
169 textEditorPlaceHolderTextSid = value;
170 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
171 NotifyPropertyChanged();
176 /// The Text property.<br />
177 /// The text to display in the UTF-8 format.<br />
179 /// <since_tizen> 3 </since_tizen>
184 return (string)GetValue(TextProperty);
188 SetValue(TextProperty, value);
189 NotifyPropertyChanged();
194 /// The TextColor property.<br />
195 /// The color of the text.<br />
198 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
200 /// <since_tizen> 3 </since_tizen>
201 public Vector4 TextColor
205 Vector4 temp = (Vector4)GetValue(TextColorProperty);
206 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
210 SetValue(TextColorProperty, value);
211 NotifyPropertyChanged();
216 /// The FontFamily property.<br />
217 /// The requested font family to use.<br />
219 /// <since_tizen> 3 </since_tizen>
220 public string FontFamily
224 return (string)GetValue(FontFamilyProperty);
228 SetValue(FontFamilyProperty, value);
229 NotifyPropertyChanged();
234 /// The FontStyle property.<br />
235 /// The requested font style to use.<br />
236 /// The fontStyle map contains the following keys :<br />
237 /// <list type="table">
238 /// <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>
239 /// <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>
240 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
243 /// <since_tizen> 3 </since_tizen>
244 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
245 public PropertyMap FontStyle
249 return (PropertyMap)GetValue(FontStyleProperty);
253 SetValue(FontStyleProperty, value);
254 NotifyPropertyChanged();
259 /// Set FontStyle to TextEditor. <br />
261 /// <param name="fontStyle">The FontStyle</param>
263 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
266 /// The following example demonstrates how to use the SetFontStyle method.
268 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
269 /// fontStyle.Width = FontWidthType.Expanded;
270 /// fontStyle.Weight = FontWeightType.Bold;
271 /// fontStyle.Slant = FontSlantType.Italic;
272 /// editor.SetFontStyle(fontStyle);
275 [EditorBrowsable(EditorBrowsableState.Never)]
276 public void SetFontStyle(FontStyle fontStyle)
278 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
280 SetValue(FontStyleProperty, fontStyleMap);
285 /// Get FontStyle from TextEditor. <br />
287 /// <returns>The FontStyle</returns>
289 /// <see cref="Tizen.NUI.Text.FontStyle"/>
291 [EditorBrowsable(EditorBrowsableState.Never)]
292 public FontStyle GetFontStyle()
295 using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty))
297 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
303 /// The PointSize property.<br />
304 /// The size of font in points.<br />
306 /// <since_tizen> 3 </since_tizen>
307 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
308 public float PointSize
312 return (float)GetValue(PointSizeProperty);
316 SetValue(PointSizeProperty, value);
317 NotifyPropertyChanged();
322 /// The HorizontalAlignment property.<br />
323 /// The line horizontal alignment.<br />
325 /// <since_tizen> 3 </since_tizen>
326 public HorizontalAlignment HorizontalAlignment
330 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
334 SetValue(HorizontalAlignmentProperty, value);
335 NotifyPropertyChanged();
340 /// The VerticalAlignment property.<br />
341 /// The line vertical alignment.
343 [EditorBrowsable(EditorBrowsableState.Never)]
344 public VerticalAlignment VerticalAlignment
348 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
352 SetValue(VerticalAlignmentProperty, value);
353 NotifyPropertyChanged();
358 /// The ScrollThreshold property.<br />
359 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
361 /// <since_tizen> 3 </since_tizen>
362 public float ScrollThreshold
366 return (float)GetValue(ScrollThresholdProperty);
370 SetValue(ScrollThresholdProperty, value);
371 NotifyPropertyChanged();
376 /// The ScrollSpeed property.<br />
377 /// The scroll speed in pixels per second.<br />
379 /// <since_tizen> 3 </since_tizen>
380 public float ScrollSpeed
384 return (float)GetValue(ScrollSpeedProperty);
388 SetValue(ScrollSpeedProperty, value);
389 NotifyPropertyChanged();
394 /// The PrimaryCursorColor property.<br />
395 /// The color to apply to the primary cursor.<br />
398 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
400 /// <since_tizen> 3 </since_tizen>
401 public Vector4 PrimaryCursorColor
405 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
406 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
410 SetValue(PrimaryCursorColorProperty, value);
411 NotifyPropertyChanged();
416 /// The SecondaryCursorColor property.<br />
417 /// The color to apply to the secondary cursor.<br />
420 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
422 /// <since_tizen> 3 </since_tizen>
423 public Vector4 SecondaryCursorColor
427 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
428 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
432 SetValue(SecondaryCursorColorProperty, value);
433 NotifyPropertyChanged();
438 /// The EnableCursorBlink property.<br />
439 /// Whether the cursor should blink or not.<br />
441 /// <since_tizen> 3 </since_tizen>
442 public bool EnableCursorBlink
446 return (bool)GetValue(EnableCursorBlinkProperty);
450 SetValue(EnableCursorBlinkProperty, value);
451 NotifyPropertyChanged();
456 /// The CursorBlinkInterval property.<br />
457 /// The time interval in seconds between cursor on/off states.<br />
459 /// <since_tizen> 3 </since_tizen>
460 public float CursorBlinkInterval
464 return (float)GetValue(CursorBlinkIntervalProperty);
468 SetValue(CursorBlinkIntervalProperty, value);
469 NotifyPropertyChanged();
474 /// The CursorBlinkDuration property.<br />
475 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
477 /// <since_tizen> 3 </since_tizen>
478 public float CursorBlinkDuration
482 return (float)GetValue(CursorBlinkDurationProperty);
486 SetValue(CursorBlinkDurationProperty, value);
487 NotifyPropertyChanged();
492 /// The CursorWidth property.
494 /// <since_tizen> 3 </since_tizen>
495 public int CursorWidth
499 return (int)GetValue(CursorWidthProperty);
503 SetValue(CursorWidthProperty, value);
504 NotifyPropertyChanged();
509 /// The GrabHandleImage property.<br />
510 /// The image to display for the grab handle.<br />
512 /// <since_tizen> 3 </since_tizen>
513 public string GrabHandleImage
517 return (string)GetValue(GrabHandleImageProperty);
521 SetValue(GrabHandleImageProperty, value);
522 NotifyPropertyChanged();
527 /// The GrabHandlePressedImage property.<br />
528 /// The image to display when the grab handle is pressed.<br />
530 /// <since_tizen> 3 </since_tizen>
531 public string GrabHandlePressedImage
535 return (string)GetValue(GrabHandlePressedImageProperty);
539 SetValue(GrabHandlePressedImageProperty, value);
540 NotifyPropertyChanged();
545 /// The SelectionPopupStyle property.<br />
546 /// The style of the text selection popup can be set through SelectionPopupStyle property.
548 [EditorBrowsable(EditorBrowsableState.Never)]
549 public PropertyMap SelectionPopupStyle
553 return (PropertyMap)GetValue(SelectionPopupStyleProperty);
557 SetValue(SelectionPopupStyleProperty, value);
558 NotifyPropertyChanged();
563 /// The SelectionHandleImageLeft property.<br />
564 /// The image to display for the left selection handle.<br />
565 /// The selectionHandleImageLeft map contains the following key :<br />
566 /// <list type="table">
567 /// <item><term>filename (string)</term><description>The path of image file</description></item>
570 /// <since_tizen> 3 </since_tizen>
571 public PropertyMap SelectionHandleImageLeft
575 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
579 SetValue(SelectionHandleImageLeftProperty, value);
580 NotifyPropertyChanged();
585 /// The SelectionHandleImageRight property.<br />
586 /// The image to display for the right selection handle.<br />
587 /// The selectionHandleImageRight map contains the following key :<br />
588 /// <list type="table">
589 /// <item><term>filename (string)</term><description>The path of image file</description></item>
592 /// <since_tizen> 3 </since_tizen>
593 public PropertyMap SelectionHandleImageRight
597 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
601 SetValue(SelectionHandleImageRightProperty, value);
602 NotifyPropertyChanged();
607 /// Set SelectionHandleImage to TextEditor. <br />
609 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
611 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
614 /// The following example demonstrates how to use the SetSelectionHandleImage method.
616 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
617 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
618 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
619 /// editor.SetSelectionHandleImage(selectionHandleImage);
622 [EditorBrowsable(EditorBrowsableState.Never)]
623 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
625 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
627 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
629 SetValue(SelectionHandleImageLeftProperty, leftImageMap);
633 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
635 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
637 SetValue(SelectionHandleImageRightProperty, rightImageMap);
643 /// Get SelectionHandleImage from TextEditor. <br />
645 /// <returns>The SelectionHandleImage</returns>
647 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
649 [EditorBrowsable(EditorBrowsableState.Never)]
650 public SelectionHandleImage GetSelectionHandleImage()
652 SelectionHandleImage selectionHandleImage;
653 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
654 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
656 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
658 return selectionHandleImage;
662 /// The SelectionHandlePressedImageLeft property.<br />
663 /// The image to display when the left selection handle is pressed.<br />
664 /// The selectionHandlePressedImageLeft map contains the following key :<br />
665 /// <list type="table">
666 /// <item><term>filename (string)</term><description>The path of image file</description></item>
669 /// <since_tizen> 3 </since_tizen>
670 public PropertyMap SelectionHandlePressedImageLeft
674 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
678 SetValue(SelectionHandlePressedImageLeftProperty, value);
679 NotifyPropertyChanged();
684 /// The SelectionHandlePressedImageRight property.<br />
685 /// The image to display when the right selection handle is pressed.<br />
686 /// The selectionHandlePressedImageRight map contains the following key :<br />
687 /// <list type="table">
688 /// <item><term>filename (string)</term><description>The path of image file</description></item>
691 /// <since_tizen> 3 </since_tizen>
692 public PropertyMap SelectionHandlePressedImageRight
696 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
700 SetValue(SelectionHandlePressedImageRightProperty, value);
701 NotifyPropertyChanged();
706 /// Set SelectionHandlePressedImage to TextEditor. <br />
708 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
710 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
713 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
715 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
716 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
717 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
718 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
721 [EditorBrowsable(EditorBrowsableState.Never)]
722 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
724 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
726 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
728 SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
732 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
734 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
736 SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
742 /// Get SelectionHandlePressedImage from TextEditor. <br />
744 /// <returns>The SelectionHandlePressedImage</returns>
746 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
748 [EditorBrowsable(EditorBrowsableState.Never)]
749 public SelectionHandleImage GetSelectionHandlePressedImage()
751 SelectionHandleImage selectionHandleImage;
752 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
753 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
755 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
757 return selectionHandleImage;
761 /// The SelectionHandleMarkerImageLeft property.<br />
762 /// The image to display for the left selection handle marker.<br />
763 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
764 /// <list type="table">
765 /// <item><term>filename (string)</term><description>The path of image file</description></item>
768 /// <since_tizen> 3 </since_tizen>
769 public PropertyMap SelectionHandleMarkerImageLeft
773 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
777 SetValue(SelectionHandleMarkerImageLeftProperty, value);
778 NotifyPropertyChanged();
783 /// The SelectionHandleMarkerImageRight property.<br />
784 /// The image to display for the right selection handle marker.<br />
785 /// The selectionHandleMarkerImageRight map contains the following key :<br />
786 /// <list type="table">
787 /// <item><term>filename (string)</term><description>The path of image file</description></item>
790 /// <since_tizen> 3 </since_tizen>
791 public PropertyMap SelectionHandleMarkerImageRight
795 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
799 SetValue(SelectionHandleMarkerImageRightProperty, value);
800 NotifyPropertyChanged();
805 /// Set SelectionHandleMarkerImage to TextEditor. <br />
807 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
809 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
812 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
814 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
815 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
816 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
817 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
820 [EditorBrowsable(EditorBrowsableState.Never)]
821 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
823 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
825 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
827 SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
831 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
833 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
835 SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
841 /// Get SelectionHandleMarkerImage from TextEditor. <br />
843 /// <returns>The SelectionHandleMarkerImage</returns>
845 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
847 [EditorBrowsable(EditorBrowsableState.Never)]
848 public SelectionHandleImage GetSelectionHandleMarkerImage()
850 SelectionHandleImage selectionHandleImage;
851 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
852 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
854 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
856 return selectionHandleImage;
860 /// The SelectionHighlightColor property.<br />
861 /// The color of the selection highlight.<br />
864 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
866 /// <since_tizen> 3 </since_tizen>
867 public Vector4 SelectionHighlightColor
871 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
872 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
876 SetValue(SelectionHighlightColorProperty, value);
877 NotifyPropertyChanged();
882 /// The DecorationBoundingBox property.<br />
883 /// The decorations (handles etc) will positioned within this area on-screen.<br />
886 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
888 /// <since_tizen> 3 </since_tizen>
889 public Rectangle DecorationBoundingBox
893 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
894 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
898 SetValue(DecorationBoundingBoxProperty, value);
899 NotifyPropertyChanged();
904 /// The EnableMarkup property.<br />
905 /// Whether the mark-up processing is enabled.<br />
907 /// <since_tizen> 3 </since_tizen>
908 public bool EnableMarkup
912 return (bool)GetValue(EnableMarkupProperty);
916 SetValue(EnableMarkupProperty, value);
917 NotifyPropertyChanged();
922 /// The InputColor property.<br />
923 /// The color of the new input text.<br />
926 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
928 /// <since_tizen> 3 </since_tizen>
929 public Vector4 InputColor
933 Vector4 temp = (Vector4)GetValue(InputColorProperty);
934 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
938 SetValue(InputColorProperty, value);
939 NotifyPropertyChanged();
944 /// The InputFontFamily property.<br />
945 /// The font's family of the new input text.<br />
947 /// <since_tizen> 3 </since_tizen>
948 public string InputFontFamily
952 return (string)GetValue(InputFontFamilyProperty);
956 SetValue(InputFontFamilyProperty, value);
957 NotifyPropertyChanged();
962 /// The InputFontStyle property.<br />
963 /// The font's style of the new input text.<br />
964 /// The inputFontStyle map contains the following keys :<br />
965 /// <list type="table">
966 /// <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>
967 /// <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>
968 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
971 /// <since_tizen> 3 </since_tizen>
972 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
973 public PropertyMap InputFontStyle
977 return (PropertyMap)GetValue(InputFontStyleProperty);
981 SetValue(InputFontStyleProperty, value);
982 NotifyPropertyChanged();
987 /// Set InputFontStyle to TextEditor. <br />
989 /// <param name="fontStyle">The FontStyle</param>
991 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
994 /// The following example demonstrates how to use the SetInputFontStyle method.
996 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
997 /// fontStyle.Width = FontWidthType.Expanded;
998 /// fontStyle.Weight = FontWeightType.Bold;
999 /// fontStyle.Slant = FontSlantType.Italic;
1000 /// editor.SetInputFontStyle(fontStyle);
1003 [EditorBrowsable(EditorBrowsableState.Never)]
1004 public void SetInputFontStyle(FontStyle fontStyle)
1006 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
1008 SetValue(InputFontStyleProperty, fontStyleMap);
1013 /// Get InputFontStyle from TextEditor. <br />
1015 /// <returns>The FontStyle</returns>
1017 /// <see cref="Tizen.NUI.Text.FontStyle"/>
1019 [EditorBrowsable(EditorBrowsableState.Never)]
1020 public FontStyle GetInputFontStyle()
1022 FontStyle fontStyle;
1023 using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
1025 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
1031 /// The InputPointSize property.<br />
1032 /// The font's size of the new input text in points.<br />
1034 /// <since_tizen> 3 </since_tizen>
1035 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
1036 public float InputPointSize
1040 return (float)GetValue(InputPointSizeProperty);
1044 SetValue(InputPointSizeProperty, value);
1045 NotifyPropertyChanged();
1050 /// The LineSpacing property.<br />
1051 /// The default extra space between lines in points.<br />
1053 /// <since_tizen> 3 </since_tizen>
1054 public float LineSpacing
1058 return (float)GetValue(LineSpacingProperty);
1062 SetValue(LineSpacingProperty, value);
1063 NotifyPropertyChanged();
1068 /// The InputLineSpacing property.<br />
1069 /// The extra space between lines in points.<br />
1071 /// <since_tizen> 3 </since_tizen>
1072 public float InputLineSpacing
1076 return (float)GetValue(InputLineSpacingProperty);
1080 SetValue(InputLineSpacingProperty, value);
1081 NotifyPropertyChanged();
1086 /// The relative height of the line (a factor that will be multiplied by text height). <br />
1087 /// If the value is less than 1, the lines could to be overlapped.
1089 [EditorBrowsable(EditorBrowsableState.Never)]
1090 public float RelativeLineHeight
1094 return (float)GetValue(RelativeLineHeightProperty);
1098 SetValue(RelativeLineHeightProperty, value);
1099 NotifyPropertyChanged();
1104 /// The Underline property.<br />
1105 /// The default underline parameters.<br />
1106 /// The underline map contains the following keys :<br />
1107 /// <list type="table">
1108 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1109 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1110 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1113 /// <since_tizen> 3 </since_tizen>
1114 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1115 public PropertyMap Underline
1119 return (PropertyMap)GetValue(UnderlineProperty);
1123 SetValue(UnderlineProperty, value);
1124 NotifyPropertyChanged();
1129 /// Set Underline to TextEditor. <br />
1131 /// <param name="underline">The Underline</param>
1133 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1136 /// The following example demonstrates how to use the SetUnderline method.
1138 /// var underline = new Tizen.NUI.Text.Underline();
1139 /// underline.Enable = true;
1140 /// underline.Color = new Color("#3498DB");
1141 /// underline.Height = 2.0f;
1142 /// editor.SetUnderline(underline);
1145 [EditorBrowsable(EditorBrowsableState.Never)]
1146 public void SetUnderline(Underline underline)
1148 using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1150 SetValue(UnderlineProperty, underlineMap);
1155 /// Get Underline from TextEditor. <br />
1157 /// <returns>The Underline</returns>
1159 /// <see cref="Tizen.NUI.Text.Underline"/>
1161 [EditorBrowsable(EditorBrowsableState.Never)]
1162 public Underline GetUnderline()
1164 Underline underline;
1165 using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1167 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1173 /// The InputUnderline property.<br />
1174 /// The underline parameters of the new input text.<br />
1176 /// <since_tizen> 3 </since_tizen>
1177 public string InputUnderline
1181 return (string)GetValue(InputUnderlineProperty);
1185 SetValue(InputUnderlineProperty, value);
1186 NotifyPropertyChanged();
1191 /// The Shadow property.<br />
1192 /// The default shadow parameters.<br />
1193 /// The shadow map contains the following keys :<br />
1194 /// <list type="table">
1195 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1196 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1197 /// <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>
1200 /// <since_tizen> 3 </since_tizen>
1201 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1202 public PropertyMap Shadow
1206 return (PropertyMap)GetValue(ShadowProperty);
1210 SetValue(ShadowProperty, value);
1211 NotifyPropertyChanged();
1216 /// Set Shadow to TextEditor. <br />
1218 /// <param name="shadow">The Shadow</param>
1220 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1223 /// The following example demonstrates how to use the SetShadow method.
1225 /// var shadow = new Tizen.NUI.Text.Shadow();
1226 /// shadow.Offset = new Vector2(3, 3);
1227 /// shadow.Color = new Color("#F1C40F");
1228 /// editor.SetShadow(shadow);
1231 [EditorBrowsable(EditorBrowsableState.Never)]
1232 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1234 using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1236 SetValue(ShadowProperty, shadowMap);
1241 /// Get Shadow from TextEditor. <br />
1243 /// <returns>The Shadow</returns>
1245 /// <see cref="Tizen.NUI.Text.Shadow"/>
1247 [EditorBrowsable(EditorBrowsableState.Never)]
1248 public Tizen.NUI.Text.Shadow GetShadow()
1250 Tizen.NUI.Text.Shadow shadow;
1251 using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
1253 shadow = TextMapHelper.GetShadowStruct(shadowMap);
1259 /// The InputShadow property.<br />
1260 /// The shadow parameters of the new input text.<br />
1262 /// <since_tizen> 3 </since_tizen>
1263 public string InputShadow
1267 return (string)GetValue(InputShadowProperty);
1271 SetValue(InputShadowProperty, value);
1272 NotifyPropertyChanged();
1277 /// The Emboss property.<br />
1278 /// The default emboss parameters.<br />
1280 /// <since_tizen> 3 </since_tizen>
1281 public string Emboss
1285 return (string)GetValue(EmbossProperty);
1289 SetValue(EmbossProperty, value);
1290 NotifyPropertyChanged();
1295 /// The InputEmboss property.<br />
1296 /// The emboss parameters of the new input text.<br />
1298 /// <since_tizen> 3 </since_tizen>
1299 public string InputEmboss
1303 return (string)GetValue(InputEmbossProperty);
1307 SetValue(InputEmbossProperty, value);
1308 NotifyPropertyChanged();
1313 /// The Outline property.<br />
1314 /// The default outline parameters.<br />
1315 /// The outline map contains the following keys :<br />
1316 /// <list type="table">
1317 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1318 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1321 /// <since_tizen> 3 </since_tizen>
1322 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1323 public PropertyMap Outline
1327 return (PropertyMap)GetValue(OutlineProperty);
1331 SetValue(OutlineProperty, value);
1332 NotifyPropertyChanged();
1337 /// Set Outline to TextEditor. <br />
1339 /// <param name="outline">The Outline</param>
1341 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1344 /// The following example demonstrates how to use the SetOutline method.
1346 /// var outline = new Tizen.NUI.Text.Outline();
1347 /// outline.Width = 2.0f;
1348 /// outline.Color = new Color("#45B39D");
1349 /// editor.SetOutline(outline);
1352 [EditorBrowsable(EditorBrowsableState.Never)]
1353 public void SetOutline(Outline outline)
1355 using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
1357 SetValue(OutlineProperty, outlineMap);
1362 /// Get Outline from TextEditor. <br />
1364 /// <returns>The Outline</returns>
1366 /// <see cref="Tizen.NUI.Text.Outline"/>
1368 [EditorBrowsable(EditorBrowsableState.Never)]
1369 public Outline GetOutline()
1372 using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
1374 outline = TextMapHelper.GetOutlineStruct(outlineMap);
1380 /// The InputOutline property.<br />
1381 /// The outline parameters of the new input text.<br />
1383 /// <since_tizen> 3 </since_tizen>
1384 public string InputOutline
1388 return (string)GetValue(InputOutlineProperty);
1392 SetValue(InputOutlineProperty, value);
1393 NotifyPropertyChanged();
1398 /// The SmoothScroll property.<br />
1399 /// Enable or disable the smooth scroll animation.<br />
1401 /// <since_tizen> 3 </since_tizen>
1402 public bool SmoothScroll
1406 return (bool)GetValue(SmoothScrollProperty);
1410 SetValue(SmoothScrollProperty, value);
1411 NotifyPropertyChanged();
1416 /// The SmoothScrollDuration property.<br />
1417 /// Sets the duration of smooth scroll animation.<br />
1419 /// <since_tizen> 3 </since_tizen>
1420 public float SmoothScrollDuration
1424 return (float)GetValue(SmoothScrollDurationProperty);
1428 SetValue(SmoothScrollDurationProperty, value);
1429 NotifyPropertyChanged();
1434 /// The EnableScrollBar property.<br />
1435 /// Enable or disable the scroll bar.<br />
1437 /// <since_tizen> 3 </since_tizen>
1438 public bool EnableScrollBar
1442 return (bool)GetValue(EnableScrollBarProperty);
1446 SetValue(EnableScrollBarProperty, value);
1447 NotifyPropertyChanged();
1452 /// The ScrollBarShowDuration property.<br />
1453 /// Sets the duration of scroll bar to show.<br />
1455 /// <since_tizen> 3 </since_tizen>
1456 public float ScrollBarShowDuration
1460 return (float)GetValue(ScrollBarShowDurationProperty);
1464 SetValue(ScrollBarShowDurationProperty, value);
1465 NotifyPropertyChanged();
1470 /// The ScrollBarFadeDuration property.<br />
1471 /// Sets the duration of scroll bar to fade out.<br />
1473 /// <since_tizen> 3 </since_tizen>
1474 public float ScrollBarFadeDuration
1478 return (float)GetValue(ScrollBarFadeDurationProperty);
1482 SetValue(ScrollBarFadeDurationProperty, value);
1483 NotifyPropertyChanged();
1488 /// The PixelSize property.<br />
1489 /// The size of font in pixels.<br />
1491 /// <since_tizen> 3 </since_tizen>
1492 [Binding.TypeConverter(typeof(FloatGraphicsTypeConverter))]
1493 public float PixelSize
1497 return (float)GetValue(PixelSizeProperty);
1501 SetValue(PixelSizeProperty, value);
1502 NotifyPropertyChanged();
1507 /// The line count of the text.
1509 /// <since_tizen> 3 </since_tizen>
1510 public int LineCount
1515 using (var propertyValue = GetProperty(TextEditor.Property.LineCount))
1517 propertyValue.Get(out lineCount);
1524 /// The text to display when the TextEditor is empty and inactive.
1526 /// <since_tizen> 3 </since_tizen>
1527 public string PlaceholderText
1531 return (string)GetValue(PlaceholderTextProperty);
1535 SetValue(PlaceholderTextProperty, value);
1536 NotifyPropertyChanged();
1541 /// The portion of the text that has been selected by the user.
1544 /// Empty string when nothing is selected.
1546 /// <since_tizen> 9 </since_tizen>
1547 public string SelectedText
1551 string selectedText;
1552 using (var propertyValue = GetProperty(TextEditor.Property.SelectedText))
1554 propertyValue.Get(out selectedText);
1556 return selectedText;
1561 /// The Placeholder text color.
1564 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1566 /// <since_tizen> 3 </since_tizen>
1567 public Color PlaceholderTextColor
1571 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1572 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1576 SetValue(PlaceholderTextColorProperty, value);
1577 NotifyPropertyChanged();
1582 /// The Enable selection property.<br />
1583 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1585 /// <since_tizen> 3 </since_tizen>
1586 public bool EnableSelection
1590 return (bool)GetValue(EnableSelectionProperty);
1594 SetValue(EnableSelectionProperty, value);
1595 NotifyPropertyChanged();
1600 /// The start index for selection.
1603 /// When there is no selection, the index is current cursor position.
1605 /// <since_tizen> 9 </since_tizen>
1606 public int SelectedTextStart
1610 int selectedTextStart;
1611 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextStart))
1613 propertyValue.Get(out selectedTextStart);
1615 return selectedTextStart;
1620 /// The end index for selection.
1623 /// When there is no selection, the index is current cursor position.
1625 /// <since_tizen> 9 </since_tizen>
1626 public int SelectedTextEnd
1630 int selectedTextEnd;
1631 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextEnd))
1633 propertyValue.Get(out selectedTextEnd);
1635 return selectedTextEnd;
1640 /// Enable editing in text control.
1642 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1643 [EditorBrowsable(EditorBrowsableState.Never)]
1644 public bool EnableEditing
1648 return (bool)GetValue(EnableEditingProperty);
1652 SetValue(EnableEditingProperty, value);
1656 private bool InternalEnableEditing
1661 using (var propertyValue = GetProperty(TextEditor.Property.EnableEditing))
1663 propertyValue.Get(out enableEditing);
1665 return enableEditing;
1669 using (var propertyValue = new PropertyValue(value))
1671 SetProperty(TextEditor.Property.EnableEditing, propertyValue);
1672 NotifyPropertyChanged();
1678 /// Specify horizontal scroll position in text control.
1680 [EditorBrowsable(EditorBrowsableState.Never)]
1681 public int HorizontalScrollPosition
1685 return (int)GetValue(HorizontalScrollPositionProperty);
1689 SetValue(HorizontalScrollPositionProperty, value);
1693 private int InternalHorizontalScrollPosition
1697 int horizontalScrollPosition;
1698 using (var propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1700 propertyValue.Get(out horizontalScrollPosition);
1702 return horizontalScrollPosition;
1706 using (var propertyValue = new PropertyValue(value))
1708 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1709 NotifyPropertyChanged();
1715 /// Specify vertical scroll position in text control.
1717 [EditorBrowsable(EditorBrowsableState.Never)]
1718 public int VerticalScrollPosition
1722 return (int)GetValue(VerticalScrollPositionProperty);
1726 SetValue(VerticalScrollPositionProperty, value);
1730 private int InternalVerticalScrollPosition
1734 int verticalScrollPosition;
1735 using (var propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1737 propertyValue.Get(out verticalScrollPosition);
1739 return verticalScrollPosition;
1743 using (var propertyValue = new PropertyValue(value))
1745 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1746 NotifyPropertyChanged();
1752 /// PrimaryCursorPosition property.<br />
1753 /// Specify the position of the primary cursor (caret) in text control.
1756 /// If the value set is out of range (negative or greater than or equal the number of characters in Text) then the PrimaryCursorPosition is moved to the end of Text (the number of characters in Text).
1758 /// <since_tizen> 10 </since_tizen>
1759 public int PrimaryCursorPosition
1763 return (int)GetValue(PrimaryCursorPositionProperty);
1767 SetValue(PrimaryCursorPositionProperty, value);
1771 private int InternalPrimaryCursorPosition
1775 int primaryCursorPosition;
1776 using (var propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1778 propertyValue.Get(out primaryCursorPosition);
1780 return primaryCursorPosition;
1784 using (var propertyValue = new PropertyValue(value))
1786 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1787 NotifyPropertyChanged();
1793 /// The GrabHandleColor property.
1796 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1798 [EditorBrowsable(EditorBrowsableState.Never)]
1799 public Color GrabHandleColor
1803 Color temp = (Color)GetValue(GrabHandleColorProperty);
1804 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1808 SetValue(GrabHandleColorProperty, value);
1809 NotifyPropertyChanged();
1814 /// Set InputFilter to TextEditor.
1816 /// <param name="inputFilter">The InputFilter</param>
1818 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1819 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1820 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1823 /// The following example demonstrates how to use the SetInputFilter method.
1825 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1826 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1827 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1828 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1831 /// <since_tizen> 9 </since_tizen>
1832 public void SetInputFilter(InputFilter inputFilter)
1834 using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1835 using (var propertyValue = new PropertyValue(map))
1837 SetProperty(TextEditor.Property.InputFilter, propertyValue);
1842 /// Get InputFilter from TextEditor. <br />
1844 /// <returns>The InputFilter</returns>
1846 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1848 /// <since_tizen> 9 </since_tizen>
1849 public InputFilter GetInputFilter()
1851 InputFilter inputFilter;
1852 using (var propertyValue = GetProperty(TextEditor.Property.InputFilter))
1853 using (var map = new PropertyMap())
1855 propertyValue.Get(map);
1856 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1862 /// Set Strikethrough to TextEditor. <br />
1864 /// <param name="strikethrough">The Strikethrough</param>
1866 /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
1869 /// The following example demonstrates how to use the SetStrikethrough method.
1871 /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
1872 /// strikethrough.Enable = true;
1873 /// strikethrough.Color = new Color("#3498DB");
1874 /// strikethrough.Height = 2.0f;
1875 /// editor.SetStrikethrough(strikethrough);
1878 [EditorBrowsable(EditorBrowsableState.Never)]
1879 public void SetStrikethrough(Strikethrough strikethrough)
1881 using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
1882 using (var propertyValue = new PropertyValue(map))
1884 SetProperty(TextEditor.Property.Strikethrough, propertyValue);
1889 /// Get Strikethrough from TextEditor. <br />
1891 /// <returns>The Strikethrough</returns>
1893 /// <see cref="Tizen.NUI.Text.Strikethrough"/>
1895 [EditorBrowsable(EditorBrowsableState.Never)]
1896 public Strikethrough GetStrikethrough()
1898 Strikethrough strikethrough;
1899 using (var propertyValue = GetProperty(TextEditor.Property.Strikethrough))
1900 using (var map = new PropertyMap())
1902 propertyValue.Get(map);
1903 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
1905 return strikethrough;
1909 /// The Placeholder property.
1910 /// The placeholder map contains the following keys :<br />
1911 /// <list type="table">
1912 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1913 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1914 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1915 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1916 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1917 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1918 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1919 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1923 /// The following example demonstrates how to set the placeholder property.
1925 /// PropertyMap propertyMap = new PropertyMap();
1926 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1927 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1928 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1929 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1930 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1932 /// PropertyMap fontStyleMap = new PropertyMap();
1933 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1934 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1935 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1936 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1938 /// TextEditor editor = new TextEditor();
1939 /// editor.Placeholder = propertyMap;
1942 /// <since_tizen> 3 </since_tizen>
1943 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1944 public Tizen.NUI.PropertyMap Placeholder
1948 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1949 string defalutText = "";
1951 if (TextMapHelper.IsValue(map, 0))
1952 map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
1954 if (TextMapHelper.IsValue(map, 1))
1955 map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
1957 if (TextMapHelper.IsValue(map, 2))
1959 using (var color = TextMapHelper.GetColorFromMap(map, 2))
1961 map.Add("color", color);
1965 if (TextMapHelper.IsValue(map, 3))
1966 map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
1968 if (TextMapHelper.IsValue(map, 4))
1970 using (var properyValue = map.Find(4))
1971 using (var fontStyle = new PropertyMap())
1973 properyValue.Get(fontStyle);
1974 using (var fontStyleValue = new PropertyValue(fontStyle))
1976 map.Add("fontStyle", fontStyleValue);
1981 if (TextMapHelper.IsValue(map, 5))
1982 map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
1984 if (TextMapHelper.IsValue(map, 6))
1985 map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
1987 if (TextMapHelper.IsValue(map, 7))
1988 map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
1994 SetValue(PlaceholderProperty, value);
1995 NotifyPropertyChanged();
2000 /// Set Placeholder to TextEditor. <br />
2002 /// <param name="placeholder">The Placeholder</param>
2004 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
2007 /// The following example demonstrates how to use the SetPlaceholder method.
2009 /// var placeholder = new Tizen.NUI.Text.Placeholder();
2010 /// placeholder.Text = "placeholder text";
2011 /// placeholder.TextFocused = "placeholder textFocused";
2012 /// placeholder.Color = new Color("#45B39D");
2013 /// placeholder.FontFamily = "BreezeSans";
2014 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
2016 /// Width = FontWidthType.Expanded,
2017 /// Weight = FontWeightType.ExtraLight,
2018 /// Slant = FontSlantType.Italic,
2020 /// placeholder.PointSize = 25.0f;
2021 /// //placeholder.PixelSize = 50.0f;
2022 /// placeholder.Ellipsis = true;
2023 /// editor.SetPlaceholder(placeholder);
2026 [EditorBrowsable(EditorBrowsableState.Never)]
2027 public void SetPlaceholder(Placeholder placeholder)
2029 using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
2031 SetValue(PlaceholderProperty, placeholderMap);
2036 /// Get Placeholder from TextEditor. <br />
2038 /// <returns>The Placeholder</returns>
2040 /// <see cref="Tizen.NUI.Text.Placeholder"/>
2042 [EditorBrowsable(EditorBrowsableState.Never)]
2043 public Placeholder GetPlaceholder()
2045 Placeholder placeholder;
2046 using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
2048 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
2054 /// The Ellipsis property.<br />
2055 /// Enable or disable the ellipsis.<br />
2057 /// <since_tizen> 9 </since_tizen>
2058 public bool Ellipsis
2062 return (bool)GetValue(EllipsisProperty);
2066 SetValue(EllipsisProperty, value);
2067 NotifyPropertyChanged();
2073 /// The ellipsis position of the text.
2074 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
2076 /// <since_tizen> 9 </since_tizen>
2077 public EllipsisPosition EllipsisPosition
2081 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
2085 SetValue(EllipsisPositionProperty, value);
2086 NotifyPropertyChanged();
2091 /// The LineWrapMode property.<br />
2092 /// The line wrap mode when the text lines over the layout width.<br />
2094 /// <since_tizen> 4 </since_tizen>
2095 public LineWrapMode LineWrapMode
2099 return (LineWrapMode)GetValue(LineWrapModeProperty);
2103 SetValue(LineWrapModeProperty, value);
2104 NotifyPropertyChanged();
2109 /// Enables Text selection using Shift key.
2111 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2112 [EditorBrowsable(EditorBrowsableState.Never)]
2113 public bool EnableShiftSelection
2117 return (bool)GetValue(EnableShiftSelectionProperty);
2121 SetValue(EnableShiftSelectionProperty, value);
2122 NotifyPropertyChanged();
2127 /// The text alignment to match the direction of the system language.
2129 /// <since_tizen> 6 </since_tizen>
2130 public bool MatchSystemLanguageDirection
2134 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2138 SetValue(MatchSystemLanguageDirectionProperty, value);
2139 NotifyPropertyChanged();
2144 /// The MaxLength property.<br />
2145 /// The maximum number of characters that can be inserted.<br />
2147 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2148 [EditorBrowsable(EditorBrowsableState.Never)]
2149 public int MaxLength
2153 return (int)GetValue(MaxLengthProperty);
2157 SetValue(MaxLengthProperty, value);
2158 NotifyPropertyChanged();
2163 /// The FontSizeScale property. <br />
2164 /// The default value is 1.0. <br />
2165 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2166 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2168 /// <since_tizen> 9 </since_tizen>
2169 public float FontSizeScale
2173 return fontSizeScale;
2177 float newFontSizeScale;
2179 if (fontSizeScale == value) return;
2181 fontSizeScale = value;
2182 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2184 SystemSettingsFontSize systemSettingsFontSize;
2188 systemSettingsFontSize = SystemSettings.FontSize;
2192 Console.WriteLine("{0} Exception caught.", e);
2193 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2195 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2196 addFontSizeChangedCallback();
2200 newFontSizeScale = fontSizeScale;
2201 removeFontSizeChangedCallback();
2204 SetValue(FontSizeScaleProperty, newFontSizeScale);
2205 NotifyPropertyChanged();
2210 /// The EnableFontSizeScale property.<br />
2211 /// Whether the font size scale is enabled. (The default value is true)
2213 [EditorBrowsable(EditorBrowsableState.Never)]
2214 public bool EnableFontSizeScale
2218 return (bool)GetValue(EnableFontSizeScaleProperty);
2222 SetValue(EnableFontSizeScaleProperty, value);
2223 NotifyPropertyChanged();
2228 /// The InputMethodSettings property.<br />
2229 /// The settings to relating to the System's Input Method, Key and Value.<br />
2232 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Use the <see cref="InputMethod"/> class for this property.
2235 /// The following example demonstrates how to set the InputMethodSettings property.
2237 /// InputMethod method = new InputMethod();
2238 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2239 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2240 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2241 /// method.Variation = 1;
2242 /// textEditor.InputMethodSettings = method.OutputMap;
2245 [EditorBrowsable(EditorBrowsableState.Never)]
2246 public PropertyMap InputMethodSettings
2250 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2254 SetValue(InputMethodSettingsProperty, value);
2255 NotifyPropertyChanged();
2260 /// Scroll the text control by specific amount..
2262 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2263 [EditorBrowsable(EditorBrowsableState.Never)]
2264 public void ScrollBy(Vector2 scroll)
2266 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2271 /// Get the InputMethodContext instance.
2273 /// <returns>The InputMethodContext instance.</returns>
2274 /// <since_tizen> 5 </since_tizen>
2275 public InputMethodContext GetInputMethodContext()
2277 if (inputMethodContext == null)
2279 /*Avoid raising InputMethodContext reference count.*/
2280 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2283 return inputMethodContext;
2287 /// Select the whole text.
2289 /// <since_tizen> 9 </since_tizen>
2290 public void SelectWholeText()
2292 Interop.TextEditor.SelectWholeText(SwigCPtr);
2293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2297 /// Select text from start to end index. <br />
2298 /// The index is valid when 0 or positive.
2300 /// <param name="start">The start index for selection.</param>
2301 /// <param name="end">The end index for selection.</param>
2303 /// If the end index exceeds the maximum value, it is set to the length of the text.
2305 /// <since_tizen> 9 </since_tizen>
2306 public void SelectText(int start, int end)
2309 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2311 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2313 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2318 /// Clear selection of the text. <br />
2319 /// Valid when selection is activate.
2321 /// <since_tizen> 9 </since_tizen>
2322 public void SelectNone()
2324 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2329 /// The Enable grab handle property.<br />
2330 /// Enables the grab handles for text selection.<br />
2331 /// The default value is true, which means the grab handles are enabled by default.<br />
2333 [EditorBrowsable(EditorBrowsableState.Never)]
2334 public bool EnableGrabHandle
2338 return (bool)GetValue(EnableGrabHandleProperty);
2342 SetValue(EnableGrabHandleProperty, value);
2343 NotifyPropertyChanged();
2348 /// The Enable grab handle popup property.<br />
2349 /// Enables the grab handle popup for text selection.<br />
2350 /// The default value is true, which means the grab handle popup is enabled by default.<br />
2352 [EditorBrowsable(EditorBrowsableState.Never)]
2353 public bool EnableGrabHandlePopup
2357 return (bool)GetValue(EnableGrabHandlePopupProperty);
2361 SetValue(EnableGrabHandlePopupProperty, value);
2362 NotifyPropertyChanged();
2367 /// Minimum line size to be used.<br />
2368 /// The height of the line in points. <br />
2369 /// If the font size is larger than the line size, it works with the font size. <br />
2371 [EditorBrowsable(EditorBrowsableState.Never)]
2372 public float MinLineSize
2376 return (float)GetValue(MinLineSizeProperty);
2380 SetValue(MinLineSizeProperty, value);
2381 NotifyPropertyChanged();
2385 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2387 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));
2388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2393 /// The spaces between characters in Pixels.
2395 /// A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).<br />
2396 /// The default value is 0.f which does nothing.
2399 [EditorBrowsable(EditorBrowsableState.Never)]
2400 public float CharacterSpacing
2404 return (float)GetValue(CharacterSpacingProperty);
2408 SetValue(CharacterSpacingProperty, value);
2409 NotifyPropertyChanged();
2416 /// <since_tizen> 3 </since_tizen>
2417 protected override void Dispose(DisposeTypes type)
2424 #if NUI_PROPERTY_CHANGE_2
2425 internalPlaceholderTextColor?.Dispose();
2426 internalPrimaryCursorColor?.Dispose();
2427 internalSecondaryCursorColor?.Dispose();
2428 internalSelectionHighlightColor?.Dispose();
2429 internalInputColor?.Dispose();
2430 internalTextColor?.Dispose();
2431 internalGrabHandleColor?.Dispose();
2434 if (systemlangTextFlag)
2436 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2439 removeFontSizeChangedCallback();
2441 //Release your own unmanaged resources here.
2442 //You should not access any managed member here except static instance.
2443 //because the execution order of Finalizes is non-deterministic.
2447 if (textEditorTextChangedCallbackDelegate != null)
2449 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2452 if (textEditorMaxLengthReachedCallbackDelegate != null)
2454 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2457 if (textEditorSelectionStartedCallbackDelegate != null)
2459 this.SelectionStartedSignal().Disconnect(textEditorSelectionStartedCallbackDelegate);
2462 if (textEditorSelectionClearedCallbackDelegate != null)
2464 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2467 if (textEditorCursorPositionChangedCallbackDelegate != null)
2469 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2472 if (textEditorSelectionChangedCallbackDelegate != null)
2474 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2478 TextChanged -= TextEditorTextChanged;
2482 /// This will not be public opened.
2483 [EditorBrowsable(EditorBrowsableState.Never)]
2484 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2486 // In order to speed up IME hide, temporarily add
2487 GetInputMethodContext()?.DestroyContext();
2488 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2491 internal override LayoutItem CreateDefaultLayout()
2493 return new TextEditorLayout();
2496 internal void SetTextWithoutTextChanged(string text)
2498 invokeTextChanged = false;
2499 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(text));
2500 invokeTextChanged = true;
2503 private string SetTranslatable(string textEditorSid)
2505 string translatableText = null;
2506 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2507 if (translatableText != null)
2509 if (systemlangTextFlag == false)
2511 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2512 systemlangTextFlag = true;
2514 return translatableText;
2518 translatableText = "";
2519 return translatableText;
2523 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2525 if (textEditorTextSid != null)
2527 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2529 if (textEditorPlaceHolderTextSid != null)
2531 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2535 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2537 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2538 SetValue(FontSizeScaleProperty, newFontSizeScale);
2539 NotifyPropertyChanged();
2542 private void addFontSizeChangedCallback()
2544 if (hasFontSizeChangedCallback != true)
2548 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2549 hasFontSizeChangedCallback = true;
2553 Console.WriteLine("{0} Exception caught.", e);
2554 hasFontSizeChangedCallback = false;
2559 private void removeFontSizeChangedCallback()
2561 if (hasFontSizeChangedCallback == true)
2565 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2566 hasFontSizeChangedCallback = false;
2570 Console.WriteLine("{0} Exception caught.", e);
2571 hasFontSizeChangedCallback = true;
2576 private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
2578 if (!isSettingTextInCSharp)
2580 EnforceNotifyBindedInstance(TextProperty);
2584 internal new class Property
2586 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2587 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2588 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2589 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2590 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2591 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2592 internal static readonly int VerticalAlignment = Interop.TextEditor.VerticalAlignmentGet();
2593 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2594 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2595 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2596 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2597 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2598 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2599 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2600 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2601 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2602 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2603 internal static readonly int SelectionPopupStyle = Interop.TextEditor.SelectionPopupStyleGet();
2604 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2605 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2606 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2607 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2608 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2609 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2610 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2611 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2612 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2613 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2614 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2615 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2616 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2617 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2618 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2619 internal static readonly int RelativeLineHeight = Interop.TextEditor.RelativeLineHeightGet();
2620 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2621 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2622 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2623 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2624 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2625 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2626 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2627 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2628 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2629 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2630 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2631 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2632 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2633 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2634 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2635 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2636 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2637 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2638 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2639 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2640 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2641 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2642 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2643 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2644 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2645 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2646 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2647 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2648 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2649 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2650 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2651 internal static readonly int EnableFontSizeScale = Interop.TextEditor.EnableFontSizeScaleGet();
2652 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2653 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2654 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2655 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2656 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2657 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2658 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2659 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2660 internal static readonly int Strikethrough = Interop.TextEditor.StrikethroughGet();
2661 internal static readonly int CharacterSpacing = Interop.TextEditor.CharacterSpacingGet();
2664 internal class InputStyle
2670 FontFamily = 0x0002,
2673 LineSpacing = 0x0010,
2681 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2683 DecorationBoundingBox = new Rectangle(x, y, width, height);
2685 private void OnInputColorChanged(float x, float y, float z, float w)
2687 InputColor = new Vector4(x, y, z, w);
2689 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2691 PlaceholderTextColor = new Color(r, g, b, a);
2693 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2695 PrimaryCursorColor = new Vector4(x, y, z, w);
2697 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2699 SecondaryCursorColor = new Vector4(x, y, z, w);
2701 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2703 SelectionHighlightColor = new Vector4(x, y, z, w);
2705 private void OnTextColorChanged(float x, float y, float z, float w)
2707 TextColor = new Vector4(x, y, z, w);
2709 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2711 GrabHandleColor = new Color(r, g, b, a);
2714 private class TextEditorLayout : LayoutItem
2716 protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
2718 // Padding will be automatically applied by DALi TextEditor.
2719 var totalWidth = widthMeasureSpec.Size.AsDecimal();
2720 var totalHeight = heightMeasureSpec.Size.AsDecimal();
2721 var minSize = Owner.MinimumSize;
2722 var maxSize = Owner.MaximumSize;
2723 var naturalSize = Owner.GetNaturalSize();
2725 if (((TextEditor)Owner).Text.Length == 0)
2727 // Calculate height of TextEditor by setting Text with " ".
2728 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2729 ((TextEditor)Owner).SetTextWithoutTextChanged(" ");
2731 // Store original WidthSpecification to restore it after setting ResizePolicy.
2732 var widthSpecification = Owner.WidthSpecification;
2734 // In DALi's Size logic, if Width or Height is set to be 0, then
2735 // ResizePolicy is not changed to Fixed.
2736 // This causes Size changes after NUI Layout's OnMeasure is finished.
2737 // e.g. TextEditor's Width fills to its parent although Text is null and
2738 // WidthSpecification is WrapContent.
2739 // To prevent the Size changes, WidthResizePolicy is set to be Fixed
2740 // in advance if Text is null.
2741 Owner.WidthResizePolicy = ResizePolicyType.Fixed;
2743 // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
2744 Owner.WidthSpecification = widthSpecification;
2746 naturalSize = Owner.GetNaturalSize();
2748 // Restore TextEditor's Text after calculating height of TextEditor.
2749 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2750 ((TextEditor)Owner).SetTextWithoutTextChanged("");
2753 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2755 totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), maxSize.Width);
2758 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2760 totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), maxSize.Height);
2763 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
2764 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
2766 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
2767 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
2769 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
2770 ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));