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 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-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
32 class ScrollViewEffect;
34 namespace Internal DALI_INTERNAL
36 class ScrollViewCarouselEffect;
40 * ScrollView Carousel-Effect.
42 * This effect causes Actors to appear to move around around a carousel
43 * It should be used on the following Actor hierarchy:
51 * You should ensure ScrollView's default constraints have been removed,
52 * by calling ScrollView::RemoveConstraintsFromChildren() before applying
53 * this effect to ScrollView.
56 * upon adding children to container, the ApplyToActor(...) method should be called.
58 * Automatic operation:
62 * * Assumes Actor's AnchorPoint = AnchorPoint::CENTER
64 class DALI_IMPORT_API ScrollViewCarouselEffect : public ScrollViewEffect
69 static const std::string EFFECT_ACTIVATE; ///< Activation property (a value between: 0.0 normal/no effect, 1.0 - full effect)
74 * Create an initialized ScrollViewCarouselEffect.
75 * @return A handle to a newly allocated Dali resource.
77 static ScrollViewCarouselEffect New();
80 * Create an uninitialized ScrollViewCarouselEffect; this can be initialized with ScrollViewCarouselEffect::New()
81 * Calling member functions with an uninitialized Toolkit::ScrollViewCarouselEffect is not allowed.
83 ScrollViewCarouselEffect();
86 * Downcast an Object handle to ScrollViewCarouselEffect. If handle points to a ScrollViewCarouselEffect the
87 * downcast produces valid handle. If not the returned handle is left uninitialized.
88 * @param[in] handle Handle to an object
89 * @return handle to a ScrollViewCarouselEffect or an uninitialized handle
91 static ScrollViewCarouselEffect DownCast( BaseHandle handle );
94 * Manually apply effect to an Actor.
95 * @param[in] child The child Actor to be affected by this effect.
96 * @param[in] angleSwing The maximum amount the child actor should
97 * rotate in radians for each axis (X and Y) as the page is scrolled.
99 void ApplyToActor(Actor child, const Vector2& angleSwing);
104 * This constructor is used by Dali New() methods.
105 * @param [in] impl A pointer to a newly allocated Dali resource
107 explicit DALI_INTERNAL ScrollViewCarouselEffect(Internal::ScrollViewCarouselEffect *impl);
111 } // namespace Toolkit
115 #endif // __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__