Support scroll in web view.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / web-view / web-view-impl.h
old mode 100644 (file)
new mode 100755 (executable)
index 11f7e1b..0769bad
@@ -93,6 +93,11 @@ public:
   void Resume();
 
   /**
+   * @copydoc Dali::Toolkit::WebView::ScrollBy()
+   */
+  void ScrollBy( int deltaX, int deltaY );
+
+  /**
    * @copydoc Dali::Toolkit::WebView::CanGoForward()
    */
   bool CanGoForward();
@@ -152,6 +157,11 @@ public:
    */
   Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& PageLoadErrorSignal();
 
+  /**
+   * @copydoc Dali::Toolkit::WebView::ScrollEdgeReachedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+
 public: // Properties
 
   /**
@@ -188,17 +198,17 @@ private: // From Control
   /**
    * @copydoc Toolkit::Control::OnInitialize()
    */
-  virtual void OnInitialize();
+  void OnInitialize() override;
 
   /**
    * @copydoc Toolkit::Control::GetNaturalSize
    */
-  virtual Vector3 GetNaturalSize();
+  Vector3 GetNaturalSize() override;
 
   /**
    * @copydoc Toolkit::Control::OnRelayout()
    */
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+  void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
 
   /**
    * Signal occurs when the Web View has been touched.
@@ -211,7 +221,17 @@ private: // From Control
   /**
    * @copydoc Toolkit::Control::OnKeyEvent()
    */
-  virtual bool OnKeyEvent( const Dali::KeyEvent& event );
+  bool OnKeyEvent( const Dali::KeyEvent& event ) override;
+
+  /**
+   * @copydoc Toolkit::Control::OnKeyInputFocusGained()
+   */
+  void OnKeyInputFocusGained() override;
+
+  /**
+   * @copydoc Toolkit::Control::OnKeyInputFocusLost()
+   */
+  void OnKeyInputFocusLost() override;
 
 private:
 
@@ -221,6 +241,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
+   */
+  void GetScrollPosition( int& x, int& y ) 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
+   */
+  void GetScrollSize( int& width, int& height ) 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
+   */
+  void GetContentSize( int& width, int& height ) const;
+
+  /**
    * @brief Get cache model option. The default isToolkit::WebView::CacheModel::DOCUMENT_VIEWER.
    * @see Toolkit::WebView::CacheModel::Type
    */
@@ -333,6 +381,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 +397,7 @@ private:
   Dali::Toolkit::WebView::WebViewPageLoadSignalType      mPageLoadStartedSignal;
   Dali::Toolkit::WebView::WebViewPageLoadSignalType      mPageLoadFinishedSignal;
   Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType mPageLoadErrorSignal;
+  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
 };
 
 } // namespace Internal