Formatting API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / scroll-bar / scroll-bar.cpp
1 /*
2  * Copyright (c) 2020 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 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 ScrollBar::ScrollBar()
29 {
30 }
31
32 ScrollBar::ScrollBar(Internal::ScrollBar& implementation)
33 : Control(implementation)
34 {
35 }
36
37 ScrollBar::ScrollBar(Dali::Internal::CustomActor* internal)
38 : Control(internal)
39 {
40   VerifyCustomActorPointer<Internal::ScrollBar>(internal);
41 }
42
43 ScrollBar::ScrollBar(const ScrollBar& handle)
44 : Control(handle)
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(ScrollBar::Direction direction)
58 {
59   return Internal::ScrollBar::New(direction);
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::SetScrollPropertySource(Handle handle, Dali::Property::Index propertyScrollPosition, Dali::Property::Index propertyMinScrollPosition, Dali::Property::Index propertyMaxScrollPosition, Dali::Property::Index propertyScrollContentSize)
72 {
73   GetImpl(*this).SetScrollPropertySource(handle, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
74 }
75
76 void ScrollBar::SetScrollIndicator(Actor indicator)
77 {
78   GetImpl(*this).SetScrollIndicator(indicator);
79 }
80
81 Actor ScrollBar::GetScrollIndicator()
82 {
83   return GetImpl(*this).GetScrollIndicator();
84 }
85
86 void ScrollBar::SetScrollPositionIntervals(const Dali::Vector<float>& positions)
87 {
88   GetImpl(*this).SetScrollPositionIntervals(positions);
89 }
90
91 Dali::Vector<float> ScrollBar::GetScrollPositionIntervals() const
92 {
93   return GetImpl(*this).GetScrollPositionIntervals();
94 }
95
96 void ScrollBar::SetScrollDirection(ScrollBar::Direction direction)
97 {
98   GetImpl(*this).SetScrollDirection(direction);
99 }
100
101 ScrollBar::Direction ScrollBar::GetScrollDirection() const
102 {
103   return GetImpl(*this).GetScrollDirection();
104 }
105
106 void ScrollBar::SetIndicatorHeightPolicy(ScrollBar::IndicatorHeightPolicy policy)
107 {
108   GetImpl(*this).SetIndicatorHeightPolicy(policy);
109 }
110
111 ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy() const
112 {
113   return GetImpl(*this).GetIndicatorHeightPolicy();
114 }
115
116 void ScrollBar::SetIndicatorFixedHeight(float height)
117 {
118   GetImpl(*this).SetIndicatorFixedHeight(height);
119 }
120
121 float ScrollBar::GetIndicatorFixedHeight() const
122 {
123   return GetImpl(*this).GetIndicatorFixedHeight();
124 }
125
126 void ScrollBar::SetIndicatorShowDuration(float durationSeconds)
127 {
128   GetImpl(*this).SetIndicatorShowDuration(durationSeconds);
129 }
130
131 float ScrollBar::GetIndicatorShowDuration() const
132 {
133   return GetImpl(*this).GetIndicatorShowDuration();
134 }
135
136 void ScrollBar::SetIndicatorHideDuration(float durationSeconds)
137 {
138   GetImpl(*this).SetIndicatorHideDuration(durationSeconds);
139 }
140
141 float ScrollBar::GetIndicatorHideDuration() const
142 {
143   return GetImpl(*this).GetIndicatorHideDuration();
144 }
145
146 void ScrollBar::ShowIndicator()
147 {
148   GetImpl(*this).ShowIndicator();
149 }
150
151 void ScrollBar::HideIndicator()
152 {
153   GetImpl(*this).HideIndicator();
154 }
155
156 ScrollBar::PanFinishedSignalType& ScrollBar::PanFinishedSignal()
157 {
158   return GetImpl(*this).PanFinishedSignal();
159 }
160
161 ScrollBar::ScrollPositionIntervalReachedSignalType& ScrollBar::ScrollPositionIntervalReachedSignal()
162 {
163   return GetImpl(*this).ScrollPositionIntervalReachedSignal();
164 }
165
166 } // namespace Toolkit
167
168 } // namespace Dali