Formatting API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / item-view / item-view.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 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
19 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
20 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
21
22 namespace Dali
23 {
24 namespace Toolkit
25 {
26 ItemView::ItemView()
27 {
28 }
29
30 ItemView::ItemView(Internal::ItemView& implementation)
31 : Scrollable(implementation)
32 {
33 }
34
35 ItemView::ItemView(Dali::Internal::CustomActor* internal)
36 : Scrollable(internal)
37 {
38   VerifyCustomActorPointer<Internal::ItemView>(internal);
39 }
40
41 ItemView::ItemView(const ItemView& itemView) = default;
42
43 ItemView::ItemView(ItemView&& rhs) = default;
44
45 ItemView& ItemView::operator=(const ItemView& itemView) = default;
46
47 ItemView& ItemView::operator=(ItemView&& rhs) = default;
48
49 ItemView ItemView::New(ItemFactory& factory)
50 {
51   return Internal::ItemView::New(factory);
52 }
53
54 ItemView ItemView::DownCast(BaseHandle handle)
55 {
56   return Control::DownCast<ItemView, Internal::ItemView>(handle);
57 }
58
59 ItemView::~ItemView()
60 {
61 }
62
63 unsigned int ItemView::GetLayoutCount() const
64 {
65   return GetImpl(*this).GetLayoutCount();
66 }
67
68 void ItemView::AddLayout(ItemLayout& layout)
69 {
70   GetImpl(*this).AddLayout(layout);
71 }
72
73 void ItemView::RemoveLayout(unsigned int layoutIndex)
74 {
75   GetImpl(*this).RemoveLayout(layoutIndex);
76 }
77
78 ItemLayoutPtr ItemView::GetLayout(unsigned int layoutIndex) const
79 {
80   return GetImpl(*this).GetLayout(layoutIndex);
81 }
82
83 ItemLayoutPtr ItemView::GetActiveLayout() const
84 {
85   return GetImpl(*this).GetActiveLayout();
86 }
87
88 float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
89 {
90   return GetImpl(*this).GetCurrentLayoutPosition(itemId);
91 }
92
93 void ItemView::ActivateLayout(unsigned int layoutIndex, Vector3 targetSize, float durationSeconds)
94 {
95   GetImpl(*this).ActivateLayout(layoutIndex, targetSize, durationSeconds);
96 }
97
98 void ItemView::DeactivateCurrentLayout()
99 {
100   GetImpl(*this).DeactivateCurrentLayout();
101 }
102
103 void ItemView::SetMinimumSwipeSpeed(float speed)
104 {
105   GetImpl(*this).SetMinimumSwipeSpeed(speed);
106 }
107
108 float ItemView::GetMinimumSwipeSpeed() const
109 {
110   return GetImpl(*this).GetMinimumSwipeSpeed();
111 }
112
113 void ItemView::SetMinimumSwipeDistance(float distance)
114 {
115   GetImpl(*this).SetMinimumSwipeDistance(distance);
116 }
117
118 float ItemView::GetMinimumSwipeDistance() const
119 {
120   return GetImpl(*this).GetMinimumSwipeDistance();
121 }
122
123 void ItemView::SetWheelScrollDistanceStep(float step)
124 {
125   GetImpl(*this).SetWheelScrollDistanceStep(step);
126 }
127
128 float ItemView::GetWheelScrollDistanceStep() const
129 {
130   return GetImpl(*this).GetWheelScrollDistanceStep();
131 }
132
133 void ItemView::SetAnchoring(bool enabled)
134 {
135   GetImpl(*this).SetAnchoring(enabled);
136 }
137
138 bool ItemView::GetAnchoring() const
139 {
140   return GetImpl(*this).GetAnchoring();
141 }
142
143 void ItemView::SetAnchoringDuration(float durationSeconds)
144 {
145   GetImpl(*this).SetAnchoringDuration(durationSeconds);
146 }
147
148 float ItemView::GetAnchoringDuration() const
149 {
150   return GetImpl(*this).GetAnchoringDuration();
151 }
152
153 void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
154 {
155   GetImpl(*this).ScrollToItem(itemId, durationSeconds);
156 }
157
158 void ItemView::SetRefreshInterval(float intervalLayoutPositions)
159 {
160   GetImpl(*this).SetRefreshInterval(intervalLayoutPositions);
161 }
162
163 float ItemView::GetRefreshInterval() const
164 {
165   return GetImpl(*this).GetRefreshInterval();
166 }
167
168 void ItemView::Refresh()
169 {
170   return GetImpl(*this).Refresh();
171 }
172
173 Actor ItemView::GetItem(unsigned int itemId) const
174 {
175   return GetImpl(*this).GetItem(itemId);
176 }
177
178 unsigned int ItemView::GetItemId(Actor actor) const
179 {
180   return GetImpl(*this).GetItemId(actor);
181 }
182
183 void ItemView::InsertItem(Item newItem, float durationSeconds)
184 {
185   GetImpl(*this).InsertItem(newItem, durationSeconds);
186 }
187
188 void ItemView::InsertItems(const ItemContainer& newItems, float durationSeconds)
189 {
190   GetImpl(*this).InsertItems(newItems, durationSeconds);
191 }
192
193 void ItemView::RemoveItem(unsigned int itemId, float durationSeconds)
194 {
195   GetImpl(*this).RemoveItem(itemId, durationSeconds);
196 }
197
198 void ItemView::RemoveItems(const ItemIdContainer& itemIds, float durationSeconds)
199 {
200   GetImpl(*this).RemoveItems(itemIds, durationSeconds);
201 }
202
203 void ItemView::ReplaceItem(Item replacementItem, float durationSeconds)
204 {
205   GetImpl(*this).ReplaceItem(replacementItem, durationSeconds);
206 }
207
208 void ItemView::ReplaceItems(const ItemContainer& replacementItems, float durationSeconds)
209 {
210   GetImpl(*this).ReplaceItems(replacementItems, durationSeconds);
211 }
212
213 void ItemView::SetItemsParentOrigin(const Vector3& parentOrigin)
214 {
215   GetImpl(*this).SetItemsParentOrigin(parentOrigin);
216 }
217
218 Vector3 ItemView::GetItemsParentOrigin() const
219 {
220   return GetImpl(*this).GetItemsParentOrigin();
221 }
222
223 void ItemView::SetItemsAnchorPoint(const Vector3& anchorPoint)
224 {
225   GetImpl(*this).SetItemsAnchorPoint(anchorPoint);
226 }
227
228 Vector3 ItemView::GetItemsAnchorPoint() const
229 {
230   return GetImpl(*this).GetItemsAnchorPoint();
231 }
232
233 void ItemView::GetItemsRange(ItemRange& range)
234 {
235   GetImpl(*this).GetItemsRange(range);
236 }
237
238 ItemView::LayoutActivatedSignalType& ItemView::LayoutActivatedSignal()
239 {
240   return GetImpl(*this).LayoutActivatedSignal();
241 }
242
243 } // namespace Toolkit
244
245 } // namespace Dali