/*
* 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;
using System.ComponentModel;
namespace Tizen.NUI
{
///
/// It is a class for policy decision maker of web view.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public class WebPolicyDecisionMaker : Disposable
{
internal WebPolicyDecisionMaker(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
///
/// Decision type
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum DecisionType
{
///
/// Accepts the decision.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Use,
///
/// Decides to download something.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Download,
///
/// Ignores the decision.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Ignore,
}
///
/// Policy navigation type
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum NavigationType
{
///
/// Link clicked
///
[EditorBrowsable(EditorBrowsableState.Never)]
LinkClicked,
///
/// Form submitted
///
[EditorBrowsable(EditorBrowsableState.Never)]
FormSubmitted,
///
/// Back forward
///
[EditorBrowsable(EditorBrowsableState.Never)]
BackForward,
///
/// Reload
///
[EditorBrowsable(EditorBrowsableState.Never)]
Reload,
///
/// Form resubmitted
///
[EditorBrowsable(EditorBrowsableState.Never)]
FormResubmitted,
///
/// Other
///
[EditorBrowsable(EditorBrowsableState.Never)]
Other,
}
///
/// Gets the url that request policy decision.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public string Url
{
get
{
return Interop.WebPolicyDecisionMaker.GetUrl(SwigCPtr);
}
}
///
/// Gets a cookie that web page has.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public string Cookie
{
get
{
return Interop.WebPolicyDecisionMaker.GetCookie(SwigCPtr);
}
}
///
/// Gets a decision type.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public DecisionType PolicyDecisionType
{
get
{
return (DecisionType)Interop.WebPolicyDecisionMaker.GetDecisionType(SwigCPtr);
}
}
///
/// Gets a MIME type for response data.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public string ResponseMime
{
get
{
return Interop.WebPolicyDecisionMaker.GetResponseMime(SwigCPtr);
}
}
///
/// Gets a HTTP status code.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public int ResponseStatusCode
{
get
{
return Interop.WebPolicyDecisionMaker.GetResponseStatusCode(SwigCPtr);
}
}
///
/// Gets a navigation type.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public NavigationType DecisionNavigationType
{
get
{
return (NavigationType)Interop.WebPolicyDecisionMaker.GetNavigationType(SwigCPtr);
}
}
///
/// Gets frame of web view.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public WebFrame Frame
{
get
{
IntPtr result = Interop.WebPolicyDecisionMaker.GetFrame(SwigCPtr);
return new WebFrame(result, false);
}
}
///
/// Gets a scheme.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public string Scheme
{
get
{
return Interop.WebPolicyDecisionMaker.GetScheme(SwigCPtr);
}
}
///
/// Accepts the action which triggers this decision.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Use()
{
bool result = Interop.WebPolicyDecisionMaker.Use(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return result;
}
///
/// Ignores the action which triggers this decision.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Ignore()
{
bool result = Interop.WebPolicyDecisionMaker.Ignore(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return result;
}
///
/// Suspends the operation for policy decision.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Suspend()
{
bool result = Interop.WebPolicyDecisionMaker.Suspend(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return result;
}
}
}