1 #ifndef DALI_TOOLKIT_WEB_CONTEXT_H
2 #define DALI_TOOLKIT_WEB_CONTEXT_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.
23 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
26 #include <dali-toolkit/public-api/dali-toolkit-common.h>
35 * @addtogroup dali_toolkit_controls_web_view
40 * @brief WebContext is a control for settings of WebView.
42 * For working WebContext, a WebView should be provided.
45 class DALI_TOOLKIT_API WebContext
50 * @brief Creates a WebContext.
52 * @param[in] context The context of web engine.
54 WebContext( Dali::WebEngineContext& context );
59 virtual ~WebContext() final;
62 * @brief Returns the cache model type.
64 * @return #Dali::WebEngineContext::CacheModel
66 Dali::WebEngineContext::CacheModel GetCacheModel() const;
69 * @brief Requests to set the cache model.
71 * @param[in] cacheModel The cache model
73 void SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel );
76 * @brief Sets the given proxy URI to network backend of specific context.
78 * @param[in] uri The proxy URI to set
80 void SetProxyUri( const std::string& uri );
83 * Adds CA certificates to persistent NSS certificate database
85 * Function accepts a path to a CA certificate file, a path to a directory
86 * containing CA certificate files, or a colon-seprarated list of those.
87 * Certificate files should have *.crt extension.
88 * Directories are traversed recursively.
90 * @param[in] certificatePath path to a CA certificate file(s), see above for details
92 void SetCertificateFilePath( const std::string& certificatePath );
95 * Toggles the cache to be enabled or disabled
97 * Function works asynchronously.
98 * By default the cache is disabled resulting in not storing network data on disk.
100 * @param[in] cacheDisabled enable or disable cache
102 void DisableCache( bool cacheDisabled );
105 * @brief Sets a proxy auth credential to network backend of specific context.
107 * @param[in] username username to set
108 * @param[in] password password to set
110 void SetDefaultProxyAuth( const std::string& username, const std::string& password );
113 * Requests for deleting all web databases.
115 void DeleteWebDatabase();
118 * @brief Deletes web storage.
120 * @details This function does not ensure that all data will be removed.
121 * Should be used to extend free physical memory.
123 void DeleteWebStorage();
126 * @brief Requests for deleting all local file systems.
128 void DeleteLocalFileSystem();
131 * @brief Requests to clear cache
137 Dali::WebEngineContext& mWebEngineContext;
144 } // namespace Toolkit
148 #endif // DALI_TOOLKIT_WEB_CONTEXT_H