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