(ScrollView) Remove unused functions
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-wobble-effect-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
3
4 /*
5  * Copyright (c) 2014 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 // INTERNAL INCLUDES
22 #include <dali/public-api/animation/animation.h>
23 #include <dali/public-api/animation/alpha-functions.h>
24 #include <dali/public-api/animation/time-period.h>
25 #include <dali/public-api/object/ref-object.h>
26 #include <dali/public-api/actors/custom-actor.h>
27 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
28 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
29 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
30
31 namespace Dali
32 {
33
34 class Animation;
35
36 namespace Toolkit
37 {
38
39 class ScrollView;
40
41 namespace Internal
42 {
43
44 class ScrollViewEffect;
45
46 /**
47  * @copydoc Toolkit::ScrollViewWobbleEffect
48  */
49 class ScrollViewWobbleEffect : public ScrollViewEffect
50 {
51
52 public:
53
54   /**
55    * Constructor
56    */
57   ScrollViewWobbleEffect();
58
59   /**
60    * Increases the Stable Count (when this reaches mStableTotal)
61    * Then all constraints are stable, and the animation can stop.
62    */
63   void IncrementStableCount();
64
65   /**
66    * Returns animation cycle id. Every time a new animation starts
67    * this cycle id is increased.
68    *
69    * @return The Animation Cycle id is returned.
70    */
71   unsigned int GetAnimationCycleId() const;
72
73 public:
74
75   /**
76    * @copydoc ScrollViewEffect::OnAttach
77    */
78   virtual void OnAttach(Toolkit::ScrollView& scrollView);
79
80   /**
81    * @copydoc ScrollViewEffect::OnDetach
82    */
83   virtual void OnDetach(Toolkit::ScrollView& scrollView);
84
85 protected:
86
87   /**
88    * A reference counted object may only be deleted by calling Unreference()
89    */
90   virtual ~ScrollViewWobbleEffect();
91
92 private:
93
94   /**
95    * Signal handler, called when the ScrollView starts to move
96    *
97    * @param[in] position The current scroll position
98    */
99   void OnScrollStart( const Vector3& position );
100
101   /**
102    * Signal handler, called when the ScrollView is moving
103    *
104    * @param[in] position The current scroll position
105    */
106   void OnScrollUpdate( const Vector3& position );
107
108   /**
109    * Signal handler, called when the ScrollView has completed movement
110    *
111    * @param[in] position The current scroll position
112    */
113   void OnScrollComplete( const Vector3& position );
114
115   /**
116    * Signal handler, called when the Wobble Effect animation has completed.
117    *
118    * @param[in] animation The animation.
119    */
120   void OnAnimationFinished( Animation& animation );
121
122   /**
123    * Attaches effect to Scroll Actor (ScrollView)
124    *
125    * Applies the same wobble effect to each Scroll Actor.
126    *
127    * @param[in] actor The attached Actor
128    */
129   void AttachActor(Actor actor);
130
131   /**
132    * Detaches effect from Scroll Actor (ScrollView)
133    *
134    * @param[in] actor The attached Actor
135    */
136   void DetachActor(Actor actor);
137
138   /**
139    * Continues Animation to time reaches endTime
140    *
141    * @param[in] endTime the target time to reach.
142    */
143   void ContinueAnimation(float endTime);
144
145 private:
146
147   Animation mAnimation;                         ///< Animation Timer to drive the wobble effect constraint.
148   Property::Index mPropertyTime;                ///< Time property used by wobble effect constraint to calculate timePassed.
149
150   int mStableCurrent;                           ///< Stability current - how many wobble constraints are not wobbling (or have neglible wobble).
151   unsigned int mAnimationCycleId;               ///< The start of each new animation cycle is a unique number.
152
153 };
154
155 } // namespace Internal
156
157 } // namespace Toolkit
158
159 } // namespace Dali
160
161 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__