X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-scroller.h;h=a40be3f59678b63d6765e49ea82a102ba7a73851;hb=f05c437df1fc28be1354e47af9dbf336828956f1;hp=ef50b77bbb7de90b8325ff1247be1e44cb9b07c7;hpb=dda9d7ca30d6f5c42759647df03a13e52c76228a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-scroller.h b/dali-toolkit/internal/text/text-scroller.h index ef50b77..a40be3f 100644 --- a/dali-toolkit/internal/text/text-scroller.h +++ b/dali-toolkit/internal/text/text-scroller.h @@ -37,6 +37,7 @@ namespace Text class TextScroller; class ScrollerInterface; +struct ScrollerData; typedef IntrusivePtr TextScrollerPtr; @@ -46,7 +47,6 @@ typedef IntrusivePtr TextScrollerPtr; class TextScroller : public RefObject, public ConnectionTracker { public: - /** * @brief Text Scrolling helper, used to automatically scroll text, SetParameters should be called before scrolling is needed. * CleanUp removes the Scrolling actors from stage whilst keeping the Scroller object alive and preserving Speed, Gap and Loop count. @@ -56,52 +56,19 @@ public: static TextScrollerPtr New( ScrollerInterface& scrollerInterface ); /** - * @brief Set parameters relating to source required for scrolling + * @brief Starts the text scrolling. * * @param[in] sourceActor source actor to be scrolled - * @param[in] controlSize size of the control to scroll within - * @param[in] offScreenSize size of the sourceActor - * @param[in] direction text direction true for right to left text - * @param[in] alignmentOffset alignment of source text + * @param[in] data Parameters needed to set up the text scrolling. * */ - void SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, float alignmentOffset ); - - /** - * @brief Set the gap distance to elapse before the text wraps around - * @param[in] gap distance to elapse - */ - void SetGap( int gap ); - - /** - * @brief Get the distance before scrolling wraps - * @return gap distance to elapse - */ - int GetGap() const; - - /** - * @brief Set speed the text should scroll - * @param[in] scrollSpeed pixels per second - */ - void SetSpeed( int scrollSpeed ); + void StartScrolling( Actor sourceActor, + const ScrollerData& data ); /** - * @brief Get the speed of text scrolling - * @return speed in pixels per second + * @brief Stops the text scrolling. */ - int GetSpeed() const; - - /** - * @brief Set the number of times the text scrolling should loop, can stop current scrolling by passing in 0; - * @param[in] loopCount number of times the scrolled text should loop, 0 to stop scrolling - */ - void SetLoopCount( int loopCount ); - - /** - * @brief Get the number of loops - * @return int number of loops - */ - int GetLoopCount() const; + void StopScrolling(); /** * @brief Get the camera used to look at source, should be added to the parent of target actor. @@ -140,14 +107,6 @@ private: // Implementation void AutoScrollAnimationFinished( Dali::Animation& animation ); /** - * @brief variables required to set up scrolling animation - * @param[in] scrollAmount distance to animate text for the given duration - * @param[in] scrollDuration duration of aninmation - * @param[in] loopCount number of times to loop the scrolling text - */ - void StartScrolling( float scrollAmount, float scrollDuration, int loopCount ); - - /** * @brief When scrolling ended, the actors are cleaned up so no longer staged. */ void CleanUp(); @@ -161,10 +120,6 @@ private: Property::Index mScrollDeltaIndex; // Property used by shader to represent distance to scroll Animation mScrollAnimation; // Animation used to update the mScrollDeltaIndex - int mScrollSpeed; ///< Speed which text should automatically scroll at - int mLoopCount; ///< Number of time the text should scroll - int mWrapGap; ///< Gap before text wraps around when scrolling - }; // TextScroller class } // namespace Text