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