1 #ifndef DALI_WEB_ENGINE_SETTINGS_H
2 #define DALI_WEB_ENGINE_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.
26 * @brief A class WebEngineSettings for settings of web engine.
28 class WebEngineSettings
34 WebEngineSettings() = default;
39 virtual ~WebEngineSettings() = default;
42 *@brief Allow running mixed contents or not.
44 * @param[in] allowed if true, allow to run mixed contents,
47 virtual void AllowMixedContents(bool allowed) = 0;
50 * @brief Enable the spatial navigation or not.
52 * @param[in] enabled if true, use spatial navigation,
53 * otherwise to disable
55 virtual void EnableSpatialNavigation(bool enabled) = 0;
58 * @brief Get the default font size.
60 * @return defaut font size.
62 virtual uint32_t GetDefaultFontSize() const = 0;
65 * @brief Set the default font size.
67 * @param[in] size a new default font size to set
69 virtual void SetDefaultFontSize(uint32_t size) = 0;
72 * @brief Enables/disables web security.
74 * @param[in] enabled if true, to enable the web security
75 * otherwise to disable
77 virtual void EnableWebSecurity(bool enabled) = 0;
80 * @brief Enable/Disable cache builder
82 * @param[in] enabled if true, to enable cache builder
83 * otherwise to disable
85 virtual void EnableCacheBuilder( bool enabled ) = 0;
88 * @brief Used/Unused scrollbar thumb focus notifications
90 * @param[in] used if true, to use scrollbar thumb focus notifications
93 virtual void UseScrollbarThumbFocusNotifications( bool used ) = 0;
96 * @brief Enable/Disable do not track
98 * @param[in] enabled if true, to enable do not track
99 * otherwise to disable
101 virtual void EnableDoNotTrack( bool enabled ) = 0;
104 * @brief Allow/Disallow file access from external url
106 * @param[in] allowed if true, to allow file access from external url
107 * otherwise to disallow
109 virtual void AllowFileAccessFromExternalUrl(bool allowed) = 0;
112 * @brief Check if javascript is enabled or not.
114 * @return true if enabled, false if disabled.
116 virtual bool IsJavaScriptEnabled() const = 0;
119 * @brief Enable/Disable javascript
121 * @param[in] enabled if true, to enable javascript
122 * otherwise to disable
124 virtual void EnableJavaScript(bool enabled) = 0;
127 * @brief Check if auto fitting is enabled or not.
129 * @return true if enabled, false if disabled.
131 virtual bool IsAutoFittingEnabled() const = 0;
134 * @brief Enable/Disable auto fitting
136 * @param[in] enabled if true, to enable auto fitting
137 * otherwise to disable
139 virtual void EnableAutoFitting( bool enabled ) = 0;
142 * @brief Check if plugins are enabled or not.
144 * @return true if enabled, false if disabled.
146 virtual bool ArePluginsEnabled() const = 0;
149 * @brief Enable/Disable plugins
151 * @param[in] enabled if true, to enable plugins
152 * otherwise to disable
154 virtual void EnablePlugins( bool enabled ) = 0;
157 * @brief Check if private browsing is enabled or not.
159 * @return true if enabled, false if disabled.
161 virtual bool IsPrivateBrowsingEnabled() const = 0;
164 * @brief Enable/Disable private browsing
166 * @param[in] enabled if true, to enable private browsing
167 * otherwise to disable
169 virtual void EnablePrivateBrowsing( bool enabled ) = 0;
172 * @brief Check if link magnifier is enabled or not.
174 * @return true if enabled, false if disabled.
176 virtual bool IsLinkMagnifierEnabled() const = 0;
179 * @brief Enable/Disable link magnifier
181 * @param[in] enabled if true, to enable link magnifier
182 * otherwise to disable
184 virtual void EnableLinkMagnifier( bool enabled ) = 0;
187 * @brief Check if uses keypad without user action is used or not.
189 * @return true if used, false if unused.
191 virtual bool IsKeypadWithoutUserActionUsed() const = 0;
194 * @brief Uses/Unused keypad without user action
196 * @param[in] used if true, to use keypad without user action
197 * otherwise to unused
199 virtual void UseKeypadWithoutUserAction( bool used ) = 0;
202 * @brief Check if autofill password form is enabled or not.
204 * @return true if enabled, false if disabled.
206 virtual bool IsAutofillPasswordFormEnabled() const = 0;
209 * @brief Enable/Disable autofill password form
211 * @param[in] enabled if true, to enable autofill_password_form
212 * otherwise to disable
214 virtual void EnableAutofillPasswordForm( bool enabled ) = 0;
217 * @brief check if form candidate data is enabled or not.
219 * @return true if enabled, false is disabled.
221 virtual bool IsFormCandidateDataEnabled() const = 0;
224 * @brief Enable/Disable form candidate data
226 * @param[in] enabled if true, to enable form candidate data
227 * otherwise to disable
229 virtual void EnableFormCandidateData( bool enabled ) = 0;
232 * @brief check if text selection is enabled or not.
234 * @return true if enabled, false is disabled.
236 virtual bool IsTextSelectionEnabled() const = 0;
239 * @brief Enable/Disable text selection
241 * @param[in] enabled if true, to enable text selection
242 * otherwise to disable
244 virtual void EnableTextSelection( bool enabled ) = 0;
247 * @brief check if text autosizing is enabled or not.
249 * @return true if enabled, false is disabled.
251 virtual bool IsTextAutosizingEnabled() const = 0;
254 * @brief Enable/Disable text autosizing
256 * @param[in] enabled if true, to enable text autosizing
257 * otherwise to disable
259 virtual void EnableTextAutosizing( bool enabled ) = 0;
262 * @brief check if arrow scroll is enabled or not.
264 * @return true if enabled, false is disabled.
266 virtual bool IsArrowScrollEnabled() const = 0;
269 * @brief Enable/Disable arrow scroll
271 * @param[in] enable if true, to enable arrow scroll
272 * otherwise to disable
274 virtual void EnableArrowScroll( bool enable ) = 0;
277 * @brief check if clipboard is enabled or not.
279 * @return true if enabled, false is disabled.
281 virtual bool IsClipboardEnabled() const = 0;
284 * @brief Enable/Disable clipboard
286 * @param[in] enabled if true, to enable clipboard
287 * otherwise to disable
289 virtual void EnableClipboard( bool enabled ) = 0;
292 * @brief check if ime panel is enabled or not.
294 * @return true if enabled, false is disabled.
296 virtual bool IsImePanelEnabled() const = 0;
299 * @brief Enable/Disable ime panel
301 * @param[in] enabled if true, to enable ime panel
302 * otherwise to disable
304 virtual void EnableImePanel( bool enabled ) = 0;
307 * @brief Allow if the scripts can open new windows.
309 * @param[in] allowed if true, the scripts can open new windows,
312 virtual void AllowScriptsOpenWindows(bool allowed) = 0;
315 * @brief Check if images are loaded automatically or not.
317 * @return true if enabled, false if disabled.
319 virtual bool AreImagesLoadedAutomatically() const = 0;
322 * @brief Allow to load images automatically
324 * @param[in] automatic if true, to load images automatically,
327 virtual void AllowImagesLoadAutomatically(bool automatic) = 0;
330 * @brief Get the default encoding name.
332 * @return defaut encoding name.
334 virtual std::string GetDefaultTextEncodingName() const = 0;
337 * @brief Set the default encoding name.
339 * @param[in] defaultTextEncodingName a default encoding name to set
341 virtual void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName) = 0;
344 * @brief Enables/disables the viewport meta tag.
346 * By default, the viewport meta tag is enabled on mobile and wearable,
347 * but it is disabled on TV.
349 * @param[in] enable @c true to enable the viewport meta tag
350 * @c false to disable
352 * @return @c true on success or @c false on failure
354 virtual bool SetViewportMetaTag(bool enable) = 0;
357 * @brief Requests setting of force zoom.
359 * @param[in] enable to force zoom
361 * @return @c true on success or @c false on failure
363 virtual bool SetForceZoom(bool enable) = 0;
366 * @brief Returns the force zoom status.
368 * @return @c true if enable force zoom or @c false.
370 virtual bool IsZoomForced() const = 0;
373 * @brief Requests setting use of text zoom.
375 * @param[in] enable to text zoom.
377 * @return @c true on success or @c false on failure
379 virtual bool SetTextZoomEnabled(bool enable) = 0;
382 * @brief Returns whether text zoom is enabled or not.
384 * @return @c true if enable text zoom or @c false.
386 virtual bool IsTextZoomEnabled() const = 0;
389 * @brief Requests enables/disables to the specific extra feature
391 * @param[in] feature feature name
392 * @param[in] enable @c true to enable the specific extra feature
393 * @c false to disable
395 virtual void SetExtraFeature(const std::string& feature, bool enable) = 0;
398 * @brief Returns enable/disable to the specific extra feature
400 * @param[in] feature feature name
402 * @return @c true on enable or @c false on disable
404 virtual bool IsExtraFeatureEnabled(const std::string& feature) const = 0;
409 #endif // DALI_WEB_ENGINE_SETTINGS_H