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