1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_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 ScrollViewDepthEffect;
39 * ScrollView Depth-Effect.
41 * This effect causes Actors to appear to scroll off the page
42 * at different speeds.
44 * It should be used on the following Actor hierarchy:
52 * You should ensure ScrollView's default constraints have been removed,
53 * by calling ScrollView::RemoveConstraintsFromChildren() before applying
54 * this effect to ScrollView.
57 * upon adding children to pages, the ApplyToActor(...) method should be called.
59 * Automatic operation:
62 class ScrollViewDepthEffect : public ScrollViewEffect
68 * Create an initialized ScrollViewDepthEffect.
69 * @return A handle to a newly allocated Dali resource.
71 static ScrollViewDepthEffect New();
74 * Create an uninitialized ScrollViewDepthEffect; this can be initialized with ScrollViewDepthEffect::New()
75 * Calling member functions with an uninitialized Toolkit::ScrollViewDepthEffect is not allowed.
77 ScrollViewDepthEffect();
80 * Downcast an Object handle to ScrollViewDepthEffect. If handle points to a ScrollViewDepthEffect the
81 * downcast produces valid handle. If not the returned handle is left uninitialized.
82 * @param[in] handle Handle to an object
83 * @return handle to a ScrollViewCubeEffect or an uninitialized handle
85 static ScrollViewDepthEffect DownCast( BaseHandle handle );
88 * Manually apply effect to an Actor.
89 * @param[in] child The child Actor to be affected by this effect.
90 * @param[in] positionExtent Controls how much Actor's X and Y
91 * position affects their alpha function's exponent value
92 * @param[in] offsetExtent exponent offset for X and Y scrolling
94 * @param[in] positionScale Changes the amount the page as a whole
96 * @param[in] scaleExtent Scale factor to reach when page is one whole
97 * page away from screen.
99 void ApplyToActor(Actor child,
100 const Vector2& positionExtent,
101 const Vector2& offsetExtent,
108 * This constructor is used by Dali New() methods.
109 * @param [in] impl A pointer to a newly allocated Dali resource
111 ScrollViewDepthEffect(Internal::ScrollViewDepthEffect *impl);
115 } // namespace Toolkit
119 #endif // __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__