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 /// WebContext is a class for context of web view.
26 [EditorBrowsable(EditorBrowsableState.Never)]
27 public class WebContext : Disposable
29 private string proxyUri;
30 private string certificateFilePath;
31 private bool disableCache;
33 internal WebContext(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 public enum CacheModelType
44 /// The smallest cache capacity
46 [EditorBrowsable(EditorBrowsableState.Never)]
50 /// The bigger cache capacity than DocumentBrowser
52 [EditorBrowsable(EditorBrowsableState.Never)]
56 /// The biggest cache capacity.
58 [EditorBrowsable(EditorBrowsableState.Never)]
65 [EditorBrowsable(EditorBrowsableState.Never)]
66 public CacheModelType CacheModel
70 return (CacheModelType)Interop.WebContext.GetCacheModel(SwigCPtr);
74 Interop.WebContext.SetCacheModel(SwigCPtr, (int)value);
79 /// Set the proxy uri.
81 [EditorBrowsable(EditorBrowsableState.Never)]
86 return new Uri(proxyUri);
92 proxyUri = value.AbsoluteUri;
93 Interop.WebContext.SetProxyUri(SwigCPtr, proxyUri);
99 /// Set the Certificate File Path.
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 public string CertificateFilePath
106 return certificateFilePath;
110 certificateFilePath = value;
111 Interop.WebContext.SetCertificateFilePath(SwigCPtr, value);
116 /// Disable cache or not.
118 [EditorBrowsable(EditorBrowsableState.Never)]
119 public bool DisableCache
127 disableCache = value;
128 Interop.WebContext.DisableCache(SwigCPtr, value);
133 /// Set Default Proxy Auth.
135 [EditorBrowsable(EditorBrowsableState.Never)]
136 public void SetDefaultProxyAuth(string username, string password)
138 Interop.WebContext.SetDefaultProxyAuth(SwigCPtr, username, password);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 /// Delete Web Database.
145 [EditorBrowsable(EditorBrowsableState.Never)]
146 public void DeleteWebDatabase()
148 Interop.WebContext.DeleteWebDatabase(SwigCPtr);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 /// Delete Web Storage.
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public void DeleteWebStorage()
158 Interop.WebContext.DeleteWebStorage(SwigCPtr);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 /// Delete Local FileSystem.
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public void DeleteLocalFileSystem()
168 Interop.WebContext.DeleteLocalFileSystem(SwigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 [EditorBrowsable(EditorBrowsableState.Never)]
176 public void ClearCache()
178 Interop.WebContext.ClearCache(SwigCPtr);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();