1 #ifndef DALI_WEB_ENGINE_CONTEXT_H
2 #define DALI_WEB_ENGINE_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.
27 * @brief A class WebEngineContext for context of web engine.
29 class WebEngineContext
33 * @brief Enumeration for cache model options.
37 DOCUMENT_VIEWER, ///< Use the smallest cache capacity.
38 DOCUMENT_BROWSER, ///< Use the bigger cache capacity than DocumentBrowser.
39 PRIMARY_WEB_BROWSER, ///< Use the biggest cache capacity.
45 WebEngineContext() = default;
50 virtual ~WebEngineContext() = default;
53 * @brief Returns the cache model type.
56 virtual CacheModel GetCacheModel() const = 0;
59 * @brief Requests to set the cache model.
60 * @param[in] cacheModel The cache model
62 virtual void SetCacheModel(CacheModel cacheModel) = 0;
65 * @brief Sets the given proxy URI to network backend of specific context.
66 * @param[in] uri The proxy URI to set
68 virtual void SetProxyUri(const std::string& uri) = 0;
71 * @brief Sets a proxy auth credential to network backend of specific context.
72 * @details Normally, proxy auth credential should be got from the callback
73 * set by ewk_view_authentication_callback_set, once the username in
74 * this API has been set with a non-null value, the authentication
75 * callback will never been invoked. Try to avoid using this API.
76 * @param[in] username username to set
77 * @param[in] password password to set
79 virtual void SetDefaultProxyAuth(const std::string& username, const std::string& password) = 0;
82 * Adds CA certificates to persistent NSS certificate database
83 * Function accepts a path to a CA certificate file, a path to a directory
84 * containing CA certificate files, or a colon-seprarated list of those.
85 * Certificate files should have *.crt extension.
86 * Directories are traversed recursively.
87 * @param[in] certificatePath path to a CA certificate file(s), see above for details
89 virtual void SetCertificateFilePath(const std::string& certificatePath) = 0;
92 * Requests for deleting all web databases.
94 virtual void DeleteWebDatabase() = 0;
97 * @brief Deletes web storage.
98 * @details This function does not ensure that all data will be removed.
99 * Should be used to extend free physical memory.
101 virtual void DeleteWebStorage() = 0;
104 * @brief Requests for deleting all local file systems.
106 virtual void DeleteLocalFileSystem() = 0;
109 * Toggles the cache to be enabled or disabled
110 * Function works asynchronously.
111 * By default the cache is disabled resulting in not storing network data on disk.
112 * @param[in] cacheDisabled enable or disable cache
114 virtual void DisableCache(bool cacheDisabled) = 0;
117 * @brief Requests to clear cache
119 virtual void ClearCache() = 0;
124 #endif // DALI_WEB_ENGINE_CONTEXT_H