1 #ifndef DALI_TOOLKIT_WEB_COOKIE_MANAGER_H
2 #define DALI_TOOLKIT_WEB_COOKIE_MANAGER_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-cookie-manager.h>
26 #include <dali-toolkit/public-api/dali-toolkit-common.h>
30 class WebEngineCookieManager;
35 * @addtogroup dali_toolkit_controls_web_view
40 * @brief WebCookieManager is a control for cookie manager of WebView.
43 * For working WebCookieManager, a WebView should be provided.
46 class DALI_TOOLKIT_API WebCookieManager
50 * @brief Creates a WebCookieManager.
51 * @param[in] manager A #Dali::WebEngineCookieManager
53 WebCookieManager(Dali::WebEngineCookieManager& manager);
58 virtual ~WebCookieManager() final;
61 * @brief Sets @a policy as the cookie acceptance policy for @a manager.
63 * @details By default, only cookies set by the main document loaded are
66 * @param[in] policy A #Dali::WebEngineCookieManager::CookieAcceptPolicy
68 void SetCookieAcceptPolicy(Dali::WebEngineCookieManager::CookieAcceptPolicy policy);
71 * @brief Gets the cookie acceptance policy. The default is Toolkit::WebCookieManager::CookieAcceptPolicy::NO_THIRD_PARTY.
72 * @see Dali::WebEngineCookieManager::CookieAcceptPolicy
74 Dali::WebEngineCookieManager::CookieAcceptPolicy GetCookieAcceptPolicy() const;
77 * @brief Deletes all the cookies of @a manager.
82 * @brief Sets the @a path where non-session cookies are stored persistently using
83 * @a storage as the format to read/write the cookies.
85 * @details Cookies are initially read from @a path/Cookies to create an initial
86 * set of cookies. Then, non-session cookies will be written to @a path/Cookies.
87 * By default, @a manager doesn't store the cookies persistently, so you need to
88 * call this method to keep cookies saved across sessions.
89 * If @a path does not exist it will be created.
91 * @param[in] path The path where to read/write Cookies
92 * @param[in] storage The type of storage
94 void SetPersistentStorage(const std::string& path, Dali::WebEngineCookieManager::CookiePersistentStorage storage);
97 * @brief Watch for cookies' changes in @a manager.
99 * @param[in] callback cookies are added, removed or modified.
101 void ChangesWatch(Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback callback);
104 Dali::WebEngineCookieManager& mWebEngineCookieManager;
111 } // namespace Toolkit
115 #endif // DALI_TOOLKIT_WEB_COOKIE_MANAGER_H