2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
24 /// It is a class for policy decision maker of web view.
26 [EditorBrowsable(EditorBrowsableState.Never)]
27 public class WebPolicyDecisionMaker : Disposable
29 internal WebPolicyDecisionMaker(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public enum DecisionType
40 /// Accepts the decision.
42 [EditorBrowsable(EditorBrowsableState.Never)]
46 /// Decides to download something.
48 [EditorBrowsable(EditorBrowsableState.Never)]
52 /// Ignores the decision.
54 [EditorBrowsable(EditorBrowsableState.Never)]
59 /// Policy navigation type
61 [EditorBrowsable(EditorBrowsableState.Never)]
62 public enum NavigationType
67 [EditorBrowsable(EditorBrowsableState.Never)]
73 [EditorBrowsable(EditorBrowsableState.Never)]
79 [EditorBrowsable(EditorBrowsableState.Never)]
85 [EditorBrowsable(EditorBrowsableState.Never)]
91 [EditorBrowsable(EditorBrowsableState.Never)]
97 [EditorBrowsable(EditorBrowsableState.Never)]
102 /// Gets the url that request policy decision.
104 [EditorBrowsable(EditorBrowsableState.Never)]
109 return Interop.WebPolicyDecisionMaker.GetUrl(SwigCPtr);
114 /// Gets a cookie that web page has.
116 [EditorBrowsable(EditorBrowsableState.Never)]
121 return Interop.WebPolicyDecisionMaker.GetCookie(SwigCPtr);
126 /// Gets a decision type.
128 [EditorBrowsable(EditorBrowsableState.Never)]
129 public DecisionType PolicyDecisionType
133 return (DecisionType)Interop.WebPolicyDecisionMaker.GetDecisionType(SwigCPtr);
138 /// Gets a MIME type for response data.
140 [EditorBrowsable(EditorBrowsableState.Never)]
141 public string ResponseMime
145 return Interop.WebPolicyDecisionMaker.GetResponseMime(SwigCPtr);
150 /// Gets a HTTP status code.
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 public int ResponseStatusCode
157 return Interop.WebPolicyDecisionMaker.GetResponseStatusCode(SwigCPtr);
162 /// Gets a navigation type.
164 [EditorBrowsable(EditorBrowsableState.Never)]
165 public NavigationType DecisionNavigationType
169 return (NavigationType)Interop.WebPolicyDecisionMaker.GetNavigationType(SwigCPtr);
174 /// Gets frame of web view.
176 [EditorBrowsable(EditorBrowsableState.Never)]
177 public WebFrame Frame
181 IntPtr result = Interop.WebPolicyDecisionMaker.GetFrame(SwigCPtr);
182 return new WebFrame(result, false);
189 [EditorBrowsable(EditorBrowsableState.Never)]
194 return Interop.WebPolicyDecisionMaker.GetScheme(SwigCPtr);
199 /// Accepts the action which triggers this decision.
201 [EditorBrowsable(EditorBrowsableState.Never)]
204 bool result = Interop.WebPolicyDecisionMaker.Use(SwigCPtr);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 /// Ignores the action which triggers this decision.
212 [EditorBrowsable(EditorBrowsableState.Never)]
215 bool result = Interop.WebPolicyDecisionMaker.Ignore(SwigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 /// Suspends the operation for policy decision.
223 [EditorBrowsable(EditorBrowsableState.Never)]
224 public bool Suspend()
226 bool result = Interop.WebPolicyDecisionMaker.Suspend(SwigCPtr);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();