1 #ifndef DALI_TOOLKIT_WEB_SETTINGS_H
2 #define DALI_TOOLKIT_WEB_SETTINGS_H
5 * Copyright (c) 2020 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;
35 * @addtogroup dali_toolkit_controls_web_view
40 * @brief WebEngineSettings is a control for settings of WebView.
43 * For working WebEngineSettings, a WebView should be provided.
46 class DALI_TOOLKIT_API WebSettings
50 * @brief Creates a WebEngineSettings.
52 * @param[in] settings A settings of web engine.
54 WebSettings( Dali::WebEngineSettings& settings );
59 virtual ~WebSettings() final;
62 *@brief Allow running mixed contents or not.
64 * @param[in] allowed if true, allow to run mixed contents,
67 void AllowMixedContents( bool allowed );
70 * @brief Enable the spatial navigation or not.
72 * @param[in] enabled if true, use spatial navigation,
73 * otherwise to disable
75 void EnableSpatialNavigation( bool enabled );
78 * @brief Returns the default font size in pixel. The default value is 16.
80 * @return The default font size
82 int GetDefaultFontSize() const;
85 * @brief Sets the default font size in pixel. The default value is 16.
87 * @param[in] defaultFontSize A new default font size to set
89 void SetDefaultFontSize( int defaultFontSize );
92 * @brief Enables/disables web security.
94 * @param[in] enabled if true, to enable the web security
95 * otherwise to disable
97 void EnableWebSecurity( bool enabled );
100 * @brief Allow/Disallow file access from external url
102 * @param[in] allowed if true, to allow file access from external url
103 * otherwise to disallow
105 void AllowFileAccessFromExternalUrl( bool allowed );
108 * @brief Returns whether JavaScript can be executable. The default is true.
110 * @return true if JavaScript executing is enabled, false otherwise
112 bool IsJavaScriptEnabled() const;
115 * @brief Enables/disables JavaScript executing. The default is enabled.
117 * @param[in] enabled True if JavaScript executing is enabled, false otherwise
119 void EnableJavaScript( bool enabled );
122 * @brief Allow if the scripts can open new windows.
124 * @param[in] allowed if true, the scripts can open new windows,
127 void AllowScriptsOpenWindows( bool allowed );
130 * @brief Returns whether images can be loaded automatically. The default is true.
132 * @return true if images are loaded automatically, false otherwise
134 bool AreImagesLoadedAutomatically() const;
137 * @brief Enables/disables auto loading of images. The default is enabled.
139 * @param[in] automatic True if images are loaded automatically, false otherwise
141 void AllowImagesLoadAutomatically( bool automatic );
144 * @brief Gets the default text encoding name (e.g. UTF-8).
146 * @return The default text encoding name
148 std::string GetDefaultTextEncodingName() const;
151 * @brief Sets the default text encoding name (e.g. UTF-8).
153 * @param[in] defaultTextEncodingName The default text encoding name
155 void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName );
158 Dali::WebEngineSettings& mWebEngineSettings;
165 } // namespace Toolkit
169 #endif // DALI_TOOLKIT_WEB_SETTINGS_H