5a7284ca2621c07b427e8f5df6e5d076e3501ca2
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-page-cube-effect.h
1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_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 // INTERNAL INCLUDES
21 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
22
23 namespace Dali DALI_IMPORT_API
24 {
25
26 class Actor;
27
28 namespace Toolkit
29 {
30
31 namespace Internal DALI_INTERNAL
32 {
33 class ScrollViewPageCubeEffect;
34 }
35
36 /**
37  * ScrollView Inner Cube-Effect.
38  *
39  * This effect cause each page in a scroll-view to rotate round an inner 3D cube.
40  * It should be used on the following Actor hierarchy:
41  *
42  * ScrollView
43  * |
44  * Page (1..n)
45  *
46  * You should ensure ScrollView's default constraints have been removed,
47  * by calling ScrollView::RemoveConstraintsFromChildren() before applying
48  * this effect to ScrollView.
49  *
50  * Manual operation:
51  * ApplyToPage(...) method should be called on every page.
52  *
53  * Automatic operation:
54  * not implemented.
55  */
56 class ScrollViewPageCubeEffect : public ScrollViewEffect
57 {
58
59 public:
60
61   /**
62    * Create an initialized ScrollViewPageCubeEffect.
63    * @return A handle to a newly allocated Dali resource.
64    */
65   static ScrollViewPageCubeEffect New();
66
67   /**
68    * Create an uninitialized ScrollViewPageCubeEffect; this can be initialized with ScrollViewPageCubeEffect::New()
69    * Calling member functions with an uninitialized Toolkit::ScrollViewPageCubeEffect is not allowed.
70    */
71   ScrollViewPageCubeEffect();
72
73   /**
74    * Downcast an Object handle to ScrollViewPageCubeEffect. If handle points to a ScrollViewPageCubeEffect the
75    * downcast produces valid handle. If not the returned handle is left uninitialized.
76    * @param[in] handle Handle to an object
77    * @return handle to a ScrollViewPageCubeEffect or an uninitialized handle
78    */
79   static ScrollViewPageCubeEffect DownCast( BaseHandle handle );
80
81   /**
82    * Manually apply effect to a page in the scroll-view.
83    * @param[in] page The page to be affected by this effect.
84    * @param[in] angleSwing The maximum amount the child actor should
85    * rotate in radians for each axis (X and Y) as the page is scrolled.
86    */
87   void ApplyToPage( Actor page, const Vector2& angleSwing );
88
89 protected:
90
91   /**
92    * This constructor is used by Dali New() methods.
93    * @param [in] impl A pointer to a newly allocated Dali resource
94    */
95   ScrollViewPageCubeEffect( Internal::ScrollViewPageCubeEffect *impl );
96
97 };
98
99 } // namespace Toolkit
100
101 } // namespace Dali
102
103 #endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__