Some APIs related to scroll are supported.
Change-Id: Ie97364cf57bd40d7a5a855387a188c2e23f7f074
*/
typedef Signal<void(const std::string&, int)> WebEnginePageLoadErrorSignalType;
+ // forward declaration.
+ enum class ScrollEdge;
+
+ /**
+ * @brief WebView signal type related with scroll edge reached.
+ */
+ typedef Signal< void( const ScrollEdge )> WebEngineScrollEdgeReachedSignalType;
+
/**
* @brief Enumeration for cache model options.
*/
};
/**
- * @brief Constructor.
+ * @brief Enumeration for the scroll edge.
*/
- WebEnginePlugin()
+ enum class ScrollEdge
{
- }
+ LEFT, ///< Left edge reached.
+ RIGHT, ///< Right edge reached.
+ TOP, ///< Top edge reached.
+ BOTTOM, ///< Bottom edge reached.
+ };
+
+ /**
+ * @brief Constructor.
+ */
+ WebEnginePlugin() = default;
/**
* @brief Destructor.
*/
- virtual ~WebEnginePlugin()
- {
- }
+ virtual ~WebEnginePlugin() = default;
/**
* @brief Creates WebEngine instance.
virtual void Resume() = 0;
/**
+ * @brief Scrolls the webpage of view by deltaX and deltaY.
+ */
+ virtual void ScrollBy( int deltaX, int deltaY ) = 0;
+
+ /**
+ * @brief Scroll to the specified position of the given view.
+ */
+ virtual void SetScrollPosition( int x, int y ) = 0;
+
+ /**
+ * @brief Gets the current scroll position of the given view.
+ */
+ virtual void GetScrollPosition( int& x, int& y ) const = 0;
+
+ /**
+ * @brief Gets the possible scroll size of the given view.
+ */
+ virtual void GetScrollSize( int& width, int& height ) const = 0;
+
+ /**
+ * @brief Gets the last known content's size.
+ */
+ virtual void GetContentSize( int& width, int& height ) const = 0;
+
+ /**
* @brief Returns whether forward is possible.
*
* @return True if forward is possible, false otherwise
* @return A signal object to connect with.
*/
virtual WebEnginePageLoadErrorSignalType& PageLoadErrorSignal() = 0;
+
+ /**
+ * @brief Connects to this signal to be notified when scroll edge is reached.
+ *
+ * @return A signal object to connect with.
+ */
+ virtual WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal() = 0;
};
} // namespace Dali
GetImplementation(*this).Resume();
}
+void WebEngine::ScrollBy( int deltaX, int deltaY )
+{
+ GetImplementation( *this ).ScrollBy( deltaX, deltaY );
+}
+
+void WebEngine::SetScrollPosition( int x, int y )
+{
+ GetImplementation( *this ).SetScrollPosition( x, y );
+}
+
+void WebEngine::GetScrollPosition( int& x, int& y ) const
+{
+ GetImplementation( *this ).GetScrollPosition( x, y );
+}
+
+void WebEngine::GetScrollSize( int& width, int& height ) const
+{
+ GetImplementation( *this ).GetScrollSize( width, height );
+}
+
+void WebEngine::GetContentSize( int& width, int& height ) const
+{
+ GetImplementation( *this ).GetContentSize( width, height );
+}
+
bool WebEngine::CanGoForward()
{
return GetImplementation(*this).CanGoForward();
return GetImplementation(*this).PageLoadErrorSignal();
}
+Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal()
+{
+ return GetImplementation( *this ).ScrollEdgeReachedSignal();
+}
+
} // namespace Dali
void Resume();
/**
+ * @brief Scrolls the webpage of view by deltaX and deltaY.
+ */
+ void ScrollBy( int deltaX, int deltaY );
+
+ /**
+ * @brief Sets an absolute scroll of the given view.
+ */
+ void SetScrollPosition( int x, int y );
+
+ /**
+ * @brief Gets the current scroll position of the given view.
+ */
+ void GetScrollPosition( int& x, int& y ) const;
+
+ /**
+ * @brief Gets the possible scroll size of the given view.
+ */
+ void GetScrollSize( int& width, int& height ) const;
+
+ /**
+ * @brief Gets the last known content's size.
+ */
+ void GetContentSize( int& width, int& height ) const;
+
+ /**
* @brief Returns whether forward is possible.
*
* @return True if forward is possible, false otherwise
*/
Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
+ /**
+ * @brief Connects to this signal to be notified when scroll edge is reached.
+ *
+ * @return A signal object to connect with.
+ */
+ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+
private: // Not intended for application developers
/**
* @brief Internal constructor
mPlugin->Resume();
}
+void WebEngine::ScrollBy( int deltaX, int deltaY )
+{
+ mPlugin->ScrollBy( deltaX, deltaY );
+}
+
+void WebEngine::SetScrollPosition( int x, int y )
+{
+ mPlugin->SetScrollPosition( x, y );
+}
+
+void WebEngine::GetScrollPosition( int& x, int& y ) const
+{
+ mPlugin->GetScrollPosition( x, y );
+}
+
+void WebEngine::GetScrollSize( int& width, int& height ) const
+{
+ mPlugin->GetScrollSize( width, height );
+}
+
+void WebEngine::GetContentSize( int& width, int& height ) const
+{
+ mPlugin->GetContentSize( width, height );
+}
+
bool WebEngine::CanGoForward()
{
return mPlugin->CanGoForward();
return mPlugin->PageLoadErrorSignal();
}
+Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal()
+{
+ return mPlugin->ScrollEdgeReachedSignal();
+}
+
} // namespace Adaptor;
} // namespace Internal;
} // namespace Dali;
void Resume();
/**
+ * @copydoc Dali::WebEngine::ScrollBy()
+ */
+ void ScrollBy( int deltaX, int deltaY );
+
+ /**
+ * @copydoc Dali::WebEngine::SetScrollPosition()
+ */
+ void SetScrollPosition( int x, int y );
+
+ /**
+ * @copydoc Dali::WebEngine::GetScrollPosition()
+ */
+ void GetScrollPosition( int& x, int& y ) const;
+
+ /**
+ * @copydoc Dali::WebEngine::GetScrollSize()
+ */
+ void GetScrollSize( int& width, int& height ) const;
+
+ /**
+ * @copydoc Dali::WebEngine::GetContentSize()
+ */
+ void GetContentSize( int& width, int& height ) const;
+
+ /**
* @copydoc Dali::WebEngine::CanGoForward()
*/
bool CanGoForward();
*/
Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
+ /**
+ * @copydoc Dali::WebEngine::ScrollEdgeReachedSignal()
+ */
+ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+
private:
/**