2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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>
30 ItemView::ItemView(Internal::ItemView& implementation)
31 : Scrollable(implementation)
35 ItemView::ItemView(Dali::Internal::CustomActor* internal)
36 : Scrollable(internal)
38 VerifyCustomActorPointer<Internal::ItemView>(internal);
41 ItemView::ItemView(const ItemView& itemView) = default;
43 ItemView::ItemView(ItemView&& rhs) = default;
45 ItemView& ItemView::operator=(const ItemView& itemView) = default;
47 ItemView& ItemView::operator=(ItemView&& rhs) = default;
49 ItemView ItemView::New(ItemFactory& factory)
51 return Internal::ItemView::New(factory);
54 ItemView ItemView::DownCast(BaseHandle handle)
56 return Control::DownCast<ItemView, Internal::ItemView>(handle);
63 unsigned int ItemView::GetLayoutCount() const
65 return GetImpl(*this).GetLayoutCount();
68 void ItemView::AddLayout(ItemLayout& layout)
70 GetImpl(*this).AddLayout(layout);
73 void ItemView::RemoveLayout(unsigned int layoutIndex)
75 GetImpl(*this).RemoveLayout(layoutIndex);
78 ItemLayoutPtr ItemView::GetLayout(unsigned int layoutIndex) const
80 return GetImpl(*this).GetLayout(layoutIndex);
83 ItemLayoutPtr ItemView::GetActiveLayout() const
85 return GetImpl(*this).GetActiveLayout();
88 float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
90 return GetImpl(*this).GetCurrentLayoutPosition(itemId);
93 void ItemView::ActivateLayout(unsigned int layoutIndex, Vector3 targetSize, float durationSeconds)
95 GetImpl(*this).ActivateLayout(layoutIndex, targetSize, durationSeconds);
98 void ItemView::DeactivateCurrentLayout()
100 GetImpl(*this).DeactivateCurrentLayout();
103 void ItemView::SetMinimumSwipeSpeed(float speed)
105 GetImpl(*this).SetMinimumSwipeSpeed(speed);
108 float ItemView::GetMinimumSwipeSpeed() const
110 return GetImpl(*this).GetMinimumSwipeSpeed();
113 void ItemView::SetMinimumSwipeDistance(float distance)
115 GetImpl(*this).SetMinimumSwipeDistance(distance);
118 float ItemView::GetMinimumSwipeDistance() const
120 return GetImpl(*this).GetMinimumSwipeDistance();
123 void ItemView::SetWheelScrollDistanceStep(float step)
125 GetImpl(*this).SetWheelScrollDistanceStep(step);
128 float ItemView::GetWheelScrollDistanceStep() const
130 return GetImpl(*this).GetWheelScrollDistanceStep();
133 void ItemView::SetAnchoring(bool enabled)
135 GetImpl(*this).SetAnchoring(enabled);
138 bool ItemView::GetAnchoring() const
140 return GetImpl(*this).GetAnchoring();
143 void ItemView::SetAnchoringDuration(float durationSeconds)
145 GetImpl(*this).SetAnchoringDuration(durationSeconds);
148 float ItemView::GetAnchoringDuration() const
150 return GetImpl(*this).GetAnchoringDuration();
153 void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
155 GetImpl(*this).ScrollToItem(itemId, durationSeconds);
158 void ItemView::SetRefreshInterval(float intervalLayoutPositions)
160 GetImpl(*this).SetRefreshInterval(intervalLayoutPositions);
163 float ItemView::GetRefreshInterval() const
165 return GetImpl(*this).GetRefreshInterval();
168 void ItemView::Refresh()
170 return GetImpl(*this).Refresh();
173 Actor ItemView::GetItem(unsigned int itemId) const
175 return GetImpl(*this).GetItem(itemId);
178 unsigned int ItemView::GetItemId(Actor actor) const
180 return GetImpl(*this).GetItemId(actor);
183 void ItemView::InsertItem(Item newItem, float durationSeconds)
185 GetImpl(*this).InsertItem(newItem, durationSeconds);
188 void ItemView::InsertItems(const ItemContainer& newItems, float durationSeconds)
190 GetImpl(*this).InsertItems(newItems, durationSeconds);
193 void ItemView::RemoveItem(unsigned int itemId, float durationSeconds)
195 GetImpl(*this).RemoveItem(itemId, durationSeconds);
198 void ItemView::RemoveItems(const ItemIdContainer& itemIds, float durationSeconds)
200 GetImpl(*this).RemoveItems(itemIds, durationSeconds);
203 void ItemView::ReplaceItem(Item replacementItem, float durationSeconds)
205 GetImpl(*this).ReplaceItem(replacementItem, durationSeconds);
208 void ItemView::ReplaceItems(const ItemContainer& replacementItems, float durationSeconds)
210 GetImpl(*this).ReplaceItems(replacementItems, durationSeconds);
213 void ItemView::SetItemsParentOrigin(const Vector3& parentOrigin)
215 GetImpl(*this).SetItemsParentOrigin(parentOrigin);
218 Vector3 ItemView::GetItemsParentOrigin() const
220 return GetImpl(*this).GetItemsParentOrigin();
223 void ItemView::SetItemsAnchorPoint(const Vector3& anchorPoint)
225 GetImpl(*this).SetItemsAnchorPoint(anchorPoint);
228 Vector3 ItemView::GetItemsAnchorPoint() const
230 return GetImpl(*this).GetItemsAnchorPoint();
233 void ItemView::GetItemsRange(ItemRange& range)
235 GetImpl(*this).GetItemsRange(range);
238 ItemView::LayoutActivatedSignalType& ItemView::LayoutActivatedSignal()
240 return GetImpl(*this).LayoutActivatedSignal();
243 } // namespace Toolkit