X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fdecorator%2Ftext-decorator.h;h=588d224375b95f8b5899377ad010dfa69406f5f5;hb=59c891ea969ceb2e8a9f3d146c91ccf476651640;hp=70b6b65d3aded00b7417860a1b3b10c6d9fc0ec0;hpb=3b1fb566901d21b8303d9be3308e3920f5182e6d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/decorator/text-decorator.h b/dali-toolkit/internal/text/decorator/text-decorator.h index 70b6b65..588d224 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.h +++ b/dali-toolkit/internal/text/decorator/text-decorator.h @@ -22,6 +22,7 @@ #include #include #include +#include namespace Dali { @@ -65,7 +66,9 @@ enum GrabHandleState { GRAB_HANDLE_TAPPED, GRAB_HANDLE_PRESSED, - GRAB_HANDLE_RELEASED + GRAB_HANDLE_RELEASED, + GRAB_HANDLE_SCROLLING, + GRAB_HANDLE_STOP_SCROLLING }; // The set the selection-handle positions etc. @@ -170,6 +173,13 @@ public: void Relayout( const Dali::Vector2& size ); /** + * @brief Updates the decorator's actor positions after scrolling. + * + * @param[in] scrollOffset The scroll offset. + */ + void UpdatePositions( const Vector2& scrollOffset ); + + /** * @brief Sets which of the cursors are active. * * @note Cursor will only be visible if within the parent area. @@ -190,33 +200,30 @@ public: * @param[in] cursor The cursor to set. * @param[in] x The x position relative to the top-left of the parent control. * @param[in] y The y position relative to the top-left of the parent control. - * @param[in] height The logical height of the cursor. + * @param[in] cursorHeight The logical height of the cursor. + * @param[in] lineHeight The logical height of the line. */ - void SetPosition( Cursor cursor, float x, float y, float height ); + void SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight ); /** - * @brief Retrieves the position of a cursor. + * @brief Retrieves the position, height and lineHeight of a cursor. * * @param[in] cursor The cursor to get. * @param[out] x The x position relative to the top-left of the parent control. * @param[out] y The y position relative to the top-left of the parent control. - * @param[out] height The logical height of the cursor. + * @param[out] cursorHeight The logical height of the cursor. + * @param[out] lineHeight The logical height of the line. */ - void GetPosition( Cursor cursor, float& x, float& y, float& height ) const; + void GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const; /** - * @brief Sets the image for a cursor. + * @brief Retrieves the position of a cursor. * - * @param[in] image The image to use. - */ - void SetCursorImage( Dali::Image image ); - - /** - * @brief Retrieves the image for a cursor. + * @param[in] cursor The cursor to get. * - * @return The cursor image. + * @return The position. */ - Dali::Image GetCursorImage() const; + const Vector2& GetPosition( Cursor cursor ) const; /** * @brief Sets the color for a cursor. @@ -321,9 +328,9 @@ public: * @param[in] handle The handle to set. * @param[in] x The x position relative to the top-left of the parent control. * @param[in] y The y position relative to the top-left of the parent control. - * @param[in] cursorHeight The logical cursor height at this position. + * @param[in] lineHeight The logical line height at this position. */ - void SetPosition( SelectionHandle handle, float x, float y, float cursorHeight ); + void SetPosition( SelectionHandle handle, float x, float y, float lineHeight ); /** * @brief Retrieves the position of a selection handle. @@ -354,14 +361,79 @@ public: Dali::Image GetImage( SelectionHandle handle, SelectionHandleState state ) const; /** - * @brief Show the Copy and Paste Popup + * @brief Adds a quad to the existing selection highlights. + * + * @param[in] x1 The top-left x position. + * @param[in] y1 The top-left y position. + * @param[in] x2 The bottom-right x position. + * @param[in] y3 The bottom-right y position. */ - void ShowPopup(); + void AddHighlight( float x1, float y1, float x2, float y2 ); /** - * @brief Hide the Copy and Paste Popup + * @brief Removes all of the previously added highlights. + */ + void ClearHighlights(); + + /** + * @brief Set the Selection Popup to show or hide via the active flaf + * @param[in] active true to show, false to hide + */ + void SetPopupActive( bool active ); + + /** + * @brief Query whether the Selection Popup is active. + * + * @return True if the Selection Popup should be active. + */ + bool IsPopupActive() const; + + /** + * @brief Sets the scroll threshold. + * + * It defines a square area inside the control, close to the edge. + * When the cursor enters this area, the decorator starts to send scroll events. + * + * @param[in] threshold The scroll threshold. + */ + void SetScrollThreshold( float threshold ); + + /** + * @brief Retrieves the scroll threshold. + * + * @retunr The scroll threshold. + */ + float GetScrollThreshold() const; + + /** + * @brief Sets the scroll speed. + * + * Is the distance the text is going to be scrolled during a scroll interval. + * + * @param[in] speed The scroll speed. + */ + void SetScrollSpeed( float speed ); + + /** + * @brief Retrieves the scroll speed. + * + * @return The scroll speed. + */ + float GetScrollSpeed() const; + + /** + * @brief Sets the scroll interval. + * + * @param[in] seconds The scroll interval in seconds. + */ + void SetScrollTickInterval( float seconds ); + + /** + * @brief Retrieves the scroll interval. + * + * @return The scroll interval. */ - void HidePopup(); + float GetScrollTickInterval() const; protected: