1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_CUBE_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 * @addtogroup CAPI_DALI_FRAMEWORK
26 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
28 namespace Dali DALI_IMPORT_API
36 class ScrollViewEffect;
38 namespace Internal DALI_INTERNAL
40 class ScrollViewCubeEffect;
44 * ScrollView Cube-Effect.
46 * This effect causes Actors to appear to rotate around a 3D cube.
47 * It should be used on the following Actor hierarchy:
55 * You should ensure ScrollView's default constraints have been removed,
56 * by calling ScrollView::RemoveConstraintsFromChildren() before applying
57 * this effect to ScrollView.
60 * upon adding children to pages, the ApplyToActor(...) method should be called.
62 * Automatic operation:
65 class ScrollViewCubeEffect : public ScrollViewEffect
71 * Create an initialized ScrollViewCubeEffect.
72 * @return A handle to a newly allocated Dali resource.
74 static ScrollViewCubeEffect New();
77 * Create an uninitialized ScrollViewCubeEffect; this can be initialized with ScrollViewCubeEffect::New()
78 * Calling member functions with an uninitialized Toolkit::ScrollViewCubeEffect is not allowed.
80 ScrollViewCubeEffect();
83 * Downcast an Object handle to ScrollViewCubeEffect. If handle points to a ScrollViewCubeEffect the
84 * downcast produces valid handle. If not the returned handle is left uninitialized.
85 * @param[in] handle Handle to an object
86 * @return handle to a ScrollViewCubeEffect or an uninitialized handle
88 static ScrollViewCubeEffect DownCast( BaseHandle handle );
91 * Manually apply effect to an Actor.
92 * @param[in] child The child Actor to be affected by this effect.
93 * @param[in] anchor The anchor point that the child actor should
94 * rotate around when scrolling
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.
97 * @param[in] positionSwing The maximum amount the child actor should
98 * move for each axis (X and Y) as the page is scrolled.
100 void ApplyToActor(Actor child,
101 const Vector3& anchor,
102 const Vector2& angleSwing,
103 const Vector2& positionSwing);
106 * Manually apply effect to an Actor.
107 * @param[in] child The child Actor to be affected by this effect.
108 * @param[in] parentPage The parent page Actor to be used by this effect.
109 * @param[in] anchor The anchor point that the child actor should
110 * rotate around when scrolling
111 * @param[in] angleSwing The maximum amount the child actor should
112 * rotate in radians for each axis (X and Y) as the page is scrolled.
113 * @param[in] positionSwing The maximum amount the child actor should
114 * move for each axis (X and Y) as the page is scrolled.
116 void ApplyToActor(Actor child,
118 const Vector3& anchor,
119 const Vector2& angleSwing,
120 const Vector2& positionSwing);
125 * This constructor is used by Dali New() methods.
126 * @param [in] impl A pointer to a newly allocated Dali resource
128 ScrollViewCubeEffect(Internal::ScrollViewCubeEffect *impl);
132 } // namespace Toolkit
139 #endif // __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__