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 static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextEditor";
36 static private string defaultFontFamily = "TizenSans";
37 private static SystemFontTypeChanged systemFontTypeChanged = new SystemFontTypeChanged();
38 private static SystemLocaleLanguageChanged systemLocaleLanguageChanged = new SystemLocaleLanguageChanged();
39 private string textEditorTextSid = null;
40 private string textEditorPlaceHolderTextSid = null;
41 private InputMethodContext inputMethodContext = null;
42 private string fontFamily = defaultFontFamily;
43 private float fontSizeScale = 1.0f;
44 private bool hasSystemLanguageChanged = false;
45 private bool hasSystemFontSizeChanged = false;
46 private bool hasSystemFontTypeChanged = false;
47 private bool isSettingTextInCSharp = false;
49 private Color internalPlaceholderTextColor = null;
50 private Vector4 internalPrimaryCursorColor = null;
51 private Vector4 internalSecondaryCursorColor = null;
52 private Vector4 internalSelectionHighlightColor = null;
53 private Vector4 internalInputColor = null;
54 private Vector4 internalTextColor = null;
55 private Color internalGrabHandleColor = null;
60 if(NUIApplication.IsUsingXaml)
62 TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalTextProperty, defaultValueCreator: GetInternalTextProperty);
64 TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: SetInternalTextColorProperty, defaultValueCreator: GetInternalTextColorProperty);
66 FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalFontFamilyProperty, defaultValueCreator: GetInternalFontFamilyProperty);
68 FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalFontStyleProperty, defaultValueCreator: GetInternalFontStyleProperty);
70 PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalPointSizeProperty, defaultValueCreator: GetInternalPointSizeProperty);
72 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextEditor), HorizontalAlignment.Begin, propertyChanged: SetInternalHorizontalAlignmentProperty, defaultValueCreator: GetInternalHorizontalAlignmentProperty);
74 VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment), typeof(TextEditor), VerticalAlignment.Bottom, propertyChanged: SetInternalVerticalAlignmentProperty, defaultValueCreator: GetInternalVerticalAlignmentProperty);
76 ScrollThresholdProperty = BindableProperty.Create(nameof(ScrollThreshold), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalScrollThresholdProperty, defaultValueCreator: GetInternalScrollThresholdProperty);
78 ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalScrollSpeedProperty, defaultValueCreator: GetInternalScrollSpeedProperty);
80 PrimaryCursorColorProperty = BindableProperty.Create(nameof(PrimaryCursorColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: SetInternalPrimaryCursorColorProperty, defaultValueCreator: GetInternalPrimaryCursorColorProperty);
82 SecondaryCursorColorProperty = BindableProperty.Create(nameof(SecondaryCursorColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: SetInternalSecondaryCursorColorProperty, defaultValueCreator: GetInternalSecondaryCursorColorProperty);
84 EnableCursorBlinkProperty = BindableProperty.Create(nameof(EnableCursorBlink), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalEnableCursorBlinkProperty, defaultValueCreator: GetInternalEnableCursorBlinkProperty);
86 CursorBlinkIntervalProperty = BindableProperty.Create(nameof(CursorBlinkInterval), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalCursorBlinkIntervalProperty, defaultValueCreator: GetInternalCursorBlinkIntervalProperty);
88 CursorBlinkDurationProperty = BindableProperty.Create(nameof(CursorBlinkDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalCursorBlinkDurationProperty, defaultValueCreator: GetInternalCursorBlinkDurationProperty);
90 CursorWidthProperty = BindableProperty.Create(nameof(CursorWidth), typeof(int), typeof(TextEditor), default(int), propertyChanged: SetInternalCursorWidthProperty, defaultValueCreator: GetInternalCursorWidthProperty);
92 GrabHandleImageProperty = BindableProperty.Create(nameof(GrabHandleImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalGrabHandleImageProperty, defaultValueCreator: GetInternalGrabHandleImageProperty);
94 GrabHandlePressedImageProperty = BindableProperty.Create(nameof(GrabHandlePressedImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalGrabHandlePressedImageProperty, defaultValueCreator: GetInternalGrabHandlePressedImageProperty);
96 SelectionPopupStyleProperty = BindableProperty.Create(nameof(SelectionPopupStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionPopupStyleProperty, defaultValueCreator: GetInternalSelectionPopupStyleProperty);
98 SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHandleImageLeftProperty, defaultValueCreator: GetInternalSelectionHandleImageLeftProperty);
100 SelectionHandleImageRightProperty = BindableProperty.Create(nameof(SelectionHandleImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHandleImageRightProperty, defaultValueCreator: GetInternalSelectionHandleImageRightProperty);
102 SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHandlePressedImageLeftProperty, defaultValueCreator: GetInternalSelectionHandlePressedImageLeftProperty);
104 SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHandlePressedImageRightProperty, defaultValueCreator: GetInternalSelectionHandlePressedImageRightProperty);
106 SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHandleMarkerImageLeftProperty, defaultValueCreator: GetInternalSelectionHandleMarkerImageLeftProperty);
108 SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHandleMarkerImageRightProperty, defaultValueCreator: GetInternalSelectionHandleMarkerImageRightProperty);
110 SelectionHighlightColorProperty = BindableProperty.Create(nameof(SelectionHighlightColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: SetInternalSelectionHighlightColorProperty, defaultValueCreator: GetInternalSelectionHighlightColorProperty);
112 DecorationBoundingBoxProperty = BindableProperty.Create(nameof(DecorationBoundingBox), typeof(Rectangle), typeof(TextEditor), null, propertyChanged: SetInternalDecorationBoundingBoxProperty, defaultValueCreator: GetInternalDecorationBoundingBoxProperty);
114 EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalEnableMarkupProperty, defaultValueCreator: GetInternalEnableMarkupProperty);
116 InputColorProperty = BindableProperty.Create(nameof(InputColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: SetInternalInputColorProperty, defaultValueCreator: GetInternalInputColorProperty);
118 InputFontFamilyProperty = BindableProperty.Create(nameof(InputFontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalInputFontFamilyProperty, defaultValueCreator: GetInternalInputFontFamilyProperty);
120 InputFontStyleProperty = BindableProperty.Create(nameof(InputFontStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalInputFontStyleProperty, defaultValueCreator: GetInternalInputFontStyleProperty);
122 InputPointSizeProperty = BindableProperty.Create(nameof(InputPointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalInputPointSizeProperty, defaultValueCreator: GetInternalInputPointSizeProperty);
124 LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalLineSpacingProperty, defaultValueCreator: GetInternalLineSpacingProperty);
126 InputLineSpacingProperty = BindableProperty.Create(nameof(InputLineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalInputLineSpacingProperty, defaultValueCreator: GetInternalInputLineSpacingProperty);
128 RelativeLineHeightProperty = BindableProperty.Create(nameof(RelativeLineHeight), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalRelativeLineHeightProperty, defaultValueCreator: GetInternalRelativeLineHeightProperty);
130 UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalUnderlineProperty, defaultValueCreator: GetInternalUnderlineProperty);
132 InputUnderlineProperty = BindableProperty.Create(nameof(InputUnderline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalInputUnderlineProperty, defaultValueCreator: GetInternalInputUnderlineProperty);
134 ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalShadowProperty, defaultValueCreator: GetInternalShadowProperty);
136 InputShadowProperty = BindableProperty.Create(nameof(InputShadow), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalInputShadowProperty, defaultValueCreator: GetInternalInputShadowProperty);
138 EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalEmbossProperty, defaultValueCreator: GetInternalEmbossProperty);
140 InputEmbossProperty = BindableProperty.Create(nameof(InputEmboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalInputEmbossProperty, defaultValueCreator: GetInternalInputEmbossProperty);
142 OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalOutlineProperty, defaultValueCreator: GetInternalOutlineProperty);
144 InputOutlineProperty = BindableProperty.Create(nameof(InputOutline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalInputOutlineProperty, defaultValueCreator: GetInternalInputOutlineProperty);
146 SmoothScrollProperty = BindableProperty.Create(nameof(SmoothScroll), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalSmoothScrollProperty, defaultValueCreator: GetInternalSmoothScrollProperty);
148 SmoothScrollDurationProperty = BindableProperty.Create(nameof(SmoothScrollDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalSmoothScrollDurationProperty, defaultValueCreator: GetInternalSmoothScrollDurationProperty);
150 EnableScrollBarProperty = BindableProperty.Create(nameof(EnableScrollBar), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalEnableScrollBarProperty, defaultValueCreator: GetInternalEnableScrollBarProperty);
152 ScrollBarShowDurationProperty = BindableProperty.Create(nameof(ScrollBarShowDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalScrollBarShowDurationProperty, defaultValueCreator: GetInternalScrollBarShowDurationProperty);
154 ScrollBarFadeDurationProperty = BindableProperty.Create(nameof(ScrollBarFadeDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalScrollBarFadeDurationProperty, defaultValueCreator: GetInternalScrollBarFadeDurationProperty);
156 PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalPixelSizeProperty, defaultValueCreator: GetInternalPixelSizeProperty);
158 PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalPlaceholderTextProperty, defaultValueCreator: GetInternalPlaceholderTextProperty);
160 PlaceholderTextColorProperty = BindableProperty.Create(nameof(PlaceholderTextColor), typeof(Color), typeof(TextEditor), null, propertyChanged: SetInternalPlaceholderTextColorProperty, defaultValueCreator: GetInternalPlaceholderTextColorProperty);
162 EnableSelectionProperty = BindableProperty.Create(nameof(EnableSelection), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalEnableSelectionProperty, defaultValueCreator: GetInternalEnableSelectionProperty);
164 PlaceholderProperty = BindableProperty.Create(nameof(Placeholder), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalPlaceholderProperty, defaultValueCreator: GetInternalPlaceholderProperty);
166 LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextEditor), LineWrapMode.Word, propertyChanged: SetInternalLineWrapModeProperty, defaultValueCreator: GetInternalLineWrapModeProperty);
168 EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextEditor.EnableShiftSelection), typeof(bool), typeof(TextEditor), true, propertyChanged: SetInternalEnableShiftSelectionProperty, defaultValueCreator: GetInternalEnableShiftSelectionProperty);
170 MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextEditor.MatchSystemLanguageDirection), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalMatchSystemLanguageDirectionProperty, defaultValueCreator: GetInternalMatchSystemLanguageDirectionProperty);
172 MaxLengthProperty = BindableProperty.Create(nameof(MaxLength), typeof(int), typeof(TextEditor), default(int), propertyChanged: SetInternalMaxLengthProperty, defaultValueCreator: GetInternalMaxLengthProperty);
174 FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalFontSizeScaleProperty, defaultValueCreator: GetInternalFontSizeScaleProperty);
176 EnableFontSizeScaleProperty = BindableProperty.Create(nameof(EnableFontSizeScale), typeof(bool), typeof(TextEditor), default(bool), propertyChanged: SetInternalEnableFontSizeScaleProperty, defaultValueCreator: GetInternalEnableFontSizeScaleProperty);
178 GrabHandleColorProperty = BindableProperty.Create(nameof(GrabHandleColor), typeof(Color), typeof(TextEditor), null, propertyChanged: SetInternalGrabHandleColorProperty, defaultValueCreator: GetInternalGrabHandleColorProperty);
180 EnableGrabHandleProperty = BindableProperty.Create(nameof(TextEditor.EnableGrabHandle), typeof(bool), typeof(TextEditor), true, propertyChanged: SetInternalEnableGrabHandleProperty, defaultValueCreator: GetInternalEnableGrabHandleProperty);
182 EnableGrabHandlePopupProperty = BindableProperty.Create(nameof(TextEditor.EnableGrabHandlePopup), typeof(bool), typeof(TextEditor), true, propertyChanged: SetInternalEnableGrabHandlePopupProperty, defaultValueCreator: GetInternalEnableGrabHandlePopupProperty);
184 InputMethodSettingsProperty = BindableProperty.Create(nameof(TextEditor.InputMethodSettings), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: SetInternalInputMethodSettingsProperty, defaultValueCreator: GetInternalInputMethodSettingsProperty);
186 EllipsisProperty = BindableProperty.Create(nameof(TextEditor.Ellipsis), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalEllipsisProperty, defaultValueCreator: GetInternalEllipsisProperty);
188 EllipsisPositionProperty = BindableProperty.Create(nameof(EllipsisPosition), typeof(EllipsisPosition), typeof(TextEditor), EllipsisPosition.End, propertyChanged: SetInternalEllipsisPositionProperty, defaultValueCreator: GetInternalEllipsisPositionProperty);
190 MinLineSizeProperty = BindableProperty.Create(nameof(MinLineSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalMinLineSizeProperty, defaultValueCreator: GetInternalMinLineSizeProperty);
192 TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(Tizen.NUI.BaseComponents.TextEditor), string.Empty, propertyChanged: SetInternalTranslatableTextProperty, defaultValueCreator: GetInternalTranslatableTextProperty);
194 TranslatablePlaceholderTextProperty = BindableProperty.Create(nameof(TranslatablePlaceholderText), typeof(string), typeof(Tizen.NUI.BaseComponents.TextEditor), string.Empty, propertyChanged: SetInternalTranslatablePlaceholderTextProperty, defaultValueCreator: GetInternalTranslatablePlaceholderTextProperty);
196 EnableEditingProperty = BindableProperty.Create(nameof(EnableEditing), typeof(bool), typeof(Tizen.NUI.BaseComponents.TextEditor), false, propertyChanged: SetInternalEnableEditingProperty, defaultValueCreator: GetInternalEnableEditingProperty);
198 HorizontalScrollPositionProperty = BindableProperty.Create(nameof(HorizontalScrollPosition), typeof(int), typeof(Tizen.NUI.BaseComponents.TextEditor), 0, propertyChanged: SetInternalHorizontalScrollPositionProperty, defaultValueCreator: GetInternalHorizontalScrollPositionProperty);
200 VerticalScrollPositionProperty = BindableProperty.Create(nameof(VerticalScrollPosition), typeof(int), typeof(Tizen.NUI.BaseComponents.TextEditor), 0, propertyChanged: SetInternalVerticalScrollPositionProperty, defaultValueCreator: GetInternalVerticalScrollPositionProperty);
202 PrimaryCursorPositionProperty = BindableProperty.Create(nameof(PrimaryCursorPosition), typeof(int), typeof(Tizen.NUI.BaseComponents.TextEditor), 0, propertyChanged: SetInternalPrimaryCursorPositionProperty, defaultValueCreator: GetInternalPrimaryCursorPositionProperty);
204 CharacterSpacingProperty = BindableProperty.Create(nameof(CharacterSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalCharacterSpacingProperty, defaultValueCreator: GetInternalCharacterSpacingProperty);
208 static internal new void Preload()
210 // Do not call View.Preload(), since we already call it
213 // Do nothing. Just call for load static values.
217 /// Creates the TextEditor control.
219 /// <since_tizen> 3 </since_tizen>
220 public TextEditor() : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// Creates the TextEditor with specified style.
228 [EditorBrowsable(EditorBrowsableState.Never)]
229 public TextEditor(TextEditorStyle style) : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, style: style)
234 /// Creates the TextEditor with setting the status of shown or hidden.
236 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
237 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
238 [EditorBrowsable(EditorBrowsableState.Never)]
239 public TextEditor(bool shown) : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
252 TextChanged += TextEditorTextChanged;
255 private bool HasStyle()
257 return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
261 /// The TranslatableText property.<br />
262 /// The text can set the SID value.<br />
264 /// <exception cref='ArgumentNullException'>
265 /// ResourceManager about multilingual is null.
267 /// <since_tizen> 4 </since_tizen>
268 public string TranslatableText
272 if (NUIApplication.IsUsingXaml)
274 return GetValue(TranslatableTextProperty) as string;
278 return GetInternalTranslatableTextProperty(this) as string;
283 if (NUIApplication.IsUsingXaml)
285 SetValue(TranslatableTextProperty, value);
289 SetInternalTranslatableTextProperty(this, null, value);
294 private string InternalTranslatableText
298 return textEditorTextSid;
302 if (NUIApplication.MultilingualResourceManager == null)
304 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
306 textEditorTextSid = value;
307 Text = SetTranslatable(textEditorTextSid);
308 NotifyPropertyChanged();
312 /// The TranslatablePlaceholderText property.<br />
313 /// The text can set the SID value.<br />
315 /// <exception cref='ArgumentNullException'>
316 /// ResourceManager about multilingual is null.
318 /// <since_tizen> 4 </since_tizen>
319 public string TranslatablePlaceholderText
323 if (NUIApplication.IsUsingXaml)
325 return GetValue(TranslatablePlaceholderTextProperty) as string;
329 return GetInternalTranslatablePlaceholderTextProperty(this) as string;
334 if (NUIApplication.IsUsingXaml)
336 SetValue(TranslatablePlaceholderTextProperty, value);
340 SetInternalTranslatablePlaceholderTextProperty(this, null, value);
345 private string InternalTranslatablePlaceholderText
349 return textEditorPlaceHolderTextSid;
353 if (NUIApplication.MultilingualResourceManager == null)
355 throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
357 textEditorPlaceHolderTextSid = value;
358 PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
359 NotifyPropertyChanged();
364 /// The Text property.<br />
365 /// The text to display in the UTF-8 format.<br />
367 /// <since_tizen> 3 </since_tizen>
372 if (NUIApplication.IsUsingXaml)
374 return (string)GetValue(TextProperty);
378 return (string)GetInternalTextProperty(this);
383 if (NUIApplication.IsUsingXaml)
385 SetValue(TextProperty, value);
389 SetInternalTextProperty(this, null, value);
391 NotifyPropertyChanged();
396 /// The TextColor property.<br />
397 /// The color of the text.<br />
400 /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
402 /// <since_tizen> 3 </since_tizen>
403 public Vector4 TextColor
408 if (NUIApplication.IsUsingXaml)
410 temp = (Vector4)GetValue(TextColorProperty);
414 temp = (Vector4)GetInternalTextColorProperty(this);
416 return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
420 if (NUIApplication.IsUsingXaml)
422 SetValue(TextColorProperty, value);
426 SetInternalTextColorProperty(this, null, value);
428 NotifyPropertyChanged();
433 /// The FontFamily property.<br />
434 /// The requested font family to use.<br />
436 /// <since_tizen> 3 </since_tizen>
437 public string FontFamily
441 if (NUIApplication.IsUsingXaml)
443 return (string)GetValue(FontFamilyProperty);
447 return (string)GetInternalFontFamilyProperty(this);
452 if (NUIApplication.IsUsingXaml)
454 SetValue(FontFamilyProperty, value);
458 SetInternalFontFamilyProperty(this, null, value);
460 NotifyPropertyChanged();
464 private string InternalFontFamily
471 return Object.InternalGetPropertyString(this.SwigCPtr, TextEditor.Property.FontFamily);
475 string newFontFamily;
477 if (string.Equals(fontFamily, value)) return;
480 if (fontFamily == Tizen.NUI.FontFamily.UseSystemSetting)
484 newFontFamily = SystemSettings.FontType;
488 Console.WriteLine("{0} Exception caught.", e);
489 newFontFamily = defaultFontFamily;
491 AddSystemSettingsFontTypeChanged();
495 newFontFamily = fontFamily;
496 RemoveSystemSettingsFontTypeChanged();
499 SetInternalFontFamily(newFontFamily);
503 private void SetInternalFontFamily(string fontFamily)
505 Object.InternalSetPropertyString(this.SwigCPtr, TextEditor.Property.FontFamily, (string)fontFamily);
509 /// The FontStyle property.<br />
510 /// The requested font style to use.<br />
511 /// The fontStyle map contains the following keys :<br />
512 /// <list type="table">
513 /// <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>
514 /// <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>
515 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
518 /// <since_tizen> 3 </since_tizen>
519 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
520 public PropertyMap FontStyle
524 if (NUIApplication.IsUsingXaml)
526 return (PropertyMap)GetValue(FontStyleProperty);
530 return (PropertyMap)GetInternalFontStyleProperty(this);
535 if (NUIApplication.IsUsingXaml)
537 SetValue(FontStyleProperty, value);
541 SetInternalFontStyleProperty(this, null, value);
543 NotifyPropertyChanged();
548 /// Set FontStyle to TextEditor. <br />
550 /// <param name="fontStyle">The FontStyle</param>
552 /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
555 /// The following example demonstrates how to use the SetFontStyle method.
557 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
558 /// fontStyle.Width = FontWidthType.Expanded;
559 /// fontStyle.Weight = FontWeightType.Bold;
560 /// fontStyle.Slant = FontSlantType.Italic;
561 /// editor.SetFontStyle(fontStyle);
564 [EditorBrowsable(EditorBrowsableState.Never)]
565 public void SetFontStyle(FontStyle fontStyle)
567 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
569 SetValue(FontStyleProperty, fontStyleMap);
574 /// Get FontStyle from TextEditor. <br />
576 /// <returns>The FontStyle</returns>
578 /// <see cref="Tizen.NUI.Text.FontStyle"/>
580 [EditorBrowsable(EditorBrowsableState.Never)]
581 public FontStyle GetFontStyle()
584 using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty))
586 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
592 /// The PointSize property.<br />
593 /// The size of font in points.<br />
595 /// <since_tizen> 3 </since_tizen>
596 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
597 public float PointSize
601 if (NUIApplication.IsUsingXaml)
603 return (float)GetValue(PointSizeProperty);
607 return (float)GetInternalPointSizeProperty(this);
612 if (NUIApplication.IsUsingXaml)
614 SetValue(PointSizeProperty, value);
618 SetInternalPointSizeProperty(this, null, value);
620 NotifyPropertyChanged();
625 /// The HorizontalAlignment property.<br />
626 /// The line horizontal alignment.<br />
628 /// <since_tizen> 3 </since_tizen>
629 public HorizontalAlignment HorizontalAlignment
633 if (NUIApplication.IsUsingXaml)
635 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
639 return (HorizontalAlignment)GetInternalHorizontalAlignmentProperty(this);
644 if (NUIApplication.IsUsingXaml)
646 SetValue(HorizontalAlignmentProperty, value);
650 SetInternalHorizontalAlignmentProperty(this, null, value);
652 NotifyPropertyChanged();
657 /// The VerticalAlignment property.<br />
658 /// The line vertical alignment.
660 [EditorBrowsable(EditorBrowsableState.Never)]
661 public VerticalAlignment VerticalAlignment
665 if (NUIApplication.IsUsingXaml)
667 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
671 return (VerticalAlignment)GetInternalVerticalAlignmentProperty(this);
676 if (NUIApplication.IsUsingXaml)
678 SetValue(VerticalAlignmentProperty, value);
682 SetInternalVerticalAlignmentProperty(this, null, value);
684 NotifyPropertyChanged();
689 /// The ScrollThreshold property.<br />
690 /// Horizontal scrolling will occur if the cursor is this close to the control border.<br />
692 /// <since_tizen> 3 </since_tizen>
693 public float ScrollThreshold
697 if (NUIApplication.IsUsingXaml)
699 return (float)GetValue(ScrollThresholdProperty);
703 return (float)GetInternalScrollThresholdProperty(this);
708 if (NUIApplication.IsUsingXaml)
710 SetValue(ScrollThresholdProperty, value);
714 SetInternalScrollThresholdProperty(this, null, value);
716 NotifyPropertyChanged();
721 /// The ScrollSpeed property.<br />
722 /// The scroll speed in pixels per second.<br />
724 /// <since_tizen> 3 </since_tizen>
725 public float ScrollSpeed
729 if (NUIApplication.IsUsingXaml)
731 return (float)GetValue(ScrollSpeedProperty);
735 return (float)GetInternalScrollSpeedProperty(this);
740 if (NUIApplication.IsUsingXaml)
742 SetValue(ScrollSpeedProperty, value);
746 SetInternalScrollSpeedProperty(this, null, value);
748 NotifyPropertyChanged();
753 /// The PrimaryCursorColor property.<br />
754 /// The color to apply to the primary cursor.<br />
757 /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
759 /// <since_tizen> 3 </since_tizen>
760 public Vector4 PrimaryCursorColor
765 if (NUIApplication.IsUsingXaml)
767 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
771 temp = (Vector4)GetInternalPrimaryCursorColorProperty(this);
773 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
777 if (NUIApplication.IsUsingXaml)
779 SetValue(PrimaryCursorColorProperty, value);
783 SetInternalPrimaryCursorColorProperty(this, null, value);
785 NotifyPropertyChanged();
790 /// The SecondaryCursorColor property.<br />
791 /// The color to apply to the secondary cursor.<br />
794 /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
796 /// <since_tizen> 3 </since_tizen>
797 public Vector4 SecondaryCursorColor
802 if (NUIApplication.IsUsingXaml)
804 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
808 temp = (Vector4)GetInternalSecondaryCursorColorProperty(this);
810 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
814 if (NUIApplication.IsUsingXaml)
816 SetValue(SecondaryCursorColorProperty, value);
820 SetInternalSecondaryCursorColorProperty(this, null, value);
822 NotifyPropertyChanged();
827 /// The EnableCursorBlink property.<br />
828 /// Whether the cursor should blink or not.<br />
830 /// <since_tizen> 3 </since_tizen>
831 public bool EnableCursorBlink
835 if (NUIApplication.IsUsingXaml)
837 return (bool)GetValue(EnableCursorBlinkProperty);
841 return (bool)GetInternalEnableCursorBlinkProperty(this);
846 if (NUIApplication.IsUsingXaml)
848 SetValue(EnableCursorBlinkProperty, value);
852 SetInternalEnableCursorBlinkProperty(this, null, value);
854 NotifyPropertyChanged();
859 /// The CursorBlinkInterval property.<br />
860 /// The time interval in seconds between cursor on/off states.<br />
862 /// <since_tizen> 3 </since_tizen>
863 public float CursorBlinkInterval
867 if (NUIApplication.IsUsingXaml)
869 return (float)GetValue(CursorBlinkIntervalProperty);
873 return (float)GetInternalCursorBlinkIntervalProperty(this);
878 if (NUIApplication.IsUsingXaml)
880 SetValue(CursorBlinkIntervalProperty, value);
884 SetInternalCursorBlinkIntervalProperty(this, null, value);
886 NotifyPropertyChanged();
891 /// The CursorBlinkDuration property.<br />
892 /// The cursor will stop blinking after this number of seconds (if non-zero).<br />
894 /// <since_tizen> 3 </since_tizen>
895 public float CursorBlinkDuration
899 if (NUIApplication.IsUsingXaml)
901 return (float)GetValue(CursorBlinkDurationProperty);
905 return (float)GetInternalCursorBlinkDurationProperty(this);
910 if (NUIApplication.IsUsingXaml)
912 SetValue(CursorBlinkDurationProperty, value);
916 SetInternalCursorBlinkDurationProperty(this, null, value);
918 NotifyPropertyChanged();
923 /// The CursorWidth property.
925 /// <since_tizen> 3 </since_tizen>
926 public int CursorWidth
930 if (NUIApplication.IsUsingXaml)
932 return (int)GetValue(CursorWidthProperty);
936 return (int)GetInternalCursorWidthProperty(this);
941 if (NUIApplication.IsUsingXaml)
943 SetValue(CursorWidthProperty, value);
947 SetInternalCursorWidthProperty(this, null, value);
949 NotifyPropertyChanged();
954 /// The GrabHandleImage property.<br />
955 /// The image to display for the grab handle.<br />
957 /// <since_tizen> 3 </since_tizen>
958 public string GrabHandleImage
962 if (NUIApplication.IsUsingXaml)
964 return (string)GetValue(GrabHandleImageProperty);
968 return (string)GetInternalGrabHandleImageProperty(this);
973 if (NUIApplication.IsUsingXaml)
975 SetValue(GrabHandleImageProperty, value);
979 SetInternalGrabHandleImageProperty(this, null, value);
981 NotifyPropertyChanged();
986 /// The GrabHandlePressedImage property.<br />
987 /// The image to display when the grab handle is pressed.<br />
989 /// <since_tizen> 3 </since_tizen>
990 public string GrabHandlePressedImage
994 if (NUIApplication.IsUsingXaml)
996 return (string)GetValue(GrabHandlePressedImageProperty);
1000 return (string)GetInternalGrabHandlePressedImageProperty(this);
1005 if (NUIApplication.IsUsingXaml)
1007 SetValue(GrabHandlePressedImageProperty, value);
1011 SetInternalGrabHandlePressedImageProperty(this, null, value);
1013 NotifyPropertyChanged();
1018 /// The SelectionPopupStyle property.<br />
1019 /// The style of the text selection popup can be set through SelectionPopupStyle property.
1021 [EditorBrowsable(EditorBrowsableState.Never)]
1022 public PropertyMap SelectionPopupStyle
1026 if (NUIApplication.IsUsingXaml)
1028 return (PropertyMap)GetValue(SelectionPopupStyleProperty);
1032 return (PropertyMap)GetInternalSelectionPopupStyleProperty(this);
1037 if (NUIApplication.IsUsingXaml)
1039 SetValue(SelectionPopupStyleProperty, value);
1043 SetInternalSelectionPopupStyleProperty(this, null, value);
1045 NotifyPropertyChanged();
1050 /// The SelectionHandleImageLeft property.<br />
1051 /// The image to display for the left selection handle.<br />
1052 /// The selectionHandleImageLeft map contains the following key :<br />
1053 /// <list type="table">
1054 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1057 /// <since_tizen> 3 </since_tizen>
1058 public PropertyMap SelectionHandleImageLeft
1062 if (NUIApplication.IsUsingXaml)
1064 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
1068 return (PropertyMap)GetInternalSelectionHandleImageLeftProperty(this);
1073 if (NUIApplication.IsUsingXaml)
1075 SetValue(SelectionHandleImageLeftProperty, value);
1079 SetInternalSelectionHandleImageLeftProperty(this, null, value);
1081 NotifyPropertyChanged();
1086 /// The SelectionHandleImageRight property.<br />
1087 /// The image to display for the right selection handle.<br />
1088 /// The selectionHandleImageRight map contains the following key :<br />
1089 /// <list type="table">
1090 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1093 /// <since_tizen> 3 </since_tizen>
1094 public PropertyMap SelectionHandleImageRight
1098 if (NUIApplication.IsUsingXaml)
1100 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
1105 return (PropertyMap)GetInternalSelectionHandleImageRightProperty(this);
1110 if (NUIApplication.IsUsingXaml)
1112 SetValue(SelectionHandleImageRightProperty, value);
1117 SetInternalSelectionHandleImageRightProperty(this, null, value);
1119 NotifyPropertyChanged();
1124 /// Set SelectionHandleImage to TextEditor. <br />
1126 /// <param name="selectionHandleImage">The SelectionHandleImage</param>
1128 /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
1131 /// The following example demonstrates how to use the SetSelectionHandleImage method.
1133 /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
1134 /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
1135 /// selectionHandleImage.RightImageUrl = "handle_downright.png";
1136 /// editor.SetSelectionHandleImage(selectionHandleImage);
1139 [EditorBrowsable(EditorBrowsableState.Never)]
1140 public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
1142 if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
1144 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl))
1146 SetValue(SelectionHandleImageLeftProperty, leftImageMap);
1150 if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
1152 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl))
1154 SetValue(SelectionHandleImageRightProperty, rightImageMap);
1160 /// Get SelectionHandleImage from TextEditor. <br />
1162 /// <returns>The SelectionHandleImage</returns>
1164 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
1166 [EditorBrowsable(EditorBrowsableState.Never)]
1167 public SelectionHandleImage GetSelectionHandleImage()
1169 SelectionHandleImage selectionHandleImage;
1170 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty))
1171 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty))
1173 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
1175 return selectionHandleImage;
1179 /// The SelectionHandlePressedImageLeft property.<br />
1180 /// The image to display when the left selection handle is pressed.<br />
1181 /// The selectionHandlePressedImageLeft map contains the following key :<br />
1182 /// <list type="table">
1183 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1186 /// <since_tizen> 3 </since_tizen>
1187 public PropertyMap SelectionHandlePressedImageLeft
1191 if (NUIApplication.IsUsingXaml)
1193 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
1197 return (PropertyMap)GetInternalSelectionHandlePressedImageLeftProperty(this);
1202 if (NUIApplication.IsUsingXaml)
1204 SetValue(SelectionHandlePressedImageLeftProperty, value);
1208 SetInternalSelectionHandlePressedImageLeftProperty(this, null, value);
1210 NotifyPropertyChanged();
1215 /// The SelectionHandlePressedImageRight property.<br />
1216 /// The image to display when the right selection handle is pressed.<br />
1217 /// The selectionHandlePressedImageRight map contains the following key :<br />
1218 /// <list type="table">
1219 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1222 /// <since_tizen> 3 </since_tizen>
1223 public PropertyMap SelectionHandlePressedImageRight
1227 if (NUIApplication.IsUsingXaml)
1229 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
1233 return (PropertyMap)GetInternalSelectionHandlePressedImageRightProperty(this);
1238 if (NUIApplication.IsUsingXaml)
1240 SetValue(SelectionHandlePressedImageRightProperty, value);
1244 SetInternalSelectionHandlePressedImageRightProperty(this, null, value);
1246 NotifyPropertyChanged();
1251 /// Set SelectionHandlePressedImage to TextEditor. <br />
1253 /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
1255 /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
1258 /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
1260 /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
1261 /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
1262 /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
1263 /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
1266 [EditorBrowsable(EditorBrowsableState.Never)]
1267 public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
1269 if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
1271 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl))
1273 SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap);
1277 if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
1279 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl))
1281 SetValue(SelectionHandlePressedImageRightProperty, rightImageMap);
1287 /// Get SelectionHandlePressedImage from TextEditor. <br />
1289 /// <returns>The SelectionHandlePressedImage</returns>
1291 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
1293 [EditorBrowsable(EditorBrowsableState.Never)]
1294 public SelectionHandleImage GetSelectionHandlePressedImage()
1296 SelectionHandleImage selectionHandleImage;
1297 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty))
1298 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty))
1300 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
1302 return selectionHandleImage;
1306 /// The SelectionHandleMarkerImageLeft property.<br />
1307 /// The image to display for the left selection handle marker.<br />
1308 /// The selectionHandleMarkerImageLeft map contains the following key :<br />
1309 /// <list type="table">
1310 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1313 /// <since_tizen> 3 </since_tizen>
1314 public PropertyMap SelectionHandleMarkerImageLeft
1318 if (NUIApplication.IsUsingXaml)
1320 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
1324 return (PropertyMap)GetInternalSelectionHandleMarkerImageLeftProperty(this);
1329 if (NUIApplication.IsUsingXaml)
1331 SetValue(SelectionHandleMarkerImageLeftProperty, value);
1335 SetInternalSelectionHandleMarkerImageLeftProperty(this, null, value);
1337 NotifyPropertyChanged();
1342 /// The SelectionHandleMarkerImageRight property.<br />
1343 /// The image to display for the right selection handle marker.<br />
1344 /// The selectionHandleMarkerImageRight map contains the following key :<br />
1345 /// <list type="table">
1346 /// <item><term>filename (string)</term><description>The path of image file</description></item>
1349 /// <since_tizen> 3 </since_tizen>
1350 public PropertyMap SelectionHandleMarkerImageRight
1354 if (NUIApplication.IsUsingXaml)
1356 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
1360 return (PropertyMap)GetInternalSelectionHandleMarkerImageRightProperty(this);
1365 if (NUIApplication.IsUsingXaml)
1367 SetValue(SelectionHandleMarkerImageRightProperty, value);
1371 SetInternalSelectionHandleMarkerImageRightProperty(this, null, value);
1373 NotifyPropertyChanged();
1378 /// Set SelectionHandleMarkerImage to TextEditor. <br />
1380 /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
1382 /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
1385 /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
1387 /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
1388 /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
1389 /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
1390 /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
1393 [EditorBrowsable(EditorBrowsableState.Never)]
1394 public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
1396 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
1398 using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl))
1400 SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap);
1404 if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
1406 using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl))
1408 SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap);
1414 /// Get SelectionHandleMarkerImage from TextEditor. <br />
1416 /// <returns>The SelectionHandleMarkerImage</returns>
1418 /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
1420 [EditorBrowsable(EditorBrowsableState.Never)]
1421 public SelectionHandleImage GetSelectionHandleMarkerImage()
1423 SelectionHandleImage selectionHandleImage;
1424 using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty))
1425 using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty))
1427 selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
1429 return selectionHandleImage;
1433 /// The SelectionHighlightColor property.<br />
1434 /// The color of the selection highlight.<br />
1437 /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
1439 /// <since_tizen> 3 </since_tizen>
1440 public Vector4 SelectionHighlightColor
1445 if (NUIApplication.IsUsingXaml)
1447 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
1451 temp = (Vector4)GetInternalSelectionHighlightColorProperty(this);
1453 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1457 if (NUIApplication.IsUsingXaml)
1459 SetValue(SelectionHighlightColorProperty, value);
1463 SetInternalSelectionHighlightColorProperty(this, null, value);
1465 NotifyPropertyChanged();
1470 /// The DecorationBoundingBox property.<br />
1471 /// The decorations (handles etc) will positioned within this area on-screen.<br />
1474 /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
1476 /// <since_tizen> 3 </since_tizen>
1477 public Rectangle DecorationBoundingBox
1482 if (NUIApplication.IsUsingXaml)
1484 temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
1488 temp = (Rectangle)GetInternalDecorationBoundingBoxProperty(this);
1490 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
1494 if (NUIApplication.IsUsingXaml)
1496 SetValue(DecorationBoundingBoxProperty, value);
1500 SetInternalDecorationBoundingBoxProperty(this, null, value);
1502 NotifyPropertyChanged();
1507 /// The EnableMarkup property.<br />
1508 /// Whether the mark-up processing is enabled.<br />
1510 /// <since_tizen> 3 </since_tizen>
1511 public bool EnableMarkup
1515 if (NUIApplication.IsUsingXaml)
1517 return (bool)GetValue(EnableMarkupProperty);
1521 return (bool)GetInternalEnableMarkupProperty(this);
1526 if (NUIApplication.IsUsingXaml)
1528 SetValue(EnableMarkupProperty, value);
1532 SetInternalEnableMarkupProperty(this, null, value);
1534 NotifyPropertyChanged();
1539 /// The InputColor property.<br />
1540 /// The color of the new input text.<br />
1543 /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
1545 /// <since_tizen> 3 </since_tizen>
1546 public Vector4 InputColor
1551 if (NUIApplication.IsUsingXaml)
1553 temp = (Vector4)GetValue(InputColorProperty);
1557 temp = (Vector4)GetInternalInputColorProperty(this);
1559 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
1563 if (NUIApplication.IsUsingXaml)
1565 SetValue(InputColorProperty, value);
1569 SetInternalInputColorProperty(this, null, value);
1571 NotifyPropertyChanged();
1576 /// The InputFontFamily property.<br />
1577 /// The font's family of the new input text.<br />
1579 /// <since_tizen> 3 </since_tizen>
1580 public string InputFontFamily
1584 if (NUIApplication.IsUsingXaml)
1586 return (string)GetValue(InputFontFamilyProperty);
1590 return (string)GetInternalInputFontFamilyProperty(this);
1595 if (NUIApplication.IsUsingXaml)
1597 SetValue(InputFontFamilyProperty, value);
1601 SetInternalInputFontFamilyProperty(this, null, value);
1603 NotifyPropertyChanged();
1608 /// The InputFontStyle property.<br />
1609 /// The font's style of the new input text.<br />
1610 /// The inputFontStyle map contains the following keys :<br />
1611 /// <list type="table">
1612 /// <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>
1613 /// <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>
1614 /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
1617 /// <since_tizen> 3 </since_tizen>
1618 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1619 public PropertyMap InputFontStyle
1623 if (NUIApplication.IsUsingXaml)
1625 return (PropertyMap)GetValue(InputFontStyleProperty);
1629 return (PropertyMap)GetInternalInputFontStyleProperty(this);
1634 if (NUIApplication.IsUsingXaml)
1636 SetValue(InputFontStyleProperty, value);
1640 SetInternalInputFontStyleProperty(this, null, value);
1642 NotifyPropertyChanged();
1647 /// Set InputFontStyle to TextEditor. <br />
1649 /// <param name="fontStyle">The FontStyle</param>
1651 /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
1654 /// The following example demonstrates how to use the SetInputFontStyle method.
1656 /// var fontStyle = new Tizen.NUI.Text.FontStyle();
1657 /// fontStyle.Width = FontWidthType.Expanded;
1658 /// fontStyle.Weight = FontWeightType.Bold;
1659 /// fontStyle.Slant = FontSlantType.Italic;
1660 /// editor.SetInputFontStyle(fontStyle);
1663 [EditorBrowsable(EditorBrowsableState.Never)]
1664 public void SetInputFontStyle(FontStyle fontStyle)
1666 using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle))
1668 SetValue(InputFontStyleProperty, fontStyleMap);
1673 /// Get InputFontStyle from TextEditor. <br />
1675 /// <returns>The FontStyle</returns>
1677 /// <see cref="Tizen.NUI.Text.FontStyle"/>
1679 [EditorBrowsable(EditorBrowsableState.Never)]
1680 public FontStyle GetInputFontStyle()
1682 FontStyle fontStyle;
1683 using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty))
1685 fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap);
1691 /// The InputPointSize property.<br />
1692 /// The font's size of the new input text in points.<br />
1694 /// <since_tizen> 3 </since_tizen>
1695 [Binding.TypeConverter(typeof(PointSizeTypeConverter))]
1696 public float InputPointSize
1700 if (NUIApplication.IsUsingXaml)
1702 return (float)GetValue(InputPointSizeProperty);
1706 return (float)GetInternalInputPointSizeProperty(this);
1711 if (NUIApplication.IsUsingXaml)
1713 SetValue(InputPointSizeProperty, value);
1717 SetInternalInputPointSizeProperty(this, null, value);
1719 NotifyPropertyChanged();
1724 /// The LineSpacing property.<br />
1725 /// The default extra space between lines in points.<br />
1727 /// <since_tizen> 3 </since_tizen>
1728 public float LineSpacing
1732 if (NUIApplication.IsUsingXaml)
1734 return (float)GetValue(LineSpacingProperty);
1738 return (float)GetInternalLineSpacingProperty(this);
1743 if (NUIApplication.IsUsingXaml)
1745 SetValue(LineSpacingProperty, value);
1749 SetInternalLineSpacingProperty(this, null, value);
1751 NotifyPropertyChanged();
1756 /// The InputLineSpacing property.<br />
1757 /// The extra space between lines in points.<br />
1759 /// <since_tizen> 3 </since_tizen>
1760 public float InputLineSpacing
1764 if (NUIApplication.IsUsingXaml)
1766 return (float)GetValue(InputLineSpacingProperty);
1770 return (float)GetInternalInputLineSpacingProperty(this);
1775 if (NUIApplication.IsUsingXaml)
1777 SetValue(InputLineSpacingProperty, value);
1781 SetInternalInputLineSpacingProperty(this, null, value);
1783 NotifyPropertyChanged();
1788 /// The relative height of the line (a factor that will be multiplied by text height). <br />
1789 /// If the value is less than 1, the lines could to be overlapped.
1791 [EditorBrowsable(EditorBrowsableState.Never)]
1792 public float RelativeLineHeight
1796 if (NUIApplication.IsUsingXaml)
1798 return (float)GetValue(RelativeLineHeightProperty);
1802 return (float)GetInternalRelativeLineHeightProperty(this);
1807 if (NUIApplication.IsUsingXaml)
1809 SetValue(RelativeLineHeightProperty, value);
1813 SetInternalRelativeLineHeightProperty(this, null, value);
1815 NotifyPropertyChanged();
1820 /// The Underline property.<br />
1821 /// The default underline parameters.<br />
1822 /// The underline map contains the following keys :<br />
1823 /// <list type="table">
1824 /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
1825 /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
1826 /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
1829 /// <since_tizen> 3 </since_tizen>
1830 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1831 public PropertyMap Underline
1835 if (NUIApplication.IsUsingXaml)
1837 return (PropertyMap)GetValue(UnderlineProperty);
1841 return (PropertyMap)GetInternalUnderlineProperty(this);
1846 if (NUIApplication.IsUsingXaml)
1848 SetValue(UnderlineProperty, value);
1852 SetInternalUnderlineProperty(this, null, value);
1854 NotifyPropertyChanged();
1859 /// Set Underline to TextEditor. <br />
1861 /// <param name="underline">The Underline</param>
1863 /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
1866 /// The following example demonstrates how to use the SetUnderline method.
1868 /// var underline = new Tizen.NUI.Text.Underline();
1869 /// underline.Enable = true;
1870 /// underline.Color = new Color("#3498DB");
1871 /// underline.Height = 2.0f;
1872 /// editor.SetUnderline(underline);
1875 [EditorBrowsable(EditorBrowsableState.Never)]
1876 public void SetUnderline(Underline underline)
1878 using (var underlineMap = TextMapHelper.GetUnderlineMap(underline))
1880 SetValue(UnderlineProperty, underlineMap);
1885 /// Get Underline from TextEditor. <br />
1887 /// <returns>The Underline</returns>
1889 /// <see cref="Tizen.NUI.Text.Underline"/>
1891 [EditorBrowsable(EditorBrowsableState.Never)]
1892 public Underline GetUnderline()
1894 Underline underline;
1895 using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty))
1897 underline = TextMapHelper.GetUnderlineStruct(underlineMap);
1903 /// The InputUnderline property.<br />
1904 /// The underline parameters of the new input text.<br />
1906 /// <since_tizen> 3 </since_tizen>
1907 public string InputUnderline
1911 if (NUIApplication.IsUsingXaml)
1913 return (string)GetValue(InputUnderlineProperty);
1917 return (string)GetInternalInputUnderlineProperty(this);
1922 if (NUIApplication.IsUsingXaml)
1924 SetValue(InputUnderlineProperty, value);
1928 SetInternalInputUnderlineProperty(this, null, value);
1930 NotifyPropertyChanged();
1935 /// The Shadow property.<br />
1936 /// The default shadow parameters.<br />
1937 /// The shadow map contains the following keys :<br />
1938 /// <list type="table">
1939 /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
1940 /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
1941 /// <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>
1944 /// <since_tizen> 3 </since_tizen>
1945 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1946 public PropertyMap Shadow
1950 if (NUIApplication.IsUsingXaml)
1952 return (PropertyMap)GetValue(ShadowProperty);
1956 return (PropertyMap)GetInternalShadowProperty(this);
1961 if (NUIApplication.IsUsingXaml)
1963 SetValue(ShadowProperty, value);
1967 SetInternalShadowProperty(this, null, value);
1969 NotifyPropertyChanged();
1974 /// Set Shadow to TextEditor. <br />
1976 /// <param name="shadow">The Shadow</param>
1978 /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
1981 /// The following example demonstrates how to use the SetShadow method.
1983 /// var shadow = new Tizen.NUI.Text.Shadow();
1984 /// shadow.Offset = new Vector2(3, 3);
1985 /// shadow.Color = new Color("#F1C40F");
1986 /// editor.SetShadow(shadow);
1989 [EditorBrowsable(EditorBrowsableState.Never)]
1990 public void SetShadow(Tizen.NUI.Text.Shadow shadow)
1992 using (var shadowMap = TextMapHelper.GetShadowMap(shadow))
1994 SetValue(ShadowProperty, shadowMap);
1999 /// Get Shadow from TextEditor. <br />
2001 /// <returns>The Shadow</returns>
2003 /// <see cref="Tizen.NUI.Text.Shadow"/>
2005 [EditorBrowsable(EditorBrowsableState.Never)]
2006 public Tizen.NUI.Text.Shadow GetShadow()
2008 Tizen.NUI.Text.Shadow shadow;
2009 using (var shadowMap = (PropertyMap)GetValue(ShadowProperty))
2011 shadow = TextMapHelper.GetShadowStruct(shadowMap);
2017 /// The InputShadow property.<br />
2018 /// The shadow parameters of the new input text.<br />
2020 /// <since_tizen> 3 </since_tizen>
2021 public string InputShadow
2025 if (NUIApplication.IsUsingXaml)
2027 return (string)GetValue(InputShadowProperty);
2031 return (string)GetInternalInputShadowProperty(this);
2036 if (NUIApplication.IsUsingXaml)
2038 SetValue(InputShadowProperty, value);
2042 SetInternalInputShadowProperty(this, null, value);
2044 NotifyPropertyChanged();
2049 /// The Emboss property.<br />
2050 /// The default emboss parameters.<br />
2052 /// <since_tizen> 3 </since_tizen>
2053 public string Emboss
2057 if (NUIApplication.IsUsingXaml)
2059 return (string)GetValue(EmbossProperty);
2063 return (string)GetInternalEmbossProperty(this);
2068 if (NUIApplication.IsUsingXaml)
2070 SetValue(EmbossProperty, value);
2074 SetInternalEmbossProperty(this, null, value);
2076 NotifyPropertyChanged();
2081 /// The InputEmboss property.<br />
2082 /// The emboss parameters of the new input text.<br />
2084 /// <since_tizen> 3 </since_tizen>
2085 public string InputEmboss
2089 if (NUIApplication.IsUsingXaml)
2091 return (string)GetValue(InputEmbossProperty);
2095 return (string)GetInternalInputEmbossProperty(this);
2100 if (NUIApplication.IsUsingXaml)
2102 SetValue(InputEmbossProperty, value);
2106 SetInternalInputEmbossProperty(this, null, value);
2108 NotifyPropertyChanged();
2113 /// The Outline property.<br />
2114 /// The default outline parameters.<br />
2115 /// The outline map contains the following keys :<br />
2116 /// <list type="table">
2117 /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
2118 /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
2121 /// <since_tizen> 3 </since_tizen>
2122 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
2123 public PropertyMap Outline
2127 if (NUIApplication.IsUsingXaml)
2129 return (PropertyMap)GetValue(OutlineProperty);
2133 return (PropertyMap)GetInternalOutlineProperty(this);
2138 if (NUIApplication.IsUsingXaml)
2140 SetValue(OutlineProperty, value);
2144 SetInternalOutlineProperty(this, null, value);
2146 NotifyPropertyChanged();
2151 /// Set Outline to TextEditor. <br />
2153 /// <param name="outline">The Outline</param>
2155 /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
2158 /// The following example demonstrates how to use the SetOutline method.
2160 /// var outline = new Tizen.NUI.Text.Outline();
2161 /// outline.Width = 2.0f;
2162 /// outline.Color = new Color("#45B39D");
2163 /// editor.SetOutline(outline);
2166 [EditorBrowsable(EditorBrowsableState.Never)]
2167 public void SetOutline(Outline outline)
2169 using (var outlineMap = TextMapHelper.GetOutlineMap(outline))
2171 SetValue(OutlineProperty, outlineMap);
2176 /// Get Outline from TextEditor. <br />
2178 /// <returns>The Outline</returns>
2180 /// <see cref="Tizen.NUI.Text.Outline"/>
2182 [EditorBrowsable(EditorBrowsableState.Never)]
2183 public Outline GetOutline()
2186 using (var outlineMap = (PropertyMap)GetValue(OutlineProperty))
2188 outline = TextMapHelper.GetOutlineStruct(outlineMap);
2194 /// The InputOutline property.<br />
2195 /// The outline parameters of the new input text.<br />
2197 /// <since_tizen> 3 </since_tizen>
2198 public string InputOutline
2202 if (NUIApplication.IsUsingXaml)
2204 return (string)GetValue(InputOutlineProperty);
2208 return (string)GetInternalInputOutlineProperty(this);
2213 if (NUIApplication.IsUsingXaml)
2215 SetValue(InputOutlineProperty, value);
2219 SetInternalInputOutlineProperty(this, null, value);
2221 NotifyPropertyChanged();
2226 /// The SmoothScroll property.<br />
2227 /// Enable or disable the smooth scroll animation.<br />
2229 /// <since_tizen> 3 </since_tizen>
2230 public bool SmoothScroll
2234 if (NUIApplication.IsUsingXaml)
2236 return (bool)GetValue(SmoothScrollProperty);
2240 return (bool)GetInternalSmoothScrollProperty(this);
2245 if (NUIApplication.IsUsingXaml)
2247 SetValue(SmoothScrollProperty, value);
2251 SetInternalSmoothScrollProperty(this, null, value);
2253 NotifyPropertyChanged();
2258 /// The SmoothScrollDuration property.<br />
2259 /// Sets the duration of smooth scroll animation.<br />
2261 /// <since_tizen> 3 </since_tizen>
2262 public float SmoothScrollDuration
2266 if (NUIApplication.IsUsingXaml)
2268 return (float)GetValue(SmoothScrollDurationProperty);
2272 return (float)GetInternalSmoothScrollDurationProperty(this);
2277 if (NUIApplication.IsUsingXaml)
2279 SetValue(SmoothScrollDurationProperty, value);
2283 SetInternalSmoothScrollDurationProperty(this, null, value);
2285 NotifyPropertyChanged();
2290 /// The EnableScrollBar property.<br />
2291 /// Enable or disable the scroll bar.<br />
2293 /// <since_tizen> 3 </since_tizen>
2294 public bool EnableScrollBar
2298 if (NUIApplication.IsUsingXaml)
2300 return (bool)GetValue(EnableScrollBarProperty);
2304 return (bool)GetInternalEnableScrollBarProperty(this);
2309 if (NUIApplication.IsUsingXaml)
2311 SetValue(EnableScrollBarProperty, value);
2315 SetInternalEnableScrollBarProperty(this, null, value);
2317 NotifyPropertyChanged();
2322 /// The ScrollBarShowDuration property.<br />
2323 /// Sets the duration of scroll bar to show.<br />
2325 /// <since_tizen> 3 </since_tizen>
2326 public float ScrollBarShowDuration
2330 if (NUIApplication.IsUsingXaml)
2332 return (float)GetValue(ScrollBarShowDurationProperty);
2336 return (float)GetInternalScrollBarShowDurationProperty(this);
2341 if (NUIApplication.IsUsingXaml)
2343 SetValue(ScrollBarShowDurationProperty, value);
2347 SetInternalScrollBarShowDurationProperty(this, null, value);
2349 NotifyPropertyChanged();
2354 /// The ScrollBarFadeDuration property.<br />
2355 /// Sets the duration of scroll bar to fade out.<br />
2357 /// <since_tizen> 3 </since_tizen>
2358 public float ScrollBarFadeDuration
2362 if (NUIApplication.IsUsingXaml)
2364 return (float)GetValue(ScrollBarFadeDurationProperty);
2368 return (float)GetInternalScrollBarFadeDurationProperty(this);
2373 if (NUIApplication.IsUsingXaml)
2375 SetValue(ScrollBarFadeDurationProperty, value);
2379 SetInternalScrollBarFadeDurationProperty(this, null, value);
2381 NotifyPropertyChanged();
2386 /// The PixelSize property.<br />
2387 /// The size of font in pixels.<br />
2389 /// <since_tizen> 3 </since_tizen>
2390 [Binding.TypeConverter(typeof(FloatGraphicsTypeConverter))]
2391 public float PixelSize
2395 if (NUIApplication.IsUsingXaml)
2397 return (float)GetValue(PixelSizeProperty);
2401 return (float)GetInternalPixelSizeProperty(this);
2406 if (NUIApplication.IsUsingXaml)
2408 SetValue(PixelSizeProperty, value);
2412 SetInternalPixelSizeProperty(this, null, value);
2414 NotifyPropertyChanged();
2419 /// The line count of the text.
2421 /// <since_tizen> 3 </since_tizen>
2422 public int LineCount
2427 using (var propertyValue = GetProperty(TextEditor.Property.LineCount))
2429 propertyValue.Get(out lineCount);
2436 /// The text to display when the TextEditor is empty and inactive.
2438 /// <since_tizen> 3 </since_tizen>
2439 public string PlaceholderText
2443 if (NUIApplication.IsUsingXaml)
2445 return (string)GetValue(PlaceholderTextProperty);
2449 return (string)GetInternalPlaceholderTextProperty(this);
2454 if (NUIApplication.IsUsingXaml)
2456 SetValue(PlaceholderTextProperty, value);
2460 SetInternalPlaceholderTextProperty(this, null, value);
2462 NotifyPropertyChanged();
2467 /// The portion of the text that has been selected by the user.
2470 /// Empty string when nothing is selected.
2472 /// <since_tizen> 9 </since_tizen>
2473 public string SelectedText
2477 string selectedText;
2478 using (var propertyValue = GetProperty(TextEditor.Property.SelectedText))
2480 propertyValue.Get(out selectedText);
2482 return selectedText;
2487 /// The Placeholder text color.
2490 /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
2492 /// <since_tizen> 3 </since_tizen>
2493 public Color PlaceholderTextColor
2498 if (NUIApplication.IsUsingXaml)
2500 temp = (Color)GetValue(PlaceholderTextColorProperty);
2504 temp = (Color)GetInternalPlaceholderTextColorProperty(this);
2506 return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
2510 if (NUIApplication.IsUsingXaml)
2512 SetValue(PlaceholderTextColorProperty, value);
2516 SetInternalPlaceholderTextColorProperty(this, null, value);
2518 NotifyPropertyChanged();
2523 /// The Enable selection property.<br />
2524 /// Enables Text selection, such as the cursor, handle, clipboard, and highlight color.<br />
2526 /// <since_tizen> 3 </since_tizen>
2527 public bool EnableSelection
2531 if (NUIApplication.IsUsingXaml)
2533 return (bool)GetValue(EnableSelectionProperty);
2537 return (bool)GetInternalEnableSelectionProperty(this);
2542 if (NUIApplication.IsUsingXaml)
2544 SetValue(EnableSelectionProperty, value);
2548 SetInternalEnableSelectionProperty(this, null, value);
2550 NotifyPropertyChanged();
2555 /// The start index for selection.
2558 /// When there is no selection, the index is current cursor position.
2560 /// <since_tizen> 9 </since_tizen>
2561 public int SelectedTextStart
2565 int selectedTextStart;
2566 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextStart))
2568 propertyValue.Get(out selectedTextStart);
2570 return selectedTextStart;
2575 /// The end index for selection.
2578 /// When there is no selection, the index is current cursor position.
2580 /// <since_tizen> 9 </since_tizen>
2581 public int SelectedTextEnd
2585 int selectedTextEnd;
2586 using (var propertyValue = GetProperty(TextEditor.Property.SelectedTextEnd))
2588 propertyValue.Get(out selectedTextEnd);
2590 return selectedTextEnd;
2595 /// Enable editing in text control.
2597 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
2598 [EditorBrowsable(EditorBrowsableState.Never)]
2599 public bool EnableEditing
2603 if (NUIApplication.IsUsingXaml)
2605 return (bool)GetValue(EnableEditingProperty);
2609 return (bool)GetInternalEnableEditingProperty(this);
2614 if (NUIApplication.IsUsingXaml)
2616 SetValue(EnableEditingProperty, value);
2620 SetInternalEnableEditingProperty(this, null, value);
2625 private bool InternalEnableEditing
2630 using (var propertyValue = GetProperty(TextEditor.Property.EnableEditing))
2632 propertyValue.Get(out enableEditing);
2634 return enableEditing;
2638 using (var propertyValue = new PropertyValue(value))
2640 SetProperty(TextEditor.Property.EnableEditing, propertyValue);
2641 NotifyPropertyChanged();
2647 /// Specify horizontal scroll position in text control.
2649 [EditorBrowsable(EditorBrowsableState.Never)]
2650 public int HorizontalScrollPosition
2654 if (NUIApplication.IsUsingXaml)
2656 return (int)GetValue(HorizontalScrollPositionProperty);
2660 return (int)GetInternalHorizontalScrollPositionProperty(this);
2665 if (NUIApplication.IsUsingXaml)
2667 SetValue(HorizontalScrollPositionProperty, value);
2671 SetInternalHorizontalScrollPositionProperty(this, null, value);
2676 private int InternalHorizontalScrollPosition
2680 int horizontalScrollPosition;
2681 using (var propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
2683 propertyValue.Get(out horizontalScrollPosition);
2685 return horizontalScrollPosition;
2689 using (var propertyValue = new PropertyValue(value))
2691 SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
2692 NotifyPropertyChanged();
2698 /// Specify vertical scroll position in text control.
2700 [EditorBrowsable(EditorBrowsableState.Never)]
2701 public int VerticalScrollPosition
2705 if (NUIApplication.IsUsingXaml)
2707 return (int)GetValue(VerticalScrollPositionProperty);
2711 return (int)GetInternalVerticalScrollPositionProperty(this);
2716 if (NUIApplication.IsUsingXaml)
2718 SetValue(VerticalScrollPositionProperty, value);
2722 SetInternalVerticalScrollPositionProperty(this, null, value);
2727 private int InternalVerticalScrollPosition
2731 int verticalScrollPosition;
2732 using (var propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
2734 propertyValue.Get(out verticalScrollPosition);
2736 return verticalScrollPosition;
2740 using (var propertyValue = new PropertyValue(value))
2742 SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
2743 NotifyPropertyChanged();
2749 /// PrimaryCursorPosition property.<br />
2750 /// Specify the position of the primary cursor (caret) in text control.
2753 /// 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).
2755 /// <since_tizen> 10 </since_tizen>
2756 public int PrimaryCursorPosition
2760 if (NUIApplication.IsUsingXaml)
2762 return (int)GetValue(PrimaryCursorPositionProperty);
2766 return (int)GetInternalPrimaryCursorPositionProperty(this);
2771 if (NUIApplication.IsUsingXaml)
2773 SetValue(PrimaryCursorPositionProperty, value);
2777 SetInternalPrimaryCursorPositionProperty(this, null, value);
2782 private int InternalPrimaryCursorPosition
2786 int primaryCursorPosition;
2787 using (var propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
2789 propertyValue.Get(out primaryCursorPosition);
2791 return primaryCursorPosition;
2795 using (var propertyValue = new PropertyValue(value))
2797 SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
2798 NotifyPropertyChanged();
2804 /// The GrabHandleColor property.
2807 /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
2809 [EditorBrowsable(EditorBrowsableState.Never)]
2810 public Color GrabHandleColor
2815 if (NUIApplication.IsUsingXaml)
2817 temp = (Color)GetValue(GrabHandleColorProperty);
2821 temp = (Color)GetInternalGrabHandleColorProperty(this);
2823 return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
2827 if (NUIApplication.IsUsingXaml)
2829 SetValue(GrabHandleColorProperty, value);
2833 SetInternalGrabHandleColorProperty(this, null, value);
2835 NotifyPropertyChanged();
2840 /// Set InputFilter to TextEditor.
2842 /// <param name="inputFilter">The InputFilter</param>
2844 /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
2845 /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
2846 /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description.
2849 /// The following example demonstrates how to use the SetInputFilter method.
2851 /// var inputFilter = new Tizen.NUI.Text.InputFilter();
2852 /// inputFilter.Accepted = @"[\d]"; // accept whole digits
2853 /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
2854 /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
2857 /// <since_tizen> 9 </since_tizen>
2858 public void SetInputFilter(InputFilter inputFilter)
2860 using (var map = TextMapHelper.GetInputFilterMap(inputFilter))
2861 using (var propertyValue = new PropertyValue(map))
2863 SetProperty(TextEditor.Property.InputFilter, propertyValue);
2868 /// Get InputFilter from TextEditor. <br />
2870 /// <returns>The InputFilter</returns>
2872 /// <see cref="Tizen.NUI.Text.InputFilter"/>
2874 /// <since_tizen> 9 </since_tizen>
2875 public InputFilter GetInputFilter()
2877 InputFilter inputFilter;
2878 using (var propertyValue = GetProperty(TextEditor.Property.InputFilter))
2879 using (var map = new PropertyMap())
2881 propertyValue.Get(map);
2882 inputFilter = TextMapHelper.GetInputFilterStruct(map);
2888 /// Set Strikethrough to TextEditor. <br />
2890 /// <param name="strikethrough">The Strikethrough</param>
2892 /// SetStrikethrough specifies the strikethrough of the text through <see cref="Tizen.NUI.Text.Strikethrough"/>. <br />
2895 /// The following example demonstrates how to use the SetStrikethrough method.
2897 /// var strikethrough = new Tizen.NUI.Text.Strikethrough();
2898 /// strikethrough.Enable = true;
2899 /// strikethrough.Color = new Color("#3498DB");
2900 /// strikethrough.Height = 2.0f;
2901 /// editor.SetStrikethrough(strikethrough);
2904 [EditorBrowsable(EditorBrowsableState.Never)]
2905 public void SetStrikethrough(Strikethrough strikethrough)
2907 using (var map = TextMapHelper.GetStrikethroughMap(strikethrough))
2908 using (var propertyValue = new PropertyValue(map))
2910 SetProperty(TextEditor.Property.Strikethrough, propertyValue);
2915 /// Get Strikethrough from TextEditor. <br />
2917 /// <returns>The Strikethrough</returns>
2919 /// <see cref="Tizen.NUI.Text.Strikethrough"/>
2921 [EditorBrowsable(EditorBrowsableState.Never)]
2922 public Strikethrough GetStrikethrough()
2924 Strikethrough strikethrough;
2925 using (var propertyValue = GetProperty(TextEditor.Property.Strikethrough))
2926 using (var map = new PropertyMap())
2928 propertyValue.Get(map);
2929 strikethrough = TextMapHelper.GetStrikethroughStruct(map);
2931 return strikethrough;
2935 /// The Placeholder property.
2936 /// The placeholder map contains the following keys :<br />
2937 /// <list type="table">
2938 /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
2939 /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
2940 /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
2941 /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
2942 /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
2943 /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
2944 /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
2945 /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
2949 /// The following example demonstrates how to set the placeholder property.
2951 /// PropertyMap propertyMap = new PropertyMap();
2952 /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
2953 /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
2954 /// propertyMap.Add("color", new PropertyValue(Color.Red));
2955 /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
2956 /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
2958 /// PropertyMap fontStyleMap = new PropertyMap();
2959 /// fontStyleMap.Add("weight", new PropertyValue("bold"));
2960 /// fontStyleMap.Add("width", new PropertyValue("condensed"));
2961 /// fontStyleMap.Add("slant", new PropertyValue("italic"));
2962 /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
2964 /// TextEditor editor = new TextEditor();
2965 /// editor.Placeholder = propertyMap;
2968 /// <since_tizen> 3 </since_tizen>
2969 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
2970 public Tizen.NUI.PropertyMap Placeholder
2975 if (NUIApplication.IsUsingXaml)
2977 map = (PropertyMap)GetValue(PlaceholderProperty);
2981 map = (PropertyMap)GetInternalPlaceholderProperty(this);
2983 string defalutText = "";
2985 if (TextMapHelper.IsValue(map, 0))
2986 map.Add("text", TextMapHelper.GetStringFromMap(map, 0, defalutText));
2988 if (TextMapHelper.IsValue(map, 1))
2989 map.Add("textFocused", TextMapHelper.GetStringFromMap(map, 1, defalutText));
2991 if (TextMapHelper.IsValue(map, 2))
2993 using (var color = TextMapHelper.GetColorFromMap(map, 2))
2995 map.Add("color", color);
2999 if (TextMapHelper.IsValue(map, 3))
3000 map.Add("fontFamily", TextMapHelper.GetStringFromMap(map, 3, defalutText));
3002 if (TextMapHelper.IsValue(map, 4))
3004 using (var properyValue = map.Find(4))
3005 using (var fontStyle = new PropertyMap())
3007 properyValue.Get(fontStyle);
3008 using (var fontStyleValue = new PropertyValue(fontStyle))
3010 map.Add("fontStyle", fontStyleValue);
3015 if (TextMapHelper.IsValue(map, 5))
3016 map.Add("pointSize", TextMapHelper.GetNullableFloatFromMap(map, 5));
3018 if (TextMapHelper.IsValue(map, 6))
3019 map.Add("pixelSize", TextMapHelper.GetNullableFloatFromMap(map, 6));
3021 if (TextMapHelper.IsValue(map, 7))
3022 map.Add("ellipsis", TextMapHelper.GetBoolFromMap(map, 7, false));
3028 if (NUIApplication.IsUsingXaml)
3030 SetValue(PlaceholderProperty, value);
3034 SetInternalPlaceholderProperty(this, null, value);
3036 NotifyPropertyChanged();
3041 /// Set Placeholder to TextEditor. <br />
3043 /// <param name="placeholder">The Placeholder</param>
3045 /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
3048 /// The following example demonstrates how to use the SetPlaceholder method.
3050 /// var placeholder = new Tizen.NUI.Text.Placeholder();
3051 /// placeholder.Text = "placeholder text";
3052 /// placeholder.TextFocused = "placeholder textFocused";
3053 /// placeholder.Color = new Color("#45B39D");
3054 /// placeholder.FontFamily = "BreezeSans";
3055 /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
3057 /// Width = FontWidthType.Expanded,
3058 /// Weight = FontWeightType.ExtraLight,
3059 /// Slant = FontSlantType.Italic,
3061 /// placeholder.PointSize = 25.0f;
3062 /// //placeholder.PixelSize = 50.0f;
3063 /// placeholder.Ellipsis = true;
3064 /// editor.SetPlaceholder(placeholder);
3067 [EditorBrowsable(EditorBrowsableState.Never)]
3068 public void SetPlaceholder(Placeholder placeholder)
3070 using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder))
3072 SetValue(PlaceholderProperty, placeholderMap);
3077 /// Get Placeholder from TextEditor. <br />
3079 /// <returns>The Placeholder</returns>
3081 /// <see cref="Tizen.NUI.Text.Placeholder"/>
3083 [EditorBrowsable(EditorBrowsableState.Never)]
3084 public Placeholder GetPlaceholder()
3086 Placeholder placeholder;
3087 using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty))
3089 placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap);
3095 /// The Ellipsis property.<br />
3096 /// Enable or disable the ellipsis.<br />
3098 /// <since_tizen> 9 </since_tizen>
3099 public bool Ellipsis
3103 if (NUIApplication.IsUsingXaml)
3105 return (bool)GetValue(EllipsisProperty);
3110 return (bool)GetInternalEllipsisProperty(this);
3115 if (NUIApplication.IsUsingXaml)
3117 SetValue(EllipsisProperty, value);
3121 SetInternalEllipsisProperty(this, null, value);
3123 NotifyPropertyChanged();
3129 /// The ellipsis position of the text.
3130 /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
3132 /// <since_tizen> 9 </since_tizen>
3133 public EllipsisPosition EllipsisPosition
3137 if (NUIApplication.IsUsingXaml)
3139 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
3143 return (EllipsisPosition)GetInternalEllipsisPositionProperty(this);
3148 if (NUIApplication.IsUsingXaml)
3150 SetValue(EllipsisPositionProperty, value);
3154 SetInternalEllipsisPositionProperty(this, null, value);
3156 NotifyPropertyChanged();
3161 /// The LineWrapMode property.<br />
3162 /// The line wrap mode when the text lines over the layout width.<br />
3164 /// <since_tizen> 4 </since_tizen>
3165 public LineWrapMode LineWrapMode
3169 if (NUIApplication.IsUsingXaml)
3171 return (LineWrapMode)GetValue(LineWrapModeProperty);
3175 return (LineWrapMode)GetInternalLineWrapModeProperty(this);
3180 if (NUIApplication.IsUsingXaml)
3182 SetValue(LineWrapModeProperty, value);
3186 SetInternalLineWrapModeProperty(this, null, value);
3188 NotifyPropertyChanged();
3193 /// Enables Text selection using Shift key.
3195 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
3196 [EditorBrowsable(EditorBrowsableState.Never)]
3197 public bool EnableShiftSelection
3201 if (NUIApplication.IsUsingXaml)
3203 return (bool)GetValue(EnableShiftSelectionProperty);
3207 return (bool)GetInternalEnableShiftSelectionProperty(this);
3212 if (NUIApplication.IsUsingXaml)
3214 SetValue(EnableShiftSelectionProperty, value);
3218 SetInternalEnableShiftSelectionProperty(this, null, value);
3220 NotifyPropertyChanged();
3225 /// The text alignment to match the direction of the system language.
3227 /// <since_tizen> 6 </since_tizen>
3228 public bool MatchSystemLanguageDirection
3232 if (NUIApplication.IsUsingXaml)
3234 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
3238 return (bool)GetInternalMatchSystemLanguageDirectionProperty(this);
3243 if (NUIApplication.IsUsingXaml)
3245 SetValue(MatchSystemLanguageDirectionProperty, value);
3249 SetInternalMatchSystemLanguageDirectionProperty(this, null, value);
3251 NotifyPropertyChanged();
3256 /// The MaxLength property.<br />
3257 /// The maximum number of characters that can be inserted.<br />
3259 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
3260 [EditorBrowsable(EditorBrowsableState.Never)]
3261 public int MaxLength
3265 if (NUIApplication.IsUsingXaml)
3267 return (int)GetValue(MaxLengthProperty);
3271 return (int)GetInternalMaxLengthProperty(this);
3276 if (NUIApplication.IsUsingXaml)
3278 SetValue(MaxLengthProperty, value);
3282 SetInternalMaxLengthProperty(this, null, value);
3284 NotifyPropertyChanged();
3289 /// The FontSizeScale property. <br />
3290 /// The default value is 1.0. <br />
3291 /// The given font size scale value is used for multiplying the specified font size before querying fonts. <br />
3292 /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
3294 /// <since_tizen> 9 </since_tizen>
3295 public float FontSizeScale
3299 if (NUIApplication.IsUsingXaml)
3301 return (float)GetValue(FontSizeScaleProperty);
3305 return (float)GetInternalFontSizeScaleProperty(this);
3310 if (NUIApplication.IsUsingXaml)
3312 SetValue(FontSizeScaleProperty, value);
3316 SetInternalFontSizeScaleProperty(this, null, value);
3318 NotifyPropertyChanged();
3322 private float InternalFontSizeScale
3326 return fontSizeScale;
3330 float newFontSizeScale;
3332 if (fontSizeScale == value) return;
3334 fontSizeScale = value;
3335 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
3337 SystemSettingsFontSize systemSettingsFontSize;
3341 systemSettingsFontSize = SystemSettings.FontSize;
3345 Console.WriteLine("{0} Exception caught.", e);
3346 systemSettingsFontSize = SystemSettingsFontSize.Normal;
3348 newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
3349 AddSystemSettingsFontSizeChanged();
3353 newFontSizeScale = fontSizeScale;
3354 RemoveSystemSettingsFontSizeChanged();
3357 SetInternalFontSizeScale(newFontSizeScale);
3361 private void SetInternalFontSizeScale(float fontSizeScale)
3364 Object.InternalSetPropertyFloat(this.SwigCPtr, TextEditor.Property.FontSizeScale, (float)fontSizeScale);
3368 /// The EnableFontSizeScale property.<br />
3369 /// Whether the font size scale is enabled. (The default value is true)
3371 [EditorBrowsable(EditorBrowsableState.Never)]
3372 public bool EnableFontSizeScale
3376 if (NUIApplication.IsUsingXaml)
3378 return (bool)GetValue(EnableFontSizeScaleProperty);
3382 return (bool)GetInternalEnableFontSizeScaleProperty(this);
3387 if (NUIApplication.IsUsingXaml)
3389 SetValue(EnableFontSizeScaleProperty, value);
3393 SetInternalEnableFontSizeScaleProperty(this, null, value);
3395 NotifyPropertyChanged();
3400 /// The InputMethodSettings property.<br />
3401 /// The settings to relating to the System's Input Method, Key and Value.<br />
3404 /// <see cref="InputMethod"/> is a class encapsulating the input method map. Use the <see cref="InputMethod"/> class for this property.
3407 /// The following example demonstrates how to set the InputMethodSettings property.
3409 /// InputMethod method = new InputMethod();
3410 /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
3411 /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
3412 /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
3413 /// method.Variation = 1;
3414 /// textEditor.InputMethodSettings = method.OutputMap;
3417 [EditorBrowsable(EditorBrowsableState.Never)]
3418 public PropertyMap InputMethodSettings
3422 if (NUIApplication.IsUsingXaml)
3424 return (PropertyMap)GetValue(InputMethodSettingsProperty);
3428 return (PropertyMap)GetInternalInputMethodSettingsProperty(this);
3433 if (NUIApplication.IsUsingXaml)
3435 SetValue(InputMethodSettingsProperty, value);
3439 SetInternalInputMethodSettingsProperty(this, null, value);
3441 NotifyPropertyChanged();
3446 /// Scroll the text control by specific amount..
3448 /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
3449 [EditorBrowsable(EditorBrowsableState.Never)]
3450 public void ScrollBy(Vector2 scroll)
3452 Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
3453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3457 /// Get the InputMethodContext instance.
3459 /// <returns>The InputMethodContext instance.</returns>
3460 /// <since_tizen> 5 </since_tizen>
3461 public InputMethodContext GetInputMethodContext()
3463 if (inputMethodContext == null)
3465 /*Avoid raising InputMethodContext reference count.*/
3466 inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
3467 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3469 return inputMethodContext;
3473 /// Select the whole text.
3475 /// <since_tizen> 9 </since_tizen>
3476 public void SelectWholeText()
3478 Interop.TextEditor.SelectWholeText(SwigCPtr);
3479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3483 /// Select text from start to end index. <br />
3484 /// The index is valid when 0 or positive.
3486 /// <param name="start">The start index for selection.</param>
3487 /// <param name="end">The end index for selection.</param>
3489 /// If the end index exceeds the maximum value, it is set to the length of the text.
3491 /// <since_tizen> 9 </since_tizen>
3492 public void SelectText(int start, int end)
3495 throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
3497 throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
3499 Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
3500 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3504 /// Clear selection of the text. <br />
3505 /// Valid when selection is activate.
3507 /// <since_tizen> 9 </since_tizen>
3508 public void SelectNone()
3510 _ = Interop.TextEditor.SelectNone(SwigCPtr);
3511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3515 /// The Enable grab handle property.<br />
3516 /// Enables the grab handles for text selection.<br />
3517 /// The default value is true, which means the grab handles are enabled by default.<br />
3519 [EditorBrowsable(EditorBrowsableState.Never)]
3520 public bool EnableGrabHandle
3524 if (NUIApplication.IsUsingXaml)
3526 return (bool)GetValue(EnableGrabHandleProperty);
3530 return (bool)GetInternalEnableGrabHandleProperty(this);
3535 if (NUIApplication.IsUsingXaml)
3537 SetValue(EnableGrabHandleProperty, value);
3541 SetInternalEnableGrabHandleProperty(this, null, value);
3543 NotifyPropertyChanged();
3548 /// The Enable grab handle popup property.<br />
3549 /// Enables the grab handle popup for text selection.<br />
3550 /// The default value is true, which means the grab handle popup is enabled by default.<br />
3552 [EditorBrowsable(EditorBrowsableState.Never)]
3553 public bool EnableGrabHandlePopup
3557 if (NUIApplication.IsUsingXaml)
3559 return (bool)GetValue(EnableGrabHandlePopupProperty);
3563 return (bool)GetInternalEnableGrabHandlePopupProperty(this);
3568 if (NUIApplication.IsUsingXaml)
3570 SetValue(EnableGrabHandlePopupProperty, value);
3574 SetInternalEnableGrabHandlePopupProperty(this, null, value);
3576 NotifyPropertyChanged();
3581 /// Minimum line size to be used.<br />
3582 /// The height of the line in points. <br />
3583 /// If the font size is larger than the line size, it works with the font size. <br />
3585 [EditorBrowsable(EditorBrowsableState.Never)]
3586 public float MinLineSize
3590 if (NUIApplication.IsUsingXaml)
3592 return (float)GetValue(MinLineSizeProperty);
3596 return (float)GetInternalMinLineSizeProperty(this);
3601 if (NUIApplication.IsUsingXaml)
3603 SetValue(MinLineSizeProperty, value);
3607 SetInternalMinLineSizeProperty(this, null, value);
3609 NotifyPropertyChanged();
3613 internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
3615 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));
3616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3621 /// The spaces between characters in Pixels.
3623 /// A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).<br />
3624 /// The default value is 0.f which does nothing.
3627 [EditorBrowsable(EditorBrowsableState.Never)]
3628 public float CharacterSpacing
3632 if (NUIApplication.IsUsingXaml)
3634 return (float)GetValue(CharacterSpacingProperty);
3638 return (float)GetInternalCharacterSpacingProperty(this);
3643 if (NUIApplication.IsUsingXaml)
3645 SetValue(CharacterSpacingProperty, value);
3649 SetInternalCharacterSpacingProperty(this, null, value);
3651 NotifyPropertyChanged();
3658 /// <since_tizen> 3 </since_tizen>
3659 protected override void Dispose(DisposeTypes type)
3666 internalPlaceholderTextColor?.Dispose();
3667 internalPrimaryCursorColor?.Dispose();
3668 internalSecondaryCursorColor?.Dispose();
3669 internalSelectionHighlightColor?.Dispose();
3670 internalInputColor?.Dispose();
3671 internalTextColor?.Dispose();
3672 internalGrabHandleColor?.Dispose();
3674 if (hasSystemLanguageChanged)
3676 systemLocaleLanguageChanged.Remove(SystemSettings_LocaleLanguageChanged);
3679 RemoveSystemSettingsFontTypeChanged();
3680 RemoveSystemSettingsFontSizeChanged();
3682 //Release your own unmanaged resources here.
3683 //You should not access any managed member here except static instance.
3684 //because the execution order of Finalizes is non-deterministic.
3688 if (textEditorTextChangedCallbackDelegate != null)
3690 TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
3693 if (textEditorMaxLengthReachedCallbackDelegate != null)
3695 this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
3698 if (textEditorSelectionStartedCallbackDelegate != null)
3700 this.SelectionStartedSignal().Disconnect(textEditorSelectionStartedCallbackDelegate);
3703 if (textEditorSelectionClearedCallbackDelegate != null)
3705 this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
3708 if (textEditorCursorPositionChangedCallbackDelegate != null)
3710 this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
3713 if (textEditorSelectionChangedCallbackDelegate != null)
3715 this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
3719 TextChanged -= TextEditorTextChanged;
3720 GetInputMethodContext()?.DestroyContext();
3725 /// This will not be public opened.
3726 [EditorBrowsable(EditorBrowsableState.Never)]
3727 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
3729 Interop.TextEditor.DeleteTextEditor(swigCPtr);
3732 internal override LayoutItem CreateDefaultLayout()
3734 return new TextEditorLayout();
3737 internal void SetTextWithoutTextChanged(string text)
3739 invokeTextChanged = false;
3740 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(text));
3741 invokeTextChanged = true;
3744 private string SetTranslatable(string textEditorSid)
3746 string translatableText = null;
3747 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
3748 if (translatableText != null)
3750 if (hasSystemLanguageChanged == false)
3752 systemLocaleLanguageChanged.Add(SystemSettings_LocaleLanguageChanged);
3753 hasSystemLanguageChanged = true;
3755 return translatableText;
3759 translatableText = "";
3760 return translatableText;
3764 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
3766 if (textEditorTextSid != null)
3768 Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
3770 if (textEditorPlaceHolderTextSid != null)
3772 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
3776 private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
3778 float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
3779 SetInternalFontSizeScale(newFontSizeScale);
3782 private void AddSystemSettingsFontSizeChanged()
3784 if (hasSystemFontSizeChanged != true)
3788 SystemFontSizeChangedManager.Add(SystemSettingsFontSizeChanged);
3789 hasSystemFontSizeChanged = true;
3793 Console.WriteLine("{0} Exception caught.", e);
3794 hasSystemFontSizeChanged = false;
3799 private void RemoveSystemSettingsFontSizeChanged()
3801 if (hasSystemFontSizeChanged == true)
3805 SystemFontSizeChangedManager.Remove(SystemSettingsFontSizeChanged);
3806 hasSystemFontSizeChanged = false;
3810 Console.WriteLine("{0} Exception caught.", e);
3811 hasSystemFontSizeChanged = true;
3816 private void SystemSettingsFontTypeChanged(object sender, FontTypeChangedEventArgs e)
3818 SetInternalFontFamily(e.Value);
3821 private void AddSystemSettingsFontTypeChanged()
3823 if (HasStyle() && !hasSystemFontTypeChanged)
3827 systemFontTypeChanged.Add(SystemSettingsFontTypeChanged);
3828 hasSystemFontTypeChanged = true;
3832 Console.WriteLine("{0} Exception caught.", e);
3833 hasSystemFontTypeChanged = false;
3838 private void RemoveSystemSettingsFontTypeChanged()
3840 if (hasSystemFontTypeChanged)
3844 systemFontTypeChanged.Remove(SystemSettingsFontTypeChanged);
3845 hasSystemFontTypeChanged = false;
3849 Console.WriteLine("{0} Exception caught.", e);
3850 hasSystemFontTypeChanged = true;
3855 private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
3857 if (!isSettingTextInCSharp)
3859 EnforceNotifyBindedInstance(TextProperty);
3863 internal new class Property
3865 internal static readonly int TEXT = Interop.TextEditor.TextGet();
3866 internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
3867 internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
3868 internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
3869 internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
3870 internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
3871 internal static readonly int VerticalAlignment = Interop.TextEditor.VerticalAlignmentGet();
3872 internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
3873 internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
3874 internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
3875 internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
3876 internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
3877 internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
3878 internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
3879 internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
3880 internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
3881 internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
3882 internal static readonly int SelectionPopupStyle = Interop.TextEditor.SelectionPopupStyleGet();
3883 internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
3884 internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
3885 internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
3886 internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
3887 internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
3888 internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
3889 internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
3890 internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
3891 internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
3892 internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
3893 internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
3894 internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
3895 internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
3896 internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
3897 internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
3898 internal static readonly int RelativeLineHeight = Interop.TextEditor.RelativeLineHeightGet();
3899 internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
3900 internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
3901 internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
3902 internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
3903 internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
3904 internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
3905 internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
3906 internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
3907 internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
3908 internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
3909 internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
3910 internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
3911 internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
3912 internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
3913 internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
3914 internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
3915 internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
3916 internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
3917 internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
3918 internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
3919 internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
3920 internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
3921 internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
3922 internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
3923 internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
3924 internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
3925 internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
3926 internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
3927 internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
3928 internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
3929 internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
3930 internal static readonly int EnableFontSizeScale = Interop.TextEditor.EnableFontSizeScaleGet();
3931 internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
3932 internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
3933 internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
3934 internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
3935 internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
3936 internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
3937 internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
3938 internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
3939 internal static readonly int Strikethrough = Interop.TextEditor.StrikethroughGet();
3940 internal static readonly int CharacterSpacing = Interop.TextEditor.CharacterSpacingGet();
3942 internal static void Preload()
3944 // Do nothing. Just call for load static values.
3948 internal class InputStyle
3954 FontFamily = 0x0002,
3957 LineSpacing = 0x0010,
3965 private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
3967 DecorationBoundingBox = new Rectangle(x, y, width, height);
3969 private void OnInputColorChanged(float x, float y, float z, float w)
3971 InputColor = new Vector4(x, y, z, w);
3973 private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
3975 PlaceholderTextColor = new Color(r, g, b, a);
3977 private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
3979 PrimaryCursorColor = new Vector4(x, y, z, w);
3981 private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
3983 SecondaryCursorColor = new Vector4(x, y, z, w);
3985 private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
3987 SelectionHighlightColor = new Vector4(x, y, z, w);
3989 private void OnTextColorChanged(float x, float y, float z, float w)
3991 TextColor = new Vector4(x, y, z, w);
3993 private void OnGrabHandleColorChanged(float r, float g, float b, float a)
3995 GrabHandleColor = new Color(r, g, b, a);
3998 internal class TextEditorLayout : LayoutItem
4000 protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
4002 // Padding will be automatically applied by DALi TextEditor.
4003 var totalWidth = widthMeasureSpec.Size.AsDecimal();
4004 var totalHeight = heightMeasureSpec.Size.AsDecimal();
4005 var minSize = Owner.MinimumSize;
4006 var maxSize = Owner.MaximumSize;
4007 var naturalSize = Owner.GetNaturalSize();
4009 if (((TextEditor)Owner).Text.Length == 0)
4011 // Calculate height of TextEditor by setting Text with " ".
4012 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
4013 ((TextEditor)Owner).SetTextWithoutTextChanged(" ");
4015 // Store original WidthSpecification to restore it after setting ResizePolicy.
4016 var widthSpecification = Owner.WidthSpecification;
4018 // In DALi's Size logic, if Width or Height is set to be 0, then
4019 // ResizePolicy is not changed to Fixed.
4020 // This causes Size changes after NUI Layout's OnMeasure is finished.
4021 // e.g. TextEditor's Width fills to its parent although Text is null and
4022 // WidthSpecification is WrapContent.
4023 // To prevent the Size changes, WidthResizePolicy is set to be Fixed
4024 // in advance if Text is null.
4025 Owner.WidthResizePolicy = ResizePolicyType.Fixed;
4027 // Restore WidthSpecification because ResizePolicy changes WidthSpecification.
4028 Owner.WidthSpecification = widthSpecification;
4030 naturalSize = Owner.GetNaturalSize();
4032 // Restore TextEditor's Text after calculating height of TextEditor.
4033 // By calling SetTextWithoutTextChanged, TextChanged callback is not called for this.
4034 ((TextEditor)Owner).SetTextWithoutTextChanged("");
4037 if (widthMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
4039 float width = naturalSize != null ? naturalSize.Width : 0;
4040 totalWidth = Math.Min(Math.Max(width, minSize.Width), maxSize.Width);
4043 if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
4045 float height = naturalSize != null ? naturalSize.Height : 0;
4046 totalHeight = Math.Min(Math.Max(height, minSize.Height), maxSize.Height);
4049 widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
4050 heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
4052 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
4053 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
4055 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
4056 ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));