1 #ifndef DALI_WEB_ENGINE_SETTINGS_H
2 #define DALI_WEB_ENGINE_SETTINGS_H
5 * Copyright (c) 2023 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.
27 * @brief A class WebEngineSettings for settings of web engine.
29 class WebEngineSettings
35 WebEngineSettings() = default;
40 virtual ~WebEngineSettings() = default;
43 *@brief Allow running mixed contents or not.
45 * @param[in] allowed if true, allow to run mixed contents,
48 virtual void AllowMixedContents(bool allowed) = 0;
51 * @brief Enable the spatial navigation or not.
53 * @param[in] enabled if true, use spatial navigation,
54 * otherwise to disable
56 virtual void EnableSpatialNavigation(bool enabled) = 0;
59 * @brief Get the default font size.
61 * @return defaut font size.
63 virtual uint32_t GetDefaultFontSize() const = 0;
66 * @brief Set the default font size.
68 * @param[in] size a new default font size to set
70 virtual void SetDefaultFontSize(uint32_t size) = 0;
73 * @brief Enables/disables web security.
75 * @param[in] enabled if true, to enable the web security
76 * otherwise to disable
78 virtual void EnableWebSecurity(bool enabled) = 0;
81 * @brief Enable/Disable cache builder
83 * @param[in] enabled if true, to enable cache builder
84 * otherwise to disable
86 virtual void EnableCacheBuilder(bool enabled) = 0;
89 * @brief Used/Unused scrollbar thumb focus notifications
91 * @param[in] used if true, to use scrollbar thumb focus notifications
94 virtual void UseScrollbarThumbFocusNotifications(bool used) = 0;
97 * @brief Enable/Disable do not track
99 * @param[in] enabled if true, to enable do not track
100 * otherwise to disable
102 virtual void EnableDoNotTrack(bool enabled) = 0;
105 * @brief Allow/Disallow file access from external url
107 * @param[in] allowed if true, to allow file access from external url
108 * otherwise to disallow
110 virtual void AllowFileAccessFromExternalUrl(bool allowed) = 0;
113 * @brief Check if javascript is enabled or not.
115 * @return true if enabled, false if disabled.
117 virtual bool IsJavaScriptEnabled() const = 0;
120 * @brief Enable/Disable javascript
122 * @param[in] enabled if true, to enable javascript
123 * otherwise to disable
125 virtual void EnableJavaScript(bool enabled) = 0;
128 * @brief Check if auto fitting is enabled or not.
130 * @return true if enabled, false if disabled.
132 virtual bool IsAutoFittingEnabled() const = 0;
135 * @brief Enable/Disable auto fitting
137 * @param[in] enabled if true, to enable auto fitting
138 * otherwise to disable
140 virtual void EnableAutoFitting(bool enabled) = 0;
143 * @brief Check if plugins are enabled or not.
145 * @return true if enabled, false if disabled.
147 virtual bool ArePluginsEnabled() const = 0;
150 * @brief Enable/Disable plugins
152 * @param[in] enabled if true, to enable plugins
153 * otherwise to disable
155 virtual void EnablePlugins(bool enabled) = 0;
158 * @brief Check if private browsing is enabled or not.
160 * @return true if enabled, false if disabled.
162 virtual bool IsPrivateBrowsingEnabled() const = 0;
165 * @brief Enable/Disable private browsing
167 * @param[in] enabled if true, to enable private browsing
168 * otherwise to disable
170 virtual void EnablePrivateBrowsing(bool enabled) = 0;
173 * @brief Check if link magnifier is enabled or not.
175 * @return true if enabled, false if disabled.
177 virtual bool IsLinkMagnifierEnabled() const = 0;
180 * @brief Enable/Disable link magnifier
182 * @param[in] enabled if true, to enable link magnifier
183 * otherwise to disable
185 virtual void EnableLinkMagnifier(bool enabled) = 0;
188 * @brief Check if uses keypad without user action is used or not.
190 * @return true if used, false if unused.
192 virtual bool IsKeypadWithoutUserActionUsed() const = 0;
195 * @brief Uses/Unused keypad without user action
197 * @param[in] used if true, to use keypad without user action
198 * otherwise to unused
200 virtual void UseKeypadWithoutUserAction(bool used) = 0;
203 * @brief Check if autofill password form is enabled or not.
205 * @return true if enabled, false if disabled.
207 virtual bool IsAutofillPasswordFormEnabled() const = 0;
210 * @brief Enable/Disable autofill password form
212 * @param[in] enabled if true, to enable autofill_password_form
213 * otherwise to disable
215 virtual void EnableAutofillPasswordForm(bool enabled) = 0;
218 * @brief check if form candidate data is enabled or not.
220 * @return true if enabled, false is disabled.
222 virtual bool IsFormCandidateDataEnabled() const = 0;
225 * @brief Enable/Disable form candidate data
227 * @param[in] enabled if true, to enable form candidate data
228 * otherwise to disable
230 virtual void EnableFormCandidateData(bool enabled) = 0;
233 * @brief check if text selection is enabled or not.
235 * @return true if enabled, false is disabled.
237 virtual bool IsTextSelectionEnabled() const = 0;
240 * @brief Enable/Disable text selection
242 * @param[in] enabled if true, to enable text selection
243 * otherwise to disable
245 virtual void EnableTextSelection(bool enabled) = 0;
248 * @brief check if text autosizing is enabled or not.
250 * @return true if enabled, false is disabled.
252 virtual bool IsTextAutosizingEnabled() const = 0;
255 * @brief Enable/Disable text autosizing
257 * @param[in] enabled if true, to enable text autosizing
258 * otherwise to disable
260 virtual void EnableTextAutosizing(bool enabled) = 0;
263 * @brief check if arrow scroll is enabled or not.
265 * @return true if enabled, false is disabled.
267 virtual bool IsArrowScrollEnabled() const = 0;
270 * @brief Enable/Disable arrow scroll
272 * @param[in] enable if true, to enable arrow scroll
273 * otherwise to disable
275 virtual void EnableArrowScroll(bool enable) = 0;
278 * @brief check if clipboard is enabled or not.
280 * @return true if enabled, false is disabled.
282 virtual bool IsClipboardEnabled() const = 0;
285 * @brief Enable/Disable clipboard
287 * @param[in] enabled if true, to enable clipboard
288 * otherwise to disable
290 virtual void EnableClipboard(bool enabled) = 0;
293 * @brief check if ime panel is enabled or not.
295 * @return true if enabled, false is disabled.
297 virtual bool IsImePanelEnabled() const = 0;
300 * @brief Enable/Disable ime panel
302 * @param[in] enabled if true, to enable ime panel
303 * otherwise to disable
305 virtual void EnableImePanel(bool enabled) = 0;
308 * @brief Allow if the scripts can open new windows.
310 * @param[in] allowed if true, the scripts can open new windows,
313 virtual void AllowScriptsOpenWindows(bool allowed) = 0;
316 * @brief Check if images are loaded automatically or not.
318 * @return true if enabled, false if disabled.
320 virtual bool AreImagesLoadedAutomatically() const = 0;
323 * @brief Allow to load images automatically
325 * @param[in] automatic if true, to load images automatically,
328 virtual void AllowImagesLoadAutomatically(bool automatic) = 0;
331 * @brief Get the default encoding name.
333 * @return defaut encoding name.
335 virtual std::string GetDefaultTextEncodingName() const = 0;
338 * @brief Set the default encoding name.
340 * @param[in] defaultTextEncodingName a default encoding name to set
342 virtual void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName) = 0;
345 * @brief Enables/disables the viewport meta tag.
347 * By default, the viewport meta tag is enabled on mobile and wearable,
348 * but it is disabled on TV.
350 * @param[in] enable @c true to enable the viewport meta tag
351 * @c false to disable
353 * @return @c true on success or @c false on failure
355 virtual bool SetViewportMetaTag(bool enable) = 0;
358 * @brief Requests setting of force zoom.
360 * @param[in] enable to force zoom
362 * @return @c true on success or @c false on failure
364 virtual bool SetForceZoom(bool enable) = 0;
367 * @brief Returns the force zoom status.
369 * @return @c true if enable force zoom or @c false.
371 virtual bool IsZoomForced() const = 0;
374 * @brief Requests setting use of text zoom.
376 * @param[in] enable to text zoom.
378 * @return @c true on success or @c false on failure
380 virtual bool SetTextZoomEnabled(bool enable) = 0;
383 * @brief Returns whether text zoom is enabled or not.
385 * @return @c true if enable text zoom or @c false.
387 virtual bool IsTextZoomEnabled() const = 0;
390 * @brief Requests enables/disables to the specific extra feature
392 * @param[in] feature feature name
393 * @param[in] enable @c true to enable the specific extra feature
394 * @c false to disable
396 virtual void SetExtraFeature(const std::string& feature, bool enable) = 0;
399 * @brief Returns enable/disable to the specific extra feature
401 * @param[in] feature feature name
403 * @return @c true on enable or @c false on disable
405 virtual bool IsExtraFeatureEnabled(const std::string& feature) const = 0;
410 #endif // DALI_WEB_ENGINE_SETTINGS_H