New Bouncing Effect
[platform/core/uifw/dali-toolkit.git] / base / 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 const char* const Scrollable::SIGNAL_SCROLL_STARTED = "scroll-started";
35 const char* const Scrollable::SIGNAL_SCROLL_COMPLETED = "scroll-completed";
36 const char* const Scrollable::SIGNAL_SCROLL_UPDATED = "scroll-updated";
37 const char* const Scrollable::SIGNAL_SCROLL_CLAMPED = "scroll-clamped";
38
39 Scrollable::Scrollable()
40 {
41 }
42
43 Scrollable::Scrollable(Internal::Scrollable& implementation)
44 : Control(implementation)
45 {
46 }
47
48 Scrollable::Scrollable( Dali::Internal::CustomActor* internal )
49 : Control( internal )
50 {
51   VerifyCustomActorPointer<Internal::Scrollable>(internal);
52 }
53
54 Scrollable::Scrollable( const Scrollable& handle )
55 : Control( handle )
56 {
57 }
58
59 Scrollable& Scrollable::operator=( const Scrollable& handle )
60 {
61   if( &handle != this )
62   {
63     Control::operator=( handle );
64   }
65   return *this;
66 }
67
68 Scrollable::~Scrollable()
69 {
70 }
71
72 Scrollable Scrollable::DownCast( BaseHandle handle )
73 {
74   return Control::DownCast<Scrollable, Internal::Scrollable>(handle);
75 }
76
77 Scrollable::ScrollStartedSignalV2& Scrollable::ScrollStartedSignal()
78 {
79   return GetImpl(*this).ScrollStartedSignal();
80 }
81
82 Scrollable::ScrollUpdatedSignalV2& Scrollable::ScrollUpdatedSignal()
83 {
84   return GetImpl(*this).ScrollUpdatedSignal();
85 }
86
87 Scrollable::ScrollCompletedSignalV2& Scrollable::ScrollCompletedSignal()
88 {
89   return GetImpl(*this).ScrollCompletedSignal();
90 }
91
92 Scrollable::ScrollClampedSignalV2& Scrollable::ScrollClampedSignal()
93 {
94   return GetImpl(*this).ScrollClampedSignal();
95 }
96
97 bool Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType indicator) const
98 {
99   return GetImpl(*this).IsScrollComponentEnabled(indicator);
100 }
101
102 void Scrollable::EnableScrollComponent(Scrollable::ScrollComponentType indicator)
103 {
104   GetImpl(*this).EnableScrollComponent(indicator);
105 }
106
107 void Scrollable::DisableScrollComponent(Scrollable::ScrollComponentType indicator)
108 {
109   GetImpl(*this).DisableScrollComponent(indicator);
110 }
111
112 void Scrollable::SetOvershootEffectColor( const Vector4& color )
113 {
114   GetImpl(*this).SetOvershootEffectColor(color);
115 }
116
117 Vector4 Scrollable::GetOvershootEffectColor() const
118 {
119   return GetImpl(*this).GetOvershootEffectColor();
120 }
121
122 } // namespace Toolkit
123
124 } // namespace Dali