1 #ifndef DALI_WEB_ENGINE_CONTEXT_H
2 #define DALI_WEB_ENGINE_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.
27 * @brief A class WebEngineContext for context of web engine.
29 class WebEngineContext
35 * @brief Enumeration for cache model options.
39 DOCUMENT_VIEWER, ///< Use the smallest cache capacity.
40 DOCUMENT_BROWSER, ///< Use the bigger cache capacity than DocumentBrowser.
41 PRIMARY_WEB_BROWSER, ///< Use the biggest cache capacity.
47 WebEngineContext() = default;
52 virtual ~WebEngineContext() = default;
55 * @brief Returns the cache model type.
58 virtual CacheModel GetCacheModel() const = 0;
61 * @brief Requests to set the cache model.
62 * @param[in] cacheModel The cache model
64 virtual void SetCacheModel( CacheModel cacheModel ) = 0;
67 * @brief Sets the given proxy URI to network backend of specific context.
68 * @param[in] uri The proxy URI to set
70 virtual void SetProxyUri( const std::string& uri ) = 0;
73 * @brief Sets a proxy auth credential to network backend of specific context.
74 * @details Normally, proxy auth credential should be got from the callback
75 * set by ewk_view_authentication_callback_set, once the username in
76 * this API has been set with a non-null value, the authentication
77 * callback will never been invoked. Try to avoid using this API.
78 * @param[in] username username to set
79 * @param[in] password password to set
81 virtual void SetDefaultProxyAuth( const std::string& username, const std::string& password ) = 0;
84 * 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.
89 * @param[in] certificatePath path to a CA certificate file(s), see above for details
91 virtual void SetCertificateFilePath( const std::string& certificatePath ) = 0;
94 * Requests for deleting all web databases.
96 virtual void DeleteWebDatabase() = 0;
99 * @brief Deletes web storage.
100 * @details This function does not ensure that all data will be removed.
101 * Should be used to extend free physical memory.
103 virtual void DeleteWebStorage() = 0;
106 * @brief Requests for deleting all local file systems.
108 virtual void DeleteLocalFileSystem() = 0;
111 * Toggles the cache to be enabled or disabled
112 * Function works asynchronously.
113 * By default the cache is disabled resulting in not storing network data on disk.
114 * @param[in] cacheDisabled enable or disable cache
116 virtual void DisableCache( bool cacheDisabled ) = 0;
119 * @brief Requests to clear cache
121 virtual void ClearCache() = 0;
127 #endif // DALI_WEB_ENGINE_CONTEXT_H