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