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