Add some properties into web engine plugin 51/254451/5
authorFang Xiaohui <xiaohui.fang@samsung.com>
Wed, 3 Mar 2021 06:35:08 +0000 (14:35 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Fri, 26 Mar 2021 08:30:23 +0000 (16:30 +0800)
ewk_view_bg_color_set
ewk_view_clear_tiles_on_hide_enabled_set
ewk_view_tile_cover_area_multiplier_set
ewk_view_set_cursor_by_client
ewk_view_text_selection_text_get

Change-Id: I26cb8577959dfcd0ed5b6c850e98c7adc56819cf

dali-extension/web-engine-chromium/tizen-web-engine-chromium.cpp
dali-extension/web-engine-chromium/tizen-web-engine-chromium.h
dali-extension/web-engine-lwe/tizen-web-engine-lwe.cpp
dali-extension/web-engine-lwe/tizen-web-engine-lwe.h

index 599b354..af58b6f 100755 (executable)
@@ -469,6 +469,31 @@ public:
     ewk_view_key_events_enabled_set(mWebView, enabled);
   }
 
+  void SetDocumentBackgroundColor(Dali::Vector4 color)
+  {
+    ewk_view_bg_color_set(mWebView, color.r * 255, color.g * 255, color.b * 255, color.a * 255);
+  }
+
+  void ClearTilesWhenHidden(bool cleared)
+  {
+    ewk_view_clear_tiles_on_hide_enabled_set(mWebView, cleared);
+  }
+
+  void SetTileCoverAreaMultiplier(float multiplier)
+  {
+    ewk_view_tile_cover_area_multiplier_set(mWebView, multiplier);
+  }
+
+  void EnableCursorByClient(bool enabled)
+  {
+    ewk_view_set_cursor_by_client(mWebView, enabled);
+  }
+
+  std::string GetSelectedText() const
+  {
+    return ewk_view_text_selection_text_get(mWebView);
+  }
+
   bool SendTouchEvent(const TouchEvent& touch)
   {
     Ewk_Touch_Event_Type type = EWK_TOUCH_START;
@@ -1140,9 +1165,50 @@ void TizenWebEngineChromium::SetSize(int width, int height)
   }
 }
 
+void TizenWebEngineChromium::SetDocumentBackgroundColor(Dali::Vector4 color)
+{
+  if(mWebViewContainer)
+  {
+    mWebViewContainer->SetDocumentBackgroundColor(color);
+  }
+}
+
+void TizenWebEngineChromium::ClearTilesWhenHidden(bool cleared)
+{
+  if(mWebViewContainer)
+  {
+    mWebViewContainer->ClearTilesWhenHidden(cleared);
+  }
+}
+
+void TizenWebEngineChromium::SetTileCoverAreaMultiplier(float multiplier)
+{
+  if(mWebViewContainer)
+  {
+    mWebViewContainer->SetTileCoverAreaMultiplier(multiplier);
+  }
+}
+
+void TizenWebEngineChromium::EnableCursorByClient(bool enabled)
+{
+  if(mWebViewContainer)
+  {
+    mWebViewContainer->EnableCursorByClient(enabled);
+  }
+}
+
+std::string TizenWebEngineChromium::GetSelectedText() const
+{
+  if(mWebViewContainer)
+  {
+    return mWebViewContainer->GetSelectedText();
+  }
+  return EMPTY_STRING;
+}
+
 bool TizenWebEngineChromium::SendTouchEvent(const Dali::TouchEvent& touch)
 {
-  if (mWebViewContainer)
+  if(mWebViewContainer)
   {
     return mWebViewContainer->SendTouchEvent(touch);
   }
index 9cd96c9..f398a47 100755 (executable)
@@ -343,6 +343,31 @@ public:
   void SetSize(int width, int height) override;
 
   /**
+   * @copydoc Dali::WebEnginePlugin::SetDocumentBackgroundColor()
+   */
+  void SetDocumentBackgroundColor(Dali::Vector4 color) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::ClearTilesWhenHidden()
+   */
+  void ClearTilesWhenHidden(bool cleared) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::SetTileCoverAreaMultiplier()
+   */
+  void SetTileCoverAreaMultiplier(float multiplier) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::EnableCursorByClient()
+   */
+  void EnableCursorByClient(bool enabled) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::GetSelectedText()
+   */
+  std::string GetSelectedText() const override;
+
+  /**
    * @copydoc Dali::WebEnginePlugin::SendTouchEvent()
    */
   bool SendTouchEvent(const Dali::TouchEvent& touch) override;
index c6bec92..495abfb 100755 (executable)
@@ -849,6 +849,32 @@ void TizenWebEngineLWE::SetSize(int width, int height)
   }
 }
 
+void TizenWebEngineLWE::SetDocumentBackgroundColor(Dali::Vector4 color)
+{
+  // NOT IMPLEMENTED
+}
+
+void TizenWebEngineLWE::ClearTilesWhenHidden(bool cleared)
+{
+  // NOT IMPLEMENTED
+}
+
+void TizenWebEngineLWE::SetTileCoverAreaMultiplier(float multiplier)
+{
+  // NOT IMPLEMENTED
+}
+
+void TizenWebEngineLWE::EnableCursorByClient(bool enabled)
+{
+  // NOT IMPLEMENTED
+}
+
+std::string TizenWebEngineLWE::GetSelectedText() const
+{
+  // NOT IMPLEMENTED
+  return EMPTY_STRING;
+}
+
 void TizenWebEngineLWE::DispatchMouseDownEvent( float x, float y )
 {
   DALI_ASSERT_ALWAYS( mWebContainer );
index b5fea26..d69388c 100755 (executable)
@@ -252,12 +252,37 @@ public:
   /**
    * @copydoc Dali::WebEnginePlugin::SetUserAgent()
    */
-  void SetUserAgent( const std::string& userAgent ) override;
+  void SetUserAgent(const std::string& userAgent) override;
 
   /**
    * @copydoc Dali::WebEnginePlugin::SetSize()
    */
-  void SetSize( int width, int height ) override;
+  void SetSize(int width, int height) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::SetDocumentBackgroundColor()
+   */
+  void SetDocumentBackgroundColor(Dali::Vector4 color) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::ClearTilesWhenHidden()
+   */
+  void ClearTilesWhenHidden(bool cleared) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::SetTileCoverAreaMultiplier()
+   */
+  void SetTileCoverAreaMultiplier(float multiplier) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::EnableCursorByClient()
+   */
+  void EnableCursorByClient(bool enabled) override;
+
+  /**
+   * @copydoc Dali::WebEnginePlugin::GetSelectedText()
+   */
+  std::string GetSelectedText() const override;
 
   /**
    * @copydoc Dali::WebEnginePlugin::SendTouchEvent()