1 #ifndef DALI_TOOLKIT_WEB_SETTINGS_H
2 #define DALI_TOOLKIT_WEB_SETTINGS_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali-toolkit/public-api/dali-toolkit-common.h>
29 class WebEngineSettings;
34 * @addtogroup dali_toolkit_controls_web_view
39 * @brief WebEngineSettings is a control for settings of WebView.
42 * For working WebEngineSettings, a WebView should be provided.
45 class DALI_TOOLKIT_API WebSettings
49 * @brief Creates a WebEngineSettings.
51 * @param[in] settings A settings of web engine.
53 WebSettings(Dali::WebEngineSettings& settings);
58 virtual ~WebSettings() final;
61 *@brief Allow running mixed contents or not.
63 * @param[in] allowed if true, allow to run mixed contents,
66 void AllowMixedContents(bool allowed);
69 * @brief Enable the spatial navigation or not.
71 * @param[in] enabled if true, use spatial navigation,
72 * otherwise to disable
74 void EnableSpatialNavigation(bool enabled);
77 * @brief Returns the default font size in pixel. The default value is 16.
79 * @return The default font size
81 int GetDefaultFontSize() const;
84 * @brief Sets the default font size in pixel. The default value is 16.
86 * @param[in] defaultFontSize A new default font size to set
88 void SetDefaultFontSize(int defaultFontSize);
91 * @brief Enables/disables web security.
93 * @param[in] enabled if true, to enable the web security
94 * otherwise to disable
96 void EnableWebSecurity(bool enabled);
99 * @brief Enables/disables cache builder.
101 * @param[in] enabled if true, to enable the cache builder
102 * otherwise to disable
104 void EnableCacheBuilder( bool enabled );
107 * @brief Used/Unused uses scrollbar thumb focus notifications. The default is used.
109 * @param[in] used True if uses scrollbar thumb focus notifications, false otherwise
111 void UseScrollbarThumbFocusNotifications ( bool used );
114 * @brief Enable/disables do not track executing.
116 * @param[in] enabled if true, to enable do not track
117 * otherwise to disable
119 void EnableDoNotTrack( bool enabled );
122 * @brief Allow/Disallow file access from external url
124 * @param[in] allowed if true, to allow file access from external url
125 * otherwise to disallow
127 void AllowFileAccessFromExternalUrl(bool allowed);
130 * @brief Returns whether JavaScript can be executable. The default is true.
132 * @return true if JavaScript executing is enabled, false otherwise
134 bool IsJavaScriptEnabled() const;
137 * @brief Enables/disables JavaScript executing. The default is enabled.
139 * @param[in] enabled True if JavaScript executing is enabled, false otherwise
141 void EnableJavaScript(bool enabled);
144 * @brief Returns whether auto fitting can be executable. The default is true.
146 * @return true if auto fitting executing is enabled, false otherwise
148 bool IsAutoFittingEnabled() const;
151 * @brief Enables/disables auto fitting executing. The default is enabled.
153 * @param[in] enabled True if auto fitting executing is enabled, false otherwise
155 void EnableAutoFitting( bool enabled );
158 * @brief Returns whether plugins can be executable. The default is true.
160 * @return true if plugins executing is enabled, false otherwise
162 bool ArePluginsEnabled() const;
165 * @brief Enables/disables Plugins executing. The default is enabled.
167 * @param[in] enabled True if Plugins executing is enabled, false otherwise
169 void EnablePlugins( bool enabled );
172 * @brief Returns whether private browsing can be executable. The default is true.
174 * @return true if private browsing executing is enabled, false otherwise
176 bool IsPrivateBrowsingEnabled() const;
179 * @brief Enables/disables private browsing executing. The default is enabled.
181 * @param[in] enabled True if private browsing executing is enabled, false otherwise
183 void EnablePrivateBrowsing( bool enabled );
186 * @brief Returns whether link magnifier can be executable. The default is true.
188 * @return true if link magnifier executing is enabled, false otherwise
190 bool IsLinkMagnifierEnabled() const;
193 * @brief Enables/disables link magnifier executing. The default is enabled.
195 * @param[in] enabled True if link magnifier executing is enabled, false otherwise
197 void EnableLinkMagnifier( bool enabled );
200 * @brief Returns whether uses keypad without user action can be executable. The default is true.
202 * @return true if keypad without user action executing is used, false otherwise
204 bool IsKeypadWithoutUserActionUsed() const;
207 * @brief Uses/Unused keypad without user action executing. The default is used.
209 * @param[in] used True if keypad without user action executing is used, false otherwise
211 void UseKeypadWithoutUserAction( bool used );
214 * @brief Returns whether autofill password form can be executable. The default is true.
216 * @return true if autofill password form executing is enabled, false otherwise
218 bool IsAutofillPasswordFormEnabled() const;
221 * @brief Enables/disables autofill password form executing. The default is enabled.
223 * @param[in] enabled True if autofill password form executing is enabled, false otherwise
225 void EnableAutofillPasswordForm( bool enabled );
228 * @brief Returns whether form candidate data can be executable. The default is true.
230 * @return true if form candidate data executing is enabled, false otherwise
232 bool IsFormCandidateDataEnabled() const;
235 * @brief Enables/disables form candidate data executing. The default is enabled.
237 * @param[in] enabled True if form candidate data executing is enabled, false otherwise
239 void EnableFormCandidateData( bool enabled );
242 * @brief Returns whether text selection can be executable. The default is true.
244 * @return true if text selection executing is enabled, false otherwise
246 bool IsTextSelectionEnabled() const;
249 * brief Enables/disables text selection executing. The default is enabled.
251 * @param[in] enabled True if text selection executing is enabled, false otherwise
253 void EnableTextSelection( bool enabled );
256 * @brief Returns whether text autosizing can be executable. The default is true.
258 * @return true if text autosizing executing is enabled, false otherwise
260 bool IsTextAutosizingEnabled() const;
263 * @brief Enables/disables text autosizing executing. The default is enabled.
265 * @param[in] enabled True if text autosizing executing is enabled, false otherwise
267 void EnableTextAutosizing( bool enabled );
270 * @brief Returns whether arrow scroll can be executable. The default is true.
272 * @return true if arrow scroll executing is enabled, false otherwise
274 bool IsArrowScrollEnabled() const;
277 * @brief Enables/disables arrow scroll executing. The default is enabled.
279 * @param[in] enabled True if arrow scroll executing is enabled, false otherwise
281 void EnableArrowScroll( bool enabled );
284 * @brief Returns whether clipboard can be executable. The default is true.
286 * @return true if clipboard executing is enabled, false otherwise
288 bool IsClipboardEnabled() const;
291 * @brief Enables/disables clipboard executing. The default is enabled.
293 * @param[in] enabled True if clipboard is enabled, false otherwise
295 void EnableClipboard( bool enabled );
298 * @brief Returns whether ime panel can be executable. The default is true.
300 * @return true if ime panel executing is enabled, false otherwise
302 bool IsImePanelEnabled() const;
305 * @brief Enables/disables ime panel executing. The default is enabled.
307 * @param[in] enabled True if ime panel executing is enabled, false otherwise
309 void EnableImePanel( bool enabled );
312 * @brief Allow if the scripts can open new windows.
314 * @param[in] allowed if true, the scripts can open new windows,
317 void AllowScriptsOpenWindows(bool allowed);
320 * @brief Returns whether images can be loaded automatically. The default is true.
322 * @return true if images are loaded automatically, false otherwise
324 bool AreImagesLoadedAutomatically() const;
327 * @brief Enables/disables auto loading of images. The default is enabled.
329 * @param[in] automatic True if images are loaded automatically, false otherwise
331 void AllowImagesLoadAutomatically(bool automatic);
334 * @brief Gets the default text encoding name (e.g. UTF-8).
336 * @return The default text encoding name
338 std::string GetDefaultTextEncodingName() const;
341 * @brief Sets the default text encoding name (e.g. UTF-8).
343 * @param[in] defaultTextEncodingName The default text encoding name
345 void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName);
348 Dali::WebEngineSettings& mWebEngineSettings;
355 } // namespace Toolkit
359 #endif // DALI_TOOLKIT_WEB_SETTINGS_H