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 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>
24 namespace Dali DALI_IMPORT_API
32 class ScrollViewEffect;
34 namespace Internal DALI_INTERNAL
36 class ScrollViewDepthEffect;
40 * ScrollView Depth-Effect.
42 * This effect causes Actors to appear to scroll off the page
43 * at different speeds.
45 * It should be used on the following Actor hierarchy:
53 * You should ensure ScrollView's default constraints have been removed,
54 * by calling ScrollView::RemoveConstraintsFromChildren() before applying
55 * this effect to ScrollView.
58 * upon adding children to pages, the ApplyToActor(...) method should be called.
60 * Automatic operation:
63 class ScrollViewDepthEffect : public ScrollViewEffect
69 * Create an initialized ScrollViewDepthEffect.
70 * @return A handle to a newly allocated Dali resource.
72 static ScrollViewDepthEffect New();
75 * Create an uninitialized ScrollViewDepthEffect; this can be initialized with ScrollViewDepthEffect::New()
76 * Calling member functions with an uninitialized Toolkit::ScrollViewDepthEffect is not allowed.
78 ScrollViewDepthEffect();
81 * Downcast an Object handle to ScrollViewDepthEffect. If handle points to a ScrollViewDepthEffect the
82 * downcast produces valid handle. If not the returned handle is left uninitialized.
83 * @param[in] handle Handle to an object
84 * @return handle to a ScrollViewCubeEffect or an uninitialized handle
86 static ScrollViewDepthEffect DownCast( BaseHandle handle );
89 * Manually apply effect to an Actor.
90 * @param[in] child The child Actor to be affected by this effect.
91 * @param[in] positionExtent Controls how much Actor's X and Y
92 * position affects their alpha function's exponent value
93 * @param[in] offsetExtent exponent offset for X and Y scrolling
95 * @param[in] positionScale Changes the amount the page as a whole
97 * @param[in] scaleExtent Scale factor to reach when page is one whole
98 * page away from screen.
100 void ApplyToActor(Actor child,
101 const Vector2& positionExtent,
102 const Vector2& offsetExtent,
109 * This constructor is used by Dali New() methods.
110 * @param [in] impl A pointer to a newly allocated Dali resource
112 ScrollViewDepthEffect(Internal::ScrollViewDepthEffect *impl);
116 } // namespace Toolkit
120 #endif // __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__