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 static TextEditor() { }
46 /// Creates the TextEditor control.
48 /// <since_tizen> 3 </since_tizen>
49 public TextEditor() : this(Interop.TextEditor.New(), true)
51 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
55 /// Creates the TextEditor with specified style.
57 [EditorBrowsable(EditorBrowsableState.Never)]
58 public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
63 /// Creates the TextEditor with setting the status of shown or hidden.
65 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
66 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
67 [EditorBrowsable(EditorBrowsableState.Never)]
68 public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
76 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
86 TextChanged += TextEditorTextChanged;
90 /// The TranslatableText property.<br />
91 /// The text can set the SID value.<br />
93 /// <exception cref='ArgumentNullException'>
94 /// ResourceManager about multilingual is null.
96 /// <since_tizen> 4 </since_tizen>
97 public string TranslatableText
101 return GetValue(TranslatableTextProperty) as string;
105 SetValue(TranslatableTextProperty, value);
109 private string InternalTranslatableText
113 return textEditorTextSid;
117 if (NUIApplication.MultilingualResourceManager == null)
119 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
121 textEditorTextSid = value;
122 Text = SetTranslatable(textEditorTextSid);
123 NotifyPropertyChanged();
127 /// The TranslatablePlaceholderText property.<br />
128 /// The text can set the SID value.<br />
130 /// <exception cref='ArgumentNullException'>
131 /// ResourceManager about multilingual is null.
133 /// <since_tizen> 4 </since_tizen>
134 public string TranslatablePlaceholderText
138 return GetValue(TranslatablePlaceholderTextProperty) as string;
142 SetValue(TranslatablePlaceholderTextProperty, value);
146 private string InternalTranslatablePlaceholderText
150 return textEditorPlaceHolderTextSid;
154 if (NUIApplication.MultilingualResourceManager == null)
156 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
158 textEditorPlaceHolderTextSid = value;
159 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
160 NotifyPropertyChanged();
165 /// The Text property.<br />
166 /// The text to display in the UTF-8 format.<br />
168 /// <since_tizen> 3 </since_tizen>
173 return (string)GetValue(TextProperty);
177 SetValue(TextProperty, value);
178 NotifyPropertyChanged();
183 /// The TextColor property.<br />
184 /// The color of the text.<br />
187 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
189 /// <since_tizen> 3 </since_tizen>
190 public Vector4 TextColor
194 Vector4 temp = (Vector4)GetValue(TextColorProperty);
195 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
199 SetValue(TextColorProperty, value);
200 NotifyPropertyChanged();
205 /// The FontFamily property.<br />
206 /// The requested font family to use.<br />
208 /// <since_tizen> 3 </since_tizen>
209 public string FontFamily
213 return (string)GetValue(FontFamilyProperty);
217 SetValue(FontFamilyProperty, value);
218 NotifyPropertyChanged();
223 /// The FontStyle property.<br />
224 /// The requested font style to use.<br />
225 /// The fontStyle map contains the following keys :<br />
226 /// <list type="table">
227 /// <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>
228 /// <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>
229 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
232 /// <since_tizen> 3 </since_tizen>
233 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
234 public PropertyMap FontStyle
238 return (PropertyMap)GetValue(FontStyleProperty);
242 SetValue(FontStyleProperty, value);
243 NotifyPropertyChanged();
248 /// Set FontStyle to TextEditor. <br />
250 /// <param name="fontStyle">The FontStyle</param>
252 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
255 /// The following example demonstrates how to use the SetFontStyle method.
257 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
258 /// fontStyle.Width = FontWidthType.Expanded;
259 /// fontStyle.Weight = FontWeightType.Bold;
260 /// fontStyle.Slant = FontSlantType.Italic;
261 /// editor.SetFontStyle(fontStyle);
264 [EditorBrowsable(EditorBrowsableState.Never)]
265 public void SetFontStyle(FontStyle fontStyle)
267 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
269 SetValue(FontStyleProperty, fontStyleMap);
274 /// Get FontStyle from TextEditor. <br />
276 /// <returns>The FontStyle</returns>
278 /// <see cref="Tizen.NUI.Text.FontStyle"/>
280 [EditorBrowsable(EditorBrowsableState.Never)]
281 public FontStyle GetFontStyle()
284 using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty))
286 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
292 /// The PointSize property.<br />
293 /// The size of font in points.<br />
295 /// <since_tizen> 3 </since_tizen>
296 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
297 public float PointSize
301 return (float)GetValue(PointSizeProperty);
305 SetValue(PointSizeProperty, value);
306 NotifyPropertyChanged();
311 /// The HorizontalAlignment property.<br />
312 /// The line horizontal alignment.<br />
314 /// <since_tizen> 3 </since_tizen>
315 public HorizontalAlignment HorizontalAlignment
319 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
323 SetValue(HorizontalAlignmentProperty, value);
324 NotifyPropertyChanged();
329 /// The VerticalAlignment property.<br />
330 /// The line vertical alignment.
332 [EditorBrowsable(EditorBrowsableState.Never)]
333 public VerticalAlignment VerticalAlignment
337 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
341 SetValue(VerticalAlignmentProperty, value);
342 NotifyPropertyChanged();
347 /// The ScrollThreshold property.<br />
348 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
350 /// <since_tizen> 3 </since_tizen>
351 public float ScrollThreshold
355 return (float)GetValue(ScrollThresholdProperty);
359 SetValue(ScrollThresholdProperty, value);
360 NotifyPropertyChanged();
365 /// The ScrollSpeed property.<br />
366 /// The scroll speed in pixels per second.<br />
368 /// <since_tizen> 3 </since_tizen>
369 public float ScrollSpeed
373 return (float)GetValue(ScrollSpeedProperty);
377 SetValue(ScrollSpeedProperty, value);
378 NotifyPropertyChanged();
383 /// The PrimaryCursorColor property.<br />
384 /// The color to apply to the primary cursor.<br />
387 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
389 /// <since_tizen> 3 </since_tizen>
390 public Vector4 PrimaryCursorColor
394 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
395 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
399 SetValue(PrimaryCursorColorProperty, value);
400 NotifyPropertyChanged();
405 /// The SecondaryCursorColor property.<br />
406 /// The color to apply to the secondary cursor.<br />
409 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
411 /// <since_tizen> 3 </since_tizen>
412 public Vector4 SecondaryCursorColor
416 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
417 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
421 SetValue(SecondaryCursorColorProperty, value);
422 NotifyPropertyChanged();
427 /// The EnableCursorBlink property.<br />
428 /// Whether the cursor should blink or not.<br />
430 /// <since_tizen> 3 </since_tizen>
431 public bool EnableCursorBlink
435 return (bool)GetValue(EnableCursorBlinkProperty);
439 SetValue(EnableCursorBlinkProperty, value);
440 NotifyPropertyChanged();
445 /// The CursorBlinkInterval property.<br />
446 /// The time interval in seconds between cursor on/off states.<br />
448 /// <since_tizen> 3 </since_tizen>
449 public float CursorBlinkInterval
453 return (float)GetValue(CursorBlinkIntervalProperty);
457 SetValue(CursorBlinkIntervalProperty, value);
458 NotifyPropertyChanged();
463 /// The CursorBlinkDuration property.<br />
464 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
466 /// <since_tizen> 3 </since_tizen>
467 public float CursorBlinkDuration
471 return (float)GetValue(CursorBlinkDurationProperty);
475 SetValue(CursorBlinkDurationProperty, value);
476 NotifyPropertyChanged();
481 /// The CursorWidth property.
483 /// <since_tizen> 3 </since_tizen>
484 public int CursorWidth
488 return (int)GetValue(CursorWidthProperty);
492 SetValue(CursorWidthProperty, value);
493 NotifyPropertyChanged();
498 /// The GrabHandleImage property.<br />
499 /// The image to display for the grab handle.<br />
501 /// <since_tizen> 3 </since_tizen>
502 public string GrabHandleImage
506 return (string)GetValue(GrabHandleImageProperty);
510 SetValue(GrabHandleImageProperty, value);
511 NotifyPropertyChanged();
516 /// The GrabHandlePressedImage property.<br />
517 /// The image to display when the grab handle is pressed.<br />
519 /// <since_tizen> 3 </since_tizen>
520 public string GrabHandlePressedImage
524 return (string)GetValue(GrabHandlePressedImageProperty);
528 SetValue(GrabHandlePressedImageProperty, value);
529 NotifyPropertyChanged();
534 /// The SelectionPopupStyle property.<br />
535 /// The style of the text selection popup can be set through SelectionPopupStyle property.
537 [EditorBrowsable(EditorBrowsableState.Never)]
538 public PropertyMap SelectionPopupStyle
542 return (PropertyMap)GetValue(SelectionPopupStyleProperty);
546 SetValue(SelectionPopupStyleProperty, value);
547 NotifyPropertyChanged();
552 /// The SelectionHandleImageLeft property.<br />
553 /// The image to display for the left selection handle.<br />
554 /// The selectionHandleImageLeft map contains the following key :<br />
555 /// <list type="table">
556 /// <item><term>filename (string)</term><description>The path of image file</description></item>
559 /// <since_tizen> 3 </since_tizen>
560 public PropertyMap SelectionHandleImageLeft
564 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
568 SetValue(SelectionHandleImageLeftProperty, value);
569 NotifyPropertyChanged();
574 /// The SelectionHandleImageRight property.<br />
575 /// The image to display for the right selection handle.<br />
576 /// The selectionHandleImageRight map contains the following key :<br />
577 /// <list type="table">
578 /// <item><term>filename (string)</term><description>The path of image file</description></item>
581 /// <since_tizen> 3 </since_tizen>
582 public PropertyMap SelectionHandleImageRight
586 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
590 SetValue(SelectionHandleImageRightProperty, value);
591 NotifyPropertyChanged();
596 /// Set SelectionHandleImage to TextEditor. <br />
598 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
600 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
603 /// The following example demonstrates how to use the SetSelectionHandleImage method.
605 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
606 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
607 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
608 /// editor.SetSelectionHandleImage(selectionHandleImage);
611 [EditorBrowsable(EditorBrowsableState.Never)]
612 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
614 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
616 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
618 SetValue(SelectionHandleImageLeftProperty, leftImageMap);
622 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
624 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
626 SetValue(SelectionHandleImageRightProperty, rightImageMap);
632 /// Get SelectionHandleImage from TextEditor. <br />
634 /// <returns>The SelectionHandleImage</returns>
636 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
638 [EditorBrowsable(EditorBrowsableState.Never)]
639 public SelectionHandleImage GetSelectionHandleImage()
641 SelectionHandleImage selectionHandleImage;
642 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
643 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
645 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
647 return selectionHandleImage;
651 /// The SelectionHandlePressedImageLeft property.<br />
652 /// The image to display when the left selection handle is pressed.<br />
653 /// The selectionHandlePressedImageLeft map contains the following key :<br />
654 /// <list type="table">
655 /// <item><term>filename (string)</term><description>The path of image file</description></item>
658 /// <since_tizen> 3 </since_tizen>
659 public PropertyMap SelectionHandlePressedImageLeft
663 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
667 SetValue(SelectionHandlePressedImageLeftProperty, value);
668 NotifyPropertyChanged();
673 /// The SelectionHandlePressedImageRight property.<br />
674 /// The image to display when the right selection handle is pressed.<br />
675 /// The selectionHandlePressedImageRight map contains the following key :<br />
676 /// <list type="table">
677 /// <item><term>filename (string)</term><description>The path of image file</description></item>
680 /// <since_tizen> 3 </since_tizen>
681 public PropertyMap SelectionHandlePressedImageRight
685 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
689 SetValue(SelectionHandlePressedImageRightProperty, value);
690 NotifyPropertyChanged();
695 /// Set SelectionHandlePressedImage to TextEditor. <br />
697 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
699 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
702 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
704 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
705 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
706 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
707 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
710 [EditorBrowsable(EditorBrowsableState.Never)]
711 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
713 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
715 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
717 SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
721 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
723 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
725 SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
731 /// Get SelectionHandlePressedImage from TextEditor. <br />
733 /// <returns>The SelectionHandlePressedImage</returns>
735 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
737 [EditorBrowsable(EditorBrowsableState.Never)]
738 public SelectionHandleImage GetSelectionHandlePressedImage()
740 SelectionHandleImage selectionHandleImage;
741 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
742 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
744 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
746 return selectionHandleImage;
750 /// The SelectionHandleMarkerImageLeft property.<br />
751 /// The image to display for the left selection handle marker.<br />
752 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
753 /// <list type="table">
754 /// <item><term>filename (string)</term><description>The path of image file</description></item>
757 /// <since_tizen> 3 </since_tizen>
758 public PropertyMap SelectionHandleMarkerImageLeft
762 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
766 SetValue(SelectionHandleMarkerImageLeftProperty, value);
767 NotifyPropertyChanged();
772 /// The SelectionHandleMarkerImageRight property.<br />
773 /// The image to display for the right selection handle marker.<br />
774 /// The selectionHandleMarkerImageRight map contains the following key :<br />
775 /// <list type="table">
776 /// <item><term>filename (string)</term><description>The path of image file</description></item>
779 /// <since_tizen> 3 </since_tizen>
780 public PropertyMap SelectionHandleMarkerImageRight
784 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
788 SetValue(SelectionHandleMarkerImageRightProperty, value);
789 NotifyPropertyChanged();
794 /// Set SelectionHandleMarkerImage to TextEditor. <br />
796 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
798 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
801 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
803 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
804 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
805 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
806 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
809 [EditorBrowsable(EditorBrowsableState.Never)]
810 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
812 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
814 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
816 SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
820 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
822 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
824 SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
830 /// Get SelectionHandleMarkerImage from TextEditor. <br />
832 /// <returns>The SelectionHandleMarkerImage</returns>
834 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
836 [EditorBrowsable(EditorBrowsableState.Never)]
837 public SelectionHandleImage GetSelectionHandleMarkerImage()
839 SelectionHandleImage selectionHandleImage;
840 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
841 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
843 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
845 return selectionHandleImage;
849 /// The SelectionHighlightColor property.<br />
850 /// The color of the selection highlight.<br />
853 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
855 /// <since_tizen> 3 </since_tizen>
856 public Vector4 SelectionHighlightColor
860 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
861 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
865 SetValue(SelectionHighlightColorProperty, value);
866 NotifyPropertyChanged();
871 /// The DecorationBoundingBox property.<br />
872 /// The decorations (handles etc) will positioned within this area on-screen.<br />
875 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
877 /// <since_tizen> 3 </since_tizen>
878 public Rectangle DecorationBoundingBox
882 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
883 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
887 SetValue(DecorationBoundingBoxProperty, value);
888 NotifyPropertyChanged();
893 /// The EnableMarkup property.<br />
894 /// Whether the mark-up processing is enabled.<br />
896 /// <since_tizen> 3 </since_tizen>
897 public bool EnableMarkup
901 return (bool)GetValue(EnableMarkupProperty);
905 SetValue(EnableMarkupProperty, value);
906 NotifyPropertyChanged();
911 /// The InputColor property.<br />
912 /// The color of the new input text.<br />
915 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
917 /// <since_tizen> 3 </since_tizen>
918 public Vector4 InputColor
922 Vector4 temp = (Vector4)GetValue(InputColorProperty);
923 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
927 SetValue(InputColorProperty, value);
928 NotifyPropertyChanged();
933 /// The InputFontFamily property.<br />
934 /// The font's family of the new input text.<br />
936 /// <since_tizen> 3 </since_tizen>
937 public string InputFontFamily
941 return (string)GetValue(InputFontFamilyProperty);
945 SetValue(InputFontFamilyProperty, value);
946 NotifyPropertyChanged();
951 /// The InputFontStyle property.<br />
952 /// The font's style of the new input text.<br />
953 /// The inputFontStyle map contains the following keys :<br />
954 /// <list type="table">
955 /// <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>
956 /// <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>
957 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
960 /// <since_tizen> 3 </since_tizen>
961 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
962 public PropertyMap InputFontStyle
966 return (PropertyMap)GetValue(InputFontStyleProperty);
970 SetValue(InputFontStyleProperty, value);
971 NotifyPropertyChanged();
976 /// Set InputFontStyle to TextEditor. <br />
978 /// <param name="fontStyle">The FontStyle</param>
980 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
983 /// The following example demonstrates how to use the SetInputFontStyle method.
985 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
986 /// fontStyle.Width = FontWidthType.Expanded;
987 /// fontStyle.Weight = FontWeightType.Bold;
988 /// fontStyle.Slant = FontSlantType.Italic;
989 /// editor.SetInputFontStyle(fontStyle);
992 [EditorBrowsable(EditorBrowsableState.Never)]
993 public void SetInputFontStyle(FontStyle fontStyle)
995 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
997 SetValue(InputFontStyleProperty, fontStyleMap);
1002 /// Get InputFontStyle from TextEditor. <br />
1004 /// <returns>The FontStyle</returns>
1006 /// <see cref="Tizen.NUI.Text.FontStyle"/>
1008 [EditorBrowsable(EditorBrowsableState.Never)]
1009 public FontStyle GetInputFontStyle()
1011 FontStyle fontStyle;
1012 using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
1014 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
1020 /// The InputPointSize property.<br />
1021 /// The font's size of the new input text in points.<br />
1023 /// <since_tizen> 3 </since_tizen>
1024 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
1025 public float InputPointSize
1029 return (float)GetValue(InputPointSizeProperty);
1033 SetValue(InputPointSizeProperty, value);
1034 NotifyPropertyChanged();
1039 /// The LineSpacing property.<br />
1040 /// The default extra space between lines in points.<br />
1042 /// <since_tizen> 3 </since_tizen>
1043 public float LineSpacing
1047 return (float)GetValue(LineSpacingProperty);
1051 SetValue(LineSpacingProperty, value);
1052 NotifyPropertyChanged();
1057 /// The InputLineSpacing property.<br />
1058 /// The extra space between lines in points.<br />
1060 /// <since_tizen> 3 </since_tizen>
1061 public float InputLineSpacing
1065 return (float)GetValue(InputLineSpacingProperty);
1069 SetValue(InputLineSpacingProperty, value);
1070 NotifyPropertyChanged();
1075 /// The relative height of the line (a factor that will be multiplied by text height). <br />
1076 /// If the value is less than 1, the lines could to be overlapped.
1078 [EditorBrowsable(EditorBrowsableState.Never)]
1079 public float RelativeLineHeight
1083 return (float)GetValue(RelativeLineHeightProperty);
1087 SetValue(RelativeLineHeightProperty, value);
1088 NotifyPropertyChanged();
1093 /// The Underline property.<br />
1094 /// The default underline parameters.<br />
1095 /// The underline map contains the following keys :<br />
1096 /// <list type="table">
1097 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1098 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1099 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1102 /// <since_tizen> 3 </since_tizen>
1103 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1104 public PropertyMap Underline
1108 return (PropertyMap)GetValue(UnderlineProperty);
1112 SetValue(UnderlineProperty, value);
1113 NotifyPropertyChanged();
1118 /// Set Underline to TextEditor. <br />
1120 /// <param name="underline">The Underline</param>
1122 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1125 /// The following example demonstrates how to use the SetUnderline method.
1127 /// var underline = new Tizen.NUI.Text.Underline();
1128 /// underline.Enable = true;
1129 /// underline.Color = new Color("#3498DB");
1130 /// underline.Height = 2.0f;
1131 /// editor.SetUnderline(underline);
1134 [EditorBrowsable(EditorBrowsableState.Never)]
1135 public void SetUnderline(Underline underline)
1137 using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1139 SetValue(UnderlineProperty, underlineMap);
1144 /// Get Underline from TextEditor. <br />
1146 /// <returns>The Underline</returns>
1148 /// <see cref="Tizen.NUI.Text.Underline"/>
1150 [EditorBrowsable(EditorBrowsableState.Never)]
1151 public Underline GetUnderline()
1153 Underline underline;
1154 using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1156 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1162 /// The InputUnderline property.<br />
1163 /// The underline parameters of the new input text.<br />
1165 /// <since_tizen> 3 </since_tizen>
1166 public string InputUnderline
1170 return (string)GetValue(InputUnderlineProperty);
1174 SetValue(InputUnderlineProperty, value);
1175 NotifyPropertyChanged();
1180 /// The Shadow property.<br />
1181 /// The default shadow parameters.<br />
1182 /// The shadow map contains the following keys :<br />
1183 /// <list type="table">
1184 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1185 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1186 /// <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>
1189 /// <since_tizen> 3 </since_tizen>
1190 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1191 public PropertyMap Shadow
1195 return (PropertyMap)GetValue(ShadowProperty);
1199 SetValue(ShadowProperty, value);
1200 NotifyPropertyChanged();
1205 /// Set Shadow to TextEditor. <br />
1207 /// <param name="shadow">The Shadow</param>
1209 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1212 /// The following example demonstrates how to use the SetShadow method.
1214 /// var shadow = new Tizen.NUI.Text.Shadow();
1215 /// shadow.Offset = new Vector2(3, 3);
1216 /// shadow.Color = new Color("#F1C40F");
1217 /// editor.SetShadow(shadow);
1220 [EditorBrowsable(EditorBrowsableState.Never)]
1221 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1223 using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1225 SetValue(ShadowProperty, shadowMap);
1230 /// Get Shadow from TextEditor. <br />
1232 /// <returns>The Shadow</returns>
1234 /// <see cref="Tizen.NUI.Text.Shadow"/>
1236 [EditorBrowsable(EditorBrowsableState.Never)]
1237 public Tizen.NUI.Text.Shadow GetShadow()
1239 Tizen.NUI.Text.Shadow shadow;
1240 using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
1242 shadow = TextMapHelper.GetShadowStruct(shadowMap);
1248 /// The InputShadow property.<br />
1249 /// The shadow parameters of the new input text.<br />
1251 /// <since_tizen> 3 </since_tizen>
1252 public string InputShadow
1256 return (string)GetValue(InputShadowProperty);
1260 SetValue(InputShadowProperty, value);
1261 NotifyPropertyChanged();
1266 /// The Emboss property.<br />
1267 /// The default emboss parameters.<br />
1269 /// <since_tizen> 3 </since_tizen>
1270 public string Emboss
1274 return (string)GetValue(EmbossProperty);
1278 SetValue(EmbossProperty, value);
1279 NotifyPropertyChanged();
1284 /// The InputEmboss property.<br />
1285 /// The emboss parameters of the new input text.<br />
1287 /// <since_tizen> 3 </since_tizen>
1288 public string InputEmboss
1292 return (string)GetValue(InputEmbossProperty);
1296 SetValue(InputEmbossProperty, value);
1297 NotifyPropertyChanged();
1302 /// The Outline property.<br />
1303 /// The default outline parameters.<br />
1304 /// The outline map contains the following keys :<br />
1305 /// <list type="table">
1306 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
1307 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
1310 /// <since_tizen> 3 </since_tizen>
1311 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1312 public PropertyMap Outline
1316 return (PropertyMap)GetValue(OutlineProperty);
1320 SetValue(OutlineProperty, value);
1321 NotifyPropertyChanged();
1326 /// Set Outline to TextEditor. <br />
1328 /// <param name="outline">The Outline</param>
1330 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
1333 /// The following example demonstrates how to use the SetOutline method.
1335 /// var outline = new Tizen.NUI.Text.Outline();
1336 /// outline.Width = 2.0f;
1337 /// outline.Color = new Color("#45B39D");
1338 /// editor.SetOutline(outline);
1341 [EditorBrowsable(EditorBrowsableState.Never)]
1342 public void SetOutline(Outline outline)
1344 using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
1346 SetValue(OutlineProperty, outlineMap);
1351 /// Get Outline from TextEditor. <br />
1353 /// <returns>The Outline</returns>
1355 /// <see cref="Tizen.NUI.Text.Outline"/>
1357 [EditorBrowsable(EditorBrowsableState.Never)]
1358 public Outline GetOutline()
1361 using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
1363 outline = TextMapHelper.GetOutlineStruct(outlineMap);
1369 /// The InputOutline property.<br />
1370 /// The outline parameters of the new input text.<br />
1372 /// <since_tizen> 3 </since_tizen>
1373 public string InputOutline
1377 return (string)GetValue(InputOutlineProperty);
1381 SetValue(InputOutlineProperty, value);
1382 NotifyPropertyChanged();
1387 /// The SmoothScroll property.<br />
1388 /// Enable or disable the smooth scroll animation.<br />
1390 /// <since_tizen> 3 </since_tizen>
1391 public bool SmoothScroll
1395 return (bool)GetValue(SmoothScrollProperty);
1399 SetValue(SmoothScrollProperty, value);
1400 NotifyPropertyChanged();
1405 /// The SmoothScrollDuration property.<br />
1406 /// Sets the duration of smooth scroll animation.<br />
1408 /// <since_tizen> 3 </since_tizen>
1409 public float SmoothScrollDuration
1413 return (float)GetValue(SmoothScrollDurationProperty);
1417 SetValue(SmoothScrollDurationProperty, value);
1418 NotifyPropertyChanged();
1423 /// The EnableScrollBar property.<br />
1424 /// Enable or disable the scroll bar.<br />
1426 /// <since_tizen> 3 </since_tizen>
1427 public bool EnableScrollBar
1431 return (bool)GetValue(EnableScrollBarProperty);
1435 SetValue(EnableScrollBarProperty, value);
1436 NotifyPropertyChanged();
1441 /// The ScrollBarShowDuration property.<br />
1442 /// Sets the duration of scroll bar to show.<br />
1444 /// <since_tizen> 3 </since_tizen>
1445 public float ScrollBarShowDuration
1449 return (float)GetValue(ScrollBarShowDurationProperty);
1453 SetValue(ScrollBarShowDurationProperty, value);
1454 NotifyPropertyChanged();
1459 /// The ScrollBarFadeDuration property.<br />
1460 /// Sets the duration of scroll bar to fade out.<br />
1462 /// <since_tizen> 3 </since_tizen>
1463 public float ScrollBarFadeDuration
1467 return (float)GetValue(ScrollBarFadeDurationProperty);
1471 SetValue(ScrollBarFadeDurationProperty, value);
1472 NotifyPropertyChanged();
1477 /// The PixelSize property.<br />
1478 /// The size of font in pixels.<br />
1480 /// <since_tizen> 3 </since_tizen>
1481 [Binding.TypeConverter(typeof(FloatGraphicsTypeConverter))]
1482 public float PixelSize
1486 return (float)GetValue(PixelSizeProperty);
1490 SetValue(PixelSizeProperty, value);
1491 NotifyPropertyChanged();
1496 /// The line count of the text.
1498 /// <since_tizen> 3 </since_tizen>
1499 public int LineCount
1504 using (var propertyValue = GetProperty(TextEditor.Property.LineCount))
1506 propertyValue.Get(out lineCount);
1513 /// The text to display when the TextEditor is empty and inactive.
1515 /// <since_tizen> 3 </since_tizen>
1516 public string PlaceholderText
1520 return (string)GetValue(PlaceholderTextProperty);
1524 SetValue(PlaceholderTextProperty, value);
1525 NotifyPropertyChanged();
1530 /// The portion of the text that has been selected by the user.
1533 /// Empty string when nothing is selected.
1535 /// <since_tizen> 9 </since_tizen>
1536 public string SelectedText
1540 string selectedText;
1541 using (var propertyValue = GetProperty(TextEditor.Property.SelectedText))
1543 propertyValue.Get(out selectedText);
1545 return selectedText;
1550 /// The Placeholder text color.
1553 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
1555 /// <since_tizen> 3 </since_tizen>
1556 public Color PlaceholderTextColor
1560 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
1561 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
1565 SetValue(PlaceholderTextColorProperty, value);
1566 NotifyPropertyChanged();
1571 /// The Enable selection property.<br />
1572 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
1574 /// <since_tizen> 3 </since_tizen>
1575 public bool EnableSelection
1579 return (bool)GetValue(EnableSelectionProperty);
1583 SetValue(EnableSelectionProperty, value);
1584 NotifyPropertyChanged();
1589 /// The start index for selection.
1592 /// When there is no selection, the index is current cursor position.
1594 /// <since_tizen> 9 </since_tizen>
1595 public int SelectedTextStart
1599 int selectedTextStart;
1600 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextStart))
1602 propertyValue.Get(out selectedTextStart);
1604 return selectedTextStart;
1609 /// The end index for selection.
1612 /// When there is no selection, the index is current cursor position.
1614 /// <since_tizen> 9 </since_tizen>
1615 public int SelectedTextEnd
1619 int selectedTextEnd;
1620 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextEnd))
1622 propertyValue.Get(out selectedTextEnd);
1624 return selectedTextEnd;
1629 /// Enable editing in text control.
1631 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
1632 [EditorBrowsable(EditorBrowsableState.Never)]
1633 public bool EnableEditing
1637 return (bool)GetValue(EnableEditingProperty);
1641 SetValue(EnableEditingProperty, value);
1645 private bool InternalEnableEditing
1650 using (var propertyValue = GetProperty(TextEditor.Property.EnableEditing))
1652 propertyValue.Get(out enableEditing);
1654 return enableEditing;
1658 using (var propertyValue = new PropertyValue(value))
1660 SetProperty(TextEditor.Property.EnableEditing, propertyValue);
1661 NotifyPropertyChanged();
1667 /// Specify horizontal scroll position in text control.
1669 [EditorBrowsable(EditorBrowsableState.Never)]
1670 public int HorizontalScrollPosition
1674 return (int)GetValue(HorizontalScrollPositionProperty);
1678 SetValue(HorizontalScrollPositionProperty, value);
1682 private int InternalHorizontalScrollPosition
1686 int horizontalScrollPosition;
1687 using (var propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
1689 propertyValue.Get(out horizontalScrollPosition);
1691 return horizontalScrollPosition;
1695 using (var propertyValue = new PropertyValue(value))
1697 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
1698 NotifyPropertyChanged();
1704 /// Specify vertical scroll position in text control.
1706 [EditorBrowsable(EditorBrowsableState.Never)]
1707 public int VerticalScrollPosition
1711 return (int)GetValue(VerticalScrollPositionProperty);
1715 SetValue(VerticalScrollPositionProperty, value);
1719 private int InternalVerticalScrollPosition
1723 int verticalScrollPosition;
1724 using (var propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
1726 propertyValue.Get(out verticalScrollPosition);
1728 return verticalScrollPosition;
1732 using (var propertyValue = new PropertyValue(value))
1734 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
1735 NotifyPropertyChanged();
1741 /// PrimaryCursorPosition property.<br />
1742 /// Specify the position of the primary cursor (caret) in text control.
1745 /// 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).
1747 /// <since_tizen> 10 </since_tizen>
1748 public int PrimaryCursorPosition
1752 return (int)GetValue(PrimaryCursorPositionProperty);
1756 SetValue(PrimaryCursorPositionProperty, value);
1760 private int InternalPrimaryCursorPosition
1764 int primaryCursorPosition;
1765 using (var propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
1767 propertyValue.Get(out primaryCursorPosition);
1769 return primaryCursorPosition;
1773 using (var propertyValue = new PropertyValue(value))
1775 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
1776 NotifyPropertyChanged();
1782 /// The GrabHandleColor property.
1785 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
1787 [EditorBrowsable(EditorBrowsableState.Never)]
1788 public Color GrabHandleColor
1792 Color temp = (Color)GetValue(GrabHandleColorProperty);
1793 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
1797 SetValue(GrabHandleColorProperty, value);
1798 NotifyPropertyChanged();
1803 /// Set InputFilter to TextEditor.
1805 /// <param name="inputFilter">The InputFilter</param>
1807 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
1808 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
1809 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
1812 /// The following example demonstrates how to use the SetInputFilter method.
1814 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
1815 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
1816 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
1817 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
1820 /// <since_tizen> 9 </since_tizen>
1821 public void SetInputFilter(InputFilter inputFilter)
1823 using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
1824 using (var propertyValue = new PropertyValue(map))
1826 SetProperty(TextEditor.Property.InputFilter, propertyValue);
1831 /// Get InputFilter from TextEditor. <br />
1833 /// <returns>The InputFilter</returns>
1835 /// <see cref="Tizen.NUI.Text.InputFilter"/>
1837 /// <since_tizen> 9 </since_tizen>
1838 public InputFilter GetInputFilter()
1840 InputFilter inputFilter;
1841 using (var propertyValue = GetProperty(TextEditor.Property.InputFilter))
1842 using (var map = new PropertyMap())
1844 propertyValue.Get(map);
1845 inputFilter = TextMapHelper.GetInputFilterStruct(map);
1851 /// Set Strikethrough to TextEditor. <br />
1853 /// <param name="strikethrough">The Strikethrough</param>
1855 /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
1858 /// The following example demonstrates how to use the SetStrikethrough method.
1860 /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
1861 /// strikethrough.Enable = true;
1862 /// strikethrough.Color = new Color("#3498DB");
1863 /// strikethrough.Height = 2.0f;
1864 /// editor.SetStrikethrough(strikethrough);
1867 [EditorBrowsable(EditorBrowsableState.Never)]
1868 public void SetStrikethrough(Strikethrough strikethrough)
1870 using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
1871 using (var propertyValue = new PropertyValue(map))
1873 SetProperty(TextEditor.Property.Strikethrough, propertyValue);
1878 /// Get Strikethrough from TextEditor. <br />
1880 /// <returns>The Strikethrough</returns>
1882 /// <see cref="Tizen.NUI.Text.Strikethrough"/>
1884 [EditorBrowsable(EditorBrowsableState.Never)]
1885 public Strikethrough GetStrikethrough()
1887 Strikethrough strikethrough;
1888 using (var propertyValue = GetProperty(TextEditor.Property.Strikethrough))
1889 using (var map = new PropertyMap())
1891 propertyValue.Get(map);
1892 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
1894 return strikethrough;
1898 /// The Placeholder property.
1899 /// The placeholder map contains the following keys :<br />
1900 /// <list type="table">
1901 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
1902 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
1903 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
1904 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
1905 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
1906 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
1907 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
1908 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
1912 /// The following example demonstrates how to set the placeholder property.
1914 /// PropertyMap propertyMap = new PropertyMap();
1915 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1916 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1917 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1918 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1919 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1921 /// PropertyMap fontStyleMap = new PropertyMap();
1922 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1923 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1924 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1925 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1927 /// TextEditor editor = new TextEditor();
1928 /// editor.Placeholder = propertyMap;
1931 /// <since_tizen> 3 </since_tizen>
1932 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1933 public Tizen.NUI.PropertyMap Placeholder
1937 PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
1938 string defalutText = "";
1940 if (TextMapHelper.IsValue(map, 0))
1941 map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
1943 if (TextMapHelper.IsValue(map, 1))
1944 map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
1946 if (TextMapHelper.IsValue(map, 2))
1948 using (var color = TextMapHelper.GetColorFromMap(map, 2))
1950 map.Add("color", color);
1954 if (TextMapHelper.IsValue(map, 3))
1955 map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
1957 if (TextMapHelper.IsValue(map, 4))
1959 using (var properyValue = map.Find(4))
1960 using (var fontStyle = new PropertyMap())
1962 properyValue.Get(fontStyle);
1963 using (var fontStyleValue = new PropertyValue(fontStyle))
1965 map.Add("fontStyle", fontStyleValue);
1970 if (TextMapHelper.IsValue(map, 5))
1971 map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
1973 if (TextMapHelper.IsValue(map, 6))
1974 map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
1976 if (TextMapHelper.IsValue(map, 7))
1977 map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
1983 SetValue(PlaceholderProperty, value);
1984 NotifyPropertyChanged();
1989 /// Set Placeholder to TextEditor. <br />
1991 /// <param name="placeholder">The Placeholder</param>
1993 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
1996 /// The following example demonstrates how to use the SetPlaceholder method.
1998 /// var placeholder = new Tizen.NUI.Text.Placeholder();
1999 /// placeholder.Text = "placeholder text";
2000 /// placeholder.TextFocused = "placeholder textFocused";
2001 /// placeholder.Color = new Color("#45B39D");
2002 /// placeholder.FontFamily = "BreezeSans";
2003 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
2005 /// Width = FontWidthType.Expanded,
2006 /// Weight = FontWeightType.ExtraLight,
2007 /// Slant = FontSlantType.Italic,
2009 /// placeholder.PointSize = 25.0f;
2010 /// //placeholder.PixelSize = 50.0f;
2011 /// placeholder.Ellipsis = true;
2012 /// editor.SetPlaceholder(placeholder);
2015 [EditorBrowsable(EditorBrowsableState.Never)]
2016 public void SetPlaceholder(Placeholder placeholder)
2018 using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
2020 SetValue(PlaceholderProperty, placeholderMap);
2025 /// Get Placeholder from TextEditor. <br />
2027 /// <returns>The Placeholder</returns>
2029 /// <see cref="Tizen.NUI.Text.Placeholder"/>
2031 [EditorBrowsable(EditorBrowsableState.Never)]
2032 public Placeholder GetPlaceholder()
2034 Placeholder placeholder;
2035 using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
2037 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
2043 /// The Ellipsis property.<br />
2044 /// Enable or disable the ellipsis.<br />
2046 /// <since_tizen> 9 </since_tizen>
2047 public bool Ellipsis
2051 return (bool)GetValue(EllipsisProperty);
2055 SetValue(EllipsisProperty, value);
2056 NotifyPropertyChanged();
2062 /// The ellipsis position of the text.
2063 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
2065 /// <since_tizen> 9 </since_tizen>
2066 public EllipsisPosition EllipsisPosition
2070 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
2074 SetValue(EllipsisPositionProperty, value);
2075 NotifyPropertyChanged();
2080 /// The LineWrapMode property.<br />
2081 /// The line wrap mode when the text lines over the layout width.<br />
2083 /// <since_tizen> 4 </since_tizen>
2084 public LineWrapMode LineWrapMode
2088 return (LineWrapMode)GetValue(LineWrapModeProperty);
2092 SetValue(LineWrapModeProperty, value);
2093 NotifyPropertyChanged();
2098 /// Enables Text selection using Shift key.
2100 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2101 [EditorBrowsable(EditorBrowsableState.Never)]
2102 public bool EnableShiftSelection
2106 return (bool)GetValue(EnableShiftSelectionProperty);
2110 SetValue(EnableShiftSelectionProperty, value);
2111 NotifyPropertyChanged();
2116 /// The text alignment to match the direction of the system language.
2118 /// <since_tizen> 6 </since_tizen>
2119 public bool MatchSystemLanguageDirection
2123 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
2127 SetValue(MatchSystemLanguageDirectionProperty, value);
2128 NotifyPropertyChanged();
2133 /// The MaxLength property.<br />
2134 /// The maximum number of characters that can be inserted.<br />
2136 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2137 [EditorBrowsable(EditorBrowsableState.Never)]
2138 public int MaxLength
2142 return (int)GetValue(MaxLengthProperty);
2146 SetValue(MaxLengthProperty, value);
2147 NotifyPropertyChanged();
2152 /// The FontSizeScale property. <br />
2153 /// The default value is 1.0. <br />
2154 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
2155 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
2157 /// <since_tizen> 9 </since_tizen>
2158 public float FontSizeScale
2162 return fontSizeScale;
2166 float newFontSizeScale;
2168 if (fontSizeScale == value) return;
2170 fontSizeScale = value;
2171 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
2173 SystemSettingsFontSize systemSettingsFontSize;
2177 systemSettingsFontSize = SystemSettings.FontSize;
2181 Console.WriteLine("{0} Exception caught.", e);
2182 systemSettingsFontSize = SystemSettingsFontSize.Normal;
2184 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
2185 addFontSizeChangedCallback();
2189 newFontSizeScale = fontSizeScale;
2190 removeFontSizeChangedCallback();
2193 SetValue(FontSizeScaleProperty, newFontSizeScale);
2194 NotifyPropertyChanged();
2199 /// The EnableFontSizeScale property.<br />
2200 /// Whether the font size scale is enabled. (The default value is true)
2202 [EditorBrowsable(EditorBrowsableState.Never)]
2203 public bool EnableFontSizeScale
2207 return (bool)GetValue(EnableFontSizeScaleProperty);
2211 SetValue(EnableFontSizeScaleProperty, value);
2212 NotifyPropertyChanged();
2217 /// The InputMethodSettings property.<br />
2218 /// The settings to relating to the System's Input Method, Key and Value.<br />
2221 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Use the <see cref="InputMethod"/> class for this property.
2224 /// The following example demonstrates how to set the InputMethodSettings property.
2226 /// InputMethod method = new InputMethod();
2227 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
2228 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
2229 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
2230 /// method.Variation = 1;
2231 /// textEditor.InputMethodSettings = method.OutputMap;
2234 [EditorBrowsable(EditorBrowsableState.Never)]
2235 public PropertyMap InputMethodSettings
2239 return (PropertyMap)GetValue(InputMethodSettingsProperty);
2243 SetValue(InputMethodSettingsProperty, value);
2244 NotifyPropertyChanged();
2249 /// Scroll the text control by specific amount..
2251 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
2252 [EditorBrowsable(EditorBrowsableState.Never)]
2253 public void ScrollBy(Vector2 scroll)
2255 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
2256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2260 /// Get the InputMethodContext instance.
2262 /// <returns>The InputMethodContext instance.</returns>
2263 /// <since_tizen> 5 </since_tizen>
2264 public InputMethodContext GetInputMethodContext()
2266 if (inputMethodContext == null)
2268 /*Avoid raising InputMethodContext reference count.*/
2269 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
2270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2272 return inputMethodContext;
2276 /// Select the whole text.
2278 /// <since_tizen> 9 </since_tizen>
2279 public void SelectWholeText()
2281 Interop.TextEditor.SelectWholeText(SwigCPtr);
2282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2286 /// Select text from start to end index. <br />
2287 /// The index is valid when 0 or positive.
2289 /// <param name="start">The start index for selection.</param>
2290 /// <param name="end">The end index for selection.</param>
2292 /// If the end index exceeds the maximum value, it is set to the length of the text.
2294 /// <since_tizen> 9 </since_tizen>
2295 public void SelectText(int start, int end)
2298 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
2300 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
2302 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
2303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2307 /// Clear selection of the text. <br />
2308 /// Valid when selection is activate.
2310 /// <since_tizen> 9 </since_tizen>
2311 public void SelectNone()
2313 _ = Interop.TextEditor.SelectNone(SwigCPtr);
2314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2318 /// The Enable grab handle property.<br />
2319 /// Enables the grab handles for text selection.<br />
2320 /// The default value is true, which means the grab handles are enabled by default.<br />
2322 [EditorBrowsable(EditorBrowsableState.Never)]
2323 public bool EnableGrabHandle
2327 return (bool)GetValue(EnableGrabHandleProperty);
2331 SetValue(EnableGrabHandleProperty, value);
2332 NotifyPropertyChanged();
2337 /// The Enable grab handle popup property.<br />
2338 /// Enables the grab handle popup for text selection.<br />
2339 /// The default value is true, which means the grab handle popup is enabled by default.<br />
2341 [EditorBrowsable(EditorBrowsableState.Never)]
2342 public bool EnableGrabHandlePopup
2346 return (bool)GetValue(EnableGrabHandlePopupProperty);
2350 SetValue(EnableGrabHandlePopupProperty, value);
2351 NotifyPropertyChanged();
2356 /// Minimum line size to be used.<br />
2357 /// The height of the line in points. <br />
2358 /// If the font size is larger than the line size, it works with the font size. <br />
2360 [EditorBrowsable(EditorBrowsableState.Never)]
2361 public float MinLineSize
2365 return (float)GetValue(MinLineSizeProperty);
2369 SetValue(MinLineSizeProperty, value);
2370 NotifyPropertyChanged();
2374 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
2376 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));
2377 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2382 /// The spaces between characters in Pixels.
2384 /// A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).<br />
2385 /// The default value is 0.f which does nothing.
2388 [EditorBrowsable(EditorBrowsableState.Never)]
2389 public float CharacterSpacing
2393 return (float)GetValue(CharacterSpacingProperty);
2397 SetValue(CharacterSpacingProperty, value);
2398 NotifyPropertyChanged();
2405 /// <since_tizen> 3 </since_tizen>
2406 protected override void Dispose(DisposeTypes type)
2413 if (systemlangTextFlag)
2415 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
2418 removeFontSizeChangedCallback();
2420 //Release your own unmanaged resources here.
2421 //You should not access any managed member here except static instance.
2422 //because the execution order of Finalizes is non-deterministic.
2426 if (textEditorTextChangedCallbackDelegate != null)
2428 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
2431 if (textEditorMaxLengthReachedCallbackDelegate != null)
2433 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
2436 if (textEditorSelectionStartedCallbackDelegate != null)
2438 this.SelectionStartedSignal().Disconnect(textEditorSelectionStartedCallbackDelegate);
2441 if (textEditorSelectionClearedCallbackDelegate != null)
2443 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
2446 if (textEditorCursorPositionChangedCallbackDelegate != null)
2448 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
2451 if (textEditorSelectionChangedCallbackDelegate != null)
2453 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
2457 TextChanged -= TextEditorTextChanged;
2461 /// This will not be public opened.
2462 [EditorBrowsable(EditorBrowsableState.Never)]
2463 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2465 // In order to speed up IME hide, temporarily add
2466 GetInputMethodContext()?.DestroyContext();
2467 Interop.TextEditor.DeleteTextEditor(swigCPtr);
2470 internal override LayoutItem CreateDefaultLayout()
2472 return new TextEditorLayout();
2475 internal void SetTextWithoutTextChanged(string text)
2477 invokeTextChanged = false;
2478 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(text));
2479 invokeTextChanged = true;
2482 private string SetTranslatable(string textEditorSid)
2484 string translatableText = null;
2485 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
2486 if (translatableText != null)
2488 if (systemlangTextFlag == false)
2490 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
2491 systemlangTextFlag = true;
2493 return translatableText;
2497 translatableText = "";
2498 return translatableText;
2502 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
2504 if (textEditorTextSid != null)
2506 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2508 if (textEditorPlaceHolderTextSid != null)
2510 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
2514 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
2516 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
2517 SetValue(FontSizeScaleProperty, newFontSizeScale);
2518 NotifyPropertyChanged();
2521 private void addFontSizeChangedCallback()
2523 if (hasFontSizeChangedCallback != true)
2527 SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
2528 hasFontSizeChangedCallback = true;
2532 Console.WriteLine("{0} Exception caught.", e);
2533 hasFontSizeChangedCallback = false;
2538 private void removeFontSizeChangedCallback()
2540 if (hasFontSizeChangedCallback == true)
2544 SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
2545 hasFontSizeChangedCallback = false;
2549 Console.WriteLine("{0} Exception caught.", e);
2550 hasFontSizeChangedCallback = true;
2555 private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
2557 if (!isSettingTextInCSharp)
2559 EnforceNotifyBindedInstance(TextProperty);
2563 internal new class Property
2565 internal static readonly int TEXT = Interop.TextEditor.TextGet();
2566 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
2567 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
2568 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
2569 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
2570 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
2571 internal static readonly int VerticalAlignment = Interop.TextEditor.VerticalAlignmentGet();
2572 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
2573 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
2574 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
2575 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
2576 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
2577 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
2578 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
2579 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
2580 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
2581 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
2582 internal static readonly int SelectionPopupStyle = Interop.TextEditor.SelectionPopupStyleGet();
2583 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
2584 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
2585 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
2586 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
2587 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
2588 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
2589 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
2590 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
2591 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
2592 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
2593 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
2594 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
2595 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
2596 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
2597 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
2598 internal static readonly int RelativeLineHeight = Interop.TextEditor.RelativeLineHeightGet();
2599 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
2600 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
2601 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
2602 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
2603 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
2604 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
2605 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
2606 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
2607 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
2608 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
2609 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
2610 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
2611 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
2612 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
2613 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
2614 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
2615 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
2616 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
2617 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
2618 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
2619 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
2620 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
2621 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
2622 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
2623 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
2624 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
2625 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
2626 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
2627 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
2628 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
2629 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
2630 internal static readonly int EnableFontSizeScale = Interop.TextEditor.EnableFontSizeScaleGet();
2631 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
2632 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
2633 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
2634 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
2635 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
2636 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
2637 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
2638 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
2639 internal static readonly int Strikethrough = Interop.TextEditor.StrikethroughGet();
2640 internal static readonly int CharacterSpacing = Interop.TextEditor.CharacterSpacingGet();
2643 internal class InputStyle
2649 FontFamily = 0x0002,
2652 LineSpacing = 0x0010,
2660 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
2662 DecorationBoundingBox = new Rectangle(x, y, width, height);
2664 private void OnInputColorChanged(float x, float y, float z, float w)
2666 InputColor = new Vector4(x, y, z, w);
2668 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
2670 PlaceholderTextColor = new Color(r, g, b, a);
2672 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
2674 PrimaryCursorColor = new Vector4(x, y, z, w);
2676 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
2678 SecondaryCursorColor = new Vector4(x, y, z, w);
2680 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
2682 SelectionHighlightColor = new Vector4(x, y, z, w);
2684 private void OnTextColorChanged(float x, float y, float z, float w)
2686 TextColor = new Vector4(x, y, z, w);
2688 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
2690 GrabHandleColor = new Color(r, g, b, a);
2693 private class TextEditorLayout : LayoutItem
2695 protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
2697 // Padding will be automatically applied by DALi TextEditor.
2698 var totalWidth = widthMeasureSpec.Size.AsDecimal();
2699 var totalHeight = heightMeasureSpec.Size.AsDecimal();
2700 var minSize = Owner.MinimumSize;
2701 var maxSize = Owner.MaximumSize;
2702 var naturalSize = Owner.GetNaturalSize();
2704 if (((TextEditor)Owner).Text.Length == 0)
2706 // Calculate height of TextEditor by setting Text with " ".
2707 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2708 ((TextEditor)Owner).SetTextWithoutTextChanged(" ");
2710 // Store original WidthSpecification to restore it after setting ResizePolicy.
2711 var widthSpecification = Owner.WidthSpecification;
2713 // In DALi's Size logic, if Width or Height is set to be 0, then
2714 // ResizePolicy is not changed to Fixed.
2715 // This causes Size changes after NUI Layout's OnMeasure is finished.
2716 // e.g. TextEditor's Width fills to its parent although Text is null and
2717 // WidthSpecification is WrapContent.
2718 // To prevent the Size changes, WidthResizePolicy is set to be Fixed
2719 // in advance if Text is null.
2720 Owner.WidthResizePolicy = ResizePolicyType.Fixed;
2722 // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
2723 Owner.WidthSpecification = widthSpecification;
2725 naturalSize = Owner.GetNaturalSize();
2727 // Restore TextEditor's Text after calculating height of TextEditor.
2728 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
2729 ((TextEditor)Owner).SetTextWithoutTextChanged("");
2732 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2734 totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), maxSize.Width);
2737 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
2739 totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), maxSize.Height);
2742 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
2743 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
2745 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
2746 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
2748 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
2749 ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));