/*
* Copyright (c) 2021 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.ComponentModel;
namespace Tizen.NUI
{
///
/// WebCookieManager is a class for cookie manager of web view.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public class WebCookieManager : Disposable
{
///
/// Cookie Accept Policy
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum CookieAcceptPolicyType
{
///
/// Always
///
[EditorBrowsable(EditorBrowsableState.Never)]
Always,
///
/// Never
///
[EditorBrowsable(EditorBrowsableState.Never)]
Never,
///
/// No third party.
///
[EditorBrowsable(EditorBrowsableState.Never)]
NoThirdParty,
}
///
/// Cookie accept policy
///
[EditorBrowsable(EditorBrowsableState.Never)]
public CookieAcceptPolicyType CookieAcceptPolicy
{
get
{
return (CookieAcceptPolicyType)Interop.WebCookieManager.GetCookieAcceptPolicy(SwigCPtr);
}
set
{
Interop.WebCookieManager.SetCookieAcceptPolicy(SwigCPtr, (int)value);
}
}
///
/// Cookie persistent storage type.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum CookiePersistentStorageType
{
///
/// @deprecated Cookies are stored in a text file.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Text,
///
/// stored in a SQLite file
///
[EditorBrowsable(EditorBrowsableState.Never)]
SqlLite,
}
///
/// Set the proxy uri.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetPersistentStorage(string path, CookiePersistentStorageType storageType)
{
Interop.WebCookieManager.SetPersistentStorage(SwigCPtr, path, (int)storageType);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Set Default Proxy Auth.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public void ClearCookies()
{
Interop.WebCookieManager.ClearCookies(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal WebCookieManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebCookieManager obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
}
///
/// Dispose for IDisposable pattern
///
[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.
}
base.Dispose(type);
}
}
}