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 Allow/Disallow file access from external url
101 * @param[in] allowed if true, to allow file access from external url
102 * otherwise to disallow
104 void AllowFileAccessFromExternalUrl(bool allowed);
107 * @brief Returns whether JavaScript can be executable. The default is true.
109 * @return true if JavaScript executing is enabled, false otherwise
111 bool IsJavaScriptEnabled() const;
114 * @brief Enables/disables JavaScript executing. The default is enabled.
116 * @param[in] enabled True if JavaScript executing is enabled, false otherwise
118 void EnableJavaScript(bool enabled);
121 * @brief Allow if the scripts can open new windows.
123 * @param[in] allowed if true, the scripts can open new windows,
126 void AllowScriptsOpenWindows(bool allowed);
129 * @brief Returns whether images can be loaded automatically. The default is true.
131 * @return true if images are loaded automatically, false otherwise
133 bool AreImagesLoadedAutomatically() const;
136 * @brief Enables/disables auto loading of images. The default is enabled.
138 * @param[in] automatic True if images are loaded automatically, false otherwise
140 void AllowImagesLoadAutomatically(bool automatic);
143 * @brief Gets the default text encoding name (e.g. UTF-8).
145 * @return The default text encoding name
147 std::string GetDefaultTextEncodingName() const;
150 * @brief Sets the default text encoding name (e.g. UTF-8).
152 * @param[in] defaultTextEncodingName The default text encoding name
154 void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName);
157 Dali::WebEngineSettings& mWebEngineSettings;
164 } // namespace Toolkit
168 #endif // DALI_TOOLKIT_WEB_SETTINGS_H