[Tizen] Add WebView APIs for fullscreen, text found, etc.
authorWoochan Lee <wc0917.lee@samsung.com>
Wed, 7 Aug 2024 05:15:38 +0000 (14:15 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Wed, 7 Aug 2024 05:15:38 +0000 (14:15 +0900)
This reverts commit 5b5f2d2e7df1291995b4cf5b0c4e96c4eeb86d56.

dali-toolkit/devel-api/controls/web-view/web-view.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h

index 63d9cca..3b0f3b6 100755 (executable)
@@ -264,6 +264,11 @@ bool WebView::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineH
   return Dali::Toolkit::GetImpl(*this).CreateHitTestAsynchronously(x, y, mode, callback);
 }
 
+void WebView::ExitFullscreen()
+{
+  Dali::Toolkit::GetImpl(*this).ExitFullscreen();
+}
+
 void WebView::ClearHistory()
 {
   Dali::Toolkit::GetImpl(*this).ClearHistory();
@@ -379,6 +384,11 @@ void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::Web
   Dali::Toolkit::GetImpl(*this).RegisterNavigationPolicyDecidedCallback(callback);
 }
 
+void WebView::RegisterNewWindowPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNewWindowPolicyDecidedCallback callback)
+{
+  Dali::Toolkit::GetImpl(*this).RegisterNewWindowPolicyDecidedCallback(callback);
+}
+
 void WebView::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
 {
   Dali::Toolkit::GetImpl(*this).RegisterNewWindowCreatedCallback(callback);
@@ -409,6 +419,21 @@ void WebView::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngine
   Dali::Toolkit::GetImpl(*this).RegisterContextMenuHiddenCallback(callback);
 }
 
+void WebView::RegisterFullscreenEnteredCallback(Dali::WebEnginePlugin::WebEngineFullscreenEnteredCallback callback)
+{
+  Dali::Toolkit::GetImpl(*this).RegisterFullscreenEnteredCallback(callback);
+}
+
+void WebView::RegisterFullscreenExitedCallback(Dali::WebEnginePlugin::WebEngineFullscreenExitedCallback callback)
+{
+  Dali::Toolkit::GetImpl(*this).RegisterFullscreenExitedCallback(callback);
+}
+
+void WebView::RegisterTextFoundCallback(Dali::WebEnginePlugin::WebEngineTextFoundCallback callback)
+{
+  Dali::Toolkit::GetImpl(*this).RegisterTextFoundCallback(callback);
+}
+
 void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
 {
   Dali::Toolkit::GetImpl(*this).GetPlainTextAsynchronously(callback);
index 0ee8af7..42b78bc 100755 (executable)
@@ -543,6 +543,11 @@ public:
   bool CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback);
 
   /**
+   * @brief Exit fullscreen.
+   */
+  void ExitFullscreen();
+
+  /**
    * @brief Clear the history of Web.
    */
   void ClearHistory();
@@ -710,6 +715,13 @@ public:
   void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
 
   /**
+   * @brief Callback to be called when new window policy would be decided.
+   *
+   * @param[in] callback
+   */
+  void RegisterNewWindowPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNewWindowPolicyDecidedCallback callback);
+
+  /**
    * @brief Callback to be called when a new window would be created.
    *
    * @param[in] callback
@@ -752,6 +764,27 @@ public:
   void RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback);
 
   /**
+   * @brief Callback to be called when fullscreen would be entered.
+   *
+   * @param[in] callback
+   */
+  void RegisterFullscreenEnteredCallback(Dali::WebEnginePlugin::WebEngineFullscreenEnteredCallback callback);
+
+  /**
+   * @brief Callback to be called when fullscreen would be exited.
+   *
+   * @param[in] callback
+   */
+  void RegisterFullscreenExitedCallback(Dali::WebEnginePlugin::WebEngineFullscreenExitedCallback callback);
+
+  /**
+   * @brief Callback to be called when text would be found.
+   *
+   * @param[in] callback
+   */
+  void RegisterTextFoundCallback(Dali::WebEnginePlugin::WebEngineTextFoundCallback callback);
+
+  /**
    * @brief Get a plain text of current web page asynchronously.
    *
    * @param[in] callback The callback function called asynchronously.
index a0deca5..92fef21 100644 (file)
@@ -648,6 +648,14 @@ bool WebView::CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayin
   return mWebEngine ? mWebEngine.CheckVideoPlayingAsynchronously(std::move(callback)) : false;
 }
 
+void WebView::ExitFullscreen()
+{
+  if(mWebEngine)
+  {
+    mWebEngine.ExitFullscreen();
+  }
+}
+
 void WebView::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback)
 {
   if(mWebEngine)
@@ -784,6 +792,14 @@ void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::Web
   }
 }
 
+void WebView::RegisterNewWindowPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNewWindowPolicyDecidedCallback callback)
+{
+  if(mWebEngine)
+  {
+    mWebEngine.RegisterNewWindowPolicyDecidedCallback(callback);
+  }
+}
+
 void WebView::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
 {
   if(mWebEngine)
@@ -832,6 +848,30 @@ void WebView::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngine
   }
 }
 
+void WebView::RegisterFullscreenEnteredCallback(Dali::WebEnginePlugin::WebEngineFullscreenEnteredCallback callback)
+{
+  if(mWebEngine)
+  {
+    mWebEngine.RegisterFullscreenEnteredCallback(callback);
+  }
+}
+
+void WebView::RegisterFullscreenExitedCallback(Dali::WebEnginePlugin::WebEngineFullscreenExitedCallback callback)
+{
+  if(mWebEngine)
+  {
+    mWebEngine.RegisterFullscreenExitedCallback(callback);
+  }
+}
+
+void WebView::RegisterTextFoundCallback(Dali::WebEnginePlugin::WebEngineTextFoundCallback callback)
+{
+  if(mWebEngine)
+  {
+    mWebEngine.RegisterTextFoundCallback(callback);
+  }
+}
+
 void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
 {
   if(mWebEngine)
index 6415a8b..c9d25b9 100644 (file)
@@ -313,6 +313,11 @@ public:
   bool CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback);
 
   /**
+   * @copydoc Dali::Toolkit::WebView::ExitFullscreen()
+   */
+  void ExitFullscreen();
+
+  /**
    * @copydoc Dali::Toolkit::WebView::RegisterGeolocationPermissionCallback()
    */
   void RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback);
@@ -378,6 +383,11 @@ public:
   void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
 
   /**
+   * @copydoc Dali::Toolkit::WebView::RegisterNewWindowPolicyDecidedCallback()
+   */
+  void RegisterNewWindowPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNewWindowPolicyDecidedCallback callback);
+
+  /**
    * @copydoc Dali::Toolkit::WebView::RegisterNewWindowCreatedCallback()
    */
   void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback);
@@ -408,6 +418,21 @@ public:
   void RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback);
 
   /**
+   * @copydoc Dali::Toolkit::WebView::RegisterFullscreenEnteredCallback()
+   */
+  void RegisterFullscreenEnteredCallback(Dali::WebEnginePlugin::WebEngineFullscreenEnteredCallback callback);
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::RegisterFullscreenExitedCallback()
+   */
+  void RegisterFullscreenExitedCallback(Dali::WebEnginePlugin::WebEngineFullscreenExitedCallback callback);
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::RegisterTextFoundCallback()
+   */
+  void RegisterTextFoundCallback(Dali::WebEnginePlugin::WebEngineTextFoundCallback callback);
+
+  /**
    * @copydoc Dali::Toolkit::WebView::GetPlainTextAsynchronously()
    */
   void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback);