2 * Copyright(c) 2018 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 namespace Tizen.NUI.BaseComponents
28 /// A control which provides a multi-line editable text editor.
30 /// <since_tizen> 3 </since_tizen>
31 public partial class TextEditor : View
33 private string textEditorTextSid = null;
34 private string textEditorPlaceHolderTextSid = null;
35 private bool systemlangTextFlag = false;
36 private InputMethodContext inputMethodContext = null;
39 /// Creates the TextEditor control.
41 /// <since_tizen> 3 </since_tizen>
42 public TextEditor() : this(Interop.TextEditor.TextEditor_New(), true)
44 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
48 /// Creates the TextEditor with setting the status of shown or hidden.
50 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
51 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
52 [EditorBrowsable(EditorBrowsableState.Never)]
53 public TextEditor(bool shown) : this(Interop.TextEditor.TextEditor_New(), true)
55 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
61 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextEditor.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
78 /// The TranslatableText property.<br />
79 /// The text can set the SID value.<br />
81 /// <exception cref='ArgumentNullException'>
82 /// ResourceManager about multilingual is null.
84 /// <since_tizen> 4 </since_tizen>
85 public string TranslatableText
89 return textEditorTextSid;
93 if (NUIApplication.MultilingualResourceManager == null)
95 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
97 textEditorTextSid = value;
98 Text = SetTranslatable(textEditorTextSid);
99 NotifyPropertyChanged();
103 /// The TranslatablePlaceholderText property.<br />
104 /// The text can set the SID value.<br />
106 /// <exception cref='ArgumentNullException'>
107 /// ResourceManager about multilingual is null.
109 /// <since_tizen> 4 </since_tizen>
110 public string TranslatablePlaceholderText
114 return textEditorPlaceHolderTextSid;
118 if (NUIApplication.MultilingualResourceManager == null)
120 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
122 textEditorPlaceHolderTextSid = value;
123 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
124 NotifyPropertyChanged();
129 /// The Text property.
131 /// <since_tizen> 3 </since_tizen>
136 return (string)GetValue(TextProperty);
140 SetValueAndForceSendChangeSignal(TextProperty, value);
141 NotifyPropertyChanged();
146 /// The TextColor property.
149 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
151 /// <since_tizen> 3 </since_tizen>
152 public Vector4 TextColor
156 Vector4 temp = (Vector4)GetValue(TextColorProperty);
157 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
161 SetValue(TextColorProperty, value);
162 NotifyPropertyChanged();
167 /// The FontFamily property.
169 /// <since_tizen> 3 </since_tizen>
170 public string FontFamily
174 return (string)GetValue(FontFamilyProperty);
178 SetValue(FontFamilyProperty, value);
179 NotifyPropertyChanged();
184 /// The FontStyle property.
186 /// <since_tizen> 3 </since_tizen>
187 public PropertyMap FontStyle
191 return (PropertyMap)GetValue(FontStyleProperty);
195 SetValue(FontStyleProperty, value);
196 NotifyPropertyChanged();
201 /// The PointSize property.
203 /// <since_tizen> 3 </since_tizen>
204 public float PointSize
208 return (float)GetValue(PointSizeProperty);
212 SetValue(PointSizeProperty, value);
213 NotifyPropertyChanged();
218 /// The HorizontalAlignment property.
220 /// <since_tizen> 3 </since_tizen>
221 public HorizontalAlignment HorizontalAlignment
225 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
229 SetValue(HorizontalAlignmentProperty, value);
230 NotifyPropertyChanged();
235 /// The ScrollThreshold property.
237 /// <since_tizen> 3 </since_tizen>
238 public float ScrollThreshold
242 return (float)GetValue(ScrollThresholdProperty);
246 SetValue(ScrollThresholdProperty, value);
247 NotifyPropertyChanged();
252 /// The ScrollSpeed property.
254 /// <since_tizen> 3 </since_tizen>
255 public float ScrollSpeed
259 return (float)GetValue(ScrollSpeedProperty);
263 SetValue(ScrollSpeedProperty, value);
264 NotifyPropertyChanged();
269 /// The PrimaryCursorColor property.
272 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
274 /// <since_tizen> 3 </since_tizen>
275 public Vector4 PrimaryCursorColor
279 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
280 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
284 SetValue(PrimaryCursorColorProperty, value);
285 NotifyPropertyChanged();
290 /// The SecondaryCursorColor property.
293 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
295 /// <since_tizen> 3 </since_tizen>
296 public Vector4 SecondaryCursorColor
300 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
301 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
305 SetValue(SecondaryCursorColorProperty, value);
306 NotifyPropertyChanged();
311 /// The EnableCursorBlink property.
313 /// <since_tizen> 3 </since_tizen>
314 public bool EnableCursorBlink
318 return (bool)GetValue(EnableCursorBlinkProperty);
322 SetValue(EnableCursorBlinkProperty, value);
323 NotifyPropertyChanged();
328 /// The CursorBlinkInterval property.
330 /// <since_tizen> 3 </since_tizen>
331 public float CursorBlinkInterval
335 return (float)GetValue(CursorBlinkIntervalProperty);
339 SetValue(CursorBlinkIntervalProperty, value);
340 NotifyPropertyChanged();
345 /// The CursorBlinkDuration property.
347 /// <since_tizen> 3 </since_tizen>
348 public float CursorBlinkDuration
352 return (float)GetValue(CursorBlinkDurationProperty);
356 SetValue(CursorBlinkDurationProperty, value);
357 NotifyPropertyChanged();
362 /// The CursorWidth property.
364 /// <since_tizen> 3 </since_tizen>
365 public int CursorWidth
369 return (int)GetValue(CursorWidthProperty);
373 SetValue(CursorWidthProperty, value);
374 NotifyPropertyChanged();
379 /// The GrabHandleImage property.
381 /// <since_tizen> 3 </since_tizen>
382 public string GrabHandleImage
386 return (string)GetValue(GrabHandleImageProperty);
390 SetValue(GrabHandleImageProperty, value);
391 NotifyPropertyChanged();
396 /// The GrabHandlePressedImage property.
398 /// <since_tizen> 3 </since_tizen>
399 public string GrabHandlePressedImage
403 return (string)GetValue(GrabHandlePressedImageProperty);
407 SetValue(GrabHandlePressedImageProperty, value);
408 NotifyPropertyChanged();
413 /// The SelectionHandleImageLeft property.
415 /// <since_tizen> 3 </since_tizen>
416 public PropertyMap SelectionHandleImageLeft
420 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
424 SetValue(SelectionHandleImageLeftProperty, value);
425 NotifyPropertyChanged();
430 /// The SelectionHandleImageRight property.
432 /// <since_tizen> 3 </since_tizen>
433 public PropertyMap SelectionHandleImageRight
437 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
441 SetValue(SelectionHandleImageRightProperty, value);
442 NotifyPropertyChanged();
447 /// The SelectionHandlePressedImageLeft property.
449 /// <since_tizen> 3 </since_tizen>
450 public PropertyMap SelectionHandlePressedImageLeft
454 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
458 SetValue(SelectionHandlePressedImageLeftProperty, value);
459 NotifyPropertyChanged();
464 /// The SelectionHandlePressedImageRight property.
466 /// <since_tizen> 3 </since_tizen>
467 public PropertyMap SelectionHandlePressedImageRight
471 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
475 SetValue(SelectionHandlePressedImageRightProperty, value);
476 NotifyPropertyChanged();
481 /// The SelectionHandleMarkerImageLeft property.
483 /// <since_tizen> 3 </since_tizen>
484 public PropertyMap SelectionHandleMarkerImageLeft
488 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
492 SetValue(SelectionHandleMarkerImageLeftProperty, value);
493 NotifyPropertyChanged();
498 /// The SelectionHandleMarkerImageRight property.
500 /// <since_tizen> 3 </since_tizen>
501 public PropertyMap SelectionHandleMarkerImageRight
505 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
509 SetValue(SelectionHandleMarkerImageRightProperty, value);
510 NotifyPropertyChanged();
515 /// The SelectionHighlightColor property.
518 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
520 /// <since_tizen> 3 </since_tizen>
521 public Vector4 SelectionHighlightColor
525 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
526 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
530 SetValue(SelectionHighlightColorProperty, value);
531 NotifyPropertyChanged();
536 /// The DecorationBoundingBox property.
539 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
541 /// <since_tizen> 3 </since_tizen>
542 public Rectangle DecorationBoundingBox
546 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
547 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
551 SetValue(DecorationBoundingBoxProperty, value);
552 NotifyPropertyChanged();
557 /// The EnableMarkup property.
559 /// <since_tizen> 3 </since_tizen>
560 public bool EnableMarkup
564 return (bool)GetValue(EnableMarkupProperty);
568 SetValue(EnableMarkupProperty, value);
569 NotifyPropertyChanged();
574 /// The InputColor property.
577 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
579 /// <since_tizen> 3 </since_tizen>
580 public Vector4 InputColor
584 Vector4 temp = (Vector4)GetValue(InputColorProperty);
585 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
589 SetValue(InputColorProperty, value);
590 NotifyPropertyChanged();
595 /// The InputFontFamily property.
597 /// <since_tizen> 3 </since_tizen>
598 public string InputFontFamily
602 return (string)GetValue(InputFontFamilyProperty);
606 SetValue(InputFontFamilyProperty, value);
607 NotifyPropertyChanged();
612 /// The InputFontStyle property.
614 /// <since_tizen> 3 </since_tizen>
615 public PropertyMap InputFontStyle
619 return (PropertyMap)GetValue(InputFontStyleProperty);
623 SetValue(InputFontStyleProperty, value);
624 NotifyPropertyChanged();
629 /// The InputPointSize property.
631 /// <since_tizen> 3 </since_tizen>
632 public float InputPointSize
636 return (float)GetValue(InputPointSizeProperty);
640 SetValue(InputPointSizeProperty, value);
641 NotifyPropertyChanged();
646 /// The LineSpacing property.
648 /// <since_tizen> 3 </since_tizen>
649 public float LineSpacing
653 return (float)GetValue(LineSpacingProperty);
657 SetValue(LineSpacingProperty, value);
658 NotifyPropertyChanged();
663 /// The InputLineSpacing property.
665 /// <since_tizen> 3 </since_tizen>
666 public float InputLineSpacing
670 return (float)GetValue(InputLineSpacingProperty);
674 SetValue(InputLineSpacingProperty, value);
675 NotifyPropertyChanged();
680 /// The Underline property.
682 /// <since_tizen> 3 </since_tizen>
683 public PropertyMap Underline
687 return (PropertyMap)GetValue(UnderlineProperty);
691 SetValue(UnderlineProperty, value);
692 NotifyPropertyChanged();
697 /// The InputUnderline property.
699 /// <since_tizen> 3 </since_tizen>
700 public string InputUnderline
704 return (string)GetValue(InputUnderlineProperty);
708 SetValue(InputUnderlineProperty, value);
709 NotifyPropertyChanged();
714 /// The Shadow property.
716 /// <since_tizen> 3 </since_tizen>
717 public PropertyMap Shadow
721 return (PropertyMap)GetValue(ShadowProperty);
725 SetValue(ShadowProperty, value);
726 NotifyPropertyChanged();
731 /// The InputShadow property.
733 /// <since_tizen> 3 </since_tizen>
734 public string InputShadow
738 return (string)GetValue(InputShadowProperty);
742 SetValue(InputShadowProperty, value);
743 NotifyPropertyChanged();
748 /// The Emboss property.
750 /// <since_tizen> 3 </since_tizen>
755 return (string)GetValue(EmbossProperty);
759 SetValue(EmbossProperty, value);
760 NotifyPropertyChanged();
765 /// The InputEmboss property.
767 /// <since_tizen> 3 </since_tizen>
768 public string InputEmboss
772 return (string)GetValue(InputEmbossProperty);
776 SetValue(InputEmbossProperty, value);
777 NotifyPropertyChanged();
782 /// The Outline property.
784 /// <since_tizen> 3 </since_tizen>
785 public PropertyMap Outline
789 return (PropertyMap)GetValue(OutlineProperty);
793 SetValue(OutlineProperty, value);
794 NotifyPropertyChanged();
799 /// The InputOutline property.
801 /// <since_tizen> 3 </since_tizen>
802 public string InputOutline
806 return (string)GetValue(InputOutlineProperty);
810 SetValue(InputOutlineProperty, value);
811 NotifyPropertyChanged();
816 /// The SmoothScroll property.
818 /// <since_tizen> 3 </since_tizen>
819 public bool SmoothScroll
823 return (bool)GetValue(SmoothScrollProperty);
827 SetValue(SmoothScrollProperty, value);
828 NotifyPropertyChanged();
833 /// The SmoothScrollDuration property.
835 /// <since_tizen> 3 </since_tizen>
836 public float SmoothScrollDuration
840 return (float)GetValue(SmoothScrollDurationProperty);
844 SetValue(SmoothScrollDurationProperty, value);
845 NotifyPropertyChanged();
850 /// The EnableScrollBar property.
852 /// <since_tizen> 3 </since_tizen>
853 public bool EnableScrollBar
857 return (bool)GetValue(EnableScrollBarProperty);
861 SetValue(EnableScrollBarProperty, value);
862 NotifyPropertyChanged();
867 /// The ScrollBarShowDuration property.
869 /// <since_tizen> 3 </since_tizen>
870 public float ScrollBarShowDuration
874 return (float)GetValue(ScrollBarShowDurationProperty);
878 SetValue(ScrollBarShowDurationProperty, value);
879 NotifyPropertyChanged();
884 /// The ScrollBarFadeDuration property.
886 /// <since_tizen> 3 </since_tizen>
887 public float ScrollBarFadeDuration
891 return (float)GetValue(ScrollBarFadeDurationProperty);
895 SetValue(ScrollBarFadeDurationProperty, value);
896 NotifyPropertyChanged();
901 /// The PixelSize property.
903 /// <since_tizen> 3 </since_tizen>
904 public float PixelSize
908 return (float)GetValue(PixelSizeProperty);
912 SetValue(PixelSizeProperty, value);
913 NotifyPropertyChanged();
918 /// The line count of the text.
920 /// <since_tizen> 3 </since_tizen>
926 GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
932 /// The text to display when the TextEditor is empty and inactive.
934 /// <since_tizen> 3 </since_tizen>
935 public string PlaceholderText
939 return (string)GetValue(PlaceholderTextProperty);
943 SetValue(PlaceholderTextProperty, value);
944 NotifyPropertyChanged();
949 /// The Selected Text property (read-only).
951 [EditorBrowsable(EditorBrowsableState.Never)]
952 public string SelectedText
957 GetProperty(TextEditor.Property.SELECTED_TEXT).Get(out temp);
963 /// The Placeholder text color.
966 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
968 /// <since_tizen> 3 </since_tizen>
969 public Color PlaceholderTextColor
973 Color temp = (Color)GetValue(PlaceholderTextColorProperty);
974 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
978 SetValue(PlaceholderTextColorProperty, value);
979 NotifyPropertyChanged();
984 /// The EnableSelection property.
986 /// <since_tizen> 3 </since_tizen>
987 public bool EnableSelection
991 return (bool)GetValue(EnableSelectionProperty);
995 SetValue(EnableSelectionProperty, value);
996 NotifyPropertyChanged();
1001 /// The start index for selection.
1003 /// <since_tizen> 8 </since_tizen>
1004 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1005 [EditorBrowsable(EditorBrowsableState.Never)]
1006 public int SelectedTextStart
1011 GetProperty(TextEditor.Property.SELECTED_TEXT_START).Get(out temp);
1016 SetProperty(TextEditor.Property.SELECTED_TEXT_START, new PropertyValue(value));
1017 NotifyPropertyChanged();
1022 /// The end index for selection.
1024 /// <since_tizen> 8 </since_tizen>
1025 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1026 [EditorBrowsable(EditorBrowsableState.Never)]
1027 public int SelectedTextEnd
1032 GetProperty(TextEditor.Property.SELECTED_TEXT_END).Get(out temp);
1037 SetProperty(TextEditor.Property.SELECTED_TEXT_END, new PropertyValue(value));
1038 NotifyPropertyChanged();
1042 /// Enable editing in text control.
1044 /// <since_tizen> 8 </since_tizen>
1045 /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
1046 [EditorBrowsable(EditorBrowsableState.Never)]
1047 public bool EnableEditing
1052 GetProperty(TextEditor.Property.ENABLE_EDITING).Get(out temp);
1057 SetProperty(TextEditor.Property.ENABLE_EDITING, new PropertyValue(value));
1058 NotifyPropertyChanged();
1063 /// The Placeholder property.
1064 /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1067 /// The following example demonstrates how to set the placeholder property.
1069 /// PropertyMap propertyMap = new PropertyMap();
1070 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1071 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1072 /// propertyMap.Add("color", new PropertyValue(Color.Red));
1073 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1074 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1076 /// PropertyMap fontStyleMap = new PropertyMap();
1077 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1078 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1079 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1080 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1082 /// TextEditor editor = new TextEditor();
1083 /// editor.Placeholder = propertyMap;
1086 /// <since_tizen> 3 </since_tizen>
1087 public Tizen.NUI.PropertyMap Placeholder
1091 return (PropertyMap)GetValue(PlaceholderProperty);
1095 SetValue(PlaceholderProperty, value);
1096 NotifyPropertyChanged();
1101 /// The LineWrapMode property.<br />
1102 /// The line wrap mode when the text lines over the layout width.<br />
1104 /// <since_tizen> 4 </since_tizen>
1105 public LineWrapMode LineWrapMode
1109 return (LineWrapMode)GetValue(LineWrapModeProperty);
1113 SetValue(LineWrapModeProperty, value);
1114 NotifyPropertyChanged();
1119 /// Enables Text selection using Shift key.
1121 /// <since_tizen> 5 </since_tizen>
1122 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1123 [EditorBrowsable(EditorBrowsableState.Never)]
1124 public bool EnableShiftSelection
1128 return (bool)GetValue(EnableShiftSelectionProperty);
1132 SetValue(EnableShiftSelectionProperty, value);
1133 NotifyPropertyChanged();
1138 /// The text alignment to match the direction of the system language.
1140 /// <since_tizen> 6 </since_tizen>
1141 public bool MatchSystemLanguageDirection
1145 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1149 SetValue(MatchSystemLanguageDirectionProperty, value);
1150 NotifyPropertyChanged();
1155 /// The MaxLength property.
1157 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1158 [EditorBrowsable(EditorBrowsableState.Never)]
1159 public int MaxLength
1163 return (int)GetValue(MaxLengthProperty);
1167 SetValue(MaxLengthProperty, value);
1168 NotifyPropertyChanged();
1172 /// Only used by the IL of xaml, will never changed to not hidden.
1173 [EditorBrowsable(EditorBrowsableState.Never)]
1174 public override bool IsCreateByXaml
1178 return base.IsCreateByXaml;
1182 base.IsCreateByXaml = value;
1186 this.TextChanged += (obj, e) =>
1188 this.Text = this.Text;
1195 /// Get the InputMethodContext instance.
1197 /// <returns>The InputMethodContext instance.</returns>
1198 /// <since_tizen> 5 </since_tizen>
1199 public InputMethodContext GetInputMethodContext()
1201 if (inputMethodContext == null)
1203 /*Avoid raising InputMethodContext reference count.*/
1204 inputMethodContext = new InputMethodContext(Interop.TextEditor.TextEditor_GetInputMethodContext(swigCPtr), true);
1205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1207 return inputMethodContext;
1211 /// Select the whole text.
1213 [EditorBrowsable(EditorBrowsableState.Never)]
1214 public void SelectWholeText()
1216 Interop.TextEditor.TextEditor_SelectWholeText(swigCPtr);
1217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1221 /// Clear selection of the text.
1223 [EditorBrowsable(EditorBrowsableState.Never)]
1224 public void SelectNone()
1226 Interop.TextEditor.TextEditor_SelectNone(swigCPtr);
1227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1230 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
1232 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1235 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
1237 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.TextEditor_InputStyleChangedSignal(swigCPtr), false);
1238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1245 /// <since_tizen> 3 </since_tizen>
1246 protected override void Dispose(DisposeTypes type)
1253 if (systemlangTextFlag)
1255 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
1258 //Release your own unmanaged resources here.
1259 //You should not access any managed member here except static instance.
1260 //because the execution order of Finalizes is non-deterministic.
1264 if (_textEditorTextChangedCallbackDelegate != null)
1266 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
1269 if (_textEditorMaxLengthReachedCallbackDelegate != null)
1271 this.MaxLengthReachedSignal().Disconnect(_textEditorMaxLengthReachedCallbackDelegate);
1278 /// This will not be public opened.
1279 [EditorBrowsable(EditorBrowsableState.Never)]
1280 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1282 // In order to speed up IME hide, temporarily add
1283 GetInputMethodContext()?.DestroyContext();
1284 Interop.TextEditor.delete_TextEditor(swigCPtr);
1287 private string SetTranslatable(string textEditorSid)
1289 string translatableText = null;
1290 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1291 if (translatableText != null)
1293 if (systemlangTextFlag == false)
1295 SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
1296 systemlangTextFlag = true;
1298 return translatableText;
1302 translatableText = "";
1303 return translatableText;
1307 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1309 if (textEditorTextSid != null)
1311 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1313 if (textEditorPlaceHolderTextSid != null)
1315 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1319 internal new class Property
1321 internal static readonly int TEXT = Interop.TextEditor.TextEditor_Property_TEXT_get();
1322 internal static readonly int TEXT_COLOR = Interop.TextEditor.TextEditor_Property_TEXT_COLOR_get();
1323 internal static readonly int FONT_FAMILY = Interop.TextEditor.TextEditor_Property_FONT_FAMILY_get();
1324 internal static readonly int FONT_STYLE = Interop.TextEditor.TextEditor_Property_FONT_STYLE_get();
1325 internal static readonly int POINT_SIZE = Interop.TextEditor.TextEditor_Property_POINT_SIZE_get();
1326 internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextEditor.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
1327 internal static readonly int SCROLL_THRESHOLD = Interop.TextEditor.TextEditor_Property_SCROLL_THRESHOLD_get();
1328 internal static readonly int SCROLL_SPEED = Interop.TextEditor.TextEditor_Property_SCROLL_SPEED_get();
1329 internal static readonly int PRIMARY_CURSOR_COLOR = Interop.TextEditor.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
1330 internal static readonly int SECONDARY_CURSOR_COLOR = Interop.TextEditor.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
1331 internal static readonly int ENABLE_CURSOR_BLINK = Interop.TextEditor.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
1332 internal static readonly int CURSOR_BLINK_INTERVAL = Interop.TextEditor.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
1333 internal static readonly int CURSOR_BLINK_DURATION = Interop.TextEditor.TextEditor_Property_CURSOR_BLINK_DURATION_get();
1334 internal static readonly int CURSOR_WIDTH = Interop.TextEditor.TextEditor_Property_CURSOR_WIDTH_get();
1335 internal static readonly int GRAB_HANDLE_IMAGE = Interop.TextEditor.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
1336 internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = Interop.TextEditor.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
1337 internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
1338 internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
1339 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
1340 internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
1341 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
1342 internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
1343 internal static readonly int SELECTION_HIGHLIGHT_COLOR = Interop.TextEditor.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
1344 internal static readonly int DECORATION_BOUNDING_BOX = Interop.TextEditor.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
1345 internal static readonly int ENABLE_MARKUP = Interop.TextEditor.TextEditor_Property_ENABLE_MARKUP_get();
1346 internal static readonly int INPUT_COLOR = Interop.TextEditor.TextEditor_Property_INPUT_COLOR_get();
1347 internal static readonly int INPUT_FONT_FAMILY = Interop.TextEditor.TextEditor_Property_INPUT_FONT_FAMILY_get();
1348 internal static readonly int INPUT_FONT_STYLE = Interop.TextEditor.TextEditor_Property_INPUT_FONT_STYLE_get();
1349 internal static readonly int INPUT_POINT_SIZE = Interop.TextEditor.TextEditor_Property_INPUT_POINT_SIZE_get();
1350 internal static readonly int LINE_SPACING = Interop.TextEditor.TextEditor_Property_LINE_SPACING_get();
1351 internal static readonly int INPUT_LINE_SPACING = Interop.TextEditor.TextEditor_Property_INPUT_LINE_SPACING_get();
1352 internal static readonly int UNDERLINE = Interop.TextEditor.TextEditor_Property_UNDERLINE_get();
1353 internal static readonly int INPUT_UNDERLINE = Interop.TextEditor.TextEditor_Property_INPUT_UNDERLINE_get();
1354 internal static readonly int SHADOW = Interop.TextEditor.TextEditor_Property_SHADOW_get();
1355 internal static readonly int INPUT_SHADOW = Interop.TextEditor.TextEditor_Property_INPUT_SHADOW_get();
1356 internal static readonly int EMBOSS = Interop.TextEditor.TextEditor_Property_EMBOSS_get();
1357 internal static readonly int INPUT_EMBOSS = Interop.TextEditor.TextEditor_Property_INPUT_EMBOSS_get();
1358 internal static readonly int OUTLINE = Interop.TextEditor.TextEditor_Property_OUTLINE_get();
1359 internal static readonly int INPUT_OUTLINE = Interop.TextEditor.TextEditor_Property_INPUT_OUTLINE_get();
1360 internal static readonly int SMOOTH_SCROLL = Interop.TextEditor.TextEditor_Property_SMOOTH_SCROLL_get();
1361 internal static readonly int SMOOTH_SCROLL_DURATION = Interop.TextEditor.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
1362 internal static readonly int ENABLE_SCROLL_BAR = Interop.TextEditor.TextEditor_Property_ENABLE_SCROLL_BAR_get();
1363 internal static readonly int SCROLL_BAR_SHOW_DURATION = Interop.TextEditor.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
1364 internal static readonly int SCROLL_BAR_FADE_DURATION = Interop.TextEditor.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
1365 internal static readonly int PIXEL_SIZE = Interop.TextEditor.TextEditor_Property_PIXEL_SIZE_get();
1366 internal static readonly int LINE_COUNT = Interop.TextEditor.TextEditor_Property_LINE_COUNT_get();
1367 internal static readonly int ENABLE_SELECTION = Interop.TextEditor.TextEditor_Property_ENABLE_SELECTION_get();
1368 internal static readonly int PLACEHOLDER = Interop.TextEditor.TextEditor_Property_PLACEHOLDER_get();
1369 internal static readonly int LINE_WRAP_MODE = Interop.TextEditor.TextEditor_Property_LINE_WRAP_MODE_get();
1370 internal static readonly int PLACEHOLDER_TEXT = Interop.TextEditor.TextEditor_Property_PLACEHOLDER_TEXT_get();
1371 internal static readonly int PLACEHOLDER_TEXT_COLOR = Interop.TextEditor.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
1372 internal static readonly int ENABLE_SHIFT_SELECTION = Interop.TextEditor.TextEditor_Property_ENABLE_SHIFT_SELECTION_get();
1373 internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextEditor.TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1374 internal static readonly int MAX_LENGTH = Interop.TextEditor.TextEditor_Property_MAX_LENGTH_get();
1375 internal static readonly int SELECTED_TEXT_START = Interop.TextEditor.TextEditor_Property_SELECTED_TEXT_START_get();
1376 internal static readonly int SELECTED_TEXT_END = Interop.TextEditor.TextEditor_Property_SELECTED_TEXT_END_get();
1377 internal static readonly int ENABLE_EDITING = Interop.TextEditor.TextEditor_Property_ENABLE_EDITING_get();
1378 internal static readonly int SELECTED_TEXT = Interop.TextEditor.TextEditor_Property_SELECTED_TEXT_get();
1381 internal class InputStyle
1387 FontFamily = 0x0002,
1390 LineSpacing = 0x0010,
1398 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
1400 DecorationBoundingBox = new Rectangle(x, y, width, height);
1402 private void OnInputColorChanged(float x, float y, float z, float w)
1404 InputColor = new Vector4(x, y, z, w);
1406 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
1408 PlaceholderTextColor = new Color(r, g, b, a);
1410 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
1412 PrimaryCursorColor = new Vector4(x, y, z, w);
1414 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
1416 SecondaryCursorColor = new Vector4(x, y, z, w);
1418 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
1420 SelectionHighlightColor = new Vector4(x, y, z, w);
1422 private void OnTextColorChanged(float x, float y, float z, float w)
1424 TextColor = new Vector4(x, y, z, w);