/*
- * Copyright(c) 2018 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 System;
using System.Globalization;
using System.ComponentModel;
+using Tizen.NUI.Text;
namespace Tizen.NUI.BaseComponents
{
/// <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;
+ private bool isSettingTextInCSharp = false;
+
+ static TextEditor() { }
/// <summary>
/// Creates the TextEditor control.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public TextEditor() : this(Interop.TextEditor.TextEditor_New(), true)
+ public TextEditor() : this(Interop.TextEditor.New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
+ /// Creates the TextEditor with specified style.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
+ {
+ }
+
+ /// <summary>
/// Creates the TextEditor with setting the status of shown or hidden.
/// </summary>
/// <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.TextEditor_New(), true)
+ public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
}
- internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true)
+ internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
{
SetVisible(false);
}
+
+ TextChanged += TextEditorTextChanged;
}
- internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextEditor.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
+ internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style)
{
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-
if (!shown)
{
SetVisible(false);
}
+
+ TextChanged += TextEditorTextChanged;
}
/// <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);
{
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);
}
set
{
- SetValueAndForceSendChangeSignal(TextProperty, value);
+ SetValue(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
{
- return (Vector4)GetValue(TextColorProperty);
+ Vector4 temp = (Vector4)GetValue(TextColorProperty);
+ return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
/// <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
}
/// <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)
+ {
+ SetValue(FontStyleProperty, 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()
+ {
+ return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
+ }
+
+ /// <summary>
/// The PointSize property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <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
{
- return (Vector4)GetValue(PrimaryCursorColorProperty);
+ Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
+ return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
/// <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
{
- return (Vector4)GetValue(SecondaryCursorColorProperty);
+ Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
+ return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
/// <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
/// <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
}
/// <summary>
+ /// Set SelectionHandleImage to TextEditor. <br />
+ /// </summary>
+ /// <param name="selectionHandleImage">The SelectionHandleImage</param>
+ /// <remarks>
+ /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetSelectionHandleImage method.
+ /// <code>
+ /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
+ /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
+ /// selectionHandleImage.RightImageUrl = "handle_downright.png";
+ /// editor.SetSelectionHandleImage(selectionHandleImage);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
+ {
+ if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
+ {
+ SetValue(SelectionHandleImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl));
+ }
+
+ if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
+ {
+ SetValue(SelectionHandleImageRightProperty, TextUtils.GetFileNameMap(selectionHandleImage.RightImageUrl));
+ }
+ }
+
+ /// <summary>
+ /// Get SelectionHandleImage from TextEditor. <br />
+ /// </summary>
+ /// <returns>The SelectionHandleImage</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SelectionHandleImage GetSelectionHandleImage()
+ {
+ return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
+ }
+
+ /// <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
/// <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
}
/// <summary>
+ /// Set SelectionHandlePressedImage to TextEditor. <br />
+ /// </summary>
+ /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
+ /// <remarks>
+ /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
+ /// <code>
+ /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
+ /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
+ /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
+ /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
+ {
+ if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
+ {
+ SetValue(SelectionHandlePressedImageLeftProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
+ }
+
+ if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
+ {
+ SetValue(SelectionHandlePressedImageRightProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
+ }
+ }
+
+ /// <summary>
+ /// Get SelectionHandlePressedImage from TextEditor. <br />
+ /// </summary>
+ /// <returns>The SelectionHandlePressedImage</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SelectionHandleImage GetSelectionHandlePressedImage()
+ {
+ return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
+ }
+
+ /// <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
/// <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
}
/// <summary>
+ /// Set SelectionHandleMarkerImage to TextEditor. <br />
+ /// </summary>
+ /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
+ /// <remarks>
+ /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
+ /// <code>
+ /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
+ /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
+ /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
+ /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
+ {
+ if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
+ {
+ SetValue(SelectionHandleMarkerImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
+ }
+
+ if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
+ {
+ SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
+ }
+ }
+
+ /// <summary>
+ /// Get SelectionHandleMarkerImage from TextEditor. <br />
+ /// </summary>
+ /// <returns>The SelectionHandleMarkerImage</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SelectionHandleImage GetSelectionHandleMarkerImage()
+ {
+ return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
+ }
+
+ /// <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
{
- return (Vector4)GetValue(SelectionHighlightColorProperty);
+ Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
+ return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
/// <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
{
- return (Rectangle)GetValue(DecorationBoundingBoxProperty);
+ Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
+ return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
}
set
{
/// <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
{
- return (Vector4)GetValue(InputColorProperty);
+ Vector4 temp = (Vector4)GetValue(InputColorProperty);
+ return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
}
set
{
/// <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
}
/// <summary>
+ /// Set InputFontStyle to TextEditor. <br />
+ /// </summary>
+ /// <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)
+ {
+ SetValue(InputFontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
+ }
+
+ /// <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()
+ {
+ return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
+ }
+
+ /// <summary>
/// The InputPointSize property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <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
}
/// <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)
+ {
+ SetValue(UnderlineProperty, 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()
+ {
+ return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
+ }
+
+ /// <summary>
/// The InputUnderline property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <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
}
/// <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)
+ {
+ SetValue(ShadowProperty, 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()
+ {
+ return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
+ }
+
+ /// <summary>
/// The InputShadow property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <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
}
/// <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)
+ {
+ SetValue(OutlineProperty, 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()
+ {
+ return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
+ }
+
+ /// <summary>
/// The InputOutline property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
get
{
int temp = 0;
- GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
+ GetProperty(TextEditor.Property.LineCount).Get(out temp);
return temp;
}
}
}
/// <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
{
- return (Color)GetValue(PlaceholderTextColorProperty);
+ Color temp = (Color)GetValue(PlaceholderTextColorProperty);
+ return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A);
}
set
{
}
/// <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;
+ }
+ }
+
+ /// <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;
+ }
+ }
+
+ /// <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
+ {
+ 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.
/// </code>
/// </example>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public Tizen.NUI.PropertyMap Placeholder
{
get
{
- return (PropertyMap)GetValue(PlaceholderProperty);
+ 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
{
}
/// <summary>
+ /// Set Placeholder to TextEditor. <br />
+ /// </summary>
+ /// <param name="placeholder">The Placeholder</param>
+ /// <remarks>
+ /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetPlaceholder method.
+ /// <code>
+ /// var placeholder = new Tizen.NUI.Text.Placeholder();
+ /// placeholder.Text = "placeholder text";
+ /// placeholder.TextFocused = "placeholder textFocused";
+ /// placeholder.Color = new Color("#45B39D");
+ /// placeholder.FontFamily = "BreezeSans";
+ /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
+ /// {
+ /// Width = FontWidthType.Expanded,
+ /// Weight = FontWeightType.ExtraLight,
+ /// Slant = FontSlantType.Italic,
+ /// };
+ /// placeholder.PointSize = 25.0f;
+ /// //placeholder.PixelSize = 50.0f;
+ /// placeholder.Ellipsis = true;
+ /// editor.SetPlaceholder(placeholder);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetPlaceholder(Placeholder placeholder)
+ {
+ SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
+ }
+
+ /// <summary>
+ /// Get Placeholder from TextEditor. <br />
+ /// </summary>
+ /// <returns>The Placeholder</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Placeholder"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Placeholder GetPlaceholder()
+ {
+ return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
+ }
+
+ /// <summary>
+ /// The Ellipsis property.<br />
+ /// Enable or disable the ellipsis.<br />
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public bool Ellipsis
+ {
+ get
+ {
+ return (bool)GetValue(EllipsisProperty);
+ }
+ set
+ {
+ SetValue(EllipsisProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+
+ /// <summary>
+ /// The ellipsis position of the text.
+ /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ 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>
}
}
- /// Only used by the IL of xaml, will never changed to not hidden.
+ /// <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 override bool IsCreateByXaml
+ public int MaxLength
+ {
+ get
+ {
+ return (int)GetValue(MaxLengthProperty);
+ }
+ set
+ {
+ SetValue(MaxLengthProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <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 base.IsCreateByXaml;
+ return fontSizeScale;
}
set
{
- base.IsCreateByXaml = value;
+ float newFontSizeScale;
+
+ if (fontSizeScale == value) return;
- if (value == true)
+ fontSizeScale = value;
+ if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
{
- this.TextChanged += (obj, e) =>
+ SystemSettingsFontSize systemSettingsFontSize;
+
+ try
+ {
+ systemSettingsFontSize = SystemSettings.FontSize;
+ }
+ catch (Exception e)
{
- this.Text = this.Text;
- };
+ Console.WriteLine("{0} Exception caught.", e);
+ systemSettingsFontSize = SystemSettingsFontSize.Normal;
+ }
+ newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
+ addFontSizeChangedCallback();
}
+ else
+ {
+ newFontSizeScale = fontSizeScale;
+ removeFontSizeChangedCallback();
+ }
+
+ 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>
if (inputMethodContext == null)
{
/*Avoid raising InputMethodContext reference count.*/
- inputMethodContext = new InputMethodContext(Interop.TextEditor.TextEditor_GetInputMethodContext(swigCPtr), true);
+ inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return inputMethodContext;
}
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj)
+ /// <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. <br />
+ /// The index is valid when 0 or positive. <br />
+ /// </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(int start, int end)
+ {
+ if (start < 0)
+ throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
+ if (end < 0)
+ throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
+
+ Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)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
{
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ get
+ {
+ return (float)GetValue(MinLineSizeProperty);
+ }
+ set
+ {
+ SetValue(MinLineSizeProperty, value);
+ NotifyPropertyChanged();
+ }
}
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.TextEditor_InputStyleChangedSignal(swigCPtr), false);
+ 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;
}
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() && _textEditorTextChangedCallbackDelegate != null)
+ if (this.HasBody())
{
- TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
- }
+ if (textEditorTextChangedCallbackDelegate != null)
+ {
+ TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
+ }
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
+ if (textEditorMaxLengthReachedCallbackDelegate != null)
+ {
+ this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
+ }
+
+ if (textEditorSelectionClearedCallbackDelegate != null)
+ {
+ this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
+ }
+
+ if (textEditorCursorPositionChangedCallbackDelegate != null)
{
- swigCMemOwn = false;
- // In order to speed up IME hide, temporarily add
- GetInputMethodContext()?.DestroyContext();
- Interop.TextEditor.delete_TextEditor(swigCPtr);
+ this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate);
+ }
+
+ if (textEditorSelectionChangedCallbackDelegate != null)
+ {
+ this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate);
}
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
+ TextChanged -= TextEditorTextChanged;
+
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;
{
if (systemlangTextFlag == false)
{
- SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
+ SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
systemlangTextFlag = true;
}
return translatableText;
}
}
+ 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;
+ }
+ }
+ }
+
+ private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (!isSettingTextInCSharp)
+ {
+ ForceNotifyBindedInstance(TextProperty);
+ }
+ }
+
internal new class Property
{
- internal static readonly int RENDERING_BACKEND = Interop.TextEditor.TextEditor_Property_RENDERING_BACKEND_get();
- internal static readonly int TEXT = Interop.TextEditor.TextEditor_Property_TEXT_get();
- internal static readonly int TEXT_COLOR = Interop.TextEditor.TextEditor_Property_TEXT_COLOR_get();
- internal static readonly int FONT_FAMILY = Interop.TextEditor.TextEditor_Property_FONT_FAMILY_get();
- internal static readonly int FONT_STYLE = Interop.TextEditor.TextEditor_Property_FONT_STYLE_get();
- internal static readonly int POINT_SIZE = Interop.TextEditor.TextEditor_Property_POINT_SIZE_get();
- internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextEditor.TextEditor_Property_HORIZONTAL_ALIGNMENT_get();
- internal static readonly int SCROLL_THRESHOLD = Interop.TextEditor.TextEditor_Property_SCROLL_THRESHOLD_get();
- internal static readonly int SCROLL_SPEED = Interop.TextEditor.TextEditor_Property_SCROLL_SPEED_get();
- internal static readonly int PRIMARY_CURSOR_COLOR = Interop.TextEditor.TextEditor_Property_PRIMARY_CURSOR_COLOR_get();
- internal static readonly int SECONDARY_CURSOR_COLOR = Interop.TextEditor.TextEditor_Property_SECONDARY_CURSOR_COLOR_get();
- internal static readonly int ENABLE_CURSOR_BLINK = Interop.TextEditor.TextEditor_Property_ENABLE_CURSOR_BLINK_get();
- internal static readonly int CURSOR_BLINK_INTERVAL = Interop.TextEditor.TextEditor_Property_CURSOR_BLINK_INTERVAL_get();
- internal static readonly int CURSOR_BLINK_DURATION = Interop.TextEditor.TextEditor_Property_CURSOR_BLINK_DURATION_get();
- internal static readonly int CURSOR_WIDTH = Interop.TextEditor.TextEditor_Property_CURSOR_WIDTH_get();
- internal static readonly int GRAB_HANDLE_IMAGE = Interop.TextEditor.TextEditor_Property_GRAB_HANDLE_IMAGE_get();
- internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = Interop.TextEditor.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
- internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
- internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
- internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
- internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
- internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
- internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Interop.TextEditor.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
- internal static readonly int SELECTION_HIGHLIGHT_COLOR = Interop.TextEditor.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get();
- internal static readonly int DECORATION_BOUNDING_BOX = Interop.TextEditor.TextEditor_Property_DECORATION_BOUNDING_BOX_get();
- internal static readonly int ENABLE_MARKUP = Interop.TextEditor.TextEditor_Property_ENABLE_MARKUP_get();
- internal static readonly int INPUT_COLOR = Interop.TextEditor.TextEditor_Property_INPUT_COLOR_get();
- internal static readonly int INPUT_FONT_FAMILY = Interop.TextEditor.TextEditor_Property_INPUT_FONT_FAMILY_get();
- internal static readonly int INPUT_FONT_STYLE = Interop.TextEditor.TextEditor_Property_INPUT_FONT_STYLE_get();
- internal static readonly int INPUT_POINT_SIZE = Interop.TextEditor.TextEditor_Property_INPUT_POINT_SIZE_get();
- internal static readonly int LINE_SPACING = Interop.TextEditor.TextEditor_Property_LINE_SPACING_get();
- internal static readonly int INPUT_LINE_SPACING = Interop.TextEditor.TextEditor_Property_INPUT_LINE_SPACING_get();
- internal static readonly int UNDERLINE = Interop.TextEditor.TextEditor_Property_UNDERLINE_get();
- internal static readonly int INPUT_UNDERLINE = Interop.TextEditor.TextEditor_Property_INPUT_UNDERLINE_get();
- internal static readonly int SHADOW = Interop.TextEditor.TextEditor_Property_SHADOW_get();
- internal static readonly int INPUT_SHADOW = Interop.TextEditor.TextEditor_Property_INPUT_SHADOW_get();
- internal static readonly int EMBOSS = Interop.TextEditor.TextEditor_Property_EMBOSS_get();
- internal static readonly int INPUT_EMBOSS = Interop.TextEditor.TextEditor_Property_INPUT_EMBOSS_get();
- internal static readonly int OUTLINE = Interop.TextEditor.TextEditor_Property_OUTLINE_get();
- internal static readonly int INPUT_OUTLINE = Interop.TextEditor.TextEditor_Property_INPUT_OUTLINE_get();
- internal static readonly int SMOOTH_SCROLL = Interop.TextEditor.TextEditor_Property_SMOOTH_SCROLL_get();
- internal static readonly int SMOOTH_SCROLL_DURATION = Interop.TextEditor.TextEditor_Property_SMOOTH_SCROLL_DURATION_get();
- internal static readonly int ENABLE_SCROLL_BAR = Interop.TextEditor.TextEditor_Property_ENABLE_SCROLL_BAR_get();
- internal static readonly int SCROLL_BAR_SHOW_DURATION = Interop.TextEditor.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get();
- internal static readonly int SCROLL_BAR_FADE_DURATION = Interop.TextEditor.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get();
- internal static readonly int PIXEL_SIZE = Interop.TextEditor.TextEditor_Property_PIXEL_SIZE_get();
- internal static readonly int LINE_COUNT = Interop.TextEditor.TextEditor_Property_LINE_COUNT_get();
- internal static readonly int ENABLE_SELECTION = Interop.TextEditor.TextEditor_Property_ENABLE_SELECTION_get();
- internal static readonly int PLACEHOLDER = Interop.TextEditor.TextEditor_Property_PLACEHOLDER_get();
- internal static readonly int LINE_WRAP_MODE = Interop.TextEditor.TextEditor_Property_LINE_WRAP_MODE_get();
- internal static readonly int PLACEHOLDER_TEXT = Interop.TextEditor.TextEditor_Property_PLACEHOLDER_TEXT_get();
- internal static readonly int PLACEHOLDER_TEXT_COLOR = Interop.TextEditor.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
- internal static readonly int ENABLE_SHIFT_SELECTION = Interop.TextEditor.TextEditor_Property_ENABLE_SHIFT_SELECTION_get();
- internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextEditor.TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
+ 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
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);
+ }
}
}