Merge "Scrollable public API clean-up phase 1" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-page-carousel-effect.h
1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_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
25 {
26
27 class Actor;
28
29 namespace Toolkit
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 class ScrollViewPageCarouselEffect;
35 }
36
37 /**
38  * ScrollView Page Carousel Effect.
39  *
40  * This effect cause each page in a scroll-view to rotate round a 3D carousel.
41  * It should be used on the following Actor hierarchy:
42  *
43  * ScrollView
44  * |
45  * Page (1..n)
46  *
47  * You should ensure ScrollView's default constraints have been removed,
48  * by calling ScrollView::RemoveConstraintsFromChildren() before applying
49  * this effect to ScrollView.
50  *
51  * Manual operation:
52  * ApplyToPage(...) method should be called on every page.
53  *
54  * Automatic operation:
55  * not implemented.
56  */
57 class DALI_IMPORT_API ScrollViewPageCarouselEffect : public ScrollViewEffect
58 {
59
60 public:
61
62   /**
63    * Create an initialized ScrollViewPageCarouselEffect.
64    * @return A handle to a newly allocated Dali resource.
65    */
66   static ScrollViewPageCarouselEffect New();
67
68   /**
69    * Create an uninitialized ScrollViewPageCarouselEffect; this can be initialized with ScrollViewPageCarouselEffect::New()
70    * Calling member functions with an uninitialized Toolkit::ScrollViewPageCarouselEffect is not allowed.
71    */
72   ScrollViewPageCarouselEffect();
73
74   /**
75    * Downcast an Object handle to ScrollViewPageCarouselEffect. If handle points to a ScrollViewPageCarouselEffect the
76    * downcast produces valid handle. If not the returned handle is left uninitialized.
77    * @param[in] handle Handle to an object
78    * @return handle to a ScrollViewPageCarouselEffect or an uninitialized handle
79    */
80   static ScrollViewPageCarouselEffect DownCast( BaseHandle handle );
81
82   /**
83    * Manually apply effect to a page in the scroll-view.
84    * @param[in] page The page to be affected by this effect.
85    * @param[in] positionToPageSizeRatio A ratio of the size of the page which determines the amount the page will move as it fades out.
86    *                                    Default is moving it by the page size.
87    */
88   void ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio = Vector2::ONE );
89
90 protected:
91
92   /**
93    * This constructor is used by Dali New() methods.
94    * @param [in] impl A pointer to a newly allocated Dali resource
95    */
96   explicit DALI_INTERNAL ScrollViewPageCarouselEffect( Internal::ScrollViewPageCarouselEffect *impl );
97
98 };
99
100 } // namespace Toolkit
101
102 } // namespace Dali
103
104 #endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__