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)
33 /// This will not be public opened.
34 /// <param name="swigCPtr"></param>
35 [EditorBrowsable(EditorBrowsableState.Never)]
36 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
38 Interop.WebPolicyDecisionMaker.DeleteWebPolicyDecision(swigCPtr);
44 [EditorBrowsable(EditorBrowsableState.Never)]
45 public enum DecisionType
48 /// Accepts the decision.
50 [EditorBrowsable(EditorBrowsableState.Never)]
54 /// Decides to download something.
56 [EditorBrowsable(EditorBrowsableState.Never)]
60 /// Ignores the decision.
62 [EditorBrowsable(EditorBrowsableState.Never)]
67 /// Policy navigation type
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 public enum NavigationType
75 [EditorBrowsable(EditorBrowsableState.Never)]
81 [EditorBrowsable(EditorBrowsableState.Never)]
87 [EditorBrowsable(EditorBrowsableState.Never)]
93 [EditorBrowsable(EditorBrowsableState.Never)]
99 [EditorBrowsable(EditorBrowsableState.Never)]
105 [EditorBrowsable(EditorBrowsableState.Never)]
110 /// Gets the url that request policy decision.
112 [EditorBrowsable(EditorBrowsableState.Never)]
117 return Interop.WebPolicyDecisionMaker.GetUrl(SwigCPtr);
122 /// Gets a cookie that web page has.
124 [EditorBrowsable(EditorBrowsableState.Never)]
129 return Interop.WebPolicyDecisionMaker.GetCookie(SwigCPtr);
134 /// Gets a decision type.
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public DecisionType PolicyDecisionType
141 return (DecisionType)Interop.WebPolicyDecisionMaker.GetDecisionType(SwigCPtr);
146 /// Gets a MIME type for response data.
148 [EditorBrowsable(EditorBrowsableState.Never)]
149 public string ResponseMime
153 return Interop.WebPolicyDecisionMaker.GetResponseMime(SwigCPtr);
158 /// Gets a HTTP status code.
160 [EditorBrowsable(EditorBrowsableState.Never)]
161 public int ResponseStatusCode
165 return Interop.WebPolicyDecisionMaker.GetResponseStatusCode(SwigCPtr);
170 /// Gets a navigation type.
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public NavigationType DecisionNavigationType
177 return (NavigationType)Interop.WebPolicyDecisionMaker.GetNavigationType(SwigCPtr);
182 /// Gets frame of web view.
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public WebFrame Frame
189 IntPtr result = Interop.WebPolicyDecisionMaker.GetFrame(SwigCPtr);
190 return new WebFrame(result, false);
197 [EditorBrowsable(EditorBrowsableState.Never)]
202 return Interop.WebPolicyDecisionMaker.GetScheme(SwigCPtr);
207 /// Accepts the action which triggers this decision.
209 [EditorBrowsable(EditorBrowsableState.Never)]
212 bool result = Interop.WebPolicyDecisionMaker.Use(SwigCPtr);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Ignores the action which triggers this decision.
220 [EditorBrowsable(EditorBrowsableState.Never)]
223 bool result = Interop.WebPolicyDecisionMaker.Ignore(SwigCPtr);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229 /// Suspends the operation for policy decision.
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public bool Suspend()
234 bool result = Interop.WebPolicyDecisionMaker.Suspend(SwigCPtr);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();