[Tizen] Add web-view APIs 62/252762/1 submit/tizen_5.5/20210203.045826
authorhuayong.xu <huayong.xu@samsung.com>
Thu, 12 Nov 2020 06:54:28 +0000 (14:54 +0800)
committerJiyun Yang <ji.yang@samsung.com>
Tue, 2 Feb 2021 07:23:44 +0000 (16:23 +0900)
* Support scroll in web view.
* Set focus for web engine.
* Construct with program arguments.

Change-Id: I4f7bea66c7f4cca9ca902cb077a2f8f3ba08f4f4

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp
dali-toolkit/devel-api/controls/web-view/web-view.cpp [changed mode: 0644->0755]
dali-toolkit/devel-api/controls/web-view/web-view.h [changed mode: 0644->0755]
dali-toolkit/internal/controls/web-view/web-view-impl.cpp [changed mode: 0644->0755]
dali-toolkit/internal/controls/web-view/web-view-impl.h [changed mode: 0644->0755]

index 5316331..a7cb3a9 100755 (executable)
@@ -74,6 +74,9 @@ public:
     , mDefaultTextEncodingName()
     , mDefaultFontSize( 16 )
     , mEvaluating( false )
+    , mScrollPosition( 0, 0 )
+    , mScrollSize( 500, 500 )
+    , mContentSize( 500, 500 )
   {
     gInstanceCount++;
     gInstance = this;
@@ -206,6 +209,36 @@ public:
     mDefaultFontSize = defaultFontSize;
   }
 
+  void ScrollBy( int dx, int dy )
+  {
+    mScrollPosition += Dali::Vector2( dx, dy );
+    if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
+    {
+      gInstance->mScrollEdgeReachedSignal.Emit( Dali::WebEnginePlugin::ScrollEdge::BOTTOM );
+    }
+  }
+
+  void SetScrollPosition( int x, int y )
+  {
+    mScrollPosition.x = x;
+    mScrollPosition.y = y;
+  }
+
+  Dali::Vector2 GetScrollPosition() const
+  {
+    return mScrollPosition;
+  }
+
+  Dali::Vector2 GetScrollSize() const
+  {
+    return mScrollSize;
+  }
+
+  Dali::Vector2 GetContentSize() const
+  {
+    return  mContentSize;
+  }
+
   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal()
   {
     return mPageLoadStartedSignal;
@@ -221,6 +254,11 @@ public:
     return mPageLoadErrorSignal;
   }
 
+  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal()
+  {
+    return mScrollEdgeReachedSignal;
+  }
+
   std::string                                                mUrl;
   std::vector< std::string >                                 mHistory;
   size_t                                                     mCurrentPlusOnePos;
@@ -236,6 +274,11 @@ public:
   Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType    mPageLoadErrorSignal;
   std::vector< std::function< void( const std::string& ) > > mResultCallbacks;
   bool                                                       mEvaluating;
+
+  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
+  Dali::Vector2                                               mScrollPosition;
+  Dali::Vector2                                               mScrollSize;
+  Dali::Vector2                                               mContentSize;
 };
 
 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
@@ -523,6 +566,31 @@ void WebEngine::SetDefaultFontSize( int defaultFontSize )
   Internal::Adaptor::GetImplementation( *this ).SetDefaultFontSize( defaultFontSize );
 }
 
+void WebEngine::ScrollBy( int dx, int dy )
+{
+  Internal::Adaptor::GetImplementation( *this ).ScrollBy( dx, dy );
+}
+
+void WebEngine::SetScrollPosition( int x, int y )
+{
+  Internal::Adaptor::GetImplementation( *this ).SetScrollPosition( x, y );
+}
+
+Dali::Vector2 WebEngine::GetScrollPosition() const
+{
+  return Internal::Adaptor::GetImplementation( *this ).GetScrollPosition();
+}
+
+Dali::Vector2 WebEngine::GetScrollSize() const
+{
+  return Internal::Adaptor::GetImplementation( *this ).GetScrollSize();
+}
+
+Dali::Vector2 WebEngine::GetContentSize() const
+{
+  return Internal::Adaptor::GetImplementation( *this ).GetContentSize();
+}
+
 void WebEngine::SetSize( int width, int height )
 {
 }
@@ -537,6 +605,10 @@ bool WebEngine::SendKeyEvent( const KeyEvent& event )
   return true;
 }
 
+void WebEngine::SetFocus( bool focused )
+{
+}
+
 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
 {
   return Internal::Adaptor::GetImplementation( *this ).PageLoadStartedSignal();
@@ -552,5 +624,10 @@ Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErro
   return Internal::Adaptor::GetImplementation( *this ).PageLoadErrorSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeReachedSignal();
+}
+
 } // namespace Dali;
 
index bb9e279..242c53f 100644 (file)
@@ -39,6 +39,7 @@ const char* const TEST_URL2( "http://www.somewhere.valid2.com" );
 
 static int gPageLoadStartedCallbackCalled = 0;
 static int gPageLoadFinishedCallbackCalled = 0;
+static int gScrollEdgeReachedCallbackCalled = 0;
 static int gEvaluateJavaScriptCallbackCalled = 0;
 static bool gTouched = false;
 
@@ -66,6 +67,11 @@ static void OnPageLoadFinished( WebView view, const std::string& url )
   gPageLoadFinishedCallbackCalled++;
 }
 
+static void OnScrollEdgeReached( WebView view, Dali::WebEnginePlugin::ScrollEdge edge )
+{
+  gScrollEdgeReachedCallbackCalled++;
+}
+
 static void OnPageLoadError( WebView view, const std::string& url, WebView::LoadErrorCode errorCode )
 {
 }
@@ -254,6 +260,32 @@ int UtcDaliWebViewTouchAndKeys(void)
   END_TEST;
 }
 
+int UtcDaliWebViewFocusGainedAndLost(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+  view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+
+  application.GetScene().Add( view );
+  application.SendNotification();
+  application.Render();
+
+  view.SetKeyInputFocus();
+  DALI_TEST_CHECK( view.HasKeyInputFocus() );
+
+  // reset
+  view.ClearKeyInputFocus();
+  DALI_TEST_CHECK( !view.HasKeyInputFocus() );
+
+  END_TEST;
+}
+
 int UtcDaliWebViewProperty1(void)
 {
   // URL
@@ -465,6 +497,72 @@ int UtcDaliWebViewProperty8(void)
   END_TEST;
 }
 
+int UtcDaliWebViewProperty9(void)
+{
+  // SCROLL_POSITION
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // Check default value
+  Dali::Vector2 output = Dali::Vector2::ONE;
+  view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
+  DALI_TEST_CHECK( output.x == 0 && output.y == 0 );
+
+  // Check Set/GetProperty
+  Dali::Vector2 testValue = Dali::Vector2( 100, 100 );
+  view.SetProperty( WebView::Property::SCROLL_POSITION, testValue );
+  view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
+  DALI_TEST_EQUALS( output, testValue, TEST_LOCATION );
+
+  // Check default value of scroll size
+  output = Dali::Vector2::ONE;
+  view.GetProperty( WebView::Property::SCROLL_SIZE ).Get( output );
+  DALI_TEST_CHECK( output.x == 500 && output.y == 500 );
+
+  // Check default value of content size
+  output = Dali::Vector2::ONE;
+  view.GetProperty( WebView::Property::CONTENT_SIZE ).Get( output );
+  DALI_TEST_CHECK( output.x == 500 && output.y == 500 );
+
+  END_TEST;
+}
+
+int UtcDaliWebViewScrollBy(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // load url.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.ScrollEdgeReachedSignal().Connect( &OnScrollEdgeReached );
+  bool signal1 = false;
+  view.ConnectSignal( testTracker, "scrollEdgeReached", CallbackFunctor(&signal1) );
+  DALI_TEST_EQUALS( gScrollEdgeReachedCallbackCalled, 0, TEST_LOCATION );
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+
+  // set scroll position.
+  Dali::Vector2 output = Dali::Vector2::ONE;
+  Dali::Vector2 testValue = Dali::Vector2( 100, 100 );
+  view.SetProperty( WebView::Property::SCROLL_POSITION, testValue );
+  view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
+  DALI_TEST_EQUALS( output, testValue, TEST_LOCATION );
+
+  // scroll by and trigger scrollEdgeReached event.
+  view.ScrollBy( 50, 50 );
+  view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
+  DALI_TEST_CHECK( output.x == 150 && output.y == 150 );
+  DALI_TEST_EQUALS( gScrollEdgeReachedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 );
+
+  END_TEST;
+}
+
 int UtcDaliWebViewEvaluteJavaScript(void)
 {
   ToolkitTestApplication application;
old mode 100644 (file)
new mode 100755 (executable)
index 20ae948..d722c60
@@ -60,6 +60,11 @@ WebView WebView::New( const std::string& locale, const std::string& timezoneId )
   return Internal::WebView::New( locale, timezoneId );
 }
 
+WebView WebView::New( int argc, char** argv )
+{
+  return Internal::WebView::New( argc, argv );
+}
+
 WebView WebView::DownCast( BaseHandle handle )
 {
   return Control::DownCast< WebView, Internal::WebView >( handle );
@@ -95,6 +100,11 @@ void WebView::Resume()
   Dali::Toolkit::GetImpl( *this ).Resume();
 }
 
+void WebView::ScrollBy( int deltaX, int deltaY )
+{
+  Dali::Toolkit::GetImpl( *this ).ScrollBy( deltaX, deltaY );
+}
+
 bool WebView::CanGoForward()
 {
   return Dali::Toolkit::GetImpl( *this ).CanGoForward();
@@ -160,6 +170,11 @@ WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
   return Dali::Toolkit::GetImpl( *this ).PageLoadErrorSignal();
 }
 
+WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).ScrollEdgeReachedSignal();
+}
+
 WebView::WebView( Internal::WebView& implementation )
 : Control( implementation )
 {
old mode 100644 (file)
new mode 100755 (executable)
index ad39718..1f10500
@@ -22,6 +22,7 @@
 #include <functional>
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
 #include <dali-toolkit/public-api/controls/control.h>
 
 namespace Dali
@@ -176,7 +177,25 @@ public:
        * @details Name "defaultFontSize", type Property::INT.
        * @note Default is 16.
        */
-      DEFAULT_FONT_SIZE
+      DEFAULT_FONT_SIZE,
+
+      /**
+       * @brief The current position of scroll.
+       * @details Name "scrollPosition", type Property::VECTOR2.
+       */
+      SCROLL_POSITION,
+
+      /**
+       * @brief The current position of scroll.
+       * @details Name "scrollSize", type Property::VECTOR2. Read-only.
+       */
+      SCROLL_SIZE,
+
+      /**
+       * @brief The current position of scroll.
+       * @details Name "contentSize", type Property::VECTOR2. Read-only.
+       */
+      CONTENT_SIZE,
     };
   };
 
@@ -264,12 +283,17 @@ public:
   /**
    * @brief WebView signal type related with page loading.
    */
-  typedef Signal< void ( WebView, const std::string& ) > WebViewPageLoadSignalType;
+  using WebViewPageLoadSignalType = Signal< void( WebView, const std::string& ) >;
 
   /**
    * @brief WebView signal type related with page loading error.
    */
-  typedef Signal< void ( WebView, const std::string&, LoadErrorCode ) > WebViewPageLoadErrorSignalType;
+  using WebViewPageLoadErrorSignalType = Signal< void( WebView, const std::string&, LoadErrorCode ) >;
+
+  /**
+   * @brief WebView signal type related with scroll edge reached.
+   */
+  using WebViewScrollEdgeReachedSignalType = Signal< void( WebView, Dali::WebEnginePlugin::ScrollEdge ) >;
 
 public:
 
@@ -290,6 +314,14 @@ public:
   static WebView New( const std::string& locale, const std::string& timezoneId );
 
   /**
+   * @brief Creates an initialized WebView.
+   *
+   * @param [in] argc The count of arguments of Applications
+   * @param [in] argv The string array of arguments of Applications
+   */
+  static WebView New( int argc, char** argv );
+
+  /**
    * @brief Creates an uninitialized WebView.
    */
   WebView();
@@ -362,6 +394,13 @@ public:
   void Resume();
 
   /**
+   * @brief Scrolls the webpage of view by deltaX and deltaY.
+   * @param[in] deltaX The delta x of scroll
+   * @param[in] deltaY The delta y of scroll
+   */
+  void ScrollBy( int deltaX, int deltaY );
+
+  /**
    * @brief Returns whether forward is possible.
    *
    * @return True if forward is possible, false otherwise
@@ -462,6 +501,13 @@ public:
    */
   WebViewPageLoadErrorSignalType& PageLoadErrorSignal();
 
+  /**
+   * @brief Connects to this signal to be notified when scroll edge is reached.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+
 public: // Not intended for application developers
 
   /// @cond internal
old mode 100644 (file)
new mode 100755 (executable)
index b0d81de..4c747c4
@@ -71,10 +71,14 @@ DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "enableJavaScript",        BOOLEAN
 DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "loadImagesAutomatically", BOOLEAN, LOAD_IMAGES_AUTOMATICALLY  )
 DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "defaultTextEncodingName", STRING,  DEFAULT_TEXT_ENCODING_NAME )
 DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "defaultFontSize",         INTEGER, DEFAULT_FONT_SIZE          )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "scrollPosition",          VECTOR2, SCROLL_POSITION            )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "scrollSize",              VECTOR2, SCROLL_SIZE                )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "contentSize",             VECTOR2, CONTENT_SIZE               )
 
 DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "pageLoadStarted",         PAGE_LOAD_STARTED_SIGNAL            )
 DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "pageLoadFinished",        PAGE_LOAD_FINISHED_SIGNAL           )
 DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "pageLoadError",           PAGE_LOAD_ERROR_SIGNAL              )
+DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "scrollEdgeReached",       SCROLL_EDGE_REACHED_SIGNAL          )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -107,6 +111,25 @@ WebView::WebView( const std::string& locale, const std::string& timezoneId )
   }
 }
 
+WebView::WebView( int argc, char** argv )
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
+  mUrl(),
+  mVisual(),
+  mWebViewSize( Stage::GetCurrent().GetSize() ),
+  mWebEngine(),
+  mPageLoadStartedSignal(),
+  mPageLoadFinishedSignal(),
+  mPageLoadErrorSignal()
+{
+  mWebEngine = Dali::WebEngine::New();
+
+  // WebEngine is empty when it is not properly initialized.
+  if ( mWebEngine )
+  {
+    mWebEngine.Create( mWebViewSize.width, mWebViewSize.height, argc, argv );
+  }
+}
+
 WebView::WebView()
 : WebView( "", "" )
 {
@@ -134,6 +157,15 @@ Toolkit::WebView WebView::New( const std::string& locale, const std::string& tim
   return handle;
 }
 
+Toolkit::WebView WebView::New( int argc, char** argv )
+{
+  WebView* impl = new WebView( argc, argv );
+  Toolkit::WebView handle = Toolkit::WebView( *impl );
+
+  impl->Initialize();
+  return handle;
+}
+
 void WebView::OnInitialize()
 {
   Self().SetKeyboardFocusable( true );
@@ -144,6 +176,7 @@ void WebView::OnInitialize()
     mWebEngine.PageLoadStartedSignal().Connect( this, &WebView::OnPageLoadStarted );
     mWebEngine.PageLoadFinishedSignal().Connect( this, &WebView::OnPageLoadFinished );
     mWebEngine.PageLoadErrorSignal().Connect( this, &WebView::OnPageLoadError );
+    mWebEngine.ScrollEdgeReachedSignal().Connect( this, &WebView::OnScrollEdgeReached );
   }
 }
 
@@ -211,6 +244,14 @@ void WebView::Resume()
   }
 }
 
+void WebView::ScrollBy( int deltaX, int deltaY )
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.ScrollBy( deltaX, deltaY );
+  }
+}
+
 bool WebView::CanGoForward()
 {
   return mWebEngine ? mWebEngine.CanGoForward() : false;
@@ -292,6 +333,11 @@ Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSi
   return mPageLoadErrorSignal;
 }
 
+Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
+{
+  return mScrollEdgeReachedSignal;
+}
+
 void WebView::OnPageLoadStarted( const std::string& url )
 {
   if( !mPageLoadStartedSignal.Empty() )
@@ -319,6 +365,15 @@ void WebView::OnPageLoadError( const std::string& url, int errorCode )
   }
 }
 
+void WebView::OnScrollEdgeReached( Dali::WebEnginePlugin::ScrollEdge edge )
+{
+  if( !mScrollEdgeReachedSignal.Empty() )
+  {
+    Dali::Toolkit::WebView handle( GetOwner() );
+    mScrollEdgeReachedSignal.Emit( handle, edge );
+  }
+}
+
 bool WebView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   Dali::BaseHandle handle( object );
@@ -341,6 +396,11 @@ bool WebView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* t
     webView.PageLoadErrorSignal().Connect( tracker, functor );
     connected = true;
   }
+  else if( 0 == strcmp( signalName.c_str(), SCROLL_EDGE_REACHED_SIGNAL ) )
+  {
+    webView.ScrollEdgeReachedSignal().Connect( tracker, functor );
+    connected = true;
+  }
 
   return connected;
 }
@@ -449,6 +509,15 @@ void WebView::SetProperty( BaseObject* object, Property::Index index, const Prop
         }
         break;
       }
+      case Toolkit::WebView::Property::SCROLL_POSITION:
+      {
+        Vector2 input;
+        if ( value.Get( input ) )
+        {
+          impl.SetScrollPosition( input.x, input.y );
+        }
+        break;
+      }
     }
   }
 }
@@ -504,6 +573,21 @@ Property::Value WebView::GetProperty( BaseObject* object, Property::Index proper
         value = impl.GetDefaultFontSize();
         break;
       }
+      case Toolkit::WebView::Property::SCROLL_POSITION:
+      {
+        value = impl.GetScrollPosition();
+        break;
+      }
+      case Toolkit::WebView::Property::SCROLL_SIZE:
+      {
+        value = impl.GetScrollSize();
+        break;
+      }
+      case Toolkit::WebView::Property::CONTENT_SIZE:
+      {
+        value = impl.GetContentSize();
+        break;
+      }
       default:
          break;
     }
@@ -534,6 +618,49 @@ bool WebView::OnKeyEvent( const Dali::KeyEvent& event )
   return result;
 }
 
+void WebView::OnKeyInputFocusGained()
+{
+  if( mWebEngine )
+  {
+    mWebEngine.SetFocus( true );
+  }
+
+  EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last.
+}
+
+void WebView::OnKeyInputFocusLost()
+{
+  if( mWebEngine )
+  {
+    mWebEngine.SetFocus( false );
+  }
+
+  EmitKeyInputFocusSignal( false ); // Calls back into the Control hence done last.
+}
+
+void WebView::SetScrollPosition( int x, int y )
+{
+  if( mWebEngine )
+  {
+    mWebEngine.SetScrollPosition( x, y );
+  }
+}
+
+Dali::Vector2 WebView::GetScrollPosition() const
+{
+  return mWebEngine ? mWebEngine.GetScrollPosition() : Dali::Vector2::ZERO;
+}
+
+Dali::Vector2 WebView::GetScrollSize() const
+{
+  return mWebEngine ? mWebEngine.GetScrollSize() : Dali::Vector2::ZERO;
+}
+
+Dali::Vector2 WebView::GetContentSize() const
+{
+  return mWebEngine ? mWebEngine.GetContentSize() : Dali::Vector2::ZERO;
+}
+
 Toolkit::WebView::CacheModel::Type WebView::GetCacheModel() const
 {
   return mWebEngine ? static_cast< Toolkit::WebView::CacheModel::Type >( mWebEngine.GetCacheModel() ) : Toolkit::WebView::CacheModel::DOCUMENT_VIEWER;
old mode 100644 (file)
new mode 100755 (executable)
index bce288d..60d6613
@@ -48,6 +48,8 @@ protected:
 
   WebView( const std::string& locale, const std::string& timezoneId );
 
+  WebView( int argc, char** argv );
+
   virtual ~WebView();
 
 public:
@@ -63,6 +65,11 @@ public:
   static Toolkit::WebView New( const std::string& locale, const std::string& timezoneId );
 
   /**
+   * @copydoc Dali::Toolkit::WebView::New( int, char** )
+   */
+  static Toolkit::WebView New( int argc, char** argv );
+
+  /**
    * @copydoc Dali::Toolkit::WebView::LoadUrl()
    */
   void LoadUrl( const std::string& url );
@@ -93,6 +100,11 @@ public:
   void Resume();
 
   /**
+   * @copydoc Dali::Toolkit::WebView::ScrollBy()
+   */
+  void ScrollBy( int deltaX, int deltaY );
+
+  /**
    * @copydoc Dali::Toolkit::WebView::CanGoForward()
    */
   bool CanGoForward();
@@ -152,6 +164,11 @@ public:
    */
   Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& PageLoadErrorSignal();
 
+  /**
+   * @copydoc Dali::Toolkit::WebView::ScrollEdgeReachedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+
 public: // Properties
 
   /**
@@ -213,6 +230,16 @@ private: // From Control
    */
   virtual bool OnKeyEvent( const Dali::KeyEvent& event );
 
+  /**
+   * @copydoc Toolkit::Control::OnKeyInputFocusGained()
+   */
+  void OnKeyInputFocusGained() override;
+
+  /**
+   * @copydoc Toolkit::Control::OnKeyInputFocusLost()
+   */
+  void OnKeyInputFocusLost() override;
+
 private:
 
   // Undefined
@@ -221,6 +248,34 @@ private:
   WebView& operator=( const WebView& webView );
 
   /**
+   * @brief Sets an absolute scroll of the given view.
+   * @param[in] x The coordinate x of scroll
+   * @param[in] y The coordinate y of scroll
+   */
+  void SetScrollPosition( int x, int y );
+
+  /**
+   * @brief Gets the current scroll position of the given view.
+   * @param[out] x The coordinate x of scroll
+   * @param[out] y The coordinate y of scroll
+   */
+  Dali::Vector2 GetScrollPosition() const;
+
+  /**
+   * @brief Gets the possible scroll size of the given view.
+   * @param[out] width The width of scroll size
+   * @param[out] height The height of scroll size
+   */
+  Dali::Vector2 GetScrollSize() const;
+
+  /**
+   * @brief Gets the last known content's size.
+   * @param[out] width The width of content's size
+   * @param[out] height The height of content's size
+   */
+  Dali::Vector2 GetContentSize() const;
+
+  /**
    * @brief Get cache model option. The default isToolkit::WebView::CacheModel::DOCUMENT_VIEWER.
    * @see Toolkit::WebView::CacheModel::Type
    */
@@ -333,6 +388,12 @@ private:
    */
   void OnPageLoadError( const std::string& url, int errorCode );
 
+  /**
+   * @brief Callback function to be called when scroll edge is reached.
+   * @param[in] e The scroll edge reached.
+   */
+  void OnScrollEdgeReached( Dali::WebEnginePlugin::ScrollEdge edge );
+
 private:
 
   std::string                                            mUrl;
@@ -343,6 +404,7 @@ private:
   Dali::Toolkit::WebView::WebViewPageLoadSignalType      mPageLoadStartedSignal;
   Dali::Toolkit::WebView::WebViewPageLoadSignalType      mPageLoadFinishedSignal;
   Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType mPageLoadErrorSignal;
+  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
 };
 
 } // namespace Internal