2 * Copyright(c) 2018 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 using Tizen.NUI.BaseComponents;
24 using System.Runtime.InteropServices;
27 internal class ItemView : Scrollable
29 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31 internal ItemView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ItemView.ItemView_SWIGUpcast(cPtr), cMemoryOwn)
33 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
36 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemView obj)
38 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
41 protected override void Dispose(DisposeTypes type)
48 if (type == DisposeTypes.Explicit)
51 //Release your own managed resources here.
52 //You should release all of your own disposable objects here.
56 //Release your own unmanaged resources here.
57 //You should not access any managed member here except static instance.
58 //because the execution order of Finalizes is non-deterministic.
60 if (swigCPtr.Handle != global::System.IntPtr.Zero)
65 Interop.ItemView.delete_ItemView(swigCPtr);
67 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73 public new Tizen.NUI.PropertyArray Layout
77 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
78 GetProperty(ItemView.Property.LAYOUT).Get(temp);
83 SetProperty(ItemView.Property.LAYOUT, new Tizen.NUI.PropertyValue(value));
87 /// <since_tizen> 3 </since_tizen>
88 public new class Property
90 /// <since_tizen> 3 </since_tizen>
91 public static readonly int LAYOUT = Interop.ItemView.ItemView_Property_LAYOUT_get();
92 /// <since_tizen> 3 </since_tizen>
93 public static readonly int MINIMUM_SWIPE_SPEED = Interop.ItemView.ItemView_Property_MINIMUM_SWIPE_SPEED_get();
94 /// <since_tizen> 3 </since_tizen>
95 public static readonly int MINIMUM_SWIPE_DISTANCE = Interop.ItemView.ItemView_Property_MINIMUM_SWIPE_DISTANCE_get();
96 /// <since_tizen> 3 </since_tizen>
97 public static readonly int WHEEL_SCROLL_DISTANCE_STEP = Interop.ItemView.ItemView_Property_WHEEL_SCROLL_DISTANCE_STEP_get();
98 /// <since_tizen> 3 </since_tizen>
99 public static readonly int SNAP_TO_ITEM_ENABLED = Interop.ItemView.ItemView_Property_SNAP_TO_ITEM_ENABLED_get();
100 /// <since_tizen> 3 </since_tizen>
101 public static readonly int REFRESH_INTERVAL = Interop.ItemView.ItemView_Property_REFRESH_INTERVAL_get();
102 /// <since_tizen> 3 </since_tizen>
103 public static readonly int LAYOUT_POSITION = Interop.ItemView.ItemView_Property_LAYOUT_POSITION_get();
104 /// <since_tizen> 3 </since_tizen>
105 public static readonly int SCROLL_SPEED = Interop.ItemView.ItemView_Property_SCROLL_SPEED_get();
106 /// <since_tizen> 3 </since_tizen>
107 public static readonly int OVERSHOOT = Interop.ItemView.ItemView_Property_OVERSHOOT_get();
108 /// <since_tizen> 3 </since_tizen>
109 public static readonly int SCROLL_DIRECTION = Interop.ItemView.ItemView_Property_SCROLL_DIRECTION_get();
110 /// <since_tizen> 3 </since_tizen>
111 public static readonly int LAYOUT_ORIENTATION = Interop.ItemView.ItemView_Property_LAYOUT_ORIENTATION_get();
112 /// <since_tizen> 3 </since_tizen>
113 public static readonly int SCROLL_CONTENT_SIZE = Interop.ItemView.ItemView_Property_SCROLL_CONTENT_SIZE_get();
116 public ItemView(ItemFactory factory) : this(Interop.ItemView.ItemView_New(ItemFactory.getCPtr(factory)), true)
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 internal static ItemView DownCast(BaseHandle handle)
124 ItemView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView;
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 public uint GetLayoutCount()
131 uint ret = Interop.ItemView.ItemView_GetLayoutCount(swigCPtr);
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 public void AddLayout(ItemLayout layout)
138 Interop.ItemView.ItemView_AddLayout(swigCPtr, ItemLayout.getCPtr(layout));
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 public void RemoveLayout(uint layoutIndex)
144 Interop.ItemView.ItemView_RemoveLayout(swigCPtr, layoutIndex);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 public SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t GetLayout(uint layoutIndex)
150 SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t ret = new SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t(Interop.ItemView.ItemView_GetLayout(swigCPtr, layoutIndex), true);
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t GetActiveLayout()
157 SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t ret = new SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t(Interop.ItemView.ItemView_GetActiveLayout(swigCPtr), true);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public float GetCurrentLayoutPosition(uint itemId)
164 float ret = Interop.ItemView.ItemView_GetCurrentLayoutPosition(swigCPtr, itemId);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 public void ActivateLayout(uint layoutIndex, Vector3 targetSize, float durationSeconds)
171 Interop.ItemView.ItemView_ActivateLayout(swigCPtr, layoutIndex, Vector3.getCPtr(targetSize), durationSeconds);
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public void DeactivateCurrentLayout()
177 Interop.ItemView.ItemView_DeactivateCurrentLayout(swigCPtr);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 public void SetMinimumSwipeSpeed(float speed)
183 Interop.ItemView.ItemView_SetMinimumSwipeSpeed(swigCPtr, speed);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 public float GetMinimumSwipeSpeed()
189 float ret = Interop.ItemView.ItemView_GetMinimumSwipeSpeed(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public void SetMinimumSwipeDistance(float distance)
196 Interop.ItemView.ItemView_SetMinimumSwipeDistance(swigCPtr, distance);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public float GetMinimumSwipeDistance()
202 float ret = Interop.ItemView.ItemView_GetMinimumSwipeDistance(swigCPtr);
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 public void SetWheelScrollDistanceStep(float step)
209 Interop.ItemView.ItemView_SetWheelScrollDistanceStep(swigCPtr, step);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 public float GetWheelScrollDistanceStep()
215 float ret = Interop.ItemView.ItemView_GetWheelScrollDistanceStep(swigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 public void SetAnchoring(bool enabled)
222 Interop.ItemView.ItemView_SetAnchoring(swigCPtr, enabled);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 public bool GetAnchoring()
228 bool ret = Interop.ItemView.ItemView_GetAnchoring(swigCPtr);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public void SetAnchoringDuration(float durationSeconds)
235 Interop.ItemView.ItemView_SetAnchoringDuration(swigCPtr, durationSeconds);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 public float GetAnchoringDuration()
241 float ret = Interop.ItemView.ItemView_GetAnchoringDuration(swigCPtr);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 public void ScrollToItem(uint itemId, float durationSeconds)
248 Interop.ItemView.ItemView_ScrollToItem(swigCPtr, itemId, durationSeconds);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 public void SetRefreshInterval(float intervalLayoutPositions)
254 Interop.ItemView.ItemView_SetRefreshInterval(swigCPtr, intervalLayoutPositions);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 public float GetRefreshInterval()
260 float ret = Interop.ItemView.ItemView_GetRefreshInterval(swigCPtr);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 public void Refresh()
267 Interop.ItemView.ItemView_Refresh(swigCPtr);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 public View GetItem(uint itemId)
273 View ret = new View(Interop.ItemView.ItemView_GetItem(swigCPtr, itemId), true);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 public uint GetItemId(View view)
280 uint ret = Interop.ItemView.ItemView_GetItemId(swigCPtr, View.getCPtr(view));
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285 public void InsertItem(Item newItem, float durationSeconds)
287 Interop.ItemView.ItemView_InsertItem(swigCPtr, Item.getCPtr(newItem), durationSeconds);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 public void InsertItems(ItemContainer newItems, float durationSeconds)
293 Interop.ItemView.ItemView_InsertItems(swigCPtr, ItemContainer.getCPtr(newItems), durationSeconds);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 public void RemoveItem(uint itemId, float durationSeconds)
299 Interop.ItemView.ItemView_RemoveItem(swigCPtr, itemId, durationSeconds);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 public void RemoveItems(ItemIdContainer itemIds, float durationSeconds)
305 Interop.ItemView.ItemView_RemoveItems(swigCPtr, ItemIdContainer.getCPtr(itemIds), durationSeconds);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 public void ReplaceItem(Item replacementItem, float durationSeconds)
311 Interop.ItemView.ItemView_ReplaceItem(swigCPtr, Item.getCPtr(replacementItem), durationSeconds);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 public void ReplaceItems(ItemContainer replacementItems, float durationSeconds)
317 Interop.ItemView.ItemView_ReplaceItems(swigCPtr, ItemContainer.getCPtr(replacementItems), durationSeconds);
318 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 public void SetItemsParentOrigin(Vector3 parentOrigin)
323 Interop.ItemView.ItemView_SetItemsParentOrigin(swigCPtr, Vector3.getCPtr(parentOrigin));
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 public Vector3 GetItemsParentOrigin()
329 Vector3 ret = new Vector3(Interop.ItemView.ItemView_GetItemsParentOrigin(swigCPtr), true);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 public void SetItemsAnchorPoint(Vector3 anchorPoint)
336 Interop.ItemView.ItemView_SetItemsAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
337 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 public Vector3 GetItemsAnchorPoint()
342 Vector3 ret = new Vector3(Interop.ItemView.ItemView_GetItemsAnchorPoint(swigCPtr), true);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 public void GetItemsRange(ItemRange range)
349 Interop.ItemView.ItemView_GetItemsRange(swigCPtr, ItemRange.getCPtr(range));
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
353 public VoidSignal LayoutActivatedSignal()
355 VoidSignal ret = new VoidSignal(Interop.ItemView.ItemView_LayoutActivatedSignal(swigCPtr), false);
356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 public float MinimumSwipeSpeed
365 GetProperty(ItemView.Property.MINIMUM_SWIPE_SPEED).Get(out temp);
370 SetProperty(ItemView.Property.MINIMUM_SWIPE_SPEED, new Tizen.NUI.PropertyValue(value));
373 public float MinimumSwipeDistance
378 GetProperty(ItemView.Property.MINIMUM_SWIPE_DISTANCE).Get(out temp);
383 SetProperty(ItemView.Property.MINIMUM_SWIPE_DISTANCE, new Tizen.NUI.PropertyValue(value));
386 public float WheelScrollDistanceStep
391 GetProperty(ItemView.Property.WHEEL_SCROLL_DISTANCE_STEP).Get(out temp);
396 SetProperty(ItemView.Property.WHEEL_SCROLL_DISTANCE_STEP, new Tizen.NUI.PropertyValue(value));
399 public bool SnapToItemEnabled
404 GetProperty(ItemView.Property.SNAP_TO_ITEM_ENABLED).Get(out temp);
409 SetProperty(ItemView.Property.SNAP_TO_ITEM_ENABLED, new Tizen.NUI.PropertyValue(value));
412 public float RefreshInterval
417 GetProperty(ItemView.Property.REFRESH_INTERVAL).Get(out temp);
422 SetProperty(ItemView.Property.REFRESH_INTERVAL, new Tizen.NUI.PropertyValue(value));
425 public float LayoutPosition
430 GetProperty(ItemView.Property.LAYOUT_POSITION).Get(out temp);
435 SetProperty(ItemView.Property.LAYOUT_POSITION, new Tizen.NUI.PropertyValue(value));
438 public float ScrollSpeed
443 GetProperty(ItemView.Property.SCROLL_SPEED).Get(out temp);
448 SetProperty(ItemView.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
451 public float Overshoot
456 GetProperty(ItemView.Property.OVERSHOOT).Get(out temp);
461 SetProperty(ItemView.Property.OVERSHOOT, new Tizen.NUI.PropertyValue(value));
464 public Vector2 ScrollDirection
468 Vector2 temp = new Vector2(0.0f, 0.0f);
469 GetProperty(ItemView.Property.SCROLL_DIRECTION).Get(temp);
474 SetProperty(ItemView.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(value));
477 public int LayoutOrientation
482 GetProperty(ItemView.Property.LAYOUT_ORIENTATION).Get(out temp);
487 SetProperty(ItemView.Property.LAYOUT_ORIENTATION, new Tizen.NUI.PropertyValue(value));
490 public float ScrollContentSize
495 GetProperty(ItemView.Property.SCROLL_CONTENT_SIZE).Get(out temp);
500 SetProperty(ItemView.Property.SCROLL_CONTENT_SIZE, new Tizen.NUI.PropertyValue(value));