Add some properties in web engine 47/254447/5
authorFang Xiaohui <xiaohui fang>
Wed, 3 Mar 2021 01:27:02 +0000 (09:27 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Fri, 26 Mar 2021 08:41:43 +0000 (16:41 +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: I1df8f4eedb3be36d09c848181f13fb0dc1d3f587

dali/devel-api/adaptor-framework/web-engine-plugin.h [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/web-engine.cpp [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/web-engine.h [changed mode: 0644->0755]
dali/internal/web-engine/common/web-engine-impl.cpp [changed mode: 0644->0755]
dali/internal/web-engine/common/web-engine-impl.h

old mode 100644 (file)
new mode 100755 (executable)
index ea6339e..af1fb35
@@ -298,19 +298,19 @@ public:
   /**
    * @brief Reply for JavaScript confirm.
    */
-  virtual void JavaScriptConfirmReply( bool confirmed ) = 0;
+  virtual void JavaScriptConfirmReply(bool confirmed) = 0;
 
   /**
    * @brief Register a callback for JavaScript prompt.
    *
    * @param[in] callback The callback function
    */
-  virtual void RegisterJavaScriptPromptCallback( JavaScriptPromptCallback callback ) = 0;
+  virtual void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback) = 0;
 
   /**
    * @brief Reply for JavaScript prompt.
    */
-  virtual void JavaScriptPromptReply( const std::string& result ) = 0;
+  virtual void JavaScriptPromptReply(const std::string& result) = 0;
 
   /**
    * @brief Clears the history of Web.
@@ -342,6 +342,41 @@ public:
   virtual void SetSize(int width, int height) = 0;
 
   /**
+   * @brief Sets background color of web page.
+   *
+   * @param[in] color Background color
+   */
+  virtual void SetDocumentBackgroundColor(Dali::Vector4 color) = 0;
+
+  /**
+   * @brief Clears tiles when hidden.
+   *
+   * @param[in] cleared Whether tiles are cleared or not
+   */
+  virtual void ClearTilesWhenHidden(bool cleared) = 0;
+
+  /**
+   * @brief Sets multiplier of cover area of tile.
+   *
+   * @param[in] multiplier The multiplier of cover area
+   */
+  virtual void SetTileCoverAreaMultiplier(float multiplier) = 0;
+
+  /**
+   * @brief Enables cursor by client.
+   *
+   * @param[in] enabled Whether cursor is enabled or not
+   */
+  virtual void EnableCursorByClient(bool enabled) = 0;
+
+  /**
+   * @brief Gets the selected text.
+   *
+   * @return the selected text
+   */
+  virtual std::string GetSelectedText() const = 0;
+
+  /**
    * @brief Sends Touch Events.
    */
   virtual bool SendTouchEvent(const TouchEvent& touch) = 0;
@@ -434,7 +469,6 @@ public:
    * @return A signal object to connect with.
    */
   virtual WebEngineUrlChangedSignalType& UrlChangedSignal() = 0;
-
 };
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index f2df43e..35eac17
@@ -209,34 +209,34 @@ void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName
   GetImplementation(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
 }
 
-void WebEngine::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
+void WebEngine::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback)
 {
-  GetImplementation( *this ).RegisterJavaScriptAlertCallback( callback );
+  GetImplementation(*this).RegisterJavaScriptAlertCallback(callback);
 }
 
 void WebEngine::JavaScriptAlertReply()
 {
-  GetImplementation( *this ).JavaScriptAlertReply();
+  GetImplementation(*this).JavaScriptAlertReply();
 }
 
-void WebEngine::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
 {
-  GetImplementation( *this ).RegisterJavaScriptConfirmCallback( callback );
+  GetImplementation(*this).RegisterJavaScriptConfirmCallback(callback);
 }
 
-void WebEngine::JavaScriptConfirmReply( bool confirmed )
+void WebEngine::JavaScriptConfirmReply(bool confirmed)
 {
-  GetImplementation( *this ).JavaScriptConfirmReply( confirmed );
+  GetImplementation(*this).JavaScriptConfirmReply(confirmed);
 }
 
-void WebEngine::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
+void WebEngine::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback)
 {
-  GetImplementation( *this ).RegisterJavaScriptPromptCallback( callback );
+  GetImplementation(*this).RegisterJavaScriptPromptCallback(callback);
 }
 
-void WebEngine::JavaScriptPromptReply( const std::string& result )
+void WebEngine::JavaScriptPromptReply(const std::string& result)
 {
-  GetImplementation( *this ).JavaScriptPromptReply( result );
+  GetImplementation(*this).JavaScriptPromptReply(result);
 }
 
 void WebEngine::ClearHistory()
@@ -246,7 +246,7 @@ void WebEngine::ClearHistory()
 
 void WebEngine::ClearAllTilesResources()
 {
-  GetImplementation( *this ).ClearAllTilesResources();
+  GetImplementation(*this).ClearAllTilesResources();
 }
 
 const std::string& WebEngine::GetUserAgent() const
@@ -261,7 +261,32 @@ void WebEngine::SetUserAgent(const std::string& userAgent)
 
 void WebEngine::SetSize(int width, int height)
 {
-  return GetImplementation(*this).SetSize(width, height);
+  GetImplementation(*this).SetSize(width, height);
+}
+
+void WebEngine::SetDocumentBackgroundColor(Dali::Vector4 color)
+{
+  GetImplementation(*this).SetDocumentBackgroundColor(color);
+}
+
+void WebEngine::ClearTilesWhenHidden(bool cleared)
+{
+  GetImplementation(*this).ClearTilesWhenHidden(cleared);
+}
+
+void WebEngine::SetTileCoverAreaMultiplier(float multiplier)
+{
+  GetImplementation(*this).SetTileCoverAreaMultiplier(multiplier);
+}
+
+void WebEngine::EnableCursorByClient(bool enabled)
+{
+  GetImplementation(*this).EnableCursorByClient(enabled);
+}
+
+std::string WebEngine::GetSelectedText() const
+{
+  return GetImplementation(*this).GetSelectedText();
 }
 
 bool WebEngine::SendTouchEvent(const TouchEvent& touch)
old mode 100644 (file)
new mode 100755 (executable)
index fc0ce9f..df639c3
@@ -259,7 +259,7 @@ public:
    *
    * @param[in] callback The callback function
    */
-  void RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback);
+  void RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback);
 
   /**
    * @brief Reply for JavaScript alert.
@@ -271,24 +271,24 @@ public:
    *
    * @param[in] callback The callback function
    */
-  void RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback);
+  void RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback);
 
   /**
    * @brief Reply for JavaScript confirm.
    */
-  void JavaScriptConfirmReply( bool confirmed );
+  void JavaScriptConfirmReply(bool confirmed);
 
   /**
    * @brief Register a callback for JavaScript prompt.
    *
    * @param[in] callback The callback function
    */
-  void RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback );
+  void RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback);
 
   /**
    * @brief Reply for JavaScript prompt.
    */
-  void JavaScriptPromptReply( const std::string& result );
+  void JavaScriptPromptReply(const std::string& result);
 
   /**
    * @brief Clears the history of Web.
@@ -320,6 +320,41 @@ public:
   void SetSize(int width, int height);
 
   /**
+   * @brief Sets background color of web page.
+   *
+   * @param[in] color Background color
+   */
+  void SetDocumentBackgroundColor(Dali::Vector4 color);
+
+  /**
+   * @brief Clears tiles when hidden.
+   *
+   * @param[in] cleared Whether tiles are cleared or not
+   */
+  void ClearTilesWhenHidden(bool cleared);
+
+  /**
+   * @brief Sets multiplier of cover area of tile.
+   *
+   * @param[in] multiplier The multiplier of cover area
+   */
+  void SetTileCoverAreaMultiplier(float multiplier);
+
+  /**
+   * @brief Enables cursor by client.
+   *
+   * @param[in] enabled Whether cursor is enabled or not
+   */
+  void EnableCursorByClient(bool enabled);
+
+  /**
+   * @brief Gets the selected text.
+   *
+   * @return the selected text
+   */
+  std::string GetSelectedText() const;
+
+  /**
    * @brief Sends Touch Events.
    */
   bool SendTouchEvent(const TouchEvent& touch);
old mode 100644 (file)
new mode 100755 (executable)
index 0c998ad..2f444bf
@@ -204,7 +204,7 @@ Dali::WebEngineBackForwardList& WebEngine::GetBackForwardList() const
   return mPlugin->GetBackForwardList();
 }
 
-void WebEngine::LoadUrl( const std::string& url )
+void WebEngine::LoadUrl(const std::string& url)
 {
   mPlugin->LoadUrl(url);
 }
@@ -284,9 +284,9 @@ Dali::Vector2 WebEngine::GetContentSize() const
   return mPlugin->GetContentSize();
 }
 
-void WebEngine::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
+void WebEngine::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback)
 {
-  mPlugin->RegisterJavaScriptAlertCallback( callback );
+  mPlugin->RegisterJavaScriptAlertCallback(callback);
 }
 
 void WebEngine::JavaScriptAlertReply()
@@ -294,24 +294,24 @@ void WebEngine::JavaScriptAlertReply()
   mPlugin->JavaScriptAlertReply();
 }
 
-void WebEngine::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
 {
-  mPlugin->RegisterJavaScriptAlertCallback( callback );
+  mPlugin->RegisterJavaScriptAlertCallback(callback);
 }
 
-void WebEngine::JavaScriptConfirmReply( bool confirmed )
+void WebEngine::JavaScriptConfirmReply(bool confirmed)
 {
-  mPlugin->JavaScriptConfirmReply( confirmed );
+  mPlugin->JavaScriptConfirmReply(confirmed);
 }
 
-void WebEngine::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
+void WebEngine::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback)
 {
-  mPlugin->RegisterJavaScriptPromptCallback( callback );
+  mPlugin->RegisterJavaScriptPromptCallback(callback);
 }
 
-void WebEngine::JavaScriptPromptReply( const std::string& result )
+void WebEngine::JavaScriptPromptReply(const std::string& result)
 {
-  mPlugin->JavaScriptPromptReply( result );
+  mPlugin->JavaScriptPromptReply(result);
 }
 
 bool WebEngine::CanGoForward()
@@ -384,6 +384,31 @@ void WebEngine::SetFocus(bool focused)
   mPlugin->SetFocus(focused);
 }
 
+void WebEngine::SetDocumentBackgroundColor(Dali::Vector4 color)
+{
+  mPlugin->SetDocumentBackgroundColor(color);
+}
+
+void WebEngine::ClearTilesWhenHidden(bool cleared)
+{
+  mPlugin->ClearTilesWhenHidden(cleared);
+}
+
+void WebEngine::SetTileCoverAreaMultiplier(float multiplier)
+{
+  mPlugin->SetTileCoverAreaMultiplier(multiplier);
+}
+
+void WebEngine::EnableCursorByClient(bool enabled)
+{
+  mPlugin->EnableCursorByClient(enabled);
+}
+
+std::string WebEngine::GetSelectedText() const
+{
+  return mPlugin->GetSelectedText();
+}
+
 void WebEngine::UpdateDisplayArea(Dali::Rect<int> displayArea)
 {
   mPlugin->UpdateDisplayArea(displayArea);
@@ -434,7 +459,6 @@ Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSigna
   return mPlugin->UrlChangedSignal();
 }
 
-} // namespace Adaptor;
-} // namespace Internal;
-} // namespace Dali;
-
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
index a11211f..7b1675d 100644 (file)
@@ -177,7 +177,7 @@ public:
   /**
        * @copydoc Dali::WebEngine::RegisterJavaScriptAlertCallback()
        */
-  void RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback );
+  void RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback);
 
   /**
    * @copydoc Dali::WebEngine::JavaScriptAlertReply()
@@ -187,22 +187,22 @@ public:
   /**
    * @copydoc Dali::WebEngine::RegisterJavaScriptConfirmCallback()
    */
-  void RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback );
+  void RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback);
 
   /**
    * @copydoc Dali::WebEngine::JavaScriptConfirmReply()
    */
-  void JavaScriptConfirmReply( bool confirmed );
+  void JavaScriptConfirmReply(bool confirmed);
 
   /**
    * @copydoc Dali::WebEngine::RegisterJavaScriptPromptCallback()
    */
-  void RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback );
+  void RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback);
 
   /**
    * @copydoc Dali::WebEngine::JavaScriptPromptReply()
    */
-  void JavaScriptPromptReply( const std::string& result );
+  void JavaScriptPromptReply(const std::string& result);
 
   /**
    * @copydoc Dali::WebEngine::CanGoForward()
@@ -252,12 +252,37 @@ public:
   /**
    * @copydoc Dali::WebEngine::EnableMouseEvents()
    */
-  void EnableMouseEvents( bool enabled );
+  void EnableMouseEvents(bool enabled);
 
   /**
    * @copydoc Dali::WebEngine::EnableKeyEvents()
    */
-  void EnableKeyEvents( bool enabled );
+  void EnableKeyEvents(bool enabled);
+
+  /**
+   * @copydoc Dali::WebEngine::SetDocumentBackgroundColor()
+   */
+  void SetDocumentBackgroundColor(Dali::Vector4 color);
+
+  /**
+   * @copydoc Dali::WebEngine::ClearTilesWhenHidden()
+   */
+  void ClearTilesWhenHidden(bool cleared);
+
+  /**
+   * @copydoc Dali::WebEngine::SetTileCoverAreaMultiplier()
+   */
+  void SetTileCoverAreaMultiplier(float multiplier);
+
+  /**
+   * @copydoc Dali::WebEngine::EnableCursorByClient()
+   */
+  void EnableCursorByClient(bool enabled);
+
+  /**
+   * @copydoc Dali::WebEngine::GetSelectedText()
+   */
+  std::string GetSelectedText() const;
 
   /**
    * @copydoc Dali::WebEngine::SendTouchEvent()
@@ -287,12 +312,12 @@ public:
   /**
    * @copydoc Dali::WebEngine::SendHoverEvent()
    */
-  bool SendHoverEvent( const Dali::HoverEvent& event );
+  bool SendHoverEvent(const Dali::HoverEvent& event);
 
   /**
    * @copydoc Dali::WebEngine::SendWheelEvent()
    */
-  bool SendWheelEvent( const Dali::WheelEvent& event );
+  bool SendWheelEvent(const Dali::WheelEvent& event);
 
   /**
    * @copydoc Dali::WebEngine::PageLoadStartedSignal()