2 * Copyright(c) 2017 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(NDalicPINVOKE.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 NDalicPINVOKE.delete_ItemView(swigCPtr);
67 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73 public 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 public new class Property
89 public static readonly int LAYOUT = NDalicManualPINVOKE.ItemView_Property_LAYOUT_get();
90 public static readonly int MINIMUM_SWIPE_SPEED = NDalicPINVOKE.ItemView_Property_MINIMUM_SWIPE_SPEED_get();
91 public static readonly int MINIMUM_SWIPE_DISTANCE = NDalicPINVOKE.ItemView_Property_MINIMUM_SWIPE_DISTANCE_get();
92 public static readonly int WHEEL_SCROLL_DISTANCE_STEP = NDalicPINVOKE.ItemView_Property_WHEEL_SCROLL_DISTANCE_STEP_get();
93 public static readonly int SNAP_TO_ITEM_ENABLED = NDalicPINVOKE.ItemView_Property_SNAP_TO_ITEM_ENABLED_get();
94 public static readonly int REFRESH_INTERVAL = NDalicPINVOKE.ItemView_Property_REFRESH_INTERVAL_get();
95 public static readonly int LAYOUT_POSITION = NDalicPINVOKE.ItemView_Property_LAYOUT_POSITION_get();
96 public static readonly int SCROLL_SPEED = NDalicPINVOKE.ItemView_Property_SCROLL_SPEED_get();
97 public static readonly int OVERSHOOT = NDalicPINVOKE.ItemView_Property_OVERSHOOT_get();
98 public static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ItemView_Property_SCROLL_DIRECTION_get();
99 public static readonly int LAYOUT_ORIENTATION = NDalicPINVOKE.ItemView_Property_LAYOUT_ORIENTATION_get();
100 public static readonly int SCROLL_CONTENT_SIZE = NDalicPINVOKE.ItemView_Property_SCROLL_CONTENT_SIZE_get();
103 public ItemView(ItemFactory factory) : this(NDalicPINVOKE.ItemView_New(ItemFactory.getCPtr(factory)), true)
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 internal new static ItemView DownCast(BaseHandle handle)
111 ItemView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView;
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 public uint GetLayoutCount()
118 uint ret = NDalicPINVOKE.ItemView_GetLayoutCount(swigCPtr);
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 public void AddLayout(ItemLayout layout)
125 NDalicPINVOKE.ItemView_AddLayout(swigCPtr, ItemLayout.getCPtr(layout));
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 public void RemoveLayout(uint layoutIndex)
131 NDalicPINVOKE.ItemView_RemoveLayout(swigCPtr, layoutIndex);
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 public SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t GetLayout(uint layoutIndex)
137 SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t ret = new SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t(NDalicPINVOKE.ItemView_GetLayout(swigCPtr, layoutIndex), true);
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 public SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t GetActiveLayout()
144 SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t ret = new SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t(NDalicPINVOKE.ItemView_GetActiveLayout(swigCPtr), true);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public float GetCurrentLayoutPosition(uint itemId)
151 float ret = NDalicPINVOKE.ItemView_GetCurrentLayoutPosition(swigCPtr, itemId);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public void ActivateLayout(uint layoutIndex, Vector3 targetSize, float durationSeconds)
158 NDalicPINVOKE.ItemView_ActivateLayout(swigCPtr, layoutIndex, Vector3.getCPtr(targetSize), durationSeconds);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public void DeactivateCurrentLayout()
164 NDalicPINVOKE.ItemView_DeactivateCurrentLayout(swigCPtr);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public void SetMinimumSwipeSpeed(float speed)
170 NDalicPINVOKE.ItemView_SetMinimumSwipeSpeed(swigCPtr, speed);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 public float GetMinimumSwipeSpeed()
176 float ret = NDalicPINVOKE.ItemView_GetMinimumSwipeSpeed(swigCPtr);
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 public void SetMinimumSwipeDistance(float distance)
183 NDalicPINVOKE.ItemView_SetMinimumSwipeDistance(swigCPtr, distance);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 public float GetMinimumSwipeDistance()
189 float ret = NDalicPINVOKE.ItemView_GetMinimumSwipeDistance(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public void SetWheelScrollDistanceStep(float step)
196 NDalicPINVOKE.ItemView_SetWheelScrollDistanceStep(swigCPtr, step);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public float GetWheelScrollDistanceStep()
202 float ret = NDalicPINVOKE.ItemView_GetWheelScrollDistanceStep(swigCPtr);
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 public void SetAnchoring(bool enabled)
209 NDalicPINVOKE.ItemView_SetAnchoring(swigCPtr, enabled);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 public bool GetAnchoring()
215 bool ret = NDalicPINVOKE.ItemView_GetAnchoring(swigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 public void SetAnchoringDuration(float durationSeconds)
222 NDalicPINVOKE.ItemView_SetAnchoringDuration(swigCPtr, durationSeconds);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 public float GetAnchoringDuration()
228 float ret = NDalicPINVOKE.ItemView_GetAnchoringDuration(swigCPtr);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public void ScrollToItem(uint itemId, float durationSeconds)
235 NDalicPINVOKE.ItemView_ScrollToItem(swigCPtr, itemId, durationSeconds);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 public void SetRefreshInterval(float intervalLayoutPositions)
241 NDalicPINVOKE.ItemView_SetRefreshInterval(swigCPtr, intervalLayoutPositions);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 public float GetRefreshInterval()
247 float ret = NDalicPINVOKE.ItemView_GetRefreshInterval(swigCPtr);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 public void Refresh()
254 NDalicPINVOKE.ItemView_Refresh(swigCPtr);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 public View GetItem(uint itemId)
260 View ret = new View(NDalicPINVOKE.ItemView_GetItem(swigCPtr, itemId), true);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 public uint GetItemId(View view)
267 uint ret = NDalicPINVOKE.ItemView_GetItemId(swigCPtr, View.getCPtr(view));
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 public void InsertItem(Item newItem, float durationSeconds)
274 NDalicPINVOKE.ItemView_InsertItem(swigCPtr, Item.getCPtr(newItem), durationSeconds);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 public void InsertItems(ItemContainer newItems, float durationSeconds)
280 NDalicPINVOKE.ItemView_InsertItems(swigCPtr, ItemContainer.getCPtr(newItems), durationSeconds);
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
284 public void RemoveItem(uint itemId, float durationSeconds)
286 NDalicPINVOKE.ItemView_RemoveItem(swigCPtr, itemId, durationSeconds);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 public void RemoveItems(ItemIdContainer itemIds, float durationSeconds)
292 NDalicPINVOKE.ItemView_RemoveItems(swigCPtr, ItemIdContainer.getCPtr(itemIds), durationSeconds);
293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296 public void ReplaceItem(Item replacementItem, float durationSeconds)
298 NDalicPINVOKE.ItemView_ReplaceItem(swigCPtr, Item.getCPtr(replacementItem), durationSeconds);
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 public void ReplaceItems(ItemContainer replacementItems, float durationSeconds)
304 NDalicPINVOKE.ItemView_ReplaceItems(swigCPtr, ItemContainer.getCPtr(replacementItems), durationSeconds);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 public void SetItemsParentOrigin(Vector3 parentOrigin)
310 NDalicPINVOKE.ItemView_SetItemsParentOrigin(swigCPtr, Vector3.getCPtr(parentOrigin));
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 public Vector3 GetItemsParentOrigin()
316 Vector3 ret = new Vector3(NDalicPINVOKE.ItemView_GetItemsParentOrigin(swigCPtr), true);
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 public void SetItemsAnchorPoint(Vector3 anchorPoint)
323 NDalicPINVOKE.ItemView_SetItemsAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 public Vector3 GetItemsAnchorPoint()
329 Vector3 ret = new Vector3(NDalicPINVOKE.ItemView_GetItemsAnchorPoint(swigCPtr), true);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 public void GetItemsRange(ItemRange range)
336 NDalicPINVOKE.ItemView_GetItemsRange(swigCPtr, ItemRange.getCPtr(range));
337 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 public VoidSignal LayoutActivatedSignal()
342 VoidSignal ret = new VoidSignal(NDalicPINVOKE.ItemView_LayoutActivatedSignal(swigCPtr), false);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 public float MinimumSwipeSpeed
352 GetProperty(ItemView.Property.MINIMUM_SWIPE_SPEED).Get(out temp);
357 SetProperty(ItemView.Property.MINIMUM_SWIPE_SPEED, new Tizen.NUI.PropertyValue(value));
360 public float MinimumSwipeDistance
365 GetProperty(ItemView.Property.MINIMUM_SWIPE_DISTANCE).Get(out temp);
370 SetProperty(ItemView.Property.MINIMUM_SWIPE_DISTANCE, new Tizen.NUI.PropertyValue(value));
373 public float WheelScrollDistanceStep
378 GetProperty(ItemView.Property.WHEEL_SCROLL_DISTANCE_STEP).Get(out temp);
383 SetProperty(ItemView.Property.WHEEL_SCROLL_DISTANCE_STEP, new Tizen.NUI.PropertyValue(value));
386 public bool SnapToItemEnabled
391 GetProperty(ItemView.Property.SNAP_TO_ITEM_ENABLED).Get(out temp);
396 SetProperty(ItemView.Property.SNAP_TO_ITEM_ENABLED, new Tizen.NUI.PropertyValue(value));
399 public float RefreshInterval
404 GetProperty(ItemView.Property.REFRESH_INTERVAL).Get(out temp);
409 SetProperty(ItemView.Property.REFRESH_INTERVAL, new Tizen.NUI.PropertyValue(value));
412 public float LayoutPosition
417 GetProperty(ItemView.Property.LAYOUT_POSITION).Get(out temp);
422 SetProperty(ItemView.Property.LAYOUT_POSITION, new Tizen.NUI.PropertyValue(value));
425 public float ScrollSpeed
430 GetProperty(ItemView.Property.SCROLL_SPEED).Get(out temp);
435 SetProperty(ItemView.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
438 public float Overshoot
443 GetProperty(ItemView.Property.OVERSHOOT).Get(out temp);
448 SetProperty(ItemView.Property.OVERSHOOT, new Tizen.NUI.PropertyValue(value));
451 public Vector2 ScrollDirection
455 Vector2 temp = new Vector2(0.0f, 0.0f);
456 GetProperty(ItemView.Property.SCROLL_DIRECTION).Get(temp);
461 SetProperty(ItemView.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(value));
464 public int LayoutOrientation
469 GetProperty(ItemView.Property.LAYOUT_ORIENTATION).Get(out temp);
474 SetProperty(ItemView.Property.LAYOUT_ORIENTATION, new Tizen.NUI.PropertyValue(value));
477 public float ScrollContentSize
482 GetProperty(ItemView.Property.SCROLL_CONTENT_SIZE).Get(out temp);
487 SetProperty(ItemView.Property.SCROLL_CONTENT_SIZE, new Tizen.NUI.PropertyValue(value));