X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FBaseComponents%2FTextEditor.cs;h=b338296e367474948fbf7c0c9241d55f9b079b1f;hb=90a635d5f39239bf4a2e17feffa38021e7eafeb3;hp=d90c82bb0055d8436a2831237f89b292949168d6;hpb=8d3a027c5eab8e533ab16264eedd70ab794b32c7;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index d90c82b..b338296 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -1,5 +1,5 @@ /* - * 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. @@ -19,10 +19,9 @@ extern alias TizenSystemSettings; using TizenSystemSettings.Tizen.System; using System; -using System.Runtime.InteropServices; using System.Globalization; using System.ComponentModel; -using Tizen.NUI.Binding; +using Tizen.NUI.Text; namespace Tizen.NUI.BaseComponents { @@ -30,2243 +29,2292 @@ namespace Tizen.NUI.BaseComponents /// A control which provides a multi-line editable text editor. /// /// 3 - public class TextEditor : View + public partial class TextEditor : View { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = BindableProperty.Create("FontStyle", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PointSizeProperty = BindableProperty.Create("PointSize", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment), typeof(TextEditor), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false) - { - NUILog.Error("HorizontalAlignment get error!"); - } + 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; - switch (temp) - { - case "BEGIN": - return HorizontalAlignment.Begin; - case "CENTER": - return HorizontalAlignment.Center; - case "END": - return HorizontalAlignment.End; - default: - return HorizontalAlignment.Begin; - } - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollThresholdProperty = BindableProperty.Create("ScrollThreshold", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create("ScrollSpeed", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PrimaryCursorColorProperty = BindableProperty.Create("PrimaryCursorColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SecondaryCursorColorProperty = BindableProperty.Create("SecondaryCursorColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableCursorBlinkProperty = BindableProperty.Create("EnableCursorBlink", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorBlinkIntervalProperty = BindableProperty.Create("CursorBlinkInterval", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorBlinkDurationProperty = BindableProperty.Create("CursorBlinkDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorWidthProperty = BindableProperty.Create("CursorWidth", typeof(int), typeof(TextEditor), default(int), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - int temp = 0; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_WIDTH).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandleImageProperty = BindableProperty.Create("GrabHandleImage", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandlePressedImageProperty = BindableProperty.Create("GrabHandlePressedImage", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageLeftProperty = BindableProperty.Create("SelectionHandleImageLeft", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create("SelectionHandleImageRight", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = BindableProperty.Create("SelectionHandlePressedImageLeft", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandlePressedImageRightProperty = BindableProperty.Create("SelectionHandlePressedImageRight", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = BindableProperty.Create("SelectionHandleMarkerImageLeft", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = BindableProperty.Create("SelectionHandleMarkerImageRight", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHighlightColorProperty = BindableProperty.Create("SelectionHighlightColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty DecorationBoundingBoxProperty = BindableProperty.Create("DecorationBoundingBox", typeof(Rectangle), typeof(TextEditor), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); - } - }, - defaultValueCreator:(bindable) => + static TextEditor() { } + + /// + /// Creates the TextEditor control. + /// + /// 3 + public TextEditor() : this(Interop.TextEditor.New(), true) { - var textEditor = (TextEditor)bindable; - Rectangle temp = new Rectangle(0, 0, 0, 0); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates the TextEditor with specified style. + /// [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator:(bindable) => + public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style) { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + } + + /// + /// Creates the TextEditor with setting the status of shown or hidden. + /// + /// false : Not displayed (hidden), true : displayed (shown) + /// 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 static readonly BindableProperty InputColorProperty = BindableProperty.Create("InputColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => + public TextEditor(bool shown) : this(Interop.TextEditor.New(), true) { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputFontFamilyProperty = BindableProperty.Create("InputFontFamily", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + SetVisible(shown); + } + + internal TextEditor(TextEditor handle, bool shown = true) : this(Interop.TextEditor.NewTextEditor(TextEditor.getCPtr(handle)), true) { - var textEditor = (TextEditor)bindable; - if (newValue != null) + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if (!shown) { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); + SetVisible(false); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputFontStyleProperty = BindableProperty.Create("InputFontStyle", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + + TextChanged += TextEditorTextChanged; + } + + internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true, TextEditorStyle style = null) : base(cPtr, cMemoryOwn, style) { - var textEditor = (TextEditor)bindable; - if (newValue != null) + if (!shown) { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + SetVisible(false); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputPointSizeProperty = BindableProperty.Create("InputPointSize", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + + TextChanged += TextEditorTextChanged; + } + + /// + /// The TranslatableText property.
+ /// The text can set the SID value.
+ ///
+ /// + /// ResourceManager about multilingual is null. + /// + /// 4 + public string TranslatableText { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + return textEditorTextSid; } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create("LineSpacing", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); + if (NUIApplication.MultilingualResourceManager == null) + { + throw new ArgumentNullException(null, "ResourceManager about multilingual is null"); + } + textEditorTextSid = value; + Text = SetTranslatable(textEditorTextSid); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputLineSpacingProperty = BindableProperty.Create("InputLineSpacing", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + } + /// + /// The TranslatablePlaceholderText property.
+ /// The text can set the SID value.
+ ///
+ /// + /// ResourceManager about multilingual is null. + /// + /// 4 + public string TranslatablePlaceholderText { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); + return textEditorPlaceHolderTextSid; } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineProperty = BindableProperty.Create("Underline", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + if (NUIApplication.MultilingualResourceManager == null) + { + throw new ArgumentNullException(null, "ResourceManager about multilingual is null"); + } + textEditorPlaceHolderTextSid = value; + PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputUnderlineProperty = BindableProperty.Create("InputUnderline", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The Text property. + /// + /// 3 + public string Text { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); + return (string)GetValue(TextProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowProperty = BindableProperty.Create("Shadow", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + SetValue(TextProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputShadowProperty = BindableProperty.Create("InputShadow", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The TextColor property. + /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible. + /// + /// 3 + public Vector4 TextColor { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); + Vector4 temp = (Vector4)GetValue(TextColorProperty); + return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); + SetValue(TextColorProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputEmbossProperty = BindableProperty.Create("InputEmboss", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The FontFamily property. + /// + /// 3 + public string FontFamily { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); + return (string)GetValue(FontFamilyProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OutlineProperty = BindableProperty.Create("Outline", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + SetValue(FontFamilyProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputOutlineProperty = BindableProperty.Create("InputOutline", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The FontStyle property. + /// The fontStyle map contains the following keys :
+ /// + /// width (string)The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded) + /// weight (string)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) + /// slant (string)The slant key defines whether to use italics. (values: normal, roman, italic, oblique) + /// + ///
+ /// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] + public PropertyMap FontStyle { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); + return (PropertyMap)GetValue(FontStyleProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SmoothScrollProperty = BindableProperty.Create("SmoothScroll", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue)); + SetValue(FontStyleProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + } + + /// + /// Set FontStyle to TextEditor.
+ ///
+ /// The FontStyle + /// + /// SetFontStyle specifies the requested font style through .
+ ///
+ /// + /// The following example demonstrates how to use the SetFontStyle method. + /// + /// var fontStyle = new Tizen.NUI.Text.FontStyle(); + /// fontStyle.Width = FontWidthType.Expanded; + /// fontStyle.Weight = FontWeightType.Bold; + /// fontStyle.Slant = FontSlantType.Italic; + /// editor.SetFontStyle(fontStyle); + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SmoothScrollDurationProperty = BindableProperty.Create("SmoothScrollDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public void SetFontStyle(FontStyle fontStyle) { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + SetValue(FontStyleProperty, TextUtils.GetFontStyleMap(fontStyle)); + } + + /// + /// Get FontStyle from TextEditor.
+ ///
+ /// The FontStyle + /// + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableScrollBarProperty = BindableProperty.Create("EnableScrollBar", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator:(bindable) => + public FontStyle GetFontStyle() { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollBarShowDurationProperty = BindableProperty.Create("ScrollBarShowDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty)); + } + + /// + /// The PointSize property. + /// + /// 3 + public float PointSize { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + return (float)GetValue(PointSizeProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollBarFadeDurationProperty = BindableProperty.Create("ScrollBarFadeDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(PointSizeProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The HorizontalAlignment property. + /// + /// 3 + public HorizontalAlignment HorizontalAlignment { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextProperty = BindableProperty.Create("PlaceholderText", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); + SetValue(HorizontalAlignmentProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextColorProperty = BindableProperty.Create("PlaceholderTextColor", typeof(Color), typeof(TextEditor), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The ScrollThreshold property. + /// + /// 3 + public float ScrollThreshold { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); + return (float)GetValue(ScrollThresholdProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableSelectionProperty = BindableProperty.Create("EnableSelection", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + SetValue(ScrollThresholdProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderProperty = BindableProperty.Create("Placeholder", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + } + + /// + /// The ScrollSpeed property. + /// + /// 3 + public float ScrollSpeed { - var textEditor = (TextEditor)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + return (float)GetValue(ScrollSpeedProperty); } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create("LineWrapMode", typeof(LineWrapMode), typeof(TextEditor), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue)); + SetValue(ScrollSpeedProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator:(bindable) => + } + + /// + /// The PrimaryCursorColor property. + /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible. + /// + /// 3 + public Vector4 PrimaryCursorColor { - var textEditor = (TextEditor)bindable; - int temp; - if(Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false) + get { - NUILog.Error("LineWrapMode get error!"); + Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty); + return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W); } - return (LineWrapMode)temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableShiftSelectionProperty = BindableProperty.Create("EnableShiftSelection", typeof(bool), typeof(TextEditor), true, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) + set { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textEditor = (TextEditor)bindable; - //textEditor.mShiftSelectionFlag(true); - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION).Get(out temp); - return temp; - }); - - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private string textEditorTextSid = null; - private string textEditorPlaceHolderTextSid = null; - private bool systemlangTextFlag = false; - private InputMethodContext inputMethodContext = null; - - 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; + SetValue(PrimaryCursorColorProperty, value); + NotifyPropertyChanged(); + } } /// - /// Dispose. + /// The SecondaryCursorColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible. + /// /// 3 - protected override void Dispose(DisposeTypes type) + public Vector4 SecondaryCursorColor { - 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 (this.HasBody() && _textEditorTextChangedCallbackDelegate != null) + get { - TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate); + Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty); + return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W); } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + set { - if (swigCMemOwn) - { - swigCMemOwn = false; - // In order to speed up IME hide, temporarily add - GetInputMethodContext()?.DestroyContext(); - NDalicPINVOKE.delete_TextEditor(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + SetValue(SecondaryCursorColorProperty, value); + NotifyPropertyChanged(); } - - base.Dispose(type); } /// - /// Event arguments that passed via the TextChanged signal. + /// The EnableCursorBlink property. /// /// 3 - public class TextChangedEventArgs : EventArgs + public bool EnableCursorBlink { - private TextEditor _textEditor; - - /// - /// TextEditor - is the texteditor control which has the text contents changed. - /// - /// 3 - public TextEditor TextEditor + get { - get - { - return _textEditor; - } - set - { - _textEditor = value; - } + return (bool)GetValue(EnableCursorBlinkProperty); + } + set + { + SetValue(EnableCursorBlinkProperty, value); + NotifyPropertyChanged(); } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void TextChangedCallbackDelegate(IntPtr textEditor); - private EventHandler _textEditorTextChangedEventHandler; - private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate; - /// - /// 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.
+ /// The CursorBlinkInterval property. ///
/// 3 - public event EventHandler TextChanged + public float CursorBlinkInterval { - add + get { - if (_textEditorTextChangedEventHandler == null) - { - _textEditorTextChangedCallbackDelegate = (OnTextChanged); - TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate); - } - _textEditorTextChangedEventHandler += value; + return (float)GetValue(CursorBlinkIntervalProperty); } - remove + set { - _textEditorTextChangedEventHandler -= value; - if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false) - { - TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate); - } + SetValue(CursorBlinkIntervalProperty, value); + NotifyPropertyChanged(); } } - private void OnTextChanged(IntPtr textEditor) + /// + /// The CursorBlinkDuration property. + /// + /// 3 + public float CursorBlinkDuration { - TextChangedEventArgs e = new TextChangedEventArgs(); - - // Populate all members of "e" (TextChangedEventArgs) with real data - e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; - - if (_textEditorTextChangedEventHandler != null) + get { - //here we send all data to user event handlers - _textEditorTextChangedEventHandler(this, e); + return (float)GetValue(CursorBlinkDurationProperty); + } + set + { + SetValue(CursorBlinkDurationProperty, value); + NotifyPropertyChanged(); } - } /// - /// Event arguments that passed via the ScrollStateChanged signal. + /// The CursorWidth property. /// /// 3 - public class ScrollStateChangedEventArgs : EventArgs + public int CursorWidth { - private TextEditor _textEditor; - private ScrollState _scrollState; - - /// - /// TextEditor - is the texteditor control which has the scroll state changed. - /// - /// 3 - public TextEditor TextEditor + get { - get - { - return _textEditor; - } - set - { - _textEditor = value; - } + return (int)GetValue(CursorWidthProperty); } - - /// - /// ScrollState - is the texteditor control scroll state. - /// - /// 3 - public ScrollState ScrollState + set { - get - { - return _scrollState; - } - set - { - _scrollState = value; - } + SetValue(CursorWidthProperty, value); + NotifyPropertyChanged(); } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state); - private EventHandler _textEditorScrollStateChangedEventHandler; - private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate; - /// - /// 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.
+ /// The GrabHandleImage property. ///
/// 3 - public event EventHandler ScrollStateChanged + public string GrabHandleImage { - add + get { - if (_textEditorScrollStateChangedEventHandler == null) - { - _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged; - ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate); - } - _textEditorScrollStateChangedEventHandler += value; + return (string)GetValue(GrabHandleImageProperty); } - remove + set { - _textEditorScrollStateChangedEventHandler -= value; - if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false) - { - ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate); - } + SetValue(GrabHandleImageProperty, value); + NotifyPropertyChanged(); } } - private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) + /// + /// The GrabHandlePressedImage property. + /// + /// 3 + public string GrabHandlePressedImage { - ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs(); - - if (textEditor != global::System.IntPtr.Zero) + get { - // Populate all members of "e" (ScrollStateChangedEventArgs) with real data - e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; - e.ScrollState = state; + return (string)GetValue(GrabHandlePressedImageProperty); } - - if (_textEditorScrollStateChangedEventHandler != null) + set { - //here we send all data to user event handlers - _textEditorScrollStateChangedEventHandler(this, e); + SetValue(GrabHandlePressedImageProperty, value); + NotifyPropertyChanged(); } } - 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 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 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_SHIFT_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SHIFT_SELECTION_get(); - } - - internal class InputStyle + /// + /// The SelectionHandleImageLeft property. + /// The selectionHandleImageLeft map contains the following key :
+ /// + /// filename (string)The path of image file + /// + ///
+ /// 3 + public PropertyMap SelectionHandleImageLeft { - internal enum Mask + get { - None = 0x0000, - Color = 0x0001, - FontFamily = 0x0002, - PointSize = 0x0004, - FontStyle = 0x0008, - LineSpacing = 0x0010, - Underline = 0x0020, - Shadow = 0x0040, - Emboss = 0x0080, - Outline = 0x0100 + return (PropertyMap)GetValue(SelectionHandleImageLeftProperty); + } + set + { + SetValue(SelectionHandleImageLeftProperty, value); + NotifyPropertyChanged(); } } /// - /// Creates the TextEditor control. + /// The SelectionHandleImageRight property. + /// The selectionHandleImageRight map contains the following key :
+ /// + /// filename (string)The path of image file + /// ///
/// 3 - public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal override bool IsCreateByXaml + public PropertyMap SelectionHandleImageRight { get { - return base.IsCreateByXaml; + return (PropertyMap)GetValue(SelectionHandleImageRightProperty); } set { - base.IsCreateByXaml = value; - - if (value == true) - { - this.TextChanged += (obj, e) => - { - this.Text = this.Text; - }; - } + SetValue(SelectionHandleImageRightProperty, value); + NotifyPropertyChanged(); } } - internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// - /// Get the InputMethodContext instance. + /// Set SelectionHandleImage to TextEditor.
///
- /// The InputMethodContext instance. - public InputMethodContext GetInputMethodContext() + /// The SelectionHandleImage + /// + /// SetSelectionHandleImage specifies the display image used for the selection handle through .
+ ///
+ /// + /// The following example demonstrates how to use the SetSelectionHandleImage method. + /// + /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage(); + /// selectionHandleImage.LeftImageUrl = "handle_downleft.png"; + /// selectionHandleImage.RightImageUrl = "handle_downright.png"; + /// editor.SetSelectionHandleImage(selectionHandleImage); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) { - if (inputMethodContext == null) + if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl)) { - /*Avoid raising InputMethodContext reference count.*/ - inputMethodContext = new InputMethodContext(NDalicPINVOKE.TextEditor_GetInputMethodContext(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + SetValue(SelectionHandleImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl)); } - return inputMethodContext; - } - - 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; + if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl)) + { + SetValue(SelectionHandleImageRightProperty, TextUtils.GetFileNameMap(selectionHandleImage.RightImageUrl)); + } } - internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal() + /// + /// Get SelectionHandleImage from TextEditor.
+ ///
+ /// The SelectionHandleImage + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public SelectionHandleImage GetSelectionHandleImage() { - 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; + return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty)); } /// - /// The TranslatableText property.
- /// The text can set the SID value.
+ /// The SelectionHandlePressedImageLeft property. + /// The selectionHandlePressedImageLeft map contains the following key :
+ /// + /// filename (string)The path of image file + /// ///
- /// - /// ResourceManager about multilingual is null. - /// - /// 4 - public string TranslatableText + /// 3 + public PropertyMap SelectionHandlePressedImageLeft { get { - return textEditorTextSid; + return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty); } set { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textEditorTextSid = value; - Text = SetTranslatable(textEditorTextSid); + SetValue(SelectionHandlePressedImageLeftProperty, value); NotifyPropertyChanged(); } } + /// - /// The TranslatablePlaceholderText property.
- /// The text can set the SID value.
+ /// The SelectionHandlePressedImageRight property. + /// The selectionHandlePressedImageRight map contains the following key :
+ /// + /// filename (string)The path of image file + /// ///
- /// - /// ResourceManager about multilingual is null. - /// - /// 4 - public string TranslatablePlaceholderText + /// 3 + public PropertyMap SelectionHandlePressedImageRight { get { - return textEditorPlaceHolderTextSid; + return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty); } set { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textEditorPlaceHolderTextSid = value; - PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid); + SetValue(SelectionHandlePressedImageRightProperty, value); NotifyPropertyChanged(); } } - private string SetTranslatable(string textEditorSid) + + /// + /// Set SelectionHandlePressedImage to TextEditor.
+ ///
+ /// The SelectionHandleImage + /// + /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through .
+ ///
+ /// + /// The following example demonstrates how to use the SetSelectionHandlePressedImage method. + /// + /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage(); + /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png"; + /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png"; + /// editor.SetSelectionHandlePressedImage(selectionHandlePressedImage); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage) { - string translatableText = null; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); - if (translatableText != null) + if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl)) { - if (systemlangTextFlag == false) - { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; - } - return translatableText; + SetValue(SelectionHandlePressedImageLeftProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl)); } - else + + if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl)) { - translatableText = ""; - return translatableText; + SetValue(SelectionHandlePressedImageRightProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.RightImageUrl)); } } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) + + /// + /// Get SelectionHandlePressedImage from TextEditor.
+ ///
+ /// The SelectionHandlePressedImage + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public SelectionHandleImage GetSelectionHandlePressedImage() { - if (textEditorTextSid != null) + return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty)); + } + + /// + /// The SelectionHandleMarkerImageLeft property. + /// The selectionHandleMarkerImageLeft map contains the following key :
+ /// + /// filename (string)The path of image file + /// + ///
+ /// 3 + public PropertyMap SelectionHandleMarkerImageLeft + { + get { - Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-"))); + return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty); } - if (textEditorPlaceHolderTextSid != null) + set { - PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); + SetValue(SelectionHandleMarkerImageLeftProperty, value); + NotifyPropertyChanged(); } } + /// - /// The Text property. + /// The SelectionHandleMarkerImageRight property. + /// The selectionHandleMarkerImageRight map contains the following key :
+ /// + /// filename (string)The path of image file + /// ///
/// 3 - public string Text + public PropertyMap SelectionHandleMarkerImageRight { get { - return (string)GetValue(TextProperty); + return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty); } set { - SetValueAndForceSendChangeSignal(TextProperty, value); + SetValue(SelectionHandleMarkerImageRightProperty, value); NotifyPropertyChanged(); } } /// - /// The TextColor property. + /// Set SelectionHandleMarkerImage to TextEditor.
///
- /// 3 - public Vector4 TextColor + /// The SelectionHandleImage + /// + /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through .
+ ///
+ /// + /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method. + /// + /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage(); + /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png"; + /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png"; + /// editor.SetSelectionHandleMarkerImage(selectionHandleMarkerImage); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage) { - get + if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl)) { - return (Vector4)GetValue(TextColorProperty); + SetValue(SelectionHandleMarkerImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl)); } - set + + if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl)) { - SetValue(TextColorProperty, value); - NotifyPropertyChanged(); + SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl)); } } /// - /// The FontFamily property. + /// Get SelectionHandleMarkerImage from TextEditor.
+ ///
+ /// The SelectionHandleMarkerImage + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public SelectionHandleImage GetSelectionHandleMarkerImage() + { + return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty)); + } + + /// + /// The SelectionHighlightColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible. + /// /// 3 - public string FontFamily + public Vector4 SelectionHighlightColor { get { - return (string)GetValue(FontFamilyProperty); + Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty); + return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { - SetValue(FontFamilyProperty, value); + SetValue(SelectionHighlightColorProperty, value); NotifyPropertyChanged(); } } /// - /// The FontStyle property. + /// The DecorationBoundingBox property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible. + /// /// 3 - public PropertyMap FontStyle + public Rectangle DecorationBoundingBox { get { - return (PropertyMap)GetValue(FontStyleProperty); + Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty); + return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height); } set { - SetValue(FontStyleProperty, value); + SetValue(DecorationBoundingBoxProperty, value); NotifyPropertyChanged(); } } /// - /// The PointSize property. + /// The EnableMarkup property. /// /// 3 - public float PointSize + public bool EnableMarkup { get { - return (float)GetValue(PointSizeProperty); + return (bool)GetValue(EnableMarkupProperty); } set { - SetValue(PointSizeProperty, value); + SetValue(EnableMarkupProperty, value); NotifyPropertyChanged(); } } /// - /// The HorizontalAlignment property. + /// The InputColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible. + /// /// 3 - public HorizontalAlignment HorizontalAlignment + public Vector4 InputColor { get { - return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty); + Vector4 temp = (Vector4)GetValue(InputColorProperty); + return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { - SetValue(HorizontalAlignmentProperty, value); + SetValue(InputColorProperty, value); NotifyPropertyChanged(); } } /// - /// The ScrollThreshold property. + /// The InputFontFamily property. /// /// 3 - public float ScrollThreshold + public string InputFontFamily { get { - return (float)GetValue(ScrollThresholdProperty); + return (string)GetValue(InputFontFamilyProperty); } set { - SetValue(ScrollThresholdProperty, value); + SetValue(InputFontFamilyProperty, value); NotifyPropertyChanged(); } } /// - /// The ScrollSpeed property. + /// The InputFontStyle property. + /// The inputFontStyle map contains the following keys :
+ /// + /// width (string)The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded) + /// weight (string)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) + /// slant (string)The slant key defines whether to use italics. (values: normal, roman, italic, oblique) + /// ///
/// 3 - public float ScrollSpeed + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] + public PropertyMap InputFontStyle { get { - return (float)GetValue(ScrollSpeedProperty); + return (PropertyMap)GetValue(InputFontStyleProperty); } set { - SetValue(ScrollSpeedProperty, value); + SetValue(InputFontStyleProperty, value); NotifyPropertyChanged(); } } /// - /// The PrimaryCursorColor property. + /// Set InputFontStyle to TextEditor.
+ ///
+ /// The FontStyle + /// + /// SetInputFontStyle specifies the requested font style for new input text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetInputFontStyle method. + /// + /// var fontStyle = new Tizen.NUI.Text.FontStyle(); + /// fontStyle.Width = FontWidthType.Expanded; + /// fontStyle.Weight = FontWeightType.Bold; + /// fontStyle.Slant = FontSlantType.Italic; + /// editor.SetInputFontStyle(fontStyle); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetInputFontStyle(FontStyle fontStyle) + { + SetValue(InputFontStyleProperty, TextUtils.GetFontStyleMap(fontStyle)); + } + + /// + /// Get InputFontStyle from TextEditor.
+ ///
+ /// The FontStyle + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FontStyle GetInputFontStyle() + { + return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty)); + } + + /// + /// The InputPointSize property. /// /// 3 - public Vector4 PrimaryCursorColor + public float InputPointSize { get { - return (Vector4)GetValue(PrimaryCursorColorProperty); + return (float)GetValue(InputPointSizeProperty); } set { - SetValue(PrimaryCursorColorProperty, value); + SetValue(InputPointSizeProperty, value); NotifyPropertyChanged(); } } /// - /// The SecondaryCursorColor property. + /// The LineSpacing property. /// /// 3 - public Vector4 SecondaryCursorColor + public float LineSpacing { get { - return (Vector4)GetValue(SecondaryCursorColorProperty); + return (float)GetValue(LineSpacingProperty); } set { - SetValue(SecondaryCursorColorProperty, value); + SetValue(LineSpacingProperty, value); NotifyPropertyChanged(); } } /// - /// The EnableCursorBlink property. + /// The InputLineSpacing property. /// /// 3 - public bool EnableCursorBlink + public float InputLineSpacing { get { - return (bool)GetValue(EnableCursorBlinkProperty); + return (float)GetValue(InputLineSpacingProperty); } set { - SetValue(EnableCursorBlinkProperty, value); + SetValue(InputLineSpacingProperty, value); NotifyPropertyChanged(); } } /// - /// The CursorBlinkInterval property. + /// The Underline property. + /// The underline map contains the following keys :
+ /// + /// enable (bool)Whether the underline is enabled (the default value is false) + /// color (Color)The color of the underline (If not provided then the color of the text is used) + /// height (float)The height in pixels of the underline (the default value is 1.f) + /// ///
/// 3 - public float CursorBlinkInterval + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] + public PropertyMap Underline { get { - return (float)GetValue(CursorBlinkIntervalProperty); + return (PropertyMap)GetValue(UnderlineProperty); } set { - SetValue(CursorBlinkIntervalProperty, value); + SetValue(UnderlineProperty, value); NotifyPropertyChanged(); } } /// - /// The CursorBlinkDuration property. + /// Set Underline to TextEditor.
+ ///
+ /// The Underline + /// + /// SetUnderline specifies the underline of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetUnderline method. + /// + /// var underline = new Tizen.NUI.Text.Underline(); + /// underline.Enable = true; + /// underline.Color = new Color("#3498DB"); + /// underline.Height = 2.0f; + /// editor.SetUnderline(underline); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetUnderline(Underline underline) + { + SetValue(UnderlineProperty, TextUtils.GetUnderlineMap(underline)); + } + + /// + /// Get Underline from TextEditor.
+ ///
+ /// The Underline + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Underline GetUnderline() + { + return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty)); + } + + /// + /// The InputUnderline property. /// /// 3 - public float CursorBlinkDuration + public string InputUnderline { get { - return (float)GetValue(CursorBlinkDurationProperty); + return (string)GetValue(InputUnderlineProperty); } set { - SetValue(CursorBlinkDurationProperty, value); + SetValue(InputUnderlineProperty, value); NotifyPropertyChanged(); } } /// - /// The CursorWidth property. + /// The Shadow property. + /// The shadow map contains the following keys :
+ /// + /// color (Color)The color of the shadow (the default color is Color.Black) + /// offset (Vector2)The offset in pixels of the shadow (If not provided then the shadow is not enabled) + /// blurRadius (float)The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled) + /// ///
/// 3 - public int CursorWidth + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] + public PropertyMap Shadow { get { - return (int)GetValue(CursorWidthProperty); + return (PropertyMap)GetValue(ShadowProperty); } set { - SetValue(CursorWidthProperty, value); + SetValue(ShadowProperty, value); NotifyPropertyChanged(); } } /// - /// The GrabHandleImage property. + /// Set Shadow to TextEditor.
+ ///
+ /// The Shadow + /// + /// SetShadow specifies the shadow of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetShadow method. + /// + /// var shadow = new Tizen.NUI.Text.Shadow(); + /// shadow.Offset = new Vector2(3, 3); + /// shadow.Color = new Color("#F1C40F"); + /// editor.SetShadow(shadow); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetShadow(Tizen.NUI.Text.Shadow shadow) + { + SetValue(ShadowProperty, TextUtils.GetShadowMap(shadow)); + } + + /// + /// Get Shadow from TextEditor.
+ ///
+ /// The Shadow + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.Text.Shadow GetShadow() + { + return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty)); + } + + /// + /// The InputShadow property. /// /// 3 - public string GrabHandleImage + public string InputShadow { get { - return (string)GetValue(GrabHandleImageProperty); + return (string)GetValue(InputShadowProperty); } set { - SetValue(GrabHandleImageProperty, value); + SetValue(InputShadowProperty, value); NotifyPropertyChanged(); } } /// - /// The GrabHandlePressedImage property. + /// The Emboss property. /// /// 3 - public string GrabHandlePressedImage + public string Emboss { get { - return (string)GetValue(GrabHandlePressedImageProperty); + return (string)GetValue(EmbossProperty); } set { - SetValue(GrabHandlePressedImageProperty, value); + SetValue(EmbossProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHandleImageLeft property. + /// The InputEmboss property. /// /// 3 - public PropertyMap SelectionHandleImageLeft + public string InputEmboss { get { - return (PropertyMap)GetValue(SelectionHandleImageLeftProperty); + return (string)GetValue(InputEmbossProperty); } set { - SetValue(SelectionHandleImageLeftProperty, value); + SetValue(InputEmbossProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHandleImageRight property. + /// The Outline property. + /// The outline map contains the following keys :
+ /// + /// color (Color)The color of the outline (the default color is Color.White) + /// width (float)The width in pixels of the outline (If not provided then the outline is not enabled) + /// ///
/// 3 - public PropertyMap SelectionHandleImageRight + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] + public PropertyMap Outline { get { - return (PropertyMap)GetValue(SelectionHandleImageRightProperty); + return (PropertyMap)GetValue(OutlineProperty); } set { - SetValue(SelectionHandleImageRightProperty, value); + SetValue(OutlineProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHandlePressedImageLeft property. + /// Set Outline to TextEditor.
+ ///
+ /// The Outline + /// + /// SetOutline specifies the outline of the text through .
+ ///
+ /// + /// The following example demonstrates how to use the SetOutline method. + /// + /// var outline = new Tizen.NUI.Text.Outline(); + /// outline.Width = 2.0f; + /// outline.Color = new Color("#45B39D"); + /// editor.SetOutline(outline); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetOutline(Outline outline) + { + SetValue(OutlineProperty, TextUtils.GetOutlineMap(outline)); + } + + /// + /// Get Outline from TextEditor.
+ ///
+ /// The Outline + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Outline GetOutline() + { + return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty)); + } + + /// + /// The InputOutline property. /// /// 3 - public PropertyMap SelectionHandlePressedImageLeft + public string InputOutline { get { - return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty); + return (string)GetValue(InputOutlineProperty); } set { - SetValue(SelectionHandlePressedImageLeftProperty, value); + SetValue(InputOutlineProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHandlePressedImageRight property. + /// The SmoothScroll property. /// /// 3 - public PropertyMap SelectionHandlePressedImageRight + public bool SmoothScroll { get { - return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty); + return (bool)GetValue(SmoothScrollProperty); } set { - SetValue(SelectionHandlePressedImageRightProperty, value); + SetValue(SmoothScrollProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHandleMarkerImageLeft property. + /// The SmoothScrollDuration property. /// /// 3 - public PropertyMap SelectionHandleMarkerImageLeft + public float SmoothScrollDuration { get { - return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty); + return (float)GetValue(SmoothScrollDurationProperty); } set { - SetValue(SelectionHandleMarkerImageLeftProperty, value); + SetValue(SmoothScrollDurationProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHandleMarkerImageRight property. + /// The EnableScrollBar property. /// /// 3 - public PropertyMap SelectionHandleMarkerImageRight + public bool EnableScrollBar { get { - return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty); + return (bool)GetValue(EnableScrollBarProperty); } set { - SetValue(SelectionHandleMarkerImageRightProperty, value); + SetValue(EnableScrollBarProperty, value); NotifyPropertyChanged(); } } /// - /// The SelectionHighlightColor property. + /// The ScrollBarShowDuration property. /// /// 3 - public Vector4 SelectionHighlightColor + public float ScrollBarShowDuration { get { - return (Vector4)GetValue(SelectionHighlightColorProperty); + return (float)GetValue(ScrollBarShowDurationProperty); } set { - SetValue(SelectionHighlightColorProperty, value); + SetValue(ScrollBarShowDurationProperty, value); NotifyPropertyChanged(); } } /// - /// The DecorationBoundingBox property. + /// The ScrollBarFadeDuration property. /// /// 3 - public Rectangle DecorationBoundingBox + public float ScrollBarFadeDuration { get { - return (Rectangle)GetValue(DecorationBoundingBoxProperty); + return (float)GetValue(ScrollBarFadeDurationProperty); } set { - SetValue(DecorationBoundingBoxProperty, value); + SetValue(ScrollBarFadeDurationProperty, value); NotifyPropertyChanged(); } } /// - /// The EnableMarkup property. + /// The PixelSize property. /// /// 3 - public bool EnableMarkup + public float PixelSize { get { - return (bool)GetValue(EnableMarkupProperty); + return (float)GetValue(PixelSizeProperty); } set { - SetValue(EnableMarkupProperty, value); + SetValue(PixelSizeProperty, value); NotifyPropertyChanged(); } } /// - /// The InputColor property. + /// The line count of the text. /// /// 3 - public Vector4 InputColor + public int LineCount { get { - return (Vector4)GetValue(InputColorProperty); - } - set - { - SetValue(InputColorProperty, value); - NotifyPropertyChanged(); + int temp = 0; + GetProperty(TextEditor.Property.LineCount).Get(out temp); + return temp; } } /// - /// The InputFontFamily property. + /// The text to display when the TextEditor is empty and inactive. /// /// 3 - public string InputFontFamily + public string PlaceholderText { get { - return (string)GetValue(InputFontFamilyProperty); + return (string)GetValue(PlaceholderTextProperty); } set { - SetValue(InputFontFamilyProperty, value); + SetValue(PlaceholderTextProperty, value); NotifyPropertyChanged(); } } /// - /// The InputFontStyle property. + /// The Selected Text property (read-only). /// - /// 3 - public PropertyMap InputFontStyle + [EditorBrowsable(EditorBrowsableState.Never)] + public string SelectedText { get { - return (PropertyMap)GetValue(InputFontStyleProperty); - } - set - { - SetValue(InputFontStyleProperty, value); - NotifyPropertyChanged(); + string temp; + GetProperty(TextEditor.Property.SelectedText).Get(out temp); + return temp; } } /// - /// The InputPointSize property. + /// The Placeholder text color. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible. + /// /// 3 - public float InputPointSize + public Color PlaceholderTextColor { get { - return (float)GetValue(InputPointSizeProperty); + Color temp = (Color)GetValue(PlaceholderTextColorProperty); + return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A); } set { - SetValue(InputPointSizeProperty, value); + SetValue(PlaceholderTextColorProperty, value); NotifyPropertyChanged(); } } /// - /// The LineSpacing property. + /// The EnableSelection property. /// /// 3 - public float LineSpacing + public bool EnableSelection { get { - return (float)GetValue(LineSpacingProperty); + return (bool)GetValue(EnableSelectionProperty); } set { - SetValue(LineSpacingProperty, value); + SetValue(EnableSelectionProperty, value); NotifyPropertyChanged(); } } /// - /// The InputLineSpacing property. + /// The start index for selection. /// - /// 3 - public float InputLineSpacing + /// 8 + /// 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 { - return (float)GetValue(InputLineSpacingProperty); + int temp; + GetProperty(TextEditor.Property.SelectedTextStart).Get(out temp); + return temp; } - set + } + + /// + /// The end index for selection. + /// + /// 8 + /// 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 { - SetValue(InputLineSpacingProperty, value); - NotifyPropertyChanged(); + int temp; + GetProperty(TextEditor.Property.SelectedTextEnd).Get(out temp); + return temp; } } /// - /// The Underline property. + /// Enable editing in text control. /// - /// 3 - public PropertyMap Underline + /// 8 + /// 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 { - return (PropertyMap)GetValue(UnderlineProperty); + bool temp; + GetProperty(TextEditor.Property.EnableEditing).Get(out temp); + return temp; } set { - SetValue(UnderlineProperty, value); + SetProperty(TextEditor.Property.EnableEditing, new PropertyValue(value)); NotifyPropertyChanged(); } } /// - /// The InputUnderline property. + /// Specify horizontal scroll position in text control. /// - /// 3 - public string InputUnderline + [EditorBrowsable(EditorBrowsableState.Never)] + public int HorizontalScrollPosition { get { - return (string)GetValue(InputUnderlineProperty); + int temp; + using (PropertyValue propertyValue = GetProperty(TextEditor.Property.HorizontalScrollPosition)) + { + propertyValue.Get(out temp); + } + return temp; } set { - SetValue(InputUnderlineProperty, value); - NotifyPropertyChanged(); + using (PropertyValue propertyValue = new PropertyValue(value)) + { + SetProperty(TextEditor.Property.HorizontalScrollPosition, propertyValue); + NotifyPropertyChanged(); + } } } /// - /// The Shadow property. + /// Specify vertical scroll position in text control. /// - /// 3 - public PropertyMap Shadow + [EditorBrowsable(EditorBrowsableState.Never)] + public int VerticalScrollPosition { get { - return (PropertyMap)GetValue(ShadowProperty); + int temp; + using (PropertyValue propertyValue = GetProperty(TextEditor.Property.VerticalScrollPosition)) + { + propertyValue.Get(out temp); + } + return temp; } set { - SetValue(ShadowProperty, value); - NotifyPropertyChanged(); + using (PropertyValue propertyValue = new PropertyValue(value)) + { + SetProperty(TextEditor.Property.VerticalScrollPosition, propertyValue); + NotifyPropertyChanged(); + } } } /// - /// The InputShadow property. + /// Specify primary cursor (caret) position in text control. /// - /// 3 - public string InputShadow + [EditorBrowsable(EditorBrowsableState.Never)] + public int PrimaryCursorPosition { get { - return (string)GetValue(InputShadowProperty); + int temp; + using (PropertyValue propertyValue = GetProperty(TextEditor.Property.PrimaryCursorPosition)) + { + propertyValue.Get(out temp); + } + return temp; } set { - SetValue(InputShadowProperty, value); - NotifyPropertyChanged(); + using (PropertyValue propertyValue = new PropertyValue(value)) + { + SetProperty(TextEditor.Property.PrimaryCursorPosition, propertyValue); + NotifyPropertyChanged(); + } } } /// - /// The Emboss property. + /// The GrabHandleColor property. /// - /// 3 - public string Emboss + /// + /// The property cascade chaining set is possible. For example, this (textEditor.GrabHandleColor.X = 0.1f;) is possible. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Color GrabHandleColor { get { - return (string)GetValue(EmbossProperty); + Color temp = (Color)GetValue(GrabHandleColorProperty); + return new Color(OnGrabHandleColorChanged, temp.R, temp.G, temp.B, temp.A); } set { - SetValue(EmbossProperty, value); + SetValue(GrabHandleColorProperty, value); NotifyPropertyChanged(); } } /// - /// The InputEmboss property. + /// Set InputFilter to TextEditor.
+ ///
+ /// The InputFilter + /// + /// filters input based on regular expressions.
+ /// Users can set the Accepted or Rejected regular expression set, or both.
+ /// If both are used, Rejected has higher priority.
+ /// The character set must follow the regular expression rules.
+ /// Behaviour can not be guaranteed for incorrect grammars.
+ /// Refer the link below for detailed rules.
+ /// The functions in std::regex library use the ECMAScript grammar:
+ /// http://cplusplus.com/reference/regex/ECMAScript/
+ /// InputFiltered signal is emitted when the input is filtered by InputFilter
+ /// See , and for a detailed description.
+ ///
+ /// + /// The following example demonstrates how to use the SetInputFilter method. + /// + /// 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 + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetInputFilter(InputFilter inputFilter) + { + SetProperty(TextEditor.Property.InputFilter, new PropertyValue(TextUtils.GetInputFilterMap(inputFilter))); + } + + /// + /// Get InputFilter from TextEditor.
+ ///
+ /// The InputFilter + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public InputFilter GetInputFilter() + { + var map = new PropertyMap(); + GetProperty(TextEditor.Property.InputFilter).Get(map); + return TextUtils.GetInputFilterStruct(map); + } + + /// + /// The Placeholder property. + /// The placeholder map contains the following keys :
+ /// + /// text (string)The text to display when the TextEditor is empty and inactive + /// textFocused (string)The text to display when the placeholder has focus + /// color (Color)The color of the placeholder text + /// fontFamily (string)The fontFamily of the placeholder text + /// fontStyle (PropertyMap)The fontStyle of the placeholder text + /// pointSize (float)The pointSize of the placeholder text + /// pixelSize (float)The pixelSize of the placeholder text + /// ellipsis (bool)The ellipsis of the placeholder text + /// ///
+ /// + /// The following example demonstrates how to set the placeholder property. + /// + /// PropertyMap propertyMap = new PropertyMap(); + /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text")); + /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused")); + /// propertyMap.Add("color", new PropertyValue(Color.Red)); + /// propertyMap.Add("fontFamily", new PropertyValue("Arial")); + /// propertyMap.Add("pointSize", new PropertyValue(12.0f)); + /// + /// PropertyMap fontStyleMap = new PropertyMap(); + /// fontStyleMap.Add("weight", new PropertyValue("bold")); + /// fontStyleMap.Add("width", new PropertyValue("condensed")); + /// fontStyleMap.Add("slant", new PropertyValue("italic")); + /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap)); + /// + /// TextEditor editor = new TextEditor(); + /// editor.Placeholder = propertyMap; + /// + /// /// 3 - public string InputEmboss + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] + public Tizen.NUI.PropertyMap Placeholder { get { - return (string)GetValue(InputEmbossProperty); + 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 { - SetValue(InputEmbossProperty, value); + SetValue(PlaceholderProperty, value); NotifyPropertyChanged(); } } /// - /// The Outline property. + /// Set Placeholder to TextEditor.
///
- /// 3 - public PropertyMap Outline + /// The Placeholder + /// + /// SetPlaceholder specifies the attributes of the placeholder property through .
+ ///
+ /// + /// The following example demonstrates how to use the SetPlaceholder method. + /// + /// 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); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetPlaceholder(Placeholder placeholder) + { + SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder)); + } + + /// + /// Get Placeholder from TextEditor.
+ ///
+ /// The Placeholder + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Placeholder GetPlaceholder() + { + return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty)); + } + + /// + /// The Ellipsis property.
+ /// Enable or disable the ellipsis.
+ ///
+ /// 9 + public bool Ellipsis { get { - return (PropertyMap)GetValue(OutlineProperty); + return (bool)GetValue(EllipsisProperty); } set { - SetValue(OutlineProperty, value); + SetValue(EllipsisProperty, value); NotifyPropertyChanged(); } } + /// - /// The InputOutline property. + /// 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.
///
- /// 3 - public string InputOutline + /// 9 + public EllipsisPosition EllipsisPosition { get { - return (string)GetValue(InputOutlineProperty); + return (EllipsisPosition)GetValue(EllipsisPositionProperty); } set { - SetValue(InputOutlineProperty, value); + SetValue(EllipsisPositionProperty, value); NotifyPropertyChanged(); } } /// - /// The SmoothScroll property. + /// The LineWrapMode property.
+ /// The line wrap mode when the text lines over the layout width.
///
- /// 3 - public bool SmoothScroll + /// 4 + public LineWrapMode LineWrapMode { get { - return (bool)GetValue(SmoothScrollProperty); + return (LineWrapMode)GetValue(LineWrapModeProperty); } set { - SetValue(SmoothScrollProperty, value); + SetValue(LineWrapModeProperty, value); NotifyPropertyChanged(); } } /// - /// The SmoothScrollDuration property. + /// Enables Text selection using Shift key. /// - /// 3 - public float SmoothScrollDuration + /// 5 + /// 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 (float)GetValue(SmoothScrollDurationProperty); + return (bool)GetValue(EnableShiftSelectionProperty); } set { - SetValue(SmoothScrollDurationProperty, value); + SetValue(EnableShiftSelectionProperty, value); NotifyPropertyChanged(); } } /// - /// The EnableScrollBar property. + /// The text alignment to match the direction of the system language. /// - /// 3 - public bool EnableScrollBar + /// 6 + public bool MatchSystemLanguageDirection { get { - return (bool)GetValue(EnableScrollBarProperty); + return (bool)GetValue(MatchSystemLanguageDirectionProperty); } set { - SetValue(EnableScrollBarProperty, value); + SetValue(MatchSystemLanguageDirectionProperty, value); NotifyPropertyChanged(); } } /// - /// The ScrollBarShowDuration property. + /// The MaxLength property. /// - /// 3 - public float ScrollBarShowDuration + /// 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 (float)GetValue(ScrollBarShowDurationProperty); + return (int)GetValue(MaxLengthProperty); } set { - SetValue(ScrollBarShowDurationProperty, value); + SetValue(MaxLengthProperty, value); NotifyPropertyChanged(); } } /// - /// The ScrollBarFadeDuration property. + /// The FontSizeScale property.
+ /// The default value is 1.0.
+ /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally.
///
- /// 3 - public float ScrollBarFadeDuration + /// 9 + public float FontSizeScale { get { - return (float)GetValue(ScrollBarFadeDurationProperty); + return fontSizeScale; } set { - SetValue(ScrollBarFadeDurationProperty, value); + float newFontSizeScale; + + if (fontSizeScale == value) return; + + fontSizeScale = value; + if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting) + { + SystemSettingsFontSize systemSettingsFontSize; + + try + { + systemSettingsFontSize = SystemSettings.FontSize; + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + systemSettingsFontSize = SystemSettingsFontSize.Normal; + } + newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize); + addFontSizeChangedCallback(); + } + else + { + newFontSizeScale = fontSizeScale; + removeFontSizeChangedCallback(); + } + + SetValue(FontSizeScaleProperty, newFontSizeScale); NotifyPropertyChanged(); } } /// - /// The PixelSize property. + /// The InputMethodSettings property. /// - /// 3 - public float PixelSize + /// + /// is a class encapsulating the input method map. Please use the class for this property. + /// + /// + /// The following example demonstrates how to set the InputMethodSettings property. + /// + /// 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; + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap InputMethodSettings { get { - return (float)GetValue(PixelSizeProperty); + return (PropertyMap)GetValue(InputMethodSettingsProperty); } set { - SetValue(PixelSizeProperty, value); + SetValue(InputMethodSettingsProperty, value); NotifyPropertyChanged(); } } /// - /// The line count of the text. + /// Scroll the text control by specific amount.. /// - /// 3 - public int LineCount + /// The amount (in pixels) of scrolling in horizontal & vertical directions. + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollBy(Vector2 scroll) { - get + Interop.TextEditor.ScrollBy(SwigCPtr, Vector2.getCPtr(scroll)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Get the InputMethodContext instance. + /// + /// The InputMethodContext instance. + /// 5 + public InputMethodContext GetInputMethodContext() + { + if (inputMethodContext == null) { - int temp = 0; - GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp); - return temp; + /*Avoid raising InputMethodContext reference count.*/ + inputMethodContext = new InputMethodContext(Interop.TextEditor.GetInputMethodContext(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + return inputMethodContext; } /// - /// The text to display when the TextEditor is empty and inactive. + /// Select the whole text. /// - /// 3 - public string PlaceholderText + [EditorBrowsable(EditorBrowsableState.Never)] + public void SelectWholeText() + { + Interop.TextEditor.SelectWholeText(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Select text from start to end index.
+ /// The index is valid when 0 or positive.
+ ///
+ /// The start index for selection. + /// The end index for selection. + [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(); + } + + /// + /// Clear selection of the text. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SelectNone() + { + _ = Interop.TextEditor.SelectNone(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Enable grab handle property. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool EnableGrabHandle { get { - return (string)GetValue(PlaceholderTextProperty); + return (bool)GetValue(EnableGrabHandleProperty); } set { - SetValue(PlaceholderTextProperty, value); + SetValue(EnableGrabHandleProperty, value); NotifyPropertyChanged(); } } /// - /// The Placeholder text color. + /// Enable grab handle popup property. /// - /// 3 - public Color PlaceholderTextColor + [EditorBrowsable(EditorBrowsableState.Never)] + public bool EnableGrabHandlePopup { get { - return (Color)GetValue(PlaceholderTextColorProperty); + return (bool)GetValue(EnableGrabHandlePopupProperty); } set { - SetValue(PlaceholderTextColorProperty, value); + SetValue(EnableGrabHandlePopupProperty, value); NotifyPropertyChanged(); } } /// - /// The EnableSelection property. + /// Minimum line size to be used. /// - /// 3 - public bool EnableSelection + [EditorBrowsable(EditorBrowsableState.Never)] + public float MinLineSize { get { - return (bool)GetValue(EnableSelectionProperty); + return (float)GetValue(MinLineSizeProperty); } set { - SetValue(EnableSelectionProperty, value); + 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.InputStyleChangedSignal(SwigCPtr)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// - /// The Placeholder property. - /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size. + /// Dispose. /// - /// - /// The following example demonstrates how to set the placeholder property. - /// - /// PropertyMap propertyMap = new PropertyMap(); - /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text")); - /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused")); - /// propertyMap.Add("color", new PropertyValue(Color.Red)); - /// propertyMap.Add("fontFamily", new PropertyValue("Arial")); - /// propertyMap.Add("pointSize", new PropertyValue(12.0f)); - /// - /// PropertyMap fontStyleMap = new PropertyMap(); - /// fontStyleMap.Add("weight", new PropertyValue("bold")); - /// fontStyleMap.Add("width", new PropertyValue("condensed")); - /// fontStyleMap.Add("slant", new PropertyValue("italic")); - /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap)); - /// - /// TextEditor editor = new TextEditor(); - /// editor.Placeholder = propertyMap; - /// - /// /// 3 - public Tizen.NUI.PropertyMap Placeholder + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - return (PropertyMap)GetValue(PlaceholderProperty); + return; } - set + + if (systemlangTextFlag) { - SetValue(PlaceholderProperty, value); - NotifyPropertyChanged(); + 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); + } + + if (textEditorSelectionClearedCallbackDelegate != null) + { + this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate); + } + + if (textEditorCursorPositionChangedCallbackDelegate != null) + { + this.CursorPositionChangedSignal().Disconnect(textEditorCursorPositionChangedCallbackDelegate); + } + + if (textEditorSelectionChangedCallbackDelegate != null) + { + this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate); + } } + + TextChanged -= TextEditorTextChanged; + + base.Dispose(type); } - /// - /// The LineWrapMode property.
- /// The line wrap mode when the text lines over the layout width.
- ///
- /// 4 - public LineWrapMode LineWrapMode + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { - get + // 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) { - return (LineWrapMode)GetValue(LineWrapModeProperty); + if (systemlangTextFlag == false) + { + SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged; + systemlangTextFlag = true; + } + return translatableText; } - set + else { - SetValue(LineWrapModeProperty, value); - NotifyPropertyChanged(); + translatableText = ""; + return translatableText; } } - /// - /// Enables Text selection using Shift key. - /// - /// 5 - /// 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 + private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) { - get + if (textEditorTextSid != null) { - return (bool)GetValue(EnableShiftSelectionProperty); + Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-"))); } - set + if (textEditorPlaceHolderTextSid != null) { - SetValue(EnableShiftSelectionProperty, value); - NotifyPropertyChanged(); + 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; + } + } + } + + private void TextEditorTextChanged(object sender, TextChangedEventArgs e) + { + if (!isSettingTextInCSharp) + { + ForceNotifyBindedInstance(TextProperty); } } + 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); + } } }