367e7e4a0a0e8b49199c82edba68c3b4c343b0f2
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scroll-bar / scroll-bar.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/scroll-bar/scroll-bar.h>
19 #include <dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h>
20
21 namespace Dali
22 {
23
24 namespace Toolkit
25 {
26
27 const char* const ScrollBar::SCROLL_POSITION_NOTIFIED_SIGNAL_NAME = "scroll-position-notified";
28
29 ScrollBar::ScrollBar()
30 {
31 }
32
33 ScrollBar::ScrollBar(Internal::ScrollBar& implementation)
34 : ScrollComponent( implementation )
35 {
36 }
37
38 ScrollBar::ScrollBar( Dali::Internal::CustomActor* internal )
39 : ScrollComponent( internal )
40 {
41   VerifyCustomActorPointer<Internal::ScrollBar>(internal);
42 }
43
44 ScrollBar::ScrollBar( const ScrollBar& scrollBar )
45 : ScrollComponent( scrollBar )
46 {
47 }
48
49 ScrollBar& ScrollBar::operator=( const ScrollBar& scrollBar )
50 {
51   if( &scrollBar != this )
52   {
53     Control::operator=( scrollBar );
54   }
55   return *this;
56 }
57
58 ScrollBar ScrollBar::New()
59 {
60   return Internal::ScrollBar::New();
61 }
62
63 ScrollBar ScrollBar::DownCast( BaseHandle handle )
64 {
65   return Control::DownCast<ScrollBar, Internal::ScrollBar>(handle);
66 }
67
68 ScrollBar::~ScrollBar()
69 {
70 }
71
72 void ScrollBar::SetIndicatorImage( Image image )
73 {
74   GetImpl(*this).SetIndicatorImage(image);
75 }
76
77 Actor ScrollBar::GetScrollIndicator()
78 {
79   return GetImpl(*this).GetScrollIndicator();
80 }
81
82 void ScrollBar::SetPositionNotifications( const std::vector<float>& positions )
83 {
84   GetImpl(*this).SetPositionNotifications(positions);
85 }
86
87 void ScrollBar::SetIndicatorHeightPolicy( ScrollBar::IndicatorHeightPolicy policy )
88 {
89   GetImpl(*this).SetIndicatorHeightPolicy(policy);
90 }
91
92 ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy()
93 {
94   return GetImpl(*this).GetIndicatorHeightPolicy();
95 }
96
97 void ScrollBar::SetIndicatorFixedHeight( float height )
98 {
99   GetImpl(*this).SetIndicatorFixedHeight(height);
100 }
101
102 float ScrollBar::GetIndicatorFixedHeight()
103 {
104   return GetImpl(*this).GetIndicatorFixedHeight();
105 }
106
107 void ScrollBar::SetIndicatorShowDuration( float durationSeconds )
108 {
109   GetImpl(*this).SetIndicatorShowDuration(durationSeconds);
110 }
111
112 float ScrollBar::GetIndicatorShowDuration()
113 {
114   return GetImpl(*this).GetIndicatorShowDuration();
115 }
116
117 void ScrollBar::SetIndicatorHideDuration( float durationSeconds )
118 {
119   GetImpl(*this).SetIndicatorHideDuration(durationSeconds);
120 }
121
122 float ScrollBar::GetIndicatorHideDuration()
123 {
124   return GetImpl(*this).GetIndicatorHideDuration();
125 }
126
127 void ScrollBar::Show()
128 {
129   GetImpl(*this).Show();
130 }
131
132 void ScrollBar::Hide()
133 {
134   GetImpl(*this).Hide();
135 }
136
137 ScrollBar::ScrollPositionNotifiedSignalType& ScrollBar::ScrollPositionNotifiedSignal()
138 {
139   return GetImpl(*this).ScrollPositionNotifiedSignal();
140 }
141
142 } // namespace Toolkit
143
144 } // namespace Dali