Merge "Notify the IMF when backspace/cut empties the TextField" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-page-path-effect.h
1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__
3
4 /*
5  * Copyright (c) 2015 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 class Path;
29
30 namespace Toolkit
31 {
32
33 namespace Internal DALI_INTERNAL
34 {
35 class ScrollViewPagePathEffect;
36 }
37 /**
38  * @addtogroup dali-toolkit-controls-scroll-view
39  * @{
40  */
41
42 /**
43  * ScrollView Page Path Effect.
44  * This effect causes Actors to follow a given path. The opacity of the actor will be 0.0 at
45  * the beginning of the path and will go to 1.0 as it is approximating to half of the path to return
46  * to 0.0 at the end of the path
47  *
48  *
49  * ScrollView
50  * |
51  * Page (1..n)
52  *
53  * You should ensure ScrollView's default constraints have been removed,
54  * by calling ScrollView::RemoveConstraintsFromChildren() before applying
55  * this effect to ScrollView.
56  *
57  * Manual operation:
58  * ApplyToPage(...) method should be called on every page.
59  *
60  * Automatic operation:
61  * not implemented.
62  */
63 class DALI_IMPORT_API ScrollViewPagePathEffect : public ScrollViewEffect
64 {
65
66 public:
67
68   /**
69    * Create an initialized ScrollViewPagePathEffect.
70    * @param[in] path The path that will be used by the scroll effect
71    * @param[in] forward Vector in page object space which will be aligned with the tangent of the path
72    * @param[in] inputPropertyIndex Index of a property of the scroll-view which will be used as the input for the path.
73    * @param[in] pageSize Size of a page in the scrollview
74    * @param[in] pageCount Total number of pages in the scrollview
75    * @return A handle to a newly allocated Dali resource.
76    */
77   static ScrollViewPagePathEffect New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount);
78
79   /**
80    * Create an uninitialized ScrollViewPagePathEffect; this can be initialized with ScrollViewPagePathEffect::New()
81    * Calling member functions with an uninitialized Toolkit::ScrollViewPagePathEffect is not allowed.
82    */
83   ScrollViewPagePathEffect();
84
85   /**
86    * Downcast an Object handle to ScrollViewPagePathEffect. If handle points to a ScrollViewPagePathEffect the
87    * downcast produces valid handle. If not the returned handle is left uninitialized.
88    * @param[in] handle Handle to an object
89    * @return handle to a ScrollViewPagePathEffect or an uninitialized handle
90    */
91   static ScrollViewPagePathEffect DownCast( BaseHandle handle );
92
93   /**
94    * Manually apply effect to a page in the scroll-view.
95    * @param[in] page The page to be affected by this effect.
96    * @param[in] pageOrder The order of the page in the scroll-view
97    */
98   void ApplyToPage( Actor page, unsigned int pageOrder );
99
100 protected:
101
102   /**
103    * This constructor is used by Dali New() methods.
104    * @param [in] impl A pointer to a newly allocated Dali resource
105    */
106   explicit DALI_INTERNAL ScrollViewPagePathEffect( Internal::ScrollViewPagePathEffect *impl );
107
108 };
109
110 /**
111  * @}
112  */
113 } // namespace Toolkit
114
115 } // namespace Dali
116
117 #endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__