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