0455a992605ce986087a3ca4ce2ff8ed99ca1677
[platform/core/uifw/dali-toolkit.git] / capi / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-page-spiral-effect.h
1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_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 namespace Internal DALI_INTERNAL
37 {
38 class ScrollViewPageSpiralEffect;
39 }
40
41 /**
42  * @brief This effect cause each page in a scroll-view to move along a spiral.
43  *
44  * It should be used on the following Actor hierarchy:
45  *
46  * ScrollView
47  * |
48  * Page (1..n)
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  * ApplyToPage(...) method should be called on every page.
56  *
57  * Automatic operation:
58  * not implemented.
59  */
60 class ScrollViewPageSpiralEffect : public ScrollViewEffect
61 {
62
63 public:
64
65   /**
66    * @brief Create an initialized ScrollViewPageSpiralEffect.
67    *
68    * @return A handle to a newly allocated Dali resource.
69    */
70   static ScrollViewPageSpiralEffect New();
71
72   /**
73    * @brief Create an uninitialized ScrollViewPageSpiralEffect; this can be initialized with ScrollViewPageSpiralEffect::New().
74    *
75    * Calling member functions with an uninitialized Toolkit::ScrollViewPageSpiralEffect is not allowed.
76    */
77   ScrollViewPageSpiralEffect();
78
79   /**
80    * @brief Downcast an Object handle to ScrollViewPageSpiralEffect.
81    *
82    * If handle points to a ScrollViewPageSpiralEffect the
83    * downcast produces valid handle. If not the returned handle is left uninitialized.
84    * @param[in] handle Handle to an object
85    * @return handle to a ScrollViewPageSpiralEffect or an uninitialized handle
86    */
87   static ScrollViewPageSpiralEffect DownCast( BaseHandle handle );
88
89   /**
90    * @brief Manually apply effect to a page in the scroll-view.
91    *
92    * @param[in] page The page to be affected by this effect.
93    * @param[in] spiralAngle The spirald angle (in radians).
94    *
95    * @note If the wrap mode of the scroll view is changed, then this needs to be called for every
96    * page again after removing the previous constraints.
97    */
98   void ApplyToPage( Actor page, const Vector2& spiralAngle );
99
100 protected:
101
102   /**
103    * @brief This constructor is used by Dali New() methods.
104    *
105    * @param [in] impl A pointer to a newly allocated Dali resource
106    */
107   ScrollViewPageSpiralEffect( Internal::ScrollViewPageSpiralEffect *impl );
108
109 };
110
111 } // namespace Toolkit
112
113 } // namespace Dali
114
115 /**
116  * @}
117  */
118 #endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__