X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fdecorator%2Ftext-decorator.h;h=e8bc5cf8b45571282d2fe1ccd4dcb3f6a4a0c192;hb=6af7f672f096ad4de44568a48810b509379408e8;hp=939c8158b24045ff84c4814a807dbdefef9a1226;hpb=581cc30cdf80fd3d4c0775dfba6341d3546407ee;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 939c815..e8bc5cf 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.h +++ b/dali-toolkit/internal/text/decorator/text-decorator.h @@ -66,7 +66,16 @@ enum GrabHandleState { GRAB_HANDLE_TAPPED, GRAB_HANDLE_PRESSED, - GRAB_HANDLE_RELEASED + GRAB_HANDLE_RELEASED, + GRAB_HANDLE_SCROLLING, + GRAB_HANDLE_STOP_SCROLLING +}; + +// Used to set different grab handle images +enum GrabHandleImageType +{ + GRAB_HANDLE_IMAGE_PRESSED, + GRAB_HANDLE_IMAGE_RELEASED }; // The set the selection-handle positions etc. @@ -167,9 +176,15 @@ public: * @brief The decorator waits until a relayout before creating actors etc. * * @param[in] size The size of the parent control after size-negotiation. - * @param[in] scrollPosition The cursor, grab-handle positions etc. should be offset by this. */ - void Relayout( const Dali::Vector2& size, const Vector2& scrollPosition ); + 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. @@ -198,7 +213,7 @@ public: 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. @@ -209,6 +224,15 @@ public: void GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const; /** + * @brief Retrieves the position of a cursor. + * + * @param[in] cursor The cursor to get. + * + * @return The position. + */ + const Vector2& GetPosition( Cursor cursor ) const; + + /** * @brief Sets the color for a cursor. * * @param[in] cursor Whether this color is for the primary or secondary cursor. @@ -280,16 +304,18 @@ public: /** * @brief Sets the image for the grab handle. * + * @param[in] type A different image can be set for the pressed/released states. * @param[in] image The image to use. */ - void SetGrabHandleImage( Dali::Image image ); + void SetGrabHandleImage( GrabHandleImageType type, Dali::Image image ); /** * @brief Retrieves the image for the grab handle. * + * @param[in] type A different image can be set for the pressed/released states. * @return The grab handle image. */ - Dali::Image GetGrabHandleImage() const; + Dali::Image GetGrabHandleImage( GrabHandleImageType type ) const; /** * @brief Sets whether the selection handles and highlight are active. @@ -328,20 +354,34 @@ public: /** * @brief Sets the image for one of the selection handles. * - * @param[in] handle The selection handle. * @param[in] state A different image can be set for the pressed/released states. * @param[in] image The image to use. */ - void SetImage( SelectionHandle handle, SelectionHandleState state, Dali::Image image ); + void SetLeftSelectionImage( SelectionHandleState state, Dali::Image image ); + + /** + * @brief Retrieves the image for a selection handle. + * + * @param[in] state A different image can be set for the pressed/released states. + * @return The image. + */ + Dali::Image GetLeftSelectionImage( SelectionHandleState state ) const; + + /** + * @brief Sets the image for one of the selection handles. + * + * @param[in] state A different image can be set for the pressed/released states. + * @param[in] image The image to use. + */ + void SetRightSelectionImage( SelectionHandleState state, Dali::Image image ); /** * @brief Retrieves the image for a selection handle. * - * @param[in] handle The selection handle. * @param[in] state A different image can be set for the pressed/released states. * @return The image. */ - Dali::Image GetImage( SelectionHandle handle, SelectionHandleState state ) const; + Dali::Image GetRightSelectionImage( SelectionHandleState state ) const; /** * @brief Adds a quad to the existing selection highlights. @@ -359,6 +399,20 @@ public: void ClearHighlights(); /** + * @brief Sets the selection highlight color. + * + * @param[in] image The image to use. + */ + void SetHighlightColor( const Vector4& color ); + + /** + * @brief Retrieves the selection highlight color. + * + * @return The image. + */ + const Vector4& GetHighlightColor() const; + + /** * @brief Set the Selection Popup to show or hide via the active flaf * @param[in] active true to show, false to hide */ @@ -371,6 +425,52 @@ public: */ 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. + */ + float GetScrollTickInterval() const; protected: