2 * Copyright (c) 2015 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 )
44 : Scrollable(itemView)
48 ItemView& ItemView::operator=( const ItemView& itemView )
50 if( &itemView != this )
52 Control::operator=( itemView );
57 ItemView ItemView::New(ItemFactory& factory)
59 return Internal::ItemView::New(factory);
62 ItemView ItemView::DownCast( BaseHandle handle )
64 return Control::DownCast<ItemView, Internal::ItemView>(handle);
71 unsigned int ItemView::GetLayoutCount() const
73 return GetImpl(*this).GetLayoutCount();
76 void ItemView::AddLayout(ItemLayout& layout)
78 GetImpl(*this).AddLayout(layout);
81 void ItemView::RemoveLayout(unsigned int layoutIndex)
83 GetImpl(*this).RemoveLayout(layoutIndex);
86 ItemLayoutPtr ItemView::GetLayout(unsigned int layoutIndex) const
88 return GetImpl(*this).GetLayout(layoutIndex);
91 ItemLayoutPtr ItemView::GetActiveLayout() const
93 return GetImpl(*this).GetActiveLayout();
96 float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
98 return GetImpl(*this).GetCurrentLayoutPosition(itemId);
101 void ItemView::ActivateLayout(unsigned int layoutIndex, Vector3 targetSize, float durationSeconds)
103 GetImpl(*this).ActivateLayout(layoutIndex, targetSize, durationSeconds);
106 void ItemView::DeactivateCurrentLayout()
108 GetImpl(*this).DeactivateCurrentLayout();
111 void ItemView::SetMinimumSwipeSpeed(float speed)
113 GetImpl(*this).SetMinimumSwipeSpeed(speed);
116 float ItemView::GetMinimumSwipeSpeed() const
118 return GetImpl(*this).GetMinimumSwipeSpeed();
121 void ItemView::SetMinimumSwipeDistance(float distance)
123 GetImpl(*this).SetMinimumSwipeDistance(distance);
126 float ItemView::GetMinimumSwipeDistance() const
128 return GetImpl(*this).GetMinimumSwipeDistance();
131 void ItemView::SetWheelScrollDistanceStep(float step)
133 GetImpl(*this).SetWheelScrollDistanceStep(step);
136 float ItemView::GetWheelScrollDistanceStep() const
138 return GetImpl(*this).GetWheelScrollDistanceStep();
141 void ItemView::SetAnchoring(bool enabled)
143 GetImpl(*this).SetAnchoring(enabled);
146 bool ItemView::GetAnchoring() const
148 return GetImpl(*this).GetAnchoring();
151 void ItemView::SetAnchoringDuration(float durationSeconds)
153 GetImpl(*this).SetAnchoringDuration(durationSeconds);
156 float ItemView::GetAnchoringDuration() const
158 return GetImpl(*this).GetAnchoringDuration();
161 void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
163 GetImpl(*this).ScrollToItem(itemId, durationSeconds);
166 void ItemView::SetRefreshInterval(float intervalLayoutPositions)
168 GetImpl(*this).SetRefreshInterval(intervalLayoutPositions);
171 float ItemView::GetRefreshInterval() const
173 return GetImpl(*this).GetRefreshInterval();
176 void ItemView::Refresh()
178 return GetImpl(*this).Refresh();
181 Actor ItemView::GetItem(unsigned int itemId) const
183 return GetImpl(*this).GetItem(itemId);
186 unsigned int ItemView::GetItemId(Actor actor) const
188 return GetImpl(*this).GetItemId(actor);
191 void ItemView::InsertItem(Item newItem, float durationSeconds)
193 GetImpl(*this).InsertItem( newItem, durationSeconds );
196 void ItemView::InsertItems(const ItemContainer& newItems, float durationSeconds)
198 GetImpl(*this).InsertItems( newItems, durationSeconds );
201 void ItemView::RemoveItem(unsigned int itemId, float durationSeconds)
203 GetImpl(*this).RemoveItem( itemId, durationSeconds );
206 void ItemView::RemoveItems(const ItemIdContainer& itemIds, float durationSeconds)
208 GetImpl(*this).RemoveItems( itemIds, durationSeconds );
211 void ItemView::ReplaceItem(Item replacementItem, float durationSeconds)
213 GetImpl(*this).ReplaceItem( replacementItem, durationSeconds );
216 void ItemView::ReplaceItems(const ItemContainer& replacementItems, float durationSeconds)
218 GetImpl(*this).ReplaceItems( replacementItems, durationSeconds );
221 void ItemView::SetItemsParentOrigin( const Vector3& parentOrigin )
223 GetImpl(*this).SetItemsParentOrigin( parentOrigin );
226 Vector3 ItemView::GetItemsParentOrigin() const
228 return GetImpl(*this).GetItemsParentOrigin();
231 void ItemView::SetItemsAnchorPoint( const Vector3& anchorPoint )
233 GetImpl(*this).SetItemsAnchorPoint(anchorPoint);
236 Vector3 ItemView::GetItemsAnchorPoint() const
238 return GetImpl(*this).GetItemsAnchorPoint();
241 void ItemView::GetItemsRange(ItemRange& range)
243 GetImpl(*this).GetItemsRange(range);
246 } // namespace Toolkit