From f522ee44a6ed06886e9e1a3f67f2d4ca215cdceb Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Fri, 20 Aug 2021 16:00:48 +0900 Subject: [PATCH] Revert "[NUI] Add SelectionChanged Event (#3397)" (#3440) Accidentally merged before the related dali-csharp-binder patch was merged. This reverts commit d0e0dc427d0ff7a1d01cec085cb5dda7824a6111. --- .../src/internal/Interop/Interop.TextEditor.cs | 3 -- .../src/internal/Interop/Interop.TextField.cs | 3 -- .../src/public/BaseComponents/TextEditor.cs | 5 -- .../src/public/BaseComponents/TextEditorEvent.cs | 54 --------------------- .../src/public/BaseComponents/TextEvent.cs | 20 -------- .../src/public/BaseComponents/TextField.cs | 5 -- .../src/public/BaseComponents/TextFieldEvent.cs | 55 ---------------------- 7 files changed, 145 deletions(-) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs index 027fdde..1a0040d 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs @@ -183,9 +183,6 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_AnchorClickedSignal")] public static extern global::System.IntPtr AnchorClickedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_SelectionChangedSignal")] - public static extern global::System.IntPtr SelectionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditorSignal_Empty")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool TextEditorSignalEmpty(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs index d2f4d8a..6362419 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs @@ -198,9 +198,6 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_AnchorClickedSignal")] public static extern global::System.IntPtr AnchorClickedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_SelectionChangedSignal")] - public static extern global::System.IntPtr SelectionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextFieldSignal_Empty")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool TextFieldSignalEmpty(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 65574d4..b1621c3 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -1943,11 +1943,6 @@ namespace Tizen.NUI.BaseComponents { this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate); } - - if (textEditorSelectionChangedCallbackDelegate != null) - { - this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate); - } } base.Dispose(type); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs index 86ad374..d073412 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs @@ -39,9 +39,6 @@ namespace Tizen.NUI.BaseComponents private EventHandler textEditorAnchorClickedEventHandler; private AnchorClickedCallbackDelegate textEditorAnchorClickedCallbackDelegate; - private EventHandler textEditorSelectionChangedEventHandler; - private SelectionChangedCallbackDelegate textEditorSelectionChangedCallbackDelegate; - private EventHandler textEditorInputFilteredEventHandler; private InputFilteredCallbackDelegate textEditorInputFilteredCallbackDelegate; @@ -58,9 +55,6 @@ namespace Tizen.NUI.BaseComponents private delegate void AnchorClickedCallbackDelegate(IntPtr textEditor, IntPtr href, uint hrefLength); [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void SelectionChangedCallbackDelegate(IntPtr textEditor, uint oldStart, uint oldEnd); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void InputFilteredCallbackDelegate(IntPtr textEditor, InputFilterType type); /// @@ -167,32 +161,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionChanged event. - /// - /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler SelectionChanged - { - add - { - if (textEditorSelectionChangedEventHandler == null) - { - textEditorSelectionChangedCallbackDelegate = (OnSelectionChanged); - SelectionChangedSignal().Connect(textEditorSelectionChangedCallbackDelegate); - } - textEditorSelectionChangedEventHandler += value; - } - remove - { - if (textEditorSelectionChangedEventHandler == null && SelectionChangedSignal().Empty() == false) - { - this.SelectionChangedSignal().Disconnect(textEditorSelectionChangedCallbackDelegate); - } - textEditorSelectionChangedEventHandler -= value; - } - } - - /// /// The InputFiltered signal is emitted when the input is filtered by InputFilter.
///
/// @@ -264,13 +232,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - internal TextEditorSignal SelectionChangedSignal() - { - TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.SelectionChangedSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal TextEditorSignal InputFilteredSignal() { TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.InputFilteredSignal(SwigCPtr), false); @@ -333,21 +294,6 @@ namespace Tizen.NUI.BaseComponents textEditorAnchorClickedEventHandler?.Invoke(this, e); } - private void OnSelectionChanged(IntPtr textEditor, uint oldStart, uint oldEnd) - { - if (textEditorSelectionChangedEventHandler != null) - { - SelectionChangedEventArgs e = new SelectionChangedEventArgs(); - - // Populate all members of "e" (SelectionChangedEventArgs) with real data - e.OldSelectionStart = oldStart; - e.OldSelectionEnd = oldEnd; - - //here we send all data to user event handlers - textEditorSelectionChangedEventHandler?.Invoke(this, e); - } - } - private void OnInputFiltered(IntPtr textEditor, InputFilterType type) { InputFilteredEventArgs e = new InputFilteredEventArgs(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs index 4669bce..7aa5e99 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs @@ -47,24 +47,4 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public InputFilterType Type { get; set; } } - - /// - /// The SelectionChanged event arguments. - /// - /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class SelectionChangedEventArgs : EventArgs - { - /// - /// selection start before the change. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public uint OldSelectionStart { get; set; } - - /// - /// selection end before the change. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public uint OldSelectionEnd { get; set; } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index f7ae572..65b24b5 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -1949,11 +1949,6 @@ namespace Tizen.NUI.BaseComponents this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate); } - if (textFieldSelectionChangedCallbackDelegate != null) - { - this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate); - } - if (textFieldTextChangedCallbackDelegate != null) { TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs index 9e50e02..add2d50 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs @@ -33,10 +33,6 @@ namespace Tizen.NUI.BaseComponents private MaxLengthReachedCallbackDelegate textFieldMaxLengthReachedCallbackDelegate; private EventHandler textFieldAnchorClickedEventHandler; private AnchorClickedCallbackDelegate textFieldAnchorClickedCallbackDelegate; - - private EventHandler textFieldSelectionChangedEventHandler; - private SelectionChangedCallbackDelegate textFieldSelectionChangedCallbackDelegate; - private EventHandler textFieldInputFilteredEventHandler; private InputFilteredCallbackDelegate textFieldInputFilteredCallbackDelegate; @@ -50,9 +46,6 @@ namespace Tizen.NUI.BaseComponents private delegate void AnchorClickedCallbackDelegate(IntPtr textField, IntPtr href, uint hrefLength); [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void SelectionChangedCallbackDelegate(IntPtr textField, uint oldStart, uint oldEnd); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void InputFilteredCallbackDelegate(IntPtr textField, InputFilterType type); /// @@ -131,32 +124,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionChanged event. - /// - /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler SelectionChanged - { - add - { - if (textFieldSelectionChangedEventHandler == null) - { - textFieldSelectionChangedCallbackDelegate = (OnSelectionChanged); - SelectionChangedSignal().Connect(textFieldSelectionChangedCallbackDelegate); - } - textFieldSelectionChangedEventHandler += value; - } - remove - { - if (textFieldSelectionChangedEventHandler == null && SelectionChangedSignal().Empty() == false) - { - this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate); - } - textFieldSelectionChangedEventHandler -= value; - } - } - - /// /// The InputFiltered signal is emitted when the input is filtered by InputFilter.
///
/// @@ -221,13 +188,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - internal TextFieldSignal SelectionChangedSignal() - { - TextFieldSignal ret = new TextFieldSignal(Interop.TextField.SelectionChangedSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal TextFieldSignal InputFilteredSignal() { TextFieldSignal ret = new TextFieldSignal(Interop.TextField.InputFilteredSignal(SwigCPtr), false); @@ -273,21 +233,6 @@ namespace Tizen.NUI.BaseComponents textFieldAnchorClickedEventHandler?.Invoke(this, e); } - private void OnSelectionChanged(IntPtr textField, uint oldStart, uint oldEnd) - { - if (textFieldSelectionChangedEventHandler != null) - { - SelectionChangedEventArgs e = new SelectionChangedEventArgs(); - - // Populate all members of "e" (SelectionChangedEventArgs) with real data - e.OldSelectionStart = oldStart; - e.OldSelectionEnd = oldEnd; - - //here we send all data to user event handlers - textFieldSelectionChangedEventHandler?.Invoke(this, e); - } - } - private void OnInputFiltered(IntPtr textField, InputFilterType type) { InputFilteredEventArgs e = new InputFilteredEventArgs(); -- 2.7.4