[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetCertificateFilePath")]
public static extern void SetCertificateFilePath(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DisableCache")]
- public static extern void DisableCache(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetDefaultProxyAuth")]
public static extern void SetDefaultProxyAuth(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_GetWebStorageUsageForOrigin")]
public static extern bool GetWebStorageUsageForOrigin(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteWebStorage")]
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteAllWebStorage")]
public static extern void DeleteAllWebStorage(global::System.Runtime.InteropServices.HandleRef jarg1);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteWebStorageOrigin")]
- public static extern bool DeleteWebStorageOrigin(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteWebStorage")]
+ public static extern bool DeleteWebStorage(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteLocalFileSystem")]
public static extern void DeleteLocalFileSystem(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_RegisterMimeOverriddenCallback")]
public static extern void RegisterMimeOverriddenCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_EnableCache")]
+ public static extern void EnableCache(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_IsCacheEnabled")]
+ public static extern bool IsCacheEnabled(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_GetContextCertificateFile")]
+ public static extern string GetCertificateFilePath(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetContextAppId")]
+ public static extern void SetContextAppId(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetContextAppVersion")]
+ public static extern bool SetContextAppVersion(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetContextApplicationType")]
+ public static extern void SetContextApplicationType(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetContextTimeOffset")]
+ public static extern void SetContextTimeOffset(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetContextTimeZoneOffset")]
+ public static extern void SetContextTimeZoneOffset(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_RegisterUrlSchemesAsCorsEnabled")]
+ public static extern void RegisterUrlSchemesAsCorsEnabled(global::System.Runtime.InteropServices.HandleRef jarg1, string[] jarg2, uint jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_RegisterJsPluginMimeTypes")]
+ public static extern void RegisterJsPluginMimeTypes(global::System.Runtime.InteropServices.HandleRef jarg1, string[] jarg2, uint jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetDefaultZoomFactor")]
+ public static extern void SetDefaultZoomFactor(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_GetContextDefaultZoomFactor")]
+ public static extern float GetContextDefaultZoomFactor(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteAllApplicationCache")]
+ public static extern bool DeleteAllApplicationCache(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteAllWebIndexedDatabase")]
+ public static extern bool DeleteAllWebIndexedDatabase(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteFormPasswordDataList")]
+ public static extern void DeleteFormPasswordDataList(global::System.Runtime.InteropServices.HandleRef jarg1, string[] jarg2, uint jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteAllFormPasswordData")]
+ public static extern void DeleteAllFormPasswordData(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_DeleteAllFormCandidateData")]
+ public static extern void DeleteAllFormCandidateData(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_GetContextProxy")]
+ public static extern string GetContextProxy(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_SetContextProxy")]
+ public static extern void SetContextProxy(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_GetProxyBypassRule")]
+ public static extern string GetProxyBypassRule(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebContext_FreeUnusedMemory")]
+ public static extern bool FreeUnusedMemory(global::System.Runtime.InteropServices.HandleRef jarg1);
}
}
}
public class WebContext : Disposable
{
private string proxyUri;
- private string certificateFilePath;
- private bool disableCache;
+ private string appId;
+ private string appVersion;
+ private float timeOffset;
+ private ApplicationType applicationType;
private SecurityOriginListAcquiredCallback securityOriginListAcquiredCallback;
private readonly WebContextSecurityOriginListAcquiredProxyCallback securityOriginListAcquiredProxyCallback;
private PasswordDataListAcquiredCallback passwordDataListAcquiredCallback;
}
/// <summary>
+ /// Application type
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum ApplicationType
+ {
+ /// <summary>
+ /// Web browser.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ WebBrowser,
+
+ /// <summary>
+ /// Hbb tv.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ HbbTv,
+
+ /// <summary>
+ /// Web runtime.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ WebRuntime,
+
+ /// <summary>
+ /// Other.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Other,
+ }
+
+ /// <summary>
/// Cache model
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
set
{
Interop.WebContext.SetCacheModel(SwigCPtr, (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
{
if (value != null)
{
- proxyUri = value.AbsoluteUri;
Interop.WebContext.SetProxyUri(SwigCPtr, proxyUri);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ proxyUri = value.AbsoluteUri;
}
}
}
{
get
{
- return certificateFilePath;
+ return Interop.WebContext.GetCertificateFilePath(SwigCPtr);
}
set
{
- certificateFilePath = value;
Interop.WebContext.SetCertificateFilePath(SwigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
/// Disable cache or not.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool DisableCache
+ public bool CacheEnabled
+ {
+ get
+ {
+ return Interop.WebContext.IsCacheEnabled(SwigCPtr);
+ }
+ set
+ {
+ Interop.WebContext.EnableCache(SwigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Set context app id.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string AppId
{
get
{
- return disableCache;
+ return appId;
}
set
{
- disableCache = value;
- Interop.WebContext.DisableCache(SwigCPtr, value);
+ Interop.WebContext.SetContextAppId(SwigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ appId = value;
+ }
+ }
+
+ /// <summary>
+ /// Set context app version.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string AppVersion
+ {
+ get
+ {
+ return appVersion;
+ }
+ set
+ {
+ Interop.WebContext.SetContextAppVersion(SwigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ appVersion = value;
+ }
+ }
+
+ /// <summary>
+ /// Set context app type.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ApplicationType AppType
+ {
+ get
+ {
+ return applicationType;
+ }
+ set
+ {
+ Interop.WebContext.SetContextApplicationType(SwigCPtr, (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ applicationType = value;
+ }
+ }
+
+ /// <summary>
+ /// Set context time offset.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float TimeOffset
+ {
+ get
+ {
+ return timeOffset;
+ }
+ set
+ {
+ Interop.WebContext.SetContextTimeOffset(SwigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ timeOffset = value;
+ }
+ }
+
+ /// <summary>
+ /// Default zoom factor.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float DefaultZoomFactor
+ {
+ get
+ {
+ return Interop.WebContext.GetContextDefaultZoomFactor(SwigCPtr);
+ }
+ set
+ {
+ Interop.WebContext.SetDefaultZoomFactor(SwigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Get context proxy.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string ContextProxy
+ {
+ get
+ {
+ return Interop.WebContext.GetContextProxy(SwigCPtr);
+ }
+ }
+
+ /// <summary>
+ /// get proxy bypass rule.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string ProxyBypassRule
+ {
+ get
+ {
+ return Interop.WebContext.GetProxyBypassRule(SwigCPtr);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool DeleteWebStorage(WebSecurityOrigin origin)
{
- bool result = Interop.WebContext.DeleteWebStorageOrigin(SwigCPtr, WebSecurityOrigin.getCPtr(origin));
+ bool result = Interop.WebContext.DeleteWebStorage(SwigCPtr, WebSecurityOrigin.getCPtr(origin));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return result;
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Set context time zone offset.
+ /// <param name="offset">Time offset</param>
+ /// <param name="time">Daylight saving time</param>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetContextTimeZoneOffset(float offset, float time)
+ {
+ Interop.WebContext.SetContextTimeZoneOffset(SwigCPtr, offset, time);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Register url schemes enabled.
+ /// <param name="strArray">The string array of schemes</param>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void RegisterUrlSchemesAsCorsEnabled(string[] strArray)
+ {
+ if (strArray != null)
+ {
+ Interop.WebContext.RegisterUrlSchemesAsCorsEnabled(SwigCPtr, strArray, (uint)strArray.Length);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Register js plugin mime types.
+ /// <param name="strArray">The string array of types</param>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void RegisterJsPluginMimeTypes(string[] strArray)
+ {
+ if (strArray != null)
+ {
+ Interop.WebContext.RegisterJsPluginMimeTypes(SwigCPtr, strArray, (uint)strArray.Length);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Delete all application cache.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DeleteAllApplicationCache()
+ {
+ bool ret = Interop.WebContext.DeleteAllApplicationCache(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Delete all web indexed database.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DeleteAllWebIndexedDatabase()
+ {
+ bool ret = Interop.WebContext.DeleteAllWebIndexedDatabase(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Delete password dataList.
+ /// <param name="strArray">The string array of dataList</param>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void DeleteFormPasswordDataList(string[] strArray)
+ {
+ if (strArray != null)
+ {
+ Interop.WebContext.DeleteFormPasswordDataList(SwigCPtr, strArray, (uint)strArray.Length);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Delete all password data.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void DeleteAllFormPasswordData()
+ {
+ Interop.WebContext.DeleteAllFormPasswordData(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Delete all candidate data.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void DeleteAllFormCandidateData()
+ {
+ Interop.WebContext.DeleteAllFormCandidateData(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Set context proxy.
+ /// <param name="proxy">The string array of dataList</param>
+ /// <param name="rule">Bypass rule</param>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetContextProxy(string proxy, string rule)
+ {
+ Interop.WebContext.SetContextProxy(SwigCPtr, proxy, rule);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Free unused memory.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool FreeUnusedMemory()
+ {
+ bool ret = Interop.WebContext.FreeUnusedMemory(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
private void OnSecurityOriginListAcquired(IntPtr list)
{
WebSecurityOriginList originList = new WebSecurityOriginList(list, true);
*
*/
+using System;
using System.ComponentModel;
+using System.Runtime.InteropServices;
namespace Tizen.NUI
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class WebCookieManager : Disposable
{
+ private EventHandler<EventArgs> cookieChangedEventHandler;
+ private CookieChangedCallback cookieChangedCallback;
+
internal WebCookieManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void CookieChangedCallback();
+
+ /// <summary>
+ /// Event for cookie changed when cookies are added, removed or modified.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<EventArgs> CookieChanged
+ {
+ add
+ {
+ if (cookieChangedEventHandler == null)
+ {
+ cookieChangedCallback = OnCookieChanged;
+ IntPtr ip = Marshal.GetFunctionPointerForDelegate(cookieChangedCallback);
+ Interop.WebCookieManager.CookieChangedCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ cookieChangedEventHandler += value;
+ }
+ remove
+ {
+ cookieChangedEventHandler -= value;
+ }
+ }
+
/// <summary>
/// Cookie Accept Policy
/// </summary>
}
/// <summary>
- /// Cookie accept policy
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public CookieAcceptPolicyType CookieAcceptPolicy
- {
- get
- {
- return (CookieAcceptPolicyType)Interop.WebCookieManager.GetCookieAcceptPolicy(SwigCPtr);
- }
- set
- {
- Interop.WebCookieManager.SetCookieAcceptPolicy(SwigCPtr, (int)value);
- }
- }
-
- /// <summary>
/// Cookie persistent storage type.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
}
/// <summary>
+ /// Cookie accept policy
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public CookieAcceptPolicyType CookieAcceptPolicy
+ {
+ get
+ {
+ return (CookieAcceptPolicyType)Interop.WebCookieManager.GetCookieAcceptPolicy(SwigCPtr);
+ }
+ set
+ {
+ Interop.WebCookieManager.SetCookieAcceptPolicy(SwigCPtr, (int)value);
+ }
+ }
+
+ /// <summary>
/// Set the proxy uri.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Interop.WebCookieManager.ClearCookies(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+
+ private void OnCookieChanged()
+ {
+ cookieChangedEventHandler?.Invoke(this, new EventArgs());
+ }
}
}