/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using TizenSystemSettings.Tizen.System;
using System;
-using System.Runtime.InteropServices;
using System.Globalization;
using System.ComponentModel;
+using Tizen.NUI.Text;
namespace Tizen.NUI.BaseComponents
{
/// <summary>
/// A control which provides a multi-line editable text editor.
/// </summary>
- public class TextEditor : View
+ /// <since_tizen> 3 </since_tizen>
+ public partial class TextEditor : View
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private string textEditorTextSid = null;
private string textEditorPlaceHolderTextSid = null;
private bool systemlangTextFlag = false;
+ private InputMethodContext inputMethodContext = null;
+ private float fontSizeScale = 1.0f;
+ private bool hasFontSizeChangedCallback = false;
- internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
- {
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
- }
-
- /// <summary>
- /// Dispose.
- /// </summary>
- protected override void Dispose(DisposeTypes type)
- {
- if (disposed)
- {
- return;
- }
-
- if(type == DisposeTypes.Explicit)
- {
- //Called by User
- //Release your own managed resources here.
- //You should release all of your own disposable objects here.
- }
-
- //Release your own unmanaged resources here.
- //You should not access any managed member here except static instance.
- //because the execution order of Finalizes is non-deterministic.
-
- if (_textEditorTextChangedCallbackDelegate != null)
- {
- TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
- }
-
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_TextEditor(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
-
- base.Dispose(type);
- }
-
- /// <summary>
- /// Event arguments that passed via the TextChanged signal.
- /// </summary>
- public class TextChangedEventArgs : EventArgs
- {
- private TextEditor _textEditor;
-
- /// <summary>
- /// TextEditor - is the texteditor control which has the text contents changed.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public TextEditor TextEditor
- {
- get
- {
- return _textEditor;
- }
- set
- {
- _textEditor = value;
- }
- }
- }
-
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
- private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
- private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
+ static TextEditor() { }
/// <summary>
- /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
- /// provided by the user. The TextChanged signal is emitted when the text changes.<br />
+ /// Creates the TextEditor control.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public event EventHandler<TextChangedEventArgs> TextChanged
+ public TextEditor() : this(Interop.TextEditor.New(), true)
{
- add
- {
- if (_textEditorTextChangedEventHandler == null)
- {
- _textEditorTextChangedCallbackDelegate = (OnTextChanged);
- TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
- }
- _textEditorTextChangedEventHandler += value;
- }
- remove
- {
- _textEditorTextChangedEventHandler -= value;
- if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
- {
- TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
- }
- }
- }
-
- private void OnTextChanged(IntPtr textEditor)
- {
- TextChangedEventArgs e = new TextChangedEventArgs();
-
- // Populate all members of "e" (TextChangedEventArgs) with real data
- e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
-
- if (_textEditorTextChangedEventHandler != null)
- {
- //here we send all data to user event handlers
- _textEditorTextChangedEventHandler(this, e);
- }
-
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// Event arguments that passed via the ScrollStateChanged signal.
+ /// Creates the TextEditor with specified style.
/// </summary>
- public class ScrollStateChangedEventArgs : EventArgs
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
{
- private TextEditor _textEditor;
- private ScrollState _scrollState;
-
- /// <summary>
- /// TextEditor - is the texteditor control which has the scroll state changed.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public TextEditor TextEditor
- {
- get
- {
- return _textEditor;
- }
- set
- {
- _textEditor = value;
- }
- }
-
- /// <summary>
- /// ScrollState - is the texteditor control scroll state.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ScrollState ScrollState
- {
- get
- {
- return _scrollState;
- }
- set
- {
- _scrollState = value;
- }
- }
}
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
- private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
- private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
-
/// <summary>
- /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler
- /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.<br />
+ /// Creates the TextEditor with setting the status of shown or hidden.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
+ /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
+ /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
{
- add
- {
- if (_textEditorScrollStateChangedEventHandler == null)
- {
- _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
- ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
- }
- _textEditorScrollStateChangedEventHandler += value;
- }
- remove
- {
- _textEditorScrollStateChangedEventHandler -= value;
- if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
- {
- ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
- }
- }
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ SetVisible(shown);
}
- private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
+ internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
{
- ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
-
- if (textEditor != null)
- {
- // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
- e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
- e.ScrollState = state;
- }
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if (_textEditorScrollStateChangedEventHandler != null)
+ if (!shown)
{
- //here we send all data to user event handlers
- _textEditorScrollStateChangedEventHandler(this, e);
+ SetVisible(false);
}
}
- internal new class Property
- {
- internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get();
- internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get();
- internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get();
- internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get();
- internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get();
- internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get();
- internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
- internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get();
- internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get();
- internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
- internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
- internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
- internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
- internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get();
- internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get();
- internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
- internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
- internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
- internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
- internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
- internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
- internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
- internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
- internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
- internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
- internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get();
- internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get();
- internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get();
- internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get();
- internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get();
- internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get();
- internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get();
- internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get();
- internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get();
- internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get();
- internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get();
- internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get();
- internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get();
- internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get();
- internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get();
- internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get();
- internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
- internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get();
- internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
- internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
- internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get();
- internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
- internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
- internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
- internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
- internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
- internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get();
- }
-
- internal class InputStyle
+ internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
{
- internal enum Mask
+ if (!shown)
{
- None = 0x0000,
- Color = 0x0001,
- FontFamily = 0x0002,
- PointSize = 0x0004,
- FontStyle = 0x0008,
- LineSpacing = 0x0010,
- Underline = 0x0020,
- Shadow = 0x0040,
- Emboss = 0x0080,
- Outline = 0x0100
+ SetVisible(false);
}
}
/// <summary>
- /// Creates the TextEditor control.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- }
- internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- /// <summary>
- /// Downcasts a handle to textEditor handle.
- /// </summary>
- /// <param name="handle"></param>
- /// <returns></returns>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use as keyword.
- [Obsolete("Please DO NOT use! This will be deprecated, instead please USE as keyword.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public new static TextEditor DownCast(BaseHandle handle)
- {
- TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal TextEditorSignal TextChangedSignal()
- {
- TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
- {
- ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
- {
- 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(NDalicPINVOKE.TextEditor_InputStyleChangedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
/// The TranslatableText property.<br />
/// The text can set the SID value.<br />
/// </summary>
{
if (NUIApplication.MultilingualResourceManager == null)
{
- throw new ArgumentNullException("ResourceManager about multilingual is null");
+ throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
}
textEditorTextSid = value;
Text = SetTranslatable(textEditorTextSid);
+ NotifyPropertyChanged();
}
}
/// <summary>
{
if (NUIApplication.MultilingualResourceManager == null)
{
- throw new ArgumentNullException("ResourceManager about multilingual is null");
+ throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
}
textEditorPlaceHolderTextSid = value;
PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
+ NotifyPropertyChanged();
}
}
- private string SetTranslatable(string textEditorSid)
- {
- string translatableText = null;
- translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
- if (translatableText != null)
- {
- if (systemlangTextFlag == false)
- {
- SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
- systemlangTextFlag = true;
- }
- return translatableText;
- }
- else
- {
- translatableText = "";
- return translatableText;
- }
- }
- private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
- {
- if (textEditorTextSid != null)
- {
- Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
- }
- if (textEditorPlaceHolderTextSid != null)
- {
- PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
- }
- }
+
/// <summary>
/// The Text property.
/// </summary>
{
get
{
- string temp;
- GetProperty(TextEditor.Property.TEXT).Get(out temp);
- return temp;
+ return (string)GetValue(TextProperty);
}
set
{
- SetProperty(TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue(value));
+ SetValueAndForceSendChangeSignal(TextProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The TextColor property.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Vector4 TextColor
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(TextEditor.Property.TEXT_COLOR).Get(temp);
- return temp;
+ Vector4 temp = (Vector4)GetValue(TextColorProperty);
+ return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
- SetProperty(TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(TextColorProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.FONT_FAMILY).Get(out temp);
- return temp;
+ return (string)GetValue(FontFamilyProperty);
}
set
{
- SetProperty(TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
+ SetValue(FontFamilyProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The FontStyle property.
+ /// The fontStyle map contains the following keys :<br />
+ /// <list type="table">
+ /// <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>
+ /// <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>
+ /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public PropertyMap FontStyle
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.FONT_STYLE).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(FontStyleProperty);
}
set
{
- SetProperty(TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
+ SetValue(FontStyleProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
+ /// Set FontStyle to TextEditor. <br />
+ /// </summary>
+ /// <param name="fontStyle">The FontStyle</param>
+ /// <remarks>
+ /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetFontStyle method.
+ /// <code>
+ /// var fontStyle = new Tizen.NUI.Text.FontStyle();
+ /// fontStyle.Width = FontWidthType.Expanded;
+ /// fontStyle.Weight = FontWeightType.Bold;
+ /// fontStyle.Slant = FontSlantType.Italic;
+ /// editor.SetFontStyle(fontStyle);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetFontStyle(FontStyle fontStyle)
+ {
+ SetProperty(TextEditor.Property.FontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
+ }
+
+ /// <summary>
+ /// Get FontStyle from TextEditor. <br />
+ /// </summary>
+ /// <returns>The FontStyle</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.FontStyle"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public FontStyle GetFontStyle()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.FontStyle).Get(map);
+ return TextUtils.GetFontStyleStruct(map);
+ }
+
+ /// <summary>
/// The PointSize property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.POINT_SIZE).Get(out temp);
- return temp;
+ return (float)GetValue(PointSizeProperty);
}
set
{
- SetProperty(TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
+ SetValue(PointSizeProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- if (GetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
- {
- NUILog.Error("HorizontalAlignment get error!");
- }
-
- switch (temp)
- {
- case "BEGIN":
- return HorizontalAlignment.Begin;
- case "CENTER":
- return HorizontalAlignment.Center;
- case "END":
- return HorizontalAlignment.End;
- default:
- return HorizontalAlignment.Begin;
- }
+ return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
}
set
{
- string valueToString = "";
- switch (value)
- {
- case HorizontalAlignment.Begin:
- {
- valueToString = "BEGIN";
- break;
- }
- case HorizontalAlignment.Center:
- {
- valueToString = "CENTER";
- break;
- }
- case HorizontalAlignment.End:
- {
- valueToString = "END";
- break;
- }
- default:
- {
- valueToString = "BEGIN";
- break;
- }
- }
- SetProperty(TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
+ SetValue(HorizontalAlignmentProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.SCROLL_THRESHOLD).Get(out temp);
- return temp;
+ return (float)GetValue(ScrollThresholdProperty);
}
set
{
- SetProperty(TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScrollThresholdProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.SCROLL_SPEED).Get(out temp);
- return temp;
+ return (float)GetValue(ScrollSpeedProperty);
}
set
{
- SetProperty(TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScrollSpeedProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The PrimaryCursorColor property.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Vector4 PrimaryCursorColor
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp);
- return temp;
+ Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
+ return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
- SetProperty(TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(PrimaryCursorColorProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SecondaryCursorColor property.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Vector4 SecondaryCursorColor
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp);
- return temp;
+ Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
+ return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
- SetProperty(TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(SecondaryCursorColorProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp);
- return temp;
+ return (bool)GetValue(EnableCursorBlinkProperty);
}
set
{
- SetProperty(TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue(value));
+ SetValue(EnableCursorBlinkProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp);
- return temp;
+ return (float)GetValue(CursorBlinkIntervalProperty);
}
set
{
- SetProperty(TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue(value));
+ SetValue(CursorBlinkIntervalProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp);
- return temp;
+ return (float)GetValue(CursorBlinkDurationProperty);
}
set
{
- SetProperty(TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue(value));
+ SetValue(CursorBlinkDurationProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- int temp = 0;
- GetProperty(TextEditor.Property.CURSOR_WIDTH).Get(out temp);
- return temp;
+ return (int)GetValue(CursorWidthProperty);
}
set
{
- SetProperty(TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue(value));
+ SetValue(CursorWidthProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp);
- return temp;
+ return (string)GetValue(GrabHandleImageProperty);
}
set
{
- SetProperty(TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue(value));
+ SetValue(GrabHandleImageProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp);
- return temp;
+ return (string)GetValue(GrabHandlePressedImageProperty);
}
set
{
- SetProperty(TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue(value));
+ SetValue(GrabHandlePressedImageProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHandleImageLeft property.
+ /// The selectionHandleImageLeft map contains the following key :<br />
+ /// <list type="table">
+ /// <item><term>filename (string)</term><description>The path of image file</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleImageLeft
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHandleImageLeftProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHandleImageRight property.
+ /// The selectionHandleImageRight map contains the following key :<br />
+ /// <list type="table">
+ /// <item><term>filename (string)</term><description>The path of image file</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleImageRight
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHandleImageRightProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHandlePressedImageLeft property.
+ /// The selectionHandlePressedImageLeft map contains the following key :<br />
+ /// <list type="table">
+ /// <item><term>filename (string)</term><description>The path of image file</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandlePressedImageLeft
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHandlePressedImageLeftProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHandlePressedImageRight property.
+ /// The selectionHandlePressedImageRight map contains the following key :<br />
+ /// <list type="table">
+ /// <item><term>filename (string)</term><description>The path of image file</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandlePressedImageRight
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHandlePressedImageRightProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHandleMarkerImageLeft property.
+ /// The selectionHandleMarkerImageLeft map contains the following key :<br />
+ /// <list type="table">
+ /// <item><term>filename (string)</term><description>The path of image file</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleMarkerImageLeft
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHandleMarkerImageLeftProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHandleMarkerImageRight property.
+ /// The selectionHandleMarkerImageRight map contains the following key :<br />
+ /// <list type="table">
+ /// <item><term>filename (string)</term><description>The path of image file</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
public PropertyMap SelectionHandleMarkerImageRight
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHandleMarkerImageRightProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The SelectionHighlightColor property.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Vector4 SelectionHighlightColor
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp);
- return temp;
+ Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
+ return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
- SetProperty(TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(SelectionHighlightColorProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The DecorationBoundingBox property.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Rectangle DecorationBoundingBox
{
get
{
- Rectangle temp = new Rectangle(0, 0, 0, 0);
- GetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp);
- return temp;
+ Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
+ return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
}
set
{
- SetProperty(TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue(value));
+ SetValue(DecorationBoundingBoxProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(TextEditor.Property.ENABLE_MARKUP).Get(out temp);
- return temp;
+ return (bool)GetValue(EnableMarkupProperty);
}
set
{
- SetProperty(TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
+ SetValue(EnableMarkupProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The InputColor property.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Vector4 InputColor
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(TextEditor.Property.INPUT_COLOR).Get(temp);
- return temp;
+ Vector4 temp = (Vector4)GetValue(InputColorProperty);
+ return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
- SetProperty(TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputColorProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp);
- return temp;
+ return (string)GetValue(InputFontFamilyProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputFontFamilyProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The InputFontStyle property.
+ /// The inputFontStyle map contains the following keys :<br />
+ /// <list type="table">
+ /// <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>
+ /// <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>
+ /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public PropertyMap InputFontStyle
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.INPUT_FONT_STYLE).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(InputFontStyleProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputFontStyleProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// The InputPointSize property.
+ /// Set InputFontStyle to TextEditor. <br />
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public float InputPointSize
+ /// <param name="fontStyle">The FontStyle</param>
+ /// <remarks>
+ /// SetInputFontStyle specifies the requested font style for new input text through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetInputFontStyle method.
+ /// <code>
+ /// var fontStyle = new Tizen.NUI.Text.FontStyle();
+ /// fontStyle.Width = FontWidthType.Expanded;
+ /// fontStyle.Weight = FontWeightType.Bold;
+ /// fontStyle.Slant = FontSlantType.Italic;
+ /// editor.SetInputFontStyle(fontStyle);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetInputFontStyle(FontStyle fontStyle)
{
- get
- {
- float temp = 0.0f;
- GetProperty(TextEditor.Property.INPUT_POINT_SIZE).Get(out temp);
- return temp;
- }
+ SetProperty(TextEditor.Property.InputFontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
+ NotifyPropertyChanged();
+ }
+
+ /// <summary>
+ /// Get InputFontStyle from TextEditor. <br />
+ /// </summary>
+ /// <returns>The FontStyle</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.FontStyle"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public FontStyle GetInputFontStyle()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.InputFontStyle).Get(map);
+ return TextUtils.GetFontStyleStruct(map);
+ }
+
+ /// <summary>
+ /// The InputPointSize property.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public float InputPointSize
+ {
+ get
+ {
+ return (float)GetValue(InputPointSizeProperty);
+ }
set
{
- SetProperty(TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputPointSizeProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.LINE_SPACING).Get(out temp);
- return temp;
+ return (float)GetValue(LineSpacingProperty);
}
set
{
- SetProperty(TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
+ SetValue(LineSpacingProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.INPUT_LINE_SPACING).Get(out temp);
- return temp;
+ return (float)GetValue(InputLineSpacingProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputLineSpacingProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The Underline property.
+ /// The underline map contains the following keys :<br />
+ /// <list type="table">
+ /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
+ /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
+ /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public PropertyMap Underline
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.UNDERLINE).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(UnderlineProperty);
}
set
{
- SetProperty(TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
+ SetValue(UnderlineProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
+ /// Set Underline to TextEditor. <br />
+ /// </summary>
+ /// <param name="underline">The Underline</param>
+ /// <remarks>
+ /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetUnderline method.
+ /// <code>
+ /// var underline = new Tizen.NUI.Text.Underline();
+ /// underline.Enable = true;
+ /// underline.Color = new Color("#3498DB");
+ /// underline.Height = 2.0f;
+ /// editor.SetUnderline(underline);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetUnderline(Underline underline)
+ {
+ SetProperty(TextEditor.Property.UNDERLINE, new PropertyValue(TextUtils.GetUnderlineMap(underline)));
+ }
+
+ /// <summary>
+ /// Get Underline from TextEditor. <br />
+ /// </summary>
+ /// <returns>The Underline</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Underline"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Underline GetUnderline()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.UNDERLINE).Get(map);
+ return TextUtils.GetUnderlineStruct(map);
+ }
+
+ /// <summary>
/// The InputUnderline property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
get
{
- string temp;
- GetProperty(TextEditor.Property.INPUT_UNDERLINE).Get(out temp);
- return temp;
+ return (string)GetValue(InputUnderlineProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputUnderlineProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The Shadow property.
+ /// The shadow map contains the following keys :<br />
+ /// <list type="table">
+ /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
+ /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
+ /// <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>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public PropertyMap Shadow
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.SHADOW).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(ShadowProperty);
}
set
{
- SetProperty(TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
+ SetValue(ShadowProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
+ /// Set Shadow to TextEditor. <br />
+ /// </summary>
+ /// <param name="shadow">The Shadow</param>
+ /// <remarks>
+ /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetShadow method.
+ /// <code>
+ /// var shadow = new Tizen.NUI.Text.Shadow();
+ /// shadow.Offset = new Vector2(3, 3);
+ /// shadow.Color = new Color("#F1C40F");
+ /// editor.SetShadow(shadow);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetShadow(Tizen.NUI.Text.Shadow shadow)
+ {
+ SetProperty(TextEditor.Property.SHADOW, new PropertyValue(TextUtils.GetShadowMap(shadow)));
+ }
+
+ /// <summary>
+ /// Get Shadow from TextEditor. <br />
+ /// </summary>
+ /// <returns>The Shadow</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Shadow"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Tizen.NUI.Text.Shadow GetShadow()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.SHADOW).Get(map);
+ return TextUtils.GetShadowStruct(map);
+ }
+
+ /// <summary>
/// The InputShadow property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
get
{
- string temp;
- GetProperty(TextEditor.Property.INPUT_SHADOW).Get(out temp);
- return temp;
+ return (string)GetValue(InputShadowProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputShadowProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.EMBOSS).Get(out temp);
- return temp;
+ return (string)GetValue(EmbossProperty);
}
set
{
- SetProperty(TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
+ SetValue(EmbossProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.INPUT_EMBOSS).Get(out temp);
- return temp;
+ return (string)GetValue(InputEmbossProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputEmbossProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The Outline property.
+ /// The outline map contains the following keys :<br />
+ /// <list type="table">
+ /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
+ /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
+ /// </list>
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public PropertyMap Outline
{
get
{
- PropertyMap temp = new PropertyMap();
- GetProperty(TextEditor.Property.OUTLINE).Get(temp);
- return temp;
+ return (PropertyMap)GetValue(OutlineProperty);
}
set
{
- SetProperty(TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
+ SetValue(OutlineProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
+ /// Set Outline to TextEditor. <br />
+ /// </summary>
+ /// <param name="outline">The Outline</param>
+ /// <remarks>
+ /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetOutline method.
+ /// <code>
+ /// var outline = new Tizen.NUI.Text.Outline();
+ /// outline.Width = 2.0f;
+ /// outline.Color = new Color("#45B39D");
+ /// editor.SetOutline(outline);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetOutline(Outline outline)
+ {
+ SetProperty(TextEditor.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
+ }
+
+ /// <summary>
+ /// Get Outline from TextEditor. <br />
+ /// </summary>
+ /// <returns>The Outline</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Outline"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Outline GetOutline()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.OUTLINE).Get(map);
+ return TextUtils.GetOutlineStruct(map);
+ }
+
+ /// <summary>
/// The InputOutline property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
get
{
- string temp;
- GetProperty(TextEditor.Property.INPUT_OUTLINE).Get(out temp);
- return temp;
+ return (string)GetValue(InputOutlineProperty);
}
set
{
- SetProperty(TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue(value));
+ SetValue(InputOutlineProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(out temp);
- return temp;
+ return (bool)GetValue(SmoothScrollProperty);
}
set
{
- SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value));
+ SetValue(SmoothScrollProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp);
- return temp;
+ return (float)GetValue(SmoothScrollDurationProperty);
}
set
{
- SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value));
+ SetValue(SmoothScrollDurationProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- bool temp = false;
- GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp);
- return temp;
+ return (bool)GetValue(EnableScrollBarProperty);
}
set
{
- SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value));
+ SetValue(EnableScrollBarProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp);
- return temp;
+ return (float)GetValue(ScrollBarShowDurationProperty);
}
set
{
- SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScrollBarShowDurationProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp);
- return temp;
+ return (float)GetValue(ScrollBarFadeDurationProperty);
}
set
{
- SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value));
+ SetValue(ScrollBarFadeDurationProperty, value);
+ NotifyPropertyChanged();
}
}
{
get
{
- float temp = 0.0f;
- GetProperty(TextEditor.Property.PIXEL_SIZE).Get(out temp);
- return temp;
+ return (float)GetValue(PixelSizeProperty);
}
set
{
- SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
+ SetValue(PixelSizeProperty, value);
+ NotifyPropertyChanged();
}
}
get
{
int temp = 0;
- GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
+ GetProperty(TextEditor.Property.LineCount).Get(out temp);
return temp;
}
}
{
get
{
- string temp;
- GetProperty(TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp);
- return temp;
+ return (string)GetValue(PlaceholderTextProperty);
}
set
{
- SetProperty(TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue(value));
+ SetValue(PlaceholderTextProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The Selected Text property (read-only).
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string SelectedText
+ {
+ get
+ {
+ string temp;
+ GetProperty(TextEditor.Property.SelectedText).Get(out temp);
+ return temp;
}
}
/// <summary>
/// The Placeholder text color.
/// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Color PlaceholderTextColor
{
get
{
- Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
- GetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp);
- return temp;
+ Color temp = (Color)GetValue(PlaceholderTextColorProperty);
+ return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
}
set
{
- SetProperty(TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
+ SetValue(PlaceholderTextColorProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
/// The EnableSelection property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
+ /// <since_tizen> 3 </since_tizen>
public bool EnableSelection
{
get
{
- bool temp = false;
- GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
+ return (bool)GetValue(EnableSelectionProperty);
+ }
+ set
+ {
+ SetValue(EnableSelectionProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The start index for selection.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int SelectedTextStart
+ {
+ get
+ {
+ int temp;
+ GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp);
+ return temp;
+ }
+ set
+ {
+ SetProperty(TextEditor.Property.SelectedTextStart, new PropertyValue(value));
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The end index for selection.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int SelectedTextEnd
+ {
+ get
+ {
+ int temp;
+ GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp);
+ return temp;
+ }
+ set
+ {
+ SetProperty(TextEditor.Property.SelectedTextEnd, new PropertyValue(value));
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Enable editing in text control.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done, Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool EnableEditing
+ {
+ get
+ {
+ bool temp;
+ GetProperty(TextEditor.Property.EnableEditing).Get(out temp);
+ return temp;
+ }
+ set
+ {
+ SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value));
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Specify horizontal scroll position in text control.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int HorizontalScrollPosition
+ {
+ get
+ {
+ int temp;
+ using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition))
+ {
+ propertyValue.Get(out temp);
+ }
+ return temp;
+ }
+ set
+ {
+ using (PropertyValue propertyValue = new PropertyValue(value))
+ {
+ SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue);
+ NotifyPropertyChanged();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Specify vertical scroll position in text control.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int VerticalScrollPosition
+ {
+ get
+ {
+ int temp;
+ using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition))
+ {
+ propertyValue.Get(out temp);
+ }
+ return temp;
+ }
+ set
+ {
+ using (PropertyValue propertyValue = new PropertyValue(value))
+ {
+ SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue);
+ NotifyPropertyChanged();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Specify primary cursor (caret) position in text control.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int PrimaryCursorPosition
+ {
+ get
+ {
+ int temp;
+ using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition))
+ {
+ propertyValue.Get(out temp);
+ }
return temp;
}
set
{
- SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
+ using (PropertyValue propertyValue = new PropertyValue(value))
+ {
+ SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue);
+ NotifyPropertyChanged();
+ }
+ }
+ }
+
+ /// <summary>
+ /// The GrabHandleColor property.
+ /// </summary>
+ /// <remarks>
+ /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Color GrabHandleColor
+ {
+ get
+ {
+ Color temp = (Color)GetValue(GrabHandleColorProperty);
+ return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A);
+ }
+ set
+ {
+ SetValue(GrabHandleColorProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
+ /// Set InputFilter to TextEditor. <br />
+ /// </summary>
+ /// <param name="inputFilter">The InputFilter</param>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.InputFilter"/> filters input based on regular expressions. <br />
+ /// Users can set the Accepted or Rejected regular expression set, or both. <br />
+ /// If both are used, Rejected has higher priority. <br />
+ /// The character set must follow the regular expression rules. <br />
+ /// Behaviour can not be guaranteed for incorrect grammars. <br />
+ /// Refer the link below for detailed rules. <br />
+ /// The functions in std::regex library use the ECMAScript grammar: <br />
+ /// http://cplusplus.com/reference/regex/ECMAScript/ <br />
+ /// InputFiltered signal is emitted when the input is filtered by InputFilter <br />
+ /// See <see cref="InputFiltered"/>, <see cref="InputFilterType"/> and <see cref="InputFilteredEventArgs"/> for a detailed description. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetInputFilter method.
+ /// <code>
+ /// var inputFilter = new Tizen.NUI.Text.InputFilter();
+ /// inputFilter.Accepted = @"[\d]"; // accept whole digits
+ /// inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
+ /// editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetInputFilter(InputFilter inputFilter)
+ {
+ SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter)));
+ }
+
+ /// <summary>
+ /// Get InputFilter from TextEditor. <br />
+ /// </summary>
+ /// <returns>The InputFilter</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.InputFilter"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public InputFilter GetInputFilter()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.InputFilter).Get(map);
+ return TextUtils.GetInputFilterStruct(map);
+ }
+
+ /// <summary>
/// The Placeholder property.
- /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
+ /// The placeholder map contains the following keys :<br />
+ /// <list type="table">
+ /// <item><term>text (string)</term><description>The text to display when the TextEditor is empty and inactive</description></item>
+ /// <item><term>textFocused (string)</term><description>The text to display when the placeholder has focus</description></item>
+ /// <item><term>color (Color)</term><description>The color of the placeholder text</description></item>
+ /// <item><term>fontFamily (string)</term><description>The fontFamily of the placeholder text</description></item>
+ /// <item><term>fontStyle (PropertyMap)</term><description>The fontStyle of the placeholder text</description></item>
+ /// <item><term>pointSize (float)</term><description>The pointSize of the placeholder text</description></item>
+ /// <item><term>pixelSize (float)</term><description>The pixelSize of the placeholder text</description></item>
+ /// <item><term>ellipsis (bool)</term><description>The ellipsis of the placeholder text</description></item>
+ /// </list>
/// </summary>
/// <example>
/// The following example demonstrates how to set the placeholder property.
/// editor.Placeholder = propertyMap;
/// </code>
/// </example>
- /// <since_tizen> 4 </since_tizen>
+ /// <since_tizen> 3 </since_tizen>
public Tizen.NUI.PropertyMap Placeholder
{
get
{
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
- return temp;
+ PropertyMap map = (PropertyMap)GetValue(PlaceholderProperty);
+ PropertyValue value = null;
+
+ // text
+ value = map.Find(0);
+ if (null != value)
+ {
+ value.Get(out string text);
+ map.Add("text", new PropertyValue(text));
+ }
+
+ // textFocused
+ value = map.Find(1);
+ if (null != value)
+ {
+ value.Get(out string textFocused);
+ map.Add("textFocused", new PropertyValue(textFocused));
+ }
+
+ // color
+ value = map.Find(2);
+ if (null != value)
+ {
+ Color color = new Color();
+ value.Get(color);
+ map.Add("color", new PropertyValue(color));
+ }
+
+ // fontFamily
+ value = map.Find(3);
+ if (null != value)
+ {
+ value.Get(out string fontFamily);
+ map.Add("fontFamily", new PropertyValue(fontFamily));
+ }
+
+ // fontStyle
+ value = map.Find(4);
+ if (null != value)
+ {
+ PropertyMap fontStyle = new PropertyMap();
+ value.Get(fontStyle);
+ map.Add("fontStyle", new PropertyValue(fontStyle));
+ }
+
+ // pointSize
+ value = map.Find(5);
+ if (null != value)
+ {
+ value.Get(out float pointSize);
+ map.Add("pointSize", new PropertyValue(pointSize));
+ }
+
+ // pixelSize
+ value = map.Find(6);
+ if (null != value)
+ {
+ value.Get(out float pixelSize);
+ map.Add("pixelSize", new PropertyValue(pixelSize));
+ }
+
+ // ellipsis
+ value = map.Find(7);
+ if (null != value)
+ {
+ value.Get(out bool ellipsis);
+ map.Add("ellipsis", new PropertyValue(ellipsis));
+ }
+
+ return map;
}
set
{
- SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
+ SetValue(PlaceholderProperty, value);
+ NotifyPropertyChanged();
}
}
/// <summary>
- /// The LineWrapMode property.<br />
- /// The line wrap mode when the text lines over the layout width.<br />
+ /// The Ellipsis property.<br />
+ /// Enable or disable the ellipsis.<br />
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public LineWrapMode LineWrapMode
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool Ellipsis
{
get
{
- string temp;
- if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false)
- {
- NUILog.Error("LineWrapMode get error!");
- }
- switch (temp)
- {
- case "WRAP_MODE_WORD":
- return LineWrapMode.Word;
- case "WRAP_MODE_CHARACTER":
- return LineWrapMode.Character;
- default:
- return LineWrapMode.Word;
+ return (bool)GetValue(EllipsisProperty);
+ }
+ set
+ {
+ SetValue(EllipsisProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+
+ /// <summary>
+ /// The ellipsis position of the text.
+ /// The ellipsis position type when the text size over the layout size.<br />
+ /// The ellipsis position: End, Start or Middle.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public EllipsisPosition EllipsisPosition
+ {
+ get
+ {
+ return (EllipsisPosition)GetValue(EllipsisPositionProperty);
+ }
+ set
+ {
+ SetValue(EllipsisPositionProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The LineWrapMode property.<br />
+ /// The line wrap mode when the text lines over the layout width.<br />
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public LineWrapMode LineWrapMode
+ {
+ get
+ {
+ return (LineWrapMode)GetValue(LineWrapModeProperty);
+ }
+ set
+ {
+ SetValue(LineWrapModeProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Enables Text selection using Shift key.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool EnableShiftSelection
+ {
+ get
+ {
+ return (bool)GetValue(EnableShiftSelectionProperty);
+ }
+ set
+ {
+ SetValue(EnableShiftSelectionProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The text alignment to match the direction of the system language.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ public bool MatchSystemLanguageDirection
+ {
+ get
+ {
+ return (bool)GetValue(MatchSystemLanguageDirectionProperty);
+ }
+ set
+ {
+ SetValue(MatchSystemLanguageDirectionProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The MaxLength property.
+ /// </summary>
+ /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int MaxLength
+ {
+ get
+ {
+ return (int)GetValue(MaxLengthProperty);
+ }
+ set
+ {
+ SetValue(MaxLengthProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// Only used by the IL of xaml, will never changed to not hidden.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsCreateByXaml
+ {
+ get
+ {
+ return base.IsCreateByXaml;
+ }
+ set
+ {
+ base.IsCreateByXaml = value;
+
+ if (value == true)
+ {
+ this.TextChanged += (obj, e) =>
+ {
+ this.Text = e.TextEditor.Text;
+ };
}
}
+ }
+
+ /// <summary>
+ /// The FontSizeScale property. <br />
+ /// The default value is 1.0. <br />
+ /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public float FontSizeScale
+ {
+ get
+ {
+ return fontSizeScale;
+ }
set
{
- string temp = "";
- switch (value)
+ float newFontSizeScale;
+
+ if (fontSizeScale == value) return;
+
+ fontSizeScale = value;
+ if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
{
- case LineWrapMode.Word:
+ SystemSettingsFontSize systemSettingsFontSize;
+
+ try
{
- temp = "WRAP_MODE_WORD";
- break;
+ systemSettingsFontSize = SystemSettings.FontSize;
}
- case LineWrapMode.Character:
+ catch (Exception e)
{
- temp = "WRAP_MODE_CHARACTER";
- break;
+ Console.WriteLine("{0} Exception caught.", e);
+ systemSettingsFontSize = SystemSettingsFontSize.Normal;
}
+ newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
+ addFontSizeChangedCallback();
+ }
+ else
+ {
+ newFontSizeScale = fontSizeScale;
+ removeFontSizeChangedCallback();
}
- SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));
+
+ SetValue(FontSizeScaleProperty, newFontSizeScale);
+ NotifyPropertyChanged();
}
}
- }
+ /// <summary>
+ /// The InputMethodSettings property.
+ /// </summary>
+ /// <remarks>
+ /// <see cref="InputMethod"/> is a class encapsulating the input method map. Please use the <see cref="InputMethod"/> class for this property.
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to set the InputMethodSettings property.
+ /// <code>
+ /// InputMethod method = new InputMethod();
+ /// method.PanelLayout = InputMethod.PanelLayoutType.Normal;
+ /// method.ActionButton = InputMethod.ActionButtonTitleType.Default;
+ /// method.AutoCapital = InputMethod.AutoCapitalType.Word;
+ /// method.Variation = 1;
+ /// textEditor.InputMethodSettings = method.OutputMap;
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PropertyMap InputMethodSettings
+ {
+ get
+ {
+ return (PropertyMap)GetValue(InputMethodSettingsProperty);
+ }
+ set
+ {
+ SetValue(InputMethodSettingsProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Scroll the text control by specific amount..
+ /// </summary>
+ /// <param name="scroll">The amount (in pixels) of scrolling in horizontal & vertical directions.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ScrollBy(Vector2 scroll)
+ {
+ Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Get the InputMethodContext instance.
+ /// </summary>
+ /// <returns>The InputMethodContext instance.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ public InputMethodContext GetInputMethodContext()
+ {
+ if (inputMethodContext == null)
+ {
+ /*Avoid raising InputMethodContext reference count.*/
+ inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ return inputMethodContext;
+ }
+
+ /// <summary>
+ /// Select the whole text.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SelectWholeText()
+ {
+ Interop.TextEditor.SelectWholeText(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Select text from start to end index.
+ /// </summary>
+ /// <param name="start">The start index for selection.</param>
+ /// <param name="end">The end index for selection.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SelectText(uint start, uint end)
+ {
+ Interop.TextEditor.SelectText(SwigCPtr, start, end);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Clear selection of the text.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SelectNone()
+ {
+ _ = Interop.TextEditor.SelectNone(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Enable grab handle property.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool EnableGrabHandle
+ {
+ get
+ {
+ return (bool)GetValue(EnableGrabHandleProperty);
+ }
+ set
+ {
+ SetValue(EnableGrabHandleProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Enable grab handle popup property.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool EnableGrabHandlePopup
+ {
+ get
+ {
+ return (bool)GetValue(EnableGrabHandlePopupProperty);
+ }
+ set
+ {
+ SetValue(EnableGrabHandlePopupProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Minimum line size to be used.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float MinLineSize
+ {
+ get
+ {
+ return (float)GetValue(MinLineSizeProperty);
+ }
+ set
+ {
+ SetValue(MinLineSizeProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
+ }
+
+ internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
+ {
+ 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));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (systemlangTextFlag)
+ {
+ SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
+ }
+
+ removeFontSizeChangedCallback();
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+
+ if (this.HasBody())
+ {
+ if (textEditorTextChangedCallbackDelegate != null)
+ {
+ TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
+ }
+
+ if (textEditorMaxLengthReachedCallbackDelegate != null)
+ {
+ this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
+ }
+ }
+
+ base.Dispose(type);
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ // In order to speed up IME hide, temporarily add
+ GetInputMethodContext()?.DestroyContext();
+ Interop.TextEditor.DeleteTextEditor(swigCPtr);
+ }
+
+ private string SetTranslatable(string textEditorSid)
+ {
+ string translatableText = null;
+ translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
+ if (translatableText != null)
+ {
+ if (systemlangTextFlag == false)
+ {
+ SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
+ systemlangTextFlag = true;
+ }
+ return translatableText;
+ }
+ else
+ {
+ translatableText = "";
+ return translatableText;
+ }
+ }
+
+ private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
+ {
+ if (textEditorTextSid != null)
+ {
+ Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
+ }
+ if (textEditorPlaceHolderTextSid != null)
+ {
+ PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
+ }
+ }
+
+ private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
+ {
+ float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
+ SetValue(FontSizeScaleProperty, newFontSizeScale);
+ NotifyPropertyChanged();
+ }
+
+ private void addFontSizeChangedCallback()
+ {
+ if (hasFontSizeChangedCallback != true)
+ {
+ try
+ {
+ SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
+ hasFontSizeChangedCallback = true;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("{0} Exception caught.", e);
+ hasFontSizeChangedCallback = false;
+ }
+ }
+ }
+
+ private void removeFontSizeChangedCallback()
+ {
+ if (hasFontSizeChangedCallback == true)
+ {
+ try
+ {
+ SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
+ hasFontSizeChangedCallback = false;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("{0} Exception caught.", e);
+ hasFontSizeChangedCallback = true;
+ }
+ }
+ }
+
+ internal new class Property
+ {
+ internal static readonly int TEXT = Interop.TextEditor.TextGet();
+ internal static readonly int TextColor = Interop.TextEditor.TextColorGet();
+ internal static readonly int FontFamily = Interop.TextEditor.FontFamilyGet();
+ internal static readonly int FontStyle = Interop.TextEditor.FontStyleGet();
+ internal static readonly int PointSize = Interop.TextEditor.PointSizeGet();
+ internal static readonly int HorizontalAlignment = Interop.TextEditor.HorizontalAlignmentGet();
+ internal static readonly int ScrollThreshold = Interop.TextEditor.ScrollThresholdGet();
+ internal static readonly int ScrollSpeed = Interop.TextEditor.ScrollSpeedGet();
+ internal static readonly int PrimaryCursorColor = Interop.TextEditor.PrimaryCursorColorGet();
+ internal static readonly int SecondaryCursorColor = Interop.TextEditor.SecondaryCursorColorGet();
+ internal static readonly int EnableCursorBlink = Interop.TextEditor.EnableCursorBlinkGet();
+ internal static readonly int CursorBlinkInterval = Interop.TextEditor.CursorBlinkIntervalGet();
+ internal static readonly int CursorBlinkDuration = Interop.TextEditor.CursorBlinkDurationGet();
+ internal static readonly int CursorWidth = Interop.TextEditor.CursorWidthGet();
+ internal static readonly int GrabHandleImage = Interop.TextEditor.GrabHandleImageGet();
+ internal static readonly int GrabHandlePressedImage = Interop.TextEditor.GrabHandlePressedImageGet();
+ internal static readonly int SelectionHandleImageLeft = Interop.TextEditor.SelectionHandleImageLeftGet();
+ internal static readonly int SelectionHandleImageRight = Interop.TextEditor.SelectionHandleImageRightGet();
+ internal static readonly int SelectionHandlePressedImageLeft = Interop.TextEditor.SelectionHandlePressedImageLeftGet();
+ internal static readonly int SelectionHandlePressedImageRight = Interop.TextEditor.SelectionHandlePressedImageRightGet();
+ internal static readonly int SelectionHandleMarkerImageLeft = Interop.TextEditor.SelectionHandleMarkerImageLeftGet();
+ internal static readonly int SelectionHandleMarkerImageRight = Interop.TextEditor.SelectionHandleMarkerImageRightGet();
+ internal static readonly int SelectionHighlightColor = Interop.TextEditor.SelectionHighlightColorGet();
+ internal static readonly int DecorationBoundingBox = Interop.TextEditor.DecorationBoundingBoxGet();
+ internal static readonly int EnableMarkup = Interop.TextEditor.EnableMarkupGet();
+ internal static readonly int InputColor = Interop.TextEditor.InputColorGet();
+ internal static readonly int InputFontFamily = Interop.TextEditor.InputFontFamilyGet();
+ internal static readonly int InputFontStyle = Interop.TextEditor.InputFontStyleGet();
+ internal static readonly int InputPointSize = Interop.TextEditor.InputPointSizeGet();
+ internal static readonly int LineSpacing = Interop.TextEditor.LineSpacingGet();
+ internal static readonly int InputLineSpacing = Interop.TextEditor.InputLineSpacingGet();
+ internal static readonly int UNDERLINE = Interop.TextEditor.UnderlineGet();
+ internal static readonly int InputUnderline = Interop.TextEditor.InputUnderlineGet();
+ internal static readonly int SHADOW = Interop.TextEditor.ShadowGet();
+ internal static readonly int InputShadow = Interop.TextEditor.InputShadowGet();
+ internal static readonly int EMBOSS = Interop.TextEditor.EmbossGet();
+ internal static readonly int InputEmboss = Interop.TextEditor.InputEmbossGet();
+ internal static readonly int OUTLINE = Interop.TextEditor.OutlineGet();
+ internal static readonly int InputOutline = Interop.TextEditor.InputOutlineGet();
+ internal static readonly int SmoothScroll = Interop.TextEditor.SmoothScrollGet();
+ internal static readonly int SmoothScrollDuration = Interop.TextEditor.SmoothScrollDurationGet();
+ internal static readonly int EnableScrollBar = Interop.TextEditor.EnableScrollBarGet();
+ internal static readonly int ScrollBarShowDuration = Interop.TextEditor.ScrollBarShowDurationGet();
+ internal static readonly int ScrollBarFadeDuration = Interop.TextEditor.ScrollBarFadeDurationGet();
+ internal static readonly int PixelSize = Interop.TextEditor.PixelSizeGet();
+ internal static readonly int LineCount = Interop.TextEditor.LineCountGet();
+ internal static readonly int EnableSelection = Interop.TextEditor.EnableSelectionGet();
+ internal static readonly int PLACEHOLDER = Interop.TextEditor.PlaceholderGet();
+ internal static readonly int LineWrapMode = Interop.TextEditor.LineWrapModeGet();
+ internal static readonly int PlaceholderText = Interop.TextEditor.PlaceholderTextGet();
+ internal static readonly int PlaceholderTextColor = Interop.TextEditor.PlaceholderTextColorGet();
+ internal static readonly int EnableShiftSelection = Interop.TextEditor.EnableShiftSelectionGet();
+ internal static readonly int MatchSystemLanguageDirection = Interop.TextEditor.MatchSystemLanguageDirectionGet();
+ internal static readonly int MaxLength = Interop.TextEditor.MaxLengthGet();
+ internal static readonly int SelectedTextStart = Interop.TextEditor.SelectedTextStartGet();
+ internal static readonly int SelectedTextEnd = Interop.TextEditor.SelectedTextEndGet();
+ internal static readonly int EnableEditing = Interop.TextEditor.EnableEditingGet();
+ internal static readonly int SelectedText = Interop.TextEditor.SelectedTextGet();
+ internal static readonly int HorizontalScrollPosition = Interop.TextEditor.HorizontalScrollPositionGet();
+ internal static readonly int VerticalScrollPosition = Interop.TextEditor.VerticalScrollPositionGet();
+ internal static readonly int PrimaryCursorPosition = Interop.TextEditor.PrimaryCursorPositionGet();
+ internal static readonly int FontSizeScale = Interop.TextEditor.FontSizeScaleGet();
+ internal static readonly int GrabHandleColor = Interop.TextEditor.GrabHandleColorGet();
+ internal static readonly int EnableGrabHandle = Interop.TextEditor.EnableGrabHandleGet();
+ internal static readonly int EnableGrabHandlePopup = Interop.TextEditor.EnableGrabHandlePopupGet();
+ internal static readonly int InputMethodSettings = Interop.TextEditor.InputMethodSettingsGet();
+ internal static readonly int ELLIPSIS = Interop.TextEditor.EllipsisGet();
+ internal static readonly int EllipsisPosition = Interop.TextEditor.EllipsisPositionGet();
+ internal static readonly int MinLineSize = Interop.TextEditor.MinLineSizeGet();
+ internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet();
+ }
+
+ internal class InputStyle
+ {
+ internal enum Mask
+ {
+ None = 0x0000,
+ Color = 0x0001,
+ FontFamily = 0x0002,
+ PointSize = 0x0004,
+ FontStyle = 0x0008,
+ LineSpacing = 0x0010,
+ Underline = 0x0020,
+ Shadow = 0x0040,
+ Emboss = 0x0080,
+ Outline = 0x0100
+ }
+ }
+
+ private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
+ {
+ DecorationBoundingBox = new Rectangle(x, y, width, height);
+ }
+ private void OnInputColorChanged(float x, float y, float z, float w)
+ {
+ InputColor = new Vector4(x, y, z, w);
+ }
+ private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
+ {
+ PlaceholderTextColor = new Color(r, g, b, a);
+ }
+ private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
+ {
+ PrimaryCursorColor = new Vector4(x, y, z, w);
+ }
+ private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
+ {
+ SecondaryCursorColor = new Vector4(x, y, z, w);
+ }
+ private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
+ {
+ SelectionHighlightColor = new Vector4(x, y, z, w);
+ }
+ private void OnTextColorChanged(float x, float y, float z, float w)
+ {
+ TextColor = new Vector4(x, y, z, w);
+ }
+ private void OnGrabHandleColorChanged(float r, float g, float b, float a)
+ {
+ GrabHandleColor = new Color(r, g, b, a);
+ }
+ }
}