1 #ifndef DALI_TOOLKIT_TEXT_VERTICAL_SCROLLER_H
2 #define DALI_TOOLKIT_TEXT_VERTICAL_SCROLLER_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/animation/animation.h>
36 class TextVerticalScroller;
38 typedef IntrusivePtr<TextVerticalScroller> TextVerticalScrollerPtr;
41 * @brief A helper class for scrolling text vertically
43 class TextVerticalScroller : public RefObject, public ConnectionTracker
48 * @brief Text Scrolling helper, used to automatically scroll text, StartScroll should be called when scrolling is needed.
51 static TextVerticalScrollerPtr New();
54 * @brief variables required to set up scrolling animation
55 * @param[in] sourceActor actor to be animated
56 * @param[in] x The new x position
57 * @param[in] y The new y position
58 * @param[in] scrollAmount The distance to destination y position for actor to be animated
60 void CheckStartAnimation( Actor& sourceActor, float x, float y, float scrollAmount );
63 * @brief Set duration the text should scroll
64 * @param[in] duration The duration in seconds
66 void SetDuration( float duration );
68 private: // Implementation
72 TextVerticalScroller();
75 * @brief Virtual Destructor.
77 virtual ~TextVerticalScroller();
81 Animation mScrollAnimation; // Animation used to update the actor's position
82 Actor mScrollingActor; // The actor being animated
83 float mDuration; // The duration of text scrolling
84 float mScrollTo; // The destination y position
85 }; // TextVerticalScroller class
89 } // namespace Toolkit
93 #endif // DALI_TOOLKIT_TEXT_VERTICAL_SCROLLER_H