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.
18 using System.ComponentModel;
23 /// WebSettings is a class for settings of web view.
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public class WebSettings : Disposable
29 /// Allow Mixed Contents
31 [EditorBrowsable(EditorBrowsableState.Never)]
32 public bool AllowMixedContents
36 return allowMixedContents;
40 allowMixedContents = value;
41 Interop.WebSettings.AllowMixedContents(SwigCPtr, value);
46 /// Enable Spatial Navigation.
48 [EditorBrowsable(EditorBrowsableState.Never)]
49 public bool EnableSpatialNavigation
53 return enableSpatialNavigation;
57 enableSpatialNavigation = value;
58 Interop.WebSettings.EnableSpatialNavigation(SwigCPtr, value);
63 /// Default Font Size.
65 [EditorBrowsable(EditorBrowsableState.Never)]
66 public int DefaultFontSize
70 return Interop.WebSettings.GetDefaultFontSize(SwigCPtr);
74 Interop.WebSettings.SetDefaultFontSize(SwigCPtr, value);
79 /// Enable web security.
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 public bool EnableWebSecurity
86 return enableWebSecurity;
90 enableWebSecurity = value;
91 Interop.WebSettings.EnableWebSecurity(SwigCPtr, value);
96 /// Allow File Access From External Url.
98 [EditorBrowsable(EditorBrowsableState.Never)]
99 public bool AllowFileAccessFromExternalUrl
103 return allowFileAccessFromExternalUrl;
107 allowFileAccessFromExternalUrl = value;
108 Interop.WebSettings.AllowFileAccessFromExternalUrl(SwigCPtr, value);
113 /// Enable JavaScript.
115 [EditorBrowsable(EditorBrowsableState.Never)]
116 public bool EnableJavaScript
120 return Interop.WebSettings.IsJavaScriptEnabled(SwigCPtr);
124 Interop.WebSettings.EnableJavaScript(SwigCPtr, value);
129 /// Allow Scripts Open Windows.
131 [EditorBrowsable(EditorBrowsableState.Never)]
132 public bool AllowScriptsOpenWindows
136 return allowScriptsOpenWindows;
140 allowScriptsOpenWindows = value;
141 Interop.WebSettings.AllowScriptsOpenWindows(SwigCPtr, value);
146 /// Allow Images Load Automatically.
148 [EditorBrowsable(EditorBrowsableState.Never)]
149 public bool AllowImagesLoadAutomatically
153 return Interop.WebSettings.AreImagesAutomaticallyLoaded(SwigCPtr);
157 Interop.WebSettings.AllowImagesLoadAutomatically(SwigCPtr, value);
162 /// Default Text Encoding Name.
164 [EditorBrowsable(EditorBrowsableState.Never)]
165 public string DefaultTextEncodingName
169 return Interop.WebSettings.GetDefaultTextEncodingName(SwigCPtr);
173 Interop.WebSettings.SetDefaultTextEncodingName(SwigCPtr, value);
177 internal WebSettings(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
181 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebSettings obj)
183 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
187 /// Dispose for IDisposable pattern
189 [EditorBrowsable(EditorBrowsableState.Never)]
190 protected override void Dispose(DisposeTypes type)
197 if (type == DisposeTypes.Explicit)
200 //Release your own managed resources here.
201 //You should release all of your own disposable objects here.
208 private bool allowMixedContents;
209 private bool enableSpatialNavigation;
210 private bool enableWebSecurity;
211 private bool allowFileAccessFromExternalUrl;
212 private bool allowScriptsOpenWindows;