2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
17 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
18 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
19 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
31 ItemView::ItemView(Internal::ItemView& implementation)
32 : Scrollable(implementation)
36 ItemView::ItemView( Dali::Internal::CustomActor* internal )
37 : Scrollable(internal)
39 VerifyCustomActorPointer<Internal::ItemView>(internal);
42 ItemView::ItemView( const ItemView& itemView )
43 : Scrollable(itemView)
47 ItemView& ItemView::operator=( const ItemView& itemView )
49 if( &itemView != this )
51 Control::operator=( itemView );
56 ItemView ItemView::New(ItemFactory& factory)
58 return Internal::ItemView::New(factory);
61 ItemView ItemView::DownCast( BaseHandle handle )
63 return Control::DownCast<ItemView, Internal::ItemView>(handle);
66 ScrollConnector ItemView::GetScrollConnector() const
68 return GetImpl(*this).GetScrollConnector();
75 unsigned int ItemView::GetLayoutCount() const
77 return GetImpl(*this).GetLayoutCount();
80 void ItemView::AddLayout(ItemLayout& layout)
82 GetImpl(*this).AddLayout(layout);
85 void ItemView::RemoveLayout(unsigned int layoutIndex)
87 GetImpl(*this).RemoveLayout(layoutIndex);
90 ItemLayoutPtr ItemView::GetLayout(unsigned int layoutIndex) const
92 return GetImpl(*this).GetLayout(layoutIndex);
95 ItemLayoutPtr ItemView::GetActiveLayout() const
97 return GetImpl(*this).GetActiveLayout();
100 float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
102 return GetImpl(*this).GetCurrentLayoutPosition(itemId);
105 void ItemView::ActivateLayout(unsigned int layoutIndex, Vector3 targetSize, float durationSeconds)
107 GetImpl(*this).ActivateLayout(layoutIndex, targetSize, durationSeconds);
110 void ItemView::DeactivateCurrentLayout()
112 GetImpl(*this).DeactivateCurrentLayout();
115 void ItemView::SetMinimumSwipeSpeed(float speed)
117 GetImpl(*this).SetMinimumSwipeSpeed(speed);
120 float ItemView::GetMinimumSwipeSpeed() const
122 return GetImpl(*this).GetMinimumSwipeSpeed();
125 void ItemView::SetMinimumSwipeDistance(float distance)
127 GetImpl(*this).SetMinimumSwipeDistance(distance);
130 float ItemView::GetMinimumSwipeDistance() const
132 return GetImpl(*this).GetMinimumSwipeDistance();
135 void ItemView::SetMouseWheelScrollDistanceStep(float step)
137 GetImpl(*this).SetMouseWheelScrollDistanceStep(step);
140 float ItemView::GetMouseWheelScrollDistanceStep() const
142 return GetImpl(*this).GetMouseWheelScrollDistanceStep();
145 void ItemView::SetAnchoring(bool enabled)
147 GetImpl(*this).SetAnchoring(enabled);
150 bool ItemView::GetAnchoring() const
152 return GetImpl(*this).GetAnchoring();
155 void ItemView::SetAnchoringDuration(float durationSeconds)
157 GetImpl(*this).SetAnchoringDuration(durationSeconds);
160 float ItemView::GetAnchoringDuration() const
162 return GetImpl(*this).GetAnchoringDuration();
165 void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
167 GetImpl(*this).ScrollToItem(itemId, durationSeconds);
170 void ItemView::SetRefreshInterval(unsigned int intervalMilliseconds)
172 GetImpl(*this).SetRefreshInterval(intervalMilliseconds);
175 unsigned int ItemView::GetRefreshInterval() const
177 return GetImpl(*this).GetRefreshInterval();
180 Actor ItemView::GetItem(unsigned int itemId) const
182 return GetImpl(*this).GetItem(itemId);
185 unsigned int ItemView::GetItemId(Actor actor) const
187 return GetImpl(*this).GetItemId(actor);
190 void ItemView::RemoveItem(unsigned int itemId, float durationSeconds)
192 GetImpl(*this).RemoveItem(itemId, durationSeconds);
195 } // namespace Toolkit