Add U0 case to Utf8ToUtf32
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-vertical-scroller.h
1 #ifndef DALI_TOOLKIT_TEXT_VERTICAL_SCROLLER_H
2 #define DALI_TOOLKIT_TEXT_VERTICAL_SCROLLER_H
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/animation/animation.h>
24
25 // INTERNAL INCLUDES
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Text
34 {
35
36 class TextVerticalScroller;
37
38 typedef IntrusivePtr<TextVerticalScroller> TextVerticalScrollerPtr;
39
40 /**
41  * @brief A helper class for scrolling text vertically
42  */
43 class TextVerticalScroller : public RefObject, public ConnectionTracker
44 {
45 public:
46
47   /**
48    * @brief Text Scrolling helper, used to automatically scroll text, StartScroll should be called when scrolling is needed.
49    *
50    */
51   static TextVerticalScrollerPtr New();
52
53   /**
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
59    */
60   void CheckStartAnimation( Actor& sourceActor, float x, float y, float scrollAmount );
61
62   /**
63    * @brief Set duration the text should scroll
64    * @param[in] duration The duration in seconds
65    */
66   void SetDuration( float duration );
67
68 private: // Implementation
69   /**
70    * Constructor
71    */
72   TextVerticalScroller();
73
74   /**
75    * @brief Virtual Destructor.
76    */
77   virtual ~TextVerticalScroller();
78
79 private:
80
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
86
87 } // namespace Text
88
89 } // namespace Toolkit
90
91 } // namespace Dali
92
93 #endif // DALI_TOOLKIT_TEXT_VERTICAL_SCROLLER_H