Use c-style string when webview loads contents.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine / web-engine.h
index 8b73317..1515c76 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_WEB_ENGINE_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,9 @@
 
 namespace Dali
 {
+class WebEngineContext;
+class WebEngineCookieManager;
+
 namespace Internal
 {
 namespace Adaptor
@@ -62,6 +65,16 @@ public:
   static WebEngine New();
 
   /**
+   * @brief Get context of WebEngine.
+   */
+  static Dali::WebEngineContext* GetContext();
+
+  /**
+   * @brief Get cookie manager of WebEngine.
+   */
+  static Dali::WebEngineCookieManager* GetCookieManager();
+
+  /**
    * @brief Copy constructor.
    *
    * @param[in] WebEngine WebEngine to copy. The copied WebEngine will point at the same implementation
@@ -77,6 +90,21 @@ public:
   WebEngine& operator=(const WebEngine& WebEngine);
 
   /**
+   * @brief Move constructor.
+   *
+   * @param[in] WebEngine WebEngine to move. The moved WebEngine will point at the same implementation
+   */
+  WebEngine(WebEngine&& WebEngine);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @param[in] WebEngine The WebEngine to assign from.
+   * @return The updated WebEngine.
+   */
+  WebEngine& operator=(WebEngine&& WebEngine);
+
+  /**
    * @brief Downcast a handle to WebEngine handle.
    *
    * If handle points to a WebEngine the downcast produces valid
@@ -113,6 +141,11 @@ public:
   void Destroy();
 
   /**
+   * @brief Gets web engine plugin.
+   */
+  Dali::WebEnginePlugin* GetPlugin() const;
+
+  /**
    * @brief Get native image source to render.
    */
   NativeImageSourcePtr GetNativeImageSource();
@@ -123,16 +156,6 @@ public:
   Dali::WebEngineSettings& GetSettings() const;
 
   /**
-   * @brief Get context of WebEngine.
-   */
-  Dali::WebEngineContext& GetContext() const;
-
-  /**
-   * @brief Get cookie manager of WebEngine.
-   */
-  Dali::WebEngineCookieManager& GetCookieManager() const;
-
-  /**
    * @brief Get back-forward list of WebEngine.
    */
   Dali::WebEngineBackForwardList& GetBackForwardList() const;
@@ -192,7 +215,7 @@ public:
    *
    * @return true if successfully request, false otherwise
    */
-  bool LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
+  bool LoadContents(const int8_t* contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
 
   /**
    * @brief Reload the Web.
@@ -639,11 +662,11 @@ public:
   bool SendWheelEvent(const WheelEvent& event);
 
   /**
-   * @brief Connect to this signal to be notified when frame is rendered.
+   * @brief Callback to be called when frame would be rendered.
    *
-   * @return A signal object to connect with.
+   * @param[in] callback
    */
-  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal();
+  void RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback);
 
   /**
    * @brief Callback to be called when page loading is started.
@@ -716,6 +739,13 @@ public:
   void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
 
   /**
+   * @brief Callback to be called when a new window would be created.
+   *
+   * @param[in] callback
+   */
+  void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback);
+
+  /**
    * @brief Callback to be called when certificate need be confirmed.
    *
    * @param[in] callback