Add changesWatch for webview cookie
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-cookie-manager.h
index e053263..1df5a41 100755 (executable)
  */
 
 // EXTERNAL INCLUDES
+#include <string>
+#include <functional>
 
 namespace Dali
 {
-
 /**
- * @brief A class WebEngineCookieManager to wrap ewk cookie manager.
+ * @brief A class WebEngineCookieManager for cookie manager of web engine.
  */
 class WebEngineCookieManager
 {
-
 public:
-
   /**
    * @brief Enumeration for the cookies accept policies.
    */
@@ -51,6 +50,11 @@ public:
   };
 
   /**
+   * @brief Callback for changing watch.
+   */
+  using WebEngineCookieManagerChangesWatchCallback = std::function<void()>;
+
+  /**
    * @brief Constructor.
    */
   WebEngineCookieManager() = default;
@@ -67,7 +71,7 @@ public:
    *
    * @param[in] policy A #Dali::WebEngineCookieManager::CookieAcceptPolicy
    */
-  virtual void SetCookieAcceptPolicy( CookieAcceptPolicy policy ) = 0;
+  virtual void SetCookieAcceptPolicy(CookieAcceptPolicy policy) = 0;
 
   /**
    * @brief Gets the cookie acceptance policy.
@@ -92,8 +96,14 @@ public:
    * @param[in] path The path where to read/write Cookies
    * @param[in] storage The type of storage
    */
-  virtual void SetPersistentStorage( const std::string& path, CookiePersistentStorage storage ) = 0;
+  virtual void SetPersistentStorage(const std::string& path, CookiePersistentStorage storage) = 0;
 
+  /**
+   * @brief Watch for cookies' changes in @a manager.
+   *
+   * @param[in] callback function that will be called every time cookies are added, removed or modified.
+   */
+  virtual void ChangesWatch(WebEngineCookieManagerChangesWatchCallback callback) = 0;
 };
 
 } // namespace Dali