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