d33aca87f21775af4f35a16546ed9d5c4ed35cbf
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-page-carousel-effect-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_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/public-api/animation/animation.h>
23 #include <dali/public-api/animation/alpha-functions.h>
24 #include <dali/public-api/animation/time-period.h>
25 #include <dali/public-api/object/ref-object.h>
26 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
27 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h>
28 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
29
30 namespace Dali
31 {
32
33 class Animation;
34
35 namespace Toolkit
36 {
37
38 class ScrollGroup;
39 class ScrollView;
40
41 namespace Internal
42 {
43
44 /**
45  * @copydoc Toolkit::ScrollViewPageCarouselEffect
46  */
47 class ScrollViewPageCarouselEffect : public ScrollViewEffect
48 {
49
50 public:
51
52   /**
53    * Constructor
54    */
55   ScrollViewPageCarouselEffect();
56
57 public:
58
59   /**
60    * @copydoc ScrollViewEffect::ApplyToActor
61    */
62   void ApplyToPage( Actor child, const Vector2& positionToPageSizeRatio );
63
64 public:
65
66   /**
67    * @copydoc ScrollViewEffect::OnAttach
68    */
69   virtual void OnAttach( Toolkit::ScrollView& scrollView );
70
71   /**
72    * @copydoc ScrollViewEffect::OnDetach
73    */
74   virtual void OnDetach( Toolkit::ScrollView& scrollView );
75
76 protected:
77
78   /**
79    * A reference counted object may only be deleted by calling Unreference()
80    */
81   virtual ~ScrollViewPageCarouselEffect();
82
83 private:
84
85   Vector3 mPageSize; ///< The logical page size for the 3D effect.
86 };
87
88 } // namespace Internal
89
90 // Helpers for public-api forwarding methods
91
92 inline Internal::ScrollViewPageCarouselEffect& GetImpl(Dali::Toolkit::ScrollViewPageCarouselEffect& obj)
93 {
94   DALI_ASSERT_ALWAYS(obj);
95
96   Dali::RefObject& handle = obj.GetBaseObject();
97
98   return static_cast<Internal::ScrollViewPageCarouselEffect&>(handle);
99 }
100
101 inline const Internal::ScrollViewPageCarouselEffect& GetImpl(const Dali::Toolkit::ScrollViewPageCarouselEffect& obj)
102 {
103   DALI_ASSERT_ALWAYS(obj);
104
105   const Dali::RefObject& handle = obj.GetBaseObject();
106
107   return static_cast<const Internal::ScrollViewPageCarouselEffect&>(handle);
108 }
109
110 } // namespace Toolkit
111
112 } // namespace Dali
113
114 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__