1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
23 namespace Dali DALI_IMPORT_API
31 class ScrollViewEffect;
33 namespace Internal DALI_INTERNAL
35 class ScrollViewCarouselEffect;
39 * ScrollView Carousel-Effect.
41 * This effect causes Actors to appear to move around around a carousel
42 * It should be used on the following Actor hierarchy:
50 * You should ensure ScrollView's default constraints have been removed,
51 * by calling ScrollView::RemoveConstraintsFromChildren() before applying
52 * this effect to ScrollView.
55 * upon adding children to container, the ApplyToActor(...) method should be called.
57 * Automatic operation:
61 * * Assumes Actor's AnchorPoint = AnchorPoint::CENTER
63 class ScrollViewCarouselEffect : public ScrollViewEffect
68 static const std::string EFFECT_ACTIVATE; ///< Activation property (a value between: 0.0 normal/no effect, 1.0 - full effect)
73 * Create an initialized ScrollViewCarouselEffect.
74 * @return A handle to a newly allocated Dali resource.
76 static ScrollViewCarouselEffect New();
79 * Create an uninitialized ScrollViewCarouselEffect; this can be initialized with ScrollViewCarouselEffect::New()
80 * Calling member functions with an uninitialized Toolkit::ScrollViewCarouselEffect is not allowed.
82 ScrollViewCarouselEffect();
85 * Downcast an Object handle to ScrollViewCarouselEffect. If handle points to a ScrollViewCarouselEffect the
86 * downcast produces valid handle. If not the returned handle is left uninitialized.
87 * @param[in] handle Handle to an object
88 * @return handle to a ScrollViewCarouselEffect or an uninitialized handle
90 static ScrollViewCarouselEffect DownCast( BaseHandle handle );
93 * Manually apply effect to an Actor.
94 * @param[in] child The child Actor to be affected by this effect.
95 * @param[in] angleSwing The maximum amount the child actor should
96 * rotate in radians for each axis (X and Y) as the page is scrolled.
98 void ApplyToActor(Actor child, const Vector2& angleSwing);
103 * This constructor is used by Dali New() methods.
104 * @param [in] impl A pointer to a newly allocated Dali resource
106 ScrollViewCarouselEffect(Internal::ScrollViewCarouselEffect *impl);
110 } // namespace Toolkit
114 #endif // __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__