Remove CAPI from Toolkit
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-cube-effect.h
1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
23
24 namespace Dali DALI_IMPORT_API
25 {
26
27 class Actor;
28
29 namespace Toolkit
30 {
31
32 class ScrollViewEffect;
33
34 namespace Internal DALI_INTERNAL
35 {
36 class ScrollViewCubeEffect;
37 }
38
39 /**
40  * @brief This effect causes Actors to appear to rotate around a 3D cube.
41  *
42  * It should be used on the following Actor hierarchy:
43  *
44  * ScrollView
45  * |
46  * Page (1..n)
47  * |
48  * Child (1..m)
49  *
50  * You should ensure ScrollView's default constraints have been removed,
51  * by calling ScrollView::RemoveConstraintsFromChildren() before applying
52  * this effect to ScrollView.
53  *
54  * Manual operation:
55  * upon adding children to pages, the ApplyToActor(...) method should be called.
56  *
57  * Automatic operation:
58  * not implemented.
59  */
60 class ScrollViewCubeEffect : public ScrollViewEffect
61 {
62
63 public:
64
65   /**
66    * @brief Create an initialized ScrollViewCubeEffect.
67    *
68    * @return A handle to a newly allocated Dali resource.
69    */
70   static ScrollViewCubeEffect New();
71
72   /**
73    * @brief Create an uninitialized ScrollViewCubeEffect; this can be initialized with ScrollViewCubeEffect::New().
74    *
75    * Calling member functions with an uninitialized Toolkit::ScrollViewCubeEffect is not allowed.
76    */
77   ScrollViewCubeEffect();
78
79   /**
80    * @brief Downcast an Object handle to ScrollViewCubeEffect.
81    *
82    * If handle points to a ScrollViewCubeEffect the downcast produces
83    * valid handle. If not the returned handle is left uninitialized.
84    *
85    * @param[in] handle Handle to an object
86    * @return handle to a ScrollViewCubeEffect or an uninitialized handle
87    */
88   static ScrollViewCubeEffect DownCast( BaseHandle handle );
89
90   /**
91    * @brief Manually apply effect to an Actor.
92    *
93    * @param[in] child The child Actor to be affected by this effect.
94    * @param[in] anchor The anchor point that the child actor should
95    * rotate around when scrolling
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.
98    * @param[in] positionSwing The maximum amount the child actor should
99    * move for each axis (X and Y) as the page is scrolled.
100    */
101   void ApplyToActor(Actor child,
102                     const Vector3& anchor,
103                     const Vector2& angleSwing,
104                     const Vector2& positionSwing);
105
106   /**
107    * @brief Manually apply effect to an Actor.
108    *
109    * @param[in] child The child Actor to be affected by this effect.
110    * @param[in] parentPage The parent page Actor to be used by this effect.
111    * @param[in] anchor The anchor point that the child actor should
112    * rotate around when scrolling
113    * @param[in] angleSwing The maximum amount the child actor should
114    * rotate in radians for each axis (X and Y) as the page is scrolled.
115    * @param[in] positionSwing The maximum amount the child actor should
116    * move for each axis (X and Y) as the page is scrolled.
117    */
118   void ApplyToActor(Actor child,
119                     Actor parentPage,
120                     const Vector3& anchor,
121                     const Vector2& angleSwing,
122                     const Vector2& positionSwing);
123
124 protected:
125
126   /**
127    * @brief This constructor is used by Dali New() methods.
128    *
129    * @param [in] impl A pointer to a newly allocated Dali resource
130    */
131   ScrollViewCubeEffect(Internal::ScrollViewCubeEffect *impl);
132
133 };
134
135 } // namespace Toolkit
136
137 } // namespace Dali
138
139 #endif // __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__