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/public-api/controls/scrollable/scrollable.h>
19 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
20 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
32 ItemView::ItemView(Internal::ItemView& implementation)
33 : Scrollable(implementation)
37 ItemView::ItemView( Dali::Internal::CustomActor* internal )
38 : Scrollable(internal)
40 VerifyCustomActorPointer<Internal::ItemView>(internal);
43 ItemView::ItemView( const ItemView& itemView ) = default;
45 ItemView::ItemView( ItemView&& rhs ) = default;
47 ItemView& ItemView::operator=( const ItemView& itemView ) = default;
49 ItemView& ItemView::operator=( ItemView&& rhs ) = default;
51 ItemView ItemView::New(ItemFactory& factory)
53 return Internal::ItemView::New(factory);
56 ItemView ItemView::DownCast( BaseHandle handle )
58 return Control::DownCast<ItemView, Internal::ItemView>(handle);
65 unsigned int ItemView::GetLayoutCount() const
67 return GetImpl(*this).GetLayoutCount();
70 void ItemView::AddLayout(ItemLayout& layout)
72 GetImpl(*this).AddLayout(layout);
75 void ItemView::RemoveLayout(unsigned int layoutIndex)
77 GetImpl(*this).RemoveLayout(layoutIndex);
80 ItemLayoutPtr ItemView::GetLayout(unsigned int layoutIndex) const
82 return GetImpl(*this).GetLayout(layoutIndex);
85 ItemLayoutPtr ItemView::GetActiveLayout() const
87 return GetImpl(*this).GetActiveLayout();
90 float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
92 return GetImpl(*this).GetCurrentLayoutPosition(itemId);
95 void ItemView::ActivateLayout(unsigned int layoutIndex, Vector3 targetSize, float durationSeconds)
97 GetImpl(*this).ActivateLayout(layoutIndex, targetSize, durationSeconds);
100 void ItemView::DeactivateCurrentLayout()
102 GetImpl(*this).DeactivateCurrentLayout();
105 void ItemView::SetMinimumSwipeSpeed(float speed)
107 GetImpl(*this).SetMinimumSwipeSpeed(speed);
110 float ItemView::GetMinimumSwipeSpeed() const
112 return GetImpl(*this).GetMinimumSwipeSpeed();
115 void ItemView::SetMinimumSwipeDistance(float distance)
117 GetImpl(*this).SetMinimumSwipeDistance(distance);
120 float ItemView::GetMinimumSwipeDistance() const
122 return GetImpl(*this).GetMinimumSwipeDistance();
125 void ItemView::SetWheelScrollDistanceStep(float step)
127 GetImpl(*this).SetWheelScrollDistanceStep(step);
130 float ItemView::GetWheelScrollDistanceStep() const
132 return GetImpl(*this).GetWheelScrollDistanceStep();
135 void ItemView::SetAnchoring(bool enabled)
137 GetImpl(*this).SetAnchoring(enabled);
140 bool ItemView::GetAnchoring() const
142 return GetImpl(*this).GetAnchoring();
145 void ItemView::SetAnchoringDuration(float durationSeconds)
147 GetImpl(*this).SetAnchoringDuration(durationSeconds);
150 float ItemView::GetAnchoringDuration() const
152 return GetImpl(*this).GetAnchoringDuration();
155 void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
157 GetImpl(*this).ScrollToItem(itemId, durationSeconds);
160 void ItemView::SetRefreshInterval(float intervalLayoutPositions)
162 GetImpl(*this).SetRefreshInterval(intervalLayoutPositions);
165 float ItemView::GetRefreshInterval() const
167 return GetImpl(*this).GetRefreshInterval();
170 void ItemView::Refresh()
172 return GetImpl(*this).Refresh();
175 Actor ItemView::GetItem(unsigned int itemId) const
177 return GetImpl(*this).GetItem(itemId);
180 unsigned int ItemView::GetItemId(Actor actor) const
182 return GetImpl(*this).GetItemId(actor);
185 void ItemView::InsertItem(Item newItem, float durationSeconds)
187 GetImpl(*this).InsertItem( newItem, durationSeconds );
190 void ItemView::InsertItems(const ItemContainer& newItems, float durationSeconds)
192 GetImpl(*this).InsertItems( newItems, durationSeconds );
195 void ItemView::RemoveItem(unsigned int itemId, float durationSeconds)
197 GetImpl(*this).RemoveItem( itemId, durationSeconds );
200 void ItemView::RemoveItems(const ItemIdContainer& itemIds, float durationSeconds)
202 GetImpl(*this).RemoveItems( itemIds, durationSeconds );
205 void ItemView::ReplaceItem(Item replacementItem, float durationSeconds)
207 GetImpl(*this).ReplaceItem( replacementItem, durationSeconds );
210 void ItemView::ReplaceItems(const ItemContainer& replacementItems, float durationSeconds)
212 GetImpl(*this).ReplaceItems( replacementItems, durationSeconds );
215 void ItemView::SetItemsParentOrigin( const Vector3& parentOrigin )
217 GetImpl(*this).SetItemsParentOrigin( parentOrigin );
220 Vector3 ItemView::GetItemsParentOrigin() const
222 return GetImpl(*this).GetItemsParentOrigin();
225 void ItemView::SetItemsAnchorPoint( const Vector3& anchorPoint )
227 GetImpl(*this).SetItemsAnchorPoint(anchorPoint);
230 Vector3 ItemView::GetItemsAnchorPoint() const
232 return GetImpl(*this).GetItemsAnchorPoint();
235 void ItemView::GetItemsRange(ItemRange& range)
237 GetImpl(*this).GetItemsRange(range);
240 ItemView::LayoutActivatedSignalType& ItemView::LayoutActivatedSignal()
242 return GetImpl(*this).LayoutActivatedSignal();
245 } // namespace Toolkit