From 874f2cdc3bf39b603bbef6c757eb4d6d9424b17c Mon Sep 17 00:00:00 2001 From: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com> Date: Tue, 2 Jul 2019 21:29:57 +0900 Subject: [PATCH] [NUI] Add AutofillContainer and autofill implementation (#909) Change-Id: Ifc219498c53577e6560b84a8065c22c3b03e2859 Signed-off-by: Seoyeon Kim --- .../src/internal/AuthenticationSignalType.cs | 207 +++++++++ .../Interop/Interop.AuthenticationSignalType.cs | 41 ++ .../internal/Interop/Interop.AutofillContainer.cs | 87 ++++ .../Interop/Interop.ListEventSignalType.cs | 40 ++ .../src/internal/Interop/Interop.ViewProperty.cs | 1 - src/Tizen.NUI/src/internal/ListEventSignalType.cs | 208 +++++++++ src/Tizen.NUI/src/public/AutofillContainer.cs | 483 +++++++++++++++++++++ 7 files changed, 1066 insertions(+), 1 deletion(-) create mode 100755 src/Tizen.NUI/src/internal/AuthenticationSignalType.cs create mode 100755 src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs create mode 100755 src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs create mode 100755 src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs create mode 100755 src/Tizen.NUI/src/internal/ListEventSignalType.cs create mode 100755 src/Tizen.NUI/src/public/AutofillContainer.cs diff --git a/src/Tizen.NUI/src/internal/AuthenticationSignalType.cs b/src/Tizen.NUI/src/internal/AuthenticationSignalType.cs new file mode 100755 index 0000000..07b54a4 --- /dev/null +++ b/src/Tizen.NUI/src/internal/AuthenticationSignalType.cs @@ -0,0 +1,207 @@ +/* + * Copyright(c) 2019 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.Runtime.InteropServices; +using System.ComponentModel; + +namespace Tizen.NUI +{ + internal class AuthenticationSignalType : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// swigCMemOwn + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool swigCMemOwn; + + internal AuthenticationSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AuthenticationSignalType obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + /// + /// A Flat to check if it is already disposed. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool disposed = false; + + /// + /// Dispose + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ~AuthenticationSignalType() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Dispose + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + /// + /// Dispose + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.AuthenticationSignalType.delete_AuthenticationSignalType(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + /// + /// Queries whether there are any connected slots. + /// + /// True if there are any slots connected to the signal + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Empty() + { + bool ret = Interop.AuthenticationSignalType.AuthenticationSignalType_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Queries the number of slots. + /// + /// The number of slots connected to this signal + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetConnectionCount() + { + uint ret = Interop.AuthenticationSignalType.AuthenticationSignalType_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Connects a member function. + /// + /// The member function to connect + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.AuthenticationSignalType.AuthenticationSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Disconnects a function. + /// + /// The function to disconnect + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.AuthenticationSignalType.AuthenticationSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Emits the signal. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Emit(AutofillContainer arg) + { + Interop.AuthenticationSignalType.AuthenticationSignalType_Emit(swigCPtr, AutofillContainer.getCPtr(arg)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The contructor. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public AuthenticationSignalType() : this(Interop.AuthenticationSignalType.new_AuthenticationSignalType(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs b/src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs new file mode 100755 index 0000000..598560f --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class AuthenticationSignalType + { + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Empty")] + public static extern bool AuthenticationSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_GetConnectionCount")] + public static extern uint AuthenticationSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Connect")] + public static extern void AuthenticationSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Disconnect")] + public static extern void AuthenticationSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Emit")] + public static extern void AuthenticationSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AuthenticationSignalType")] + public static extern global::System.IntPtr new_AuthenticationSignalType(); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AuthenticationSignalType")] + public static extern void delete_AuthenticationSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + + + } + } +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs b/src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs new file mode 100755 index 0000000..b520197 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class AutofillContainer + { + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_SWIGUpcast")] + public static extern global::System.IntPtr AutofillContainer_SWIGUpcast(global::System.IntPtr jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_New")] + public static extern global::System.IntPtr AutofillContainer_New(string jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AutofillContainer__SWIG_1")] + public static extern global::System.IntPtr new_AutofillContainer__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AutofillContainer__SWIG_0")] + public static extern global::System.IntPtr new_AutofillContainer__SWIG_0(); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_Assign")] + public static extern global::System.IntPtr AutofillContainer_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AutofillContainer")] + public static extern void delete_AutofillContainer(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_DownCast")] + public static extern global::System.IntPtr AutofillContainer_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_AddAutofillItem")] + public static extern void AutofillContainer_AddAutofillView(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, string jarg4, string jarg5, uint jarg6, bool jarg7); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_RemoveAutofillItem")] + public static extern void AutofillContainer_RemoveAutofillItem(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_SaveAutofillData")] + public static extern void AutofillContainer_SaveAutofillData(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_RequestFillData")] + public static extern void AutofillContainer_RequestFillData(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetAutofillServiceName")] + public static extern string AutofillContainer_GetAutofillServiceName(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetAutofillServiceMessage")] + public static extern string AutofillContainer_GetAutofillServiceMessage(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetAutofillServiceImagePath")] + public static extern string AutofillContainer_GetAutofillServiceImagePath(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetListCount")] + public static extern uint AutofillContainer_GetListItemCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetListItem")] + public static extern string AutofillContainer_GetListItem(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_SetSelectedItem")] + public static extern void AutofillContainer_SetSelectedItem(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_AutofillServiceShownSignal")] + public static extern global::System.IntPtr AutofillContainer_AutofillServiceEventSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_AutofillListShownSignal")] + public static extern global::System.IntPtr AutofillContainer_AutofillListEventSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + } + } +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs new file mode 100755 index 0000000..20230c2 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class ListEventSignalType + { + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Empty")] + public static extern bool ListEventSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_GetConnectionCount")] + public static extern uint ListEventSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Connect")] + public static extern void ListEventSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Disconnect")] + public static extern void ListEventSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Emit")] + public static extern void ListEventSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ListShownSignalType")] + public static extern global::System.IntPtr new_ListEventSignalType(); + + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ListShownSignalType")] + public static extern void delete_ListEventSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + + } + } +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ViewProperty.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ViewProperty.cs index 29c9acf..56043e0 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ViewProperty.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ViewProperty.cs @@ -70,7 +70,6 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_View_Property_DOWN_FOCUSABLE_ACTOR_ID_get")] public static extern int View_Property_DOWN_FOCUSABLE_ACTOR_ID_get(); - } } } diff --git a/src/Tizen.NUI/src/internal/ListEventSignalType.cs b/src/Tizen.NUI/src/internal/ListEventSignalType.cs new file mode 100755 index 0000000..f36f669 --- /dev/null +++ b/src/Tizen.NUI/src/internal/ListEventSignalType.cs @@ -0,0 +1,208 @@ +/* + * Copyright(c) 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.Runtime.InteropServices; +using System.ComponentModel; + +namespace Tizen.NUI +{ + internal class ListEventSignalType : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// swigCMemOwn + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool swigCMemOwn; + + internal ListEventSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ListEventSignalType obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + /// + /// A Flat to check if it is already disposed. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool disposed = false; + + /// + /// Dispose + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ~ListEventSignalType() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Dispose + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + /// + /// Dispose + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.ListEventSignalType.delete_ListEventSignalType(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + /// + /// Queries whether there are any connected slots. + /// + /// True if there are any slots connected to the signal + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Empty() + { + bool ret = Interop.ListEventSignalType.ListEventSignalType_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Queries the number of slots. + /// + /// The number of slots connected to this signal + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetConnectionCount() + { + uint ret = Interop.ListEventSignalType.ListEventSignalType_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Connects a function. + /// + /// The function to connect + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ListEventSignalType.ListEventSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Disconnects a function. + /// + /// The function to disconnect + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ListEventSignalType.ListEventSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Emits the signal. + /// + /// The first value to pass to callbacks + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Emit(BaseComponents.View arg1) + { + Interop.ListEventSignalType.ListEventSignalType_Emit(swigCPtr, BaseComponents.View.getCPtr(arg1)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The contructor. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public ListEventSignalType() : this(Interop.ListEventSignalType.new_ListEventSignalType(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/public/AutofillContainer.cs b/src/Tizen.NUI/src/public/AutofillContainer.cs new file mode 100755 index 0000000..3d45b92 --- /dev/null +++ b/src/Tizen.NUI/src/public/AutofillContainer.cs @@ -0,0 +1,483 @@ +/* + * Copyright(c) 2019 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.Runtime.InteropServices; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// AutofillContainer controls several text input boxes. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class AutofillContainer : BaseHandle + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + private AuthenticationEventCallbackType _authenticationCallback; + private ListEventCallbackType _listCallback; + + private event EventHandler _authenticationEventHandler; + private event EventHandler _listEventHandler; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void AuthenticationEventCallbackType(IntPtr autofillContainer); + private delegate void ListEventCallbackType(IntPtr control); + + /// + /// AutofillContainer Authentication Service Event. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ServiceEvent + { + add + { + if (_authenticationEventHandler == null) + { + _authenticationCallback = OnServiceEvent; + AutofillServiceEventSignal().Connect(_authenticationCallback); + } + + _authenticationEventHandler += value; + } + remove + { + _authenticationEventHandler -= value; + + if (_authenticationEventHandler == null && _authenticationCallback != null) + { + AutofillServiceEventSignal().Disconnect(_authenticationCallback); + } + } + } + + /// + /// AutofillContainer Fill List Event. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ListEvent + { + add + { + if (_listEventHandler == null) + { + _listCallback = OnListEvent; + AutofillListEventSignal().Connect(_listCallback); + } + + _listEventHandler += value; + } + remove + { + _listEventHandler -= value; + + if (_listEventHandler == null && _listCallback != null) + { + AutofillListEventSignal().Disconnect(_listCallback); + } + } + } + + /// + /// Constructor. + /// + /// The AutofillContainer name + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public AutofillContainer(string name) : this(Interop.AutofillContainer.AutofillContainer_New( name ), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + internal AutofillContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.AutofillContainer.AutofillContainer_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AutofillContainer obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal AutofillContainer(AutofillContainer autofillContainer) : this(Interop.AutofillContainer.new_AutofillContainer__SWIG_1(AutofillContainer.getCPtr(autofillContainer)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal AutofillContainer Assign(AutofillContainer autofillContainer) + { + AutofillContainer ret = new AutofillContainer(Interop.AutofillContainer.AutofillContainer_Assign(swigCPtr, AutofillContainer.getCPtr(autofillContainer)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static AutofillContainer DownCast(BaseHandle handle) + { + AutofillContainer ret = new AutofillContainer(Interop.AutofillContainer.AutofillContainer_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Adds View and its Autofill item information to Autofill Container. + /// + /// The view to be added to Autofill Container + /// The Property to be filled automatically of each View + /// A unique ID that does not always change on each launching + /// An auxiliary means to guess heuristically what data is + /// The Hint - id (username), name, password, phone, credit card number, organization, and so on + /// Whether this information is a sensitive data or not + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddAutofillView(BaseComponents.View view, int propertyIndex, string id, string label, AutofillContainer.ItemHint hint, bool isSensitive) + { + Interop.AutofillContainer.AutofillContainer_AddAutofillView(swigCPtr, BaseComponents.View.getCPtr(view), propertyIndex, id, label, (uint)hint, isSensitive); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Removes View and its AutofillItem information to Autofill Container. + /// + /// The view to be removed to Autofill Container + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveAutofillItem(BaseComponents.View view) + { + Interop.AutofillContainer.AutofillContainer_RemoveAutofillItem(swigCPtr, BaseComponents.View.getCPtr(view)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Stores autofill data. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SaveAutofillData() + { + Interop.AutofillContainer.AutofillContainer_SaveAutofillData(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sends a request for filling the data. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestFillData() + { + Interop.AutofillContainer.AutofillContainer_RequestFillData(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the Autofill Service Name. + /// + /// Autofill Service Name + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetAutofillServiceName() + { + string ret = Interop.AutofillContainer.AutofillContainer_GetAutofillServiceName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Gets the Autofill Service Message. + /// + /// Autofill Service Message + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetAutofillServiceMessage() + { + string ret = Interop.AutofillContainer.AutofillContainer_GetAutofillServiceMessage(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Gets the Autofill Service Image Path. + /// + /// Autofill Service Image Path + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetAutofillServiceImagePath() + { + string ret = Interop.AutofillContainer.AutofillContainer_GetAutofillServiceImagePath(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Gets the number of list items. (The presentation text of Autofill) + /// + /// The number of list items + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetListItemCount() + { + uint ret = Interop.AutofillContainer.AutofillContainer_GetListItemCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Gets the list item of the index. + /// + /// The index for the list + /// The list item of the index + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetListItem(uint index) + { + string ret = Interop.AutofillContainer.AutofillContainer_GetListItem(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the selected item to fill out. + /// + /// The selected item + /// 5 + public void SetSelectedItem(string selected) + { + Interop.AutofillContainer.AutofillContainer_SetSelectedItem(swigCPtr, selected); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal AuthenticationSignalType AutofillServiceEventSignal() + { + + AuthenticationSignalType ret = new AuthenticationSignalType(Interop.AutofillContainer.AutofillContainer_AutofillServiceEventSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ListEventSignalType AutofillListEventSignal() + { + ListEventSignalType ret = new ListEventSignalType(Interop.AutofillContainer.AutofillContainer_AutofillListEventSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this != null) + { + if (_authenticationCallback != null) + { + AutofillServiceEventSignal().Disconnect(_authenticationCallback); + } + + if (_listCallback != null) + { + AutofillListEventSignal().Disconnect(_listCallback); + } + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.Texture.delete_Texture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnServiceEvent(IntPtr autofillContainer) + { + AuthenticationEventArgs e = new AuthenticationEventArgs(); + e.AutofillContainer = Registry.GetManagedBaseHandleFromNativePtr(autofillContainer) as AutofillContainer; + + if (_authenticationEventHandler != null) + { + _authenticationEventHandler(this, e); + } + } + + private void OnListEvent(IntPtr control) + { + ListEventArgs e = new ListEventArgs(); + e.Control = Registry.GetManagedBaseHandleFromNativePtr(control) as BaseComponents.View; + + if (_listEventHandler != null) + { + _listEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via the Authentication event. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class AuthenticationEventArgs : EventArgs + { + /// + /// The instance of AutofillContainer + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public AutofillContainer AutofillContainer + { + get; + set; + } + } + + /// + /// AutofillContainer list event arguments. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class ListEventArgs : EventArgs + { + /// + /// The instance of AutofillContainer + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public BaseComponents.View Control + { + get; + set; + } + + } + + /// + /// Enumeration for hint of the autofill item. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum ItemHint + { + /// + /// Autofill hint for a credit card expiration date + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + CreditCardExpirationData, + /// + /// Autofill hint for a credit card expiration day + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + CreditCardExpirationDay, + /// + /// Autofill hint for a credit card expiration month + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + CreditCardExpirationMonth, + /// + /// Autofill hint for a credit card expiration year + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + CreditCardExpirationYear, + /// + /// Autofill hint for a credit card number + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + CreditCardNumber, + /// + /// Autofill hint for an email address + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + EmailAddress, + /// + /// Autofill hint for a user's real name + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Name, + /// + /// Autofill hint for a phone number + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Phone, + /// + /// Autofill hint for a postal address + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + PostalAddress, + /// + /// Autofill hint for a postal code + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + PostalCode, + /// + /// Autofill hint for a user's ID + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Id, + /// + /// Autofill hint for password + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Password, + /// + /// Autofill hint for a credit card security code + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + CreditCardSecurityCode + } + } + +} \ No newline at end of file -- 2.7.4