9e708d09c76b2030cf99b999f549613746bf578e
[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 Flora License, Version 1.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://floralicense.org/license/
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 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
18 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
19
20 using namespace Dali;
21
22 namespace Dali
23 {
24
25 namespace Toolkit
26 {
27
28 const std::string Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME( "scroll-relative-position" );
29 const std::string Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME( "scroll-position-min" );
30 const std::string Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME( "scroll-position-max" );
31 const std::string Scrollable::SCROLL_DIRECTION_PROPERTY_NAME( "scroll-direction" );
32
33 const char* const Scrollable::SIGNAL_SCROLL_STARTED = "scroll-started";
34 const char* const Scrollable::SIGNAL_SCROLL_COMPLETED = "scroll-completed";
35 const char* const Scrollable::SIGNAL_SCROLL_UPDATED = "scroll-updated";
36 const char* const Scrollable::SIGNAL_SCROLL_CLAMPED = "scroll-clamped";
37
38 Scrollable::Scrollable()
39 {
40 }
41
42 Scrollable::Scrollable(Internal::Scrollable& implementation)
43 : Control(implementation)
44 {
45 }
46
47 Scrollable::Scrollable( Dali::Internal::CustomActor* internal )
48 : Control( internal )
49 {
50   VerifyCustomActorPointer<Internal::Scrollable>(internal);
51 }
52
53 Scrollable::Scrollable( const Scrollable& handle )
54 : Control( handle )
55 {
56 }
57
58 Scrollable& Scrollable::operator=( const Scrollable& handle )
59 {
60   if( &handle != this )
61   {
62     Control::operator=( handle );
63   }
64   return *this;
65 }
66
67 Scrollable::~Scrollable()
68 {
69 }
70
71 Scrollable Scrollable::DownCast( BaseHandle handle )
72 {
73   return Control::DownCast<Scrollable, Internal::Scrollable>(handle);
74 }
75
76 Scrollable::ScrollStartedSignalV2& Scrollable::ScrollStartedSignal()
77 {
78   return GetImpl(*this).ScrollStartedSignal();
79 }
80
81 Scrollable::ScrollUpdatedSignalV2& Scrollable::ScrollUpdatedSignal()
82 {
83   return GetImpl(*this).ScrollUpdatedSignal();
84 }
85
86 Scrollable::ScrollCompletedSignalV2& Scrollable::ScrollCompletedSignal()
87 {
88   return GetImpl(*this).ScrollCompletedSignal();
89 }
90
91 Scrollable::ScrollClampedSignalV2& Scrollable::ScrollClampedSignal()
92 {
93   return GetImpl(*this).ScrollClampedSignal();
94 }
95
96 bool Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType indicator) const
97 {
98   return GetImpl(*this).IsScrollComponentEnabled(indicator);
99 }
100
101 void Scrollable::EnableScrollComponent(Scrollable::ScrollComponentType indicator)
102 {
103   GetImpl(*this).EnableScrollComponent(indicator);
104 }
105
106 void Scrollable::DisableScrollComponent(Scrollable::ScrollComponentType indicator)
107 {
108   GetImpl(*this).DisableScrollComponent(indicator);
109 }
110
111 } // namespace Toolkit
112
113 } // namespace Dali