Merge "Scrollable public API clean-up phase 1" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / scrollable.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/scrollable.h>
19 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
20
21 using namespace Dali;
22
23 namespace Dali
24 {
25
26 namespace Toolkit
27 {
28
29 const std::string Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME( "scroll-relative-position" );
30 const std::string Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME( "scroll-position-min" );
31 const std::string Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME( "scroll-position-max" );
32 const std::string Scrollable::SCROLL_DIRECTION_PROPERTY_NAME( "scroll-direction" );
33
34 Scrollable::Scrollable()
35 {
36 }
37
38 Scrollable::Scrollable(Internal::Scrollable& implementation)
39 : Control(implementation)
40 {
41 }
42
43 Scrollable::Scrollable( Dali::Internal::CustomActor* internal )
44 : Control( internal )
45 {
46   VerifyCustomActorPointer<Internal::Scrollable>(internal);
47 }
48
49 Scrollable::Scrollable( const Scrollable& handle )
50 : Control( handle )
51 {
52 }
53
54 Scrollable& Scrollable::operator=( const Scrollable& handle )
55 {
56   if( &handle != this )
57   {
58     Control::operator=( handle );
59   }
60   return *this;
61 }
62
63 Scrollable::~Scrollable()
64 {
65 }
66
67 Scrollable Scrollable::DownCast( BaseHandle handle )
68 {
69   return Control::DownCast<Scrollable, Internal::Scrollable>(handle);
70 }
71
72 Scrollable::ScrollStartedSignalType& Scrollable::ScrollStartedSignal()
73 {
74   return GetImpl(*this).ScrollStartedSignal();
75 }
76
77 Scrollable::ScrollUpdatedSignalType& Scrollable::ScrollUpdatedSignal()
78 {
79   return GetImpl(*this).ScrollUpdatedSignal();
80 }
81
82 Scrollable::ScrollCompletedSignalType& Scrollable::ScrollCompletedSignal()
83 {
84   return GetImpl(*this).ScrollCompletedSignal();
85 }
86
87 bool Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType indicator) const
88 {
89   return GetImpl(*this).IsScrollComponentEnabled(indicator);
90 }
91
92 void Scrollable::EnableScrollComponent(Scrollable::ScrollComponentType indicator)
93 {
94   GetImpl(*this).EnableScrollComponent(indicator);
95 }
96
97 void Scrollable::DisableScrollComponent(Scrollable::ScrollComponentType indicator)
98 {
99   GetImpl(*this).DisableScrollComponent(indicator);
100 }
101
102 void Scrollable::SetOvershootEffectColor( const Vector4& color )
103 {
104   GetImpl(*this).SetOvershootEffectColor(color);
105 }
106
107 Vector4 Scrollable::GetOvershootEffectColor() const
108 {
109   return GetImpl(*this).GetOvershootEffectColor();
110 }
111
112 void Scrollable::SetOvershootAnimationSpeed( float pixelsPerSecond )
113 {
114   GetImpl(*this).SetOvershootAnimationSpeed(pixelsPerSecond);
115 }
116
117 float Scrollable::GetOvershootAnimationSpeed() const
118 {
119   return GetImpl(*this).GetOvershootAnimationSpeed();
120 }
121
122 } // namespace Toolkit
123
124 } // namespace Dali