Conversion to Apache 2.0 license
[platform/core/uifw/dali-toolkit.git] / base / 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::SetBackgroundImage( Image image, const Vector4& border )
73 {
74   GetImpl(*this).SetBackgroundImage(image, border);
75 }
76
77 void ScrollBar::SetIndicatorImage( Image image )
78 {
79   GetImpl(*this).SetIndicatorImage(image);
80 }
81
82 void ScrollBar::SetIndicatorImage( Image image, const Vector4& border )
83 {
84   GetImpl(*this).SetIndicatorImage(image, border);
85 }
86
87 Actor ScrollBar::GetScrollIndicator()
88 {
89   return GetImpl(*this).GetScrollIndicator();
90 }
91
92 void ScrollBar::SetPositionNotifications( const std::vector<float>& positions )
93 {
94   GetImpl(*this).SetPositionNotifications(positions);
95 }
96
97 void ScrollBar::SetIndicatorHeightPolicy( ScrollBar::IndicatorHeightPolicy policy )
98 {
99   GetImpl(*this).SetIndicatorHeightPolicy(policy);
100 }
101
102 ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy()
103 {
104   return GetImpl(*this).GetIndicatorHeightPolicy();
105 }
106
107 void ScrollBar::SetIndicatorFixedHeight( float height )
108 {
109   GetImpl(*this).SetIndicatorFixedHeight(height);
110 }
111
112 float ScrollBar::GetIndicatorFixedHeight()
113 {
114   return GetImpl(*this).GetIndicatorFixedHeight();
115 }
116
117 void ScrollBar::Show()
118 {
119   GetImpl(*this).Show();
120 }
121
122 void ScrollBar::Hide()
123 {
124   GetImpl(*this).Hide();
125 }
126
127 ScrollBar::ScrollPositionNotifiedSignalType& ScrollBar::ScrollPositionNotifiedSignal()
128 {
129   return GetImpl(*this).ScrollPositionNotifiedSignal();
130 }
131
132 } // namespace Toolkit
133
134 } // namespace Dali