1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
5 * Copyright (c) 2014 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/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>
29 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
30 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
31 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
46 class ScrollViewEffect;
49 * @copydoc Toolkit::ScrollViewWobbleEffect
51 class ScrollViewWobbleEffect : public ScrollViewEffect
59 ScrollViewWobbleEffect();
62 * Increases the Stable Count (when this reaches mStableTotal)
63 * Then all constraints are stable, and the animation can stop.
65 void IncrementStableCount();
68 * Returns animation cycle id. Every time a new animation starts
69 * this cycle id is increased.
71 * @return The Animation Cycle id is returned.
73 unsigned int GetAnimationCycleId() const;
78 * @copydoc ScrollViewEffect::OnAttach
80 virtual void OnAttach(Toolkit::ScrollView& scrollView);
83 * @copydoc ScrollViewEffect::OnDetach
85 virtual void OnDetach(Toolkit::ScrollView& scrollView);
90 * A reference counted object may only be deleted by calling Unreference()
92 virtual ~ScrollViewWobbleEffect();
97 * Signal handler, called when the ScrollView starts to move
99 * @param[in] position The current scroll position
101 void OnScrollStart( const Vector3& position );
104 * Signal handler, called when the ScrollView is moving
106 * @param[in] position The current scroll position
108 void OnScrollUpdate( const Vector3& position );
111 * Signal handler, called when the ScrollView has completed movement
113 * @param[in] position The current scroll position
115 void OnScrollComplete( const Vector3& position );
118 * Signal handler, called when the Wobble Effect animation has completed.
120 * @param[in] animation The animation.
122 void OnAnimationFinished( Animation& animation );
125 * Attaches effect to Scroll Actor (ScrollView)
127 * Applies the same wobble effect to each Scroll Actor.
129 * @param[in] actor The attached Actor
131 void AttachActor(Actor actor);
134 * Detaches effect from Scroll Actor (ScrollView)
136 * @param[in] actor The attached Actor
138 void DetachActor(Actor actor);
141 * Continues Animation to time reaches endTime
143 * @param[in] endTime the target time to reach.
145 void ContinueAnimation(float endTime);
149 Animation mAnimation; ///< Animation Timer to drive the wobble effect constraint.
150 Property::Index mPropertyTime; ///< Time property used by wobble effect constraint to calculate timePassed.
152 int mStableCurrent; ///< Stability current - how many wobble constraints are not wobbling (or have neglible wobble).
153 unsigned int mAnimationCycleId; ///< The start of each new animation cycle is a unique number.
157 } // namespace Internal
159 } // namespace Toolkit
163 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__