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
32 [EditorBrowsable(EditorBrowsableState.Never)]
33 public enum CacheModelType
36 /// The smallest cache capacity
38 [EditorBrowsable(EditorBrowsableState.Never)]
42 /// The bigger cache capacity than DocumentBrowser
44 [EditorBrowsable(EditorBrowsableState.Never)]
48 /// The biggest cache capacity.
50 [EditorBrowsable(EditorBrowsableState.Never)]
57 [EditorBrowsable(EditorBrowsableState.Never)]
58 public CacheModelType CacheModel
62 return (CacheModelType)Interop.WebContext.GetCacheModel(SwigCPtr);
66 Interop.WebContext.SetCacheModel(SwigCPtr, (int)value);
71 /// Set the proxy uri.
73 [EditorBrowsable(EditorBrowsableState.Never)]
78 return new Uri(proxyUri);
84 proxyUri = value.AbsoluteUri;
85 Interop.WebContext.SetProxyUri(SwigCPtr, proxyUri);
91 /// Set the Certificate File Path.
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public string CertificateFilePath
98 return certificateFilePath;
102 certificateFilePath = value;
103 Interop.WebContext.SetCertificateFilePath(SwigCPtr, value);
108 /// Disable cache or not.
110 [EditorBrowsable(EditorBrowsableState.Never)]
111 public bool DisableCache
119 disableCache = value;
120 Interop.WebContext.DisableCache(SwigCPtr, value);
125 /// Set Default Proxy Auth.
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 public void SetDefaultProxyAuth(string username, string password)
130 Interop.WebContext.SetDefaultProxyAuth(SwigCPtr, username, password);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// Delete Web Database.
137 [EditorBrowsable(EditorBrowsableState.Never)]
138 public void DeleteWebDatabase()
140 Interop.WebContext.DeleteWebDatabase(SwigCPtr);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 /// Delete Web Storage.
147 [EditorBrowsable(EditorBrowsableState.Never)]
148 public void DeleteWebStorage()
150 Interop.WebContext.DeleteWebStorage(SwigCPtr);
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 /// Delete Local FileSystem.
157 [EditorBrowsable(EditorBrowsableState.Never)]
158 public void DeleteLocalFileSystem()
160 Interop.WebContext.DeleteLocalFileSystem(SwigCPtr);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public void ClearCache()
170 Interop.WebContext.ClearCache(SwigCPtr);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 internal WebContext(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
178 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebContext obj)
180 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
184 /// Dispose for IDisposable pattern
186 [EditorBrowsable(EditorBrowsableState.Never)]
187 protected override void Dispose(DisposeTypes type)
194 if (type == DisposeTypes.Explicit)
197 //Release your own managed resources here.
198 //You should release all of your own disposable objects here.
205 private string proxyUri;
206 private string certificateFilePath;
207 private bool disableCache;