From a2c8329931cf1b30b3d6bb007f04c2b3f6d47bd3 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Mon, 17 May 2021 13:06:21 +0900 Subject: [PATCH] [NUI] Add EnableGrabHandle, EnableGrabHandlePopup to TextEditor Signed-off-by: Bowon Ryu --- .../src/internal/Interop/Interop.TextEditor.cs | 6 ++++ .../src/public/BaseComponents/TextEditor.cs | 36 ++++++++++++++++++++++ .../BaseComponents/TextEditorBindableProperty.cs | 36 ++++++++++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs index 2834282..d736341 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs @@ -291,6 +291,12 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_Property_GRAB_HANDLE_COLOR_get")] public static extern int GrabHandleColorGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_Property_ENABLE_GRAB_HANDLE_get")] + public static extern int EnableGrabHandleGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_Property_ENABLE_GRAB_HANDLE_POPUP_get")] + public static extern int EnableGrabHandlePopupGet(); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index b155f96..5d35246 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -1393,6 +1393,40 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Enable grab handle property. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool EnableGrabHandle + { + get + { + return (bool)GetValue(EnableGrabHandleProperty); + } + set + { + SetValue(EnableGrabHandleProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Enable grab handle popup property. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool EnableGrabHandlePopup + { + get + { + return (bool)GetValue(EnableGrabHandlePopupProperty); + } + set + { + SetValue(EnableGrabHandlePopupProperty, value); + NotifyPropertyChanged(); + } + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; @@ -1590,6 +1624,8 @@ namespace Tizen.NUI.BaseComponents 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 class InputStyle diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs index 4217254..a40f966 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs @@ -973,5 +973,41 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.GrabHandleColor).Get(temp); return temp; })); + + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty EnableGrabHandleProperty = BindableProperty.Create(nameof(TextEditor.EnableGrabHandle), typeof(bool), typeof(TextEditor), true, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.EnableGrabHandle, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.EnableGrabHandle).Get(out temp); + return temp; + })); + + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty EnableGrabHandlePopupProperty = BindableProperty.Create(nameof(TextEditor.EnableGrabHandlePopup), typeof(bool), typeof(TextEditor), true, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.EnableGrabHandlePopup, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.EnableGrabHandlePopup).Get(out temp); + return temp; + })); + + } } -- 2.7.4