*
*/
-using System;
+using System.Collections.Generic;
using System.ComponentModel;
namespace Tizen.NUI
}
/// <summary>
- /// WebBackForwardSubList is a class for back-forward copied list item of web view.
+ /// WebBackForwardList is a class for back-forward list of web view.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public class WebBackForwardSubList : Disposable
+ public class WebBackForwardList : Disposable
{
- internal WebBackForwardSubList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
- {
- }
+ private WebBackForwardSubList backwardItemList = null;
+ private WebBackForwardSubList forwardItemList = null;
- protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ internal WebBackForwardList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
- Interop.WebBackForwardSubList.DeleteCopiedItems(swigCPtr);
}
/// <summary>
- /// Get item count.
+ /// Dispose for IDisposable pattern
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint ItemCount
+ protected override void Dispose(DisposeTypes type)
{
- get
+ if (Disposed)
{
- return Interop.WebBackForwardSubList.GetItemCount(SwigCPtr);
+ return;
}
- }
- /// <summary>
- /// Get item with index.
- /// </summary>
- /// <param name="index">The index of list item.</param>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public WebBackForwardListItem GetItemAtIndex(uint index)
- {
- System.IntPtr itemPtr = Interop.WebBackForwardSubList.GetItemAtIndex(SwigCPtr, index);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardListItem ret = new WebBackForwardListItem(itemPtr, false);
- return ret;
- }
- }
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+ if (backwardItemList != null)
+ {
+ backwardItemList.Dispose();
+ }
+ if (forwardItemList != null)
+ {
+ forwardItemList.Dispose();
+ }
+ }
- /// <summary>
- /// WebBackForwardList is a class for back-forward list of web view.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class WebBackForwardList : Disposable
- {
- internal WebBackForwardList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
- {
+ base.Dispose(type);
}
/// <summary>
{
System.IntPtr itemPtr = Interop.WebBackForwardList.GetCurrentItem(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardListItem ret = new WebBackForwardListItem(itemPtr, true);
- return ret;
+ return new WebBackForwardListItem(itemPtr, true);
}
/// <summary>
{
System.IntPtr itemPtr = Interop.WebBackForwardList.GetPreviousItem(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardListItem ret = new WebBackForwardListItem(itemPtr, true);
- return ret;
+ return new WebBackForwardListItem(itemPtr, true);
}
/// <summary>
{
System.IntPtr itemPtr = Interop.WebBackForwardList.GetNextItem(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardListItem ret = new WebBackForwardListItem(itemPtr, true);
- return ret;
+ return new WebBackForwardListItem(itemPtr, true);
}
/// <summary>
{
System.IntPtr itemPtr = Interop.WebBackForwardList.GetItemAtIndex(SwigCPtr, index);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardListItem ret = new WebBackForwardListItem(itemPtr, true);
- return ret;
+ return new WebBackForwardListItem(itemPtr, true);
}
/// <summary>
- /// Get copied backward items.
+ /// Get copied backward items preceding the current item and limited by limit.
+ /// Item in returned list starts with the oldest one.
+ /// If limit is equal to ItemCount - 1, all the items preceding the current item are returned.
/// </summary>
- /// <param name="index">limit The number of items to retrieve.</param>
+ /// <param name="limit">The number of items to retrieve.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public WebBackForwardSubList GetBackwardItems(int index)
+ public IList<WebBackForwardListItem> GetBackwardItems(int limit)
{
- System.IntPtr itemPtr = Interop.WebBackForwardList.GetBackwardItems(SwigCPtr, index);
+ System.IntPtr itemPtr = Interop.WebBackForwardList.GetBackwardItems(SwigCPtr, limit);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardSubList ret = new WebBackForwardSubList(itemPtr, true);
- return ret;
+
+ if (backwardItemList != null)
+ {
+ backwardItemList.Dispose();
+ }
+ backwardItemList = new WebBackForwardSubList(itemPtr, true);
+
+ List<WebBackForwardListItem> list = new List<WebBackForwardListItem>();
+ for (uint i = 0; i < backwardItemList.ItemCount; i++)
+ {
+ list.Add(backwardItemList.GetItemAtIndex(i));
+ }
+ return list;
}
/// <summary>
- /// Get copied forward items.
+ /// Get copied forward items following the current item and limited by limit.
+ /// Item in returned list starts with the oldest one.
+ /// If limit is equal to ItemCount - 1, all the items preceding the current item are returned.
/// </summary>
- /// <param name="index">limit The number of items to retrieve.</param>
+ /// <param name="limit">The number of items to retrieve.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public WebBackForwardSubList GetForwardItems(int index)
+ public IList<WebBackForwardListItem> GetForwardItems(int limit)
{
- System.IntPtr itemPtr = Interop.WebBackForwardList.GetBackwardItems(SwigCPtr, index);
+ System.IntPtr itemPtr = Interop.WebBackForwardList.GetBackwardItems(SwigCPtr, limit);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- WebBackForwardSubList ret = new WebBackForwardSubList(itemPtr, true);
- return ret;
+
+ if (forwardItemList != null)
+ {
+ forwardItemList.Dispose();
+ }
+ forwardItemList = new WebBackForwardSubList(itemPtr, true);
+
+ List<WebBackForwardListItem> list = new List<WebBackForwardListItem>();
+ for (uint i = 0; i < forwardItemList.ItemCount; i++)
+ {
+ list.Add(forwardItemList.GetItemAtIndex(i));
+ }
+ return list;
}
}
-}
+ /// <summary>
+ /// WebBackForwardSubList is an internal class for back-forward copied list item of web view.
+ /// </summary>
+ internal class WebBackForwardSubList : Disposable
+ {
+ internal WebBackForwardSubList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ Interop.WebBackForwardSubList.DeleteCopiedItems(swigCPtr);
+ }
+
+ /// <summary>
+ /// Get item count.
+ /// </summary>
+ internal uint ItemCount
+ {
+ get
+ {
+ return Interop.WebBackForwardSubList.GetItemCount(SwigCPtr);
+ }
+ }
+
+ /// <summary>
+ /// Get item with index.
+ /// </summary>
+ /// <param name="index">The index of list item.</param>
+ internal WebBackForwardListItem GetItemAtIndex(uint index)
+ {
+ System.IntPtr itemPtr = Interop.WebBackForwardSubList.GetItemAtIndex(SwigCPtr, index);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return new WebBackForwardListItem(itemPtr, false);
+ }
+ }
+}
*/
using System;
+using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
private string appVersion;
private float timeOffset;
private ApplicationType applicationType;
- private SecurityOriginListAcquiredCallback securityOriginListAcquiredCallback;
+ private WebSecurityOriginList securityOriginList;
+ private SecurityOriginListAcquiredCallback securityOriginsAcquiredCallback;
private readonly WebContextSecurityOriginListAcquiredProxyCallback securityOriginListAcquiredProxyCallback;
+ private WebPasswordDataList passwordList;
private PasswordDataListAcquiredCallback passwordDataListAcquiredCallback;
private readonly WebContextPasswordDataListAcquiredProxyCallback passwordDataListAcquiredProxyCallback;
}
/// <summary>
+ /// Dispose for IDisposable pattern
+ /// </summary>
+ [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.
+ if (passwordList != null)
+ {
+ passwordList.Dispose();
+ }
+ if (securityOriginList != null)
+ {
+ securityOriginList.Dispose();
+ }
+ }
+
+ base.Dispose(type);
+ }
+
+ /// <summary>
/// The callback function that is invoked when security origin list is acquired.
/// </summary>
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public delegate void SecurityOriginListAcquiredCallback(WebSecurityOriginList list);
+ public delegate void SecurityOriginListAcquiredCallback(IList<WebSecurityOrigin> list);
/// <summary>
/// The callback function that is invoked when storage usage is acquired.
public delegate void StorageUsageAcquiredCallback(ulong usage);
/// <summary>
- /// The callback function that is invoked when security origin list is acquired.
+ /// The callback function that is invoked when password data list is acquired.
/// </summary>
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public delegate void PasswordDataListAcquiredCallback(WebPasswordDataList list);
+ public delegate void PasswordDataListAcquiredCallback(IList<WebPasswordData> list);
/// <summary>
/// The callback function that is invoked when download is started.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool GetWebDatabaseOrigins(SecurityOriginListAcquiredCallback callback)
{
- securityOriginListAcquiredCallback = callback;
+ securityOriginsAcquiredCallback = callback;
IntPtr ip = Marshal.GetFunctionPointerForDelegate(securityOriginListAcquiredProxyCallback);
bool result = Interop.WebContext.GetWebDatabaseOrigins(SwigCPtr, new HandleRef(this, ip));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
[EditorBrowsable(EditorBrowsableState.Never)]
public bool GetWebStorageOrigins(SecurityOriginListAcquiredCallback callback)
{
- securityOriginListAcquiredCallback = callback;
+ securityOriginsAcquiredCallback = callback;
IntPtr ip = Marshal.GetFunctionPointerForDelegate(securityOriginListAcquiredProxyCallback);
bool result = Interop.WebContext.GetWebStorageOrigins(SwigCPtr, new HandleRef(this, ip));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- private void OnSecurityOriginListAcquired(IntPtr list)
+ private void OnSecurityOriginListAcquired(IntPtr alist)
{
- WebSecurityOriginList originList = new WebSecurityOriginList(list, true);
- securityOriginListAcquiredCallback?.Invoke(originList);
- originList.Dispose();
+ if (securityOriginList != null)
+ {
+ securityOriginList.Dispose();
+ }
+ securityOriginList = new WebSecurityOriginList(alist, true);
+ List<WebSecurityOrigin> originList = new List<WebSecurityOrigin>();
+ for (uint i = 0; i < securityOriginList.ItemCount; i++)
+ {
+ originList.Add(securityOriginList.GetItemAtIndex(i));
+ }
+ securityOriginsAcquiredCallback?.Invoke(originList);
}
- private void OnPasswordDataListAcquired(IntPtr list)
+ private void OnPasswordDataListAcquired(IntPtr alist)
{
- WebPasswordDataList passwordList = new WebPasswordDataList(list, true);
- passwordDataListAcquiredCallback?.Invoke(passwordList);
- passwordList.Dispose();
+ if (passwordList != null)
+ {
+ passwordList.Dispose();
+ }
+ passwordList = new WebPasswordDataList(alist, true);
+ List<WebPasswordData> passwordDataList = new List<WebPasswordData>();
+ for(uint i = 0; i < passwordList.ItemCount; i++)
+ {
+ passwordDataList.Add(passwordList.GetItemAtIndex(i));
+ }
+ passwordDataListAcquiredCallback?.Invoke(passwordDataList);
}
}
}
namespace Tizen.NUI
{
/// <summary>
- /// It is a class for password data list of web view.
+ /// It is an internal class for password data list of web view.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class WebPasswordDataList : Disposable
+ internal class WebPasswordDataList : Disposable
{
internal WebPasswordDataList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
/// This will not be public opened.
/// <param name="swigCPtr"></param>
- [EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
Interop.WebPasswordDataList.DeleteWebPasswordDataList(swigCPtr);
/// <summary>
/// Count of password data list.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public uint ItemCount
+ internal uint ItemCount
{
get
{
/// Gets password data by index.
/// <param name="index">index of list</param>
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public WebPasswordData GetItemAtIndex(uint index)
+ internal WebPasswordData GetItemAtIndex(uint index)
{
System.IntPtr dataIntPtr = Interop.WebPasswordDataList.ValueOfIndex(SwigCPtr, index);
- if (NDalicPINVOKE.SWIGPendingException.Pending) return null;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return new WebPasswordData(dataIntPtr, false);
}
}
namespace Tizen.NUI
{
/// <summary>
- /// It is a class for security origin list of web view.
+ /// It is an internal class for security origin list of web view.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class WebSecurityOriginList : Disposable
+ internal class WebSecurityOriginList : Disposable
{
internal WebSecurityOriginList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
/// This will not be public opened.
/// <param name="swigCPtr"></param>
- [EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
Interop.WebSecurityOriginList.DeleteWebSecurityOriginList(swigCPtr);
/// <summary>
/// Count of security origin list.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public uint ItemCount
+ internal uint ItemCount
{
get
{
/// Gets security origin by index.
/// <param name="index">index of list</param>
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public WebSecurityOrigin GetItemAtIndex(uint index)
+ internal WebSecurityOrigin GetItemAtIndex(uint index)
{
System.IntPtr dataIntPtr = Interop.WebSecurityOriginList.ValueOfIndex(SwigCPtr, index);
- if (NDalicPINVOKE.SWIGPendingException.Pending) return null;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return new WebSecurityOrigin(dataIntPtr, false);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
{
- if (disposed)
+ if (Disposed)
{
return;
}