1219ca924a2cec6352d5f6db420e153ae079f240
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-slide-effect.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
19 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
20 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-slide-effect-impl.h>
21
22 using namespace Dali;
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 const std::string ScrollViewSlideEffect::EFFECT_TIME( "ScrollViewSlideEffect::EFFECT_TIME" );
31 const std::string ScrollViewSlideEffect::EFFECT_REFERENCE( "ScrollViewSlideEffect::EFFECT_REFERENCE" );
32 const std::string ScrollViewSlideEffect::EFFECT_ACTIVE( "ScrollViewSlideEffect::EFFECT_ACTIVE" );
33
34 ScrollViewSlideEffect ScrollViewSlideEffect::New()
35 {
36   return ScrollViewSlideEffect(new Internal::ScrollViewSlideEffect());
37 }
38
39 ScrollViewSlideEffect::ScrollViewSlideEffect()
40 {
41
42 }
43
44 ScrollViewSlideEffect::ScrollViewSlideEffect(Internal::ScrollViewSlideEffect *impl)
45 : ScrollViewEffect(impl)
46 {
47 }
48
49 bool ScrollViewSlideEffect::GetSlideDirection() const
50 {
51   return GetImpl(*this).GetSlideDirection();
52 }
53
54 void ScrollViewSlideEffect::SetSlideDirection(bool vertical)
55 {
56   GetImpl(*this).SetSlideDirection( vertical );
57 }
58
59 Vector3 ScrollViewSlideEffect::GetDelayReferenceOffset() const
60 {
61   return GetImpl(*this).GetDelayReferenceOffset();
62 }
63
64 void ScrollViewSlideEffect::SetDelayReferenceOffset(const Vector3& offset)
65 {
66   GetImpl(*this).SetDelayReferenceOffset(offset);
67 }
68
69 float ScrollViewSlideEffect::GetMaxDelayDuration() const
70 {
71   return GetImpl(*this).GetMaxDelayDuration();
72 }
73
74 void ScrollViewSlideEffect::SetMaxDelayDuration(float offset)
75 {
76   GetImpl(*this).SetMaxDelayDuration(offset);
77 }
78
79 ScrollViewSlideEffect ScrollViewSlideEffect::DownCast( BaseHandle handle )
80 {
81   return ScrollViewSlideEffect( dynamic_cast<Internal::ScrollViewSlideEffect*>(handle.GetObjectPtr()) );
82 }
83
84 void ScrollViewSlideEffect::ApplyToActor( Actor child,
85                                           float delayMin,
86                                           float delayMax )
87 {
88   GetImpl(*this).ApplyToActor( child,
89                                delayMin,
90                                delayMax );
91 }
92
93 } // namespace Toolkit
94
95 } // namespace Dali