1 /** Copyright (c) 2016 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class ItemView : Scrollable {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal ItemView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ItemView_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemView obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_ItemView(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
63 public class LayoutActivatedEventArgs : EventArgs
67 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
68 private delegate void LayoutActivatedEventCallbackDelegate();
69 private DaliEventHandler<object,LayoutActivatedEventArgs> _itemViewLayoutActivatedEventHandler;
70 private LayoutActivatedEventCallbackDelegate _itemViewLayoutActivatedEventCallbackDelegate;
72 public event DaliEventHandler<object,LayoutActivatedEventArgs> LayoutActivated
78 // Restricted to only one listener
79 if (_itemViewLayoutActivatedEventHandler == null)
81 _itemViewLayoutActivatedEventHandler += value;
83 _itemViewLayoutActivatedEventCallbackDelegate = new LayoutActivatedEventCallbackDelegate(OnLayoutActivated);
84 this.LayoutActivatedSignal().Connect(_itemViewLayoutActivatedEventCallbackDelegate);
93 if (_itemViewLayoutActivatedEventHandler != null)
95 this.LayoutActivatedSignal().Disconnect(_itemViewLayoutActivatedEventCallbackDelegate);
98 _itemViewLayoutActivatedEventHandler -= value;
103 // Callback for ItemView LayoutActivatedSignal
104 private void OnLayoutActivated()
106 LayoutActivatedEventArgs e = new LayoutActivatedEventArgs();
108 if (_itemViewLayoutActivatedEventHandler != null)
110 //here we send all data to user event handlers
111 _itemViewLayoutActivatedEventHandler(this, e);
116 public class Property : global::System.IDisposable {
117 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
118 protected bool swigCMemOwn;
120 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
121 swigCMemOwn = cMemoryOwn;
122 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
125 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
126 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
133 public virtual void Dispose() {
135 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
138 NDalicPINVOKE.delete_ItemView_Property(swigCPtr);
140 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
142 global::System.GC.SuppressFinalize(this);
146 public Property() : this(NDalicPINVOKE.new_ItemView_Property(), true) {
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public static readonly int MINIMUM_SWIPE_SPEED = NDalicPINVOKE.ItemView_Property_MINIMUM_SWIPE_SPEED_get();
151 public static readonly int MINIMUM_SWIPE_DISTANCE = NDalicPINVOKE.ItemView_Property_MINIMUM_SWIPE_DISTANCE_get();
152 public static readonly int WHEEL_SCROLL_DISTANCE_STEP = NDalicPINVOKE.ItemView_Property_WHEEL_SCROLL_DISTANCE_STEP_get();
153 public static readonly int SNAP_TO_ITEM_ENABLED = NDalicPINVOKE.ItemView_Property_SNAP_TO_ITEM_ENABLED_get();
154 public static readonly int REFRESH_INTERVAL = NDalicPINVOKE.ItemView_Property_REFRESH_INTERVAL_get();
155 public static readonly int LAYOUT_POSITION = NDalicPINVOKE.ItemView_Property_LAYOUT_POSITION_get();
156 public static readonly int SCROLL_SPEED = NDalicPINVOKE.ItemView_Property_SCROLL_SPEED_get();
157 public static readonly int OVERSHOOT = NDalicPINVOKE.ItemView_Property_OVERSHOOT_get();
158 public static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ItemView_Property_SCROLL_DIRECTION_get();
159 public static readonly int LAYOUT_ORIENTATION = NDalicPINVOKE.ItemView_Property_LAYOUT_ORIENTATION_get();
160 public static readonly int SCROLL_CONTENT_SIZE = NDalicPINVOKE.ItemView_Property_SCROLL_CONTENT_SIZE_get();
164 public ItemView (ItemFactory factory) : this (NDalicPINVOKE.ItemView_New(ItemFactory.getCPtr(factory)), true) {
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public ItemView(ItemView itemView) : this(NDalicPINVOKE.new_ItemView__SWIG_1(ItemView.getCPtr(itemView)), true) {
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 public ItemView Assign(ItemView itemView) {
173 ItemView ret = new ItemView(NDalicPINVOKE.ItemView_Assign(swigCPtr, ItemView.getCPtr(itemView)), false);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public new static ItemView DownCast(BaseHandle handle) {
179 ItemView ret = new ItemView(NDalicPINVOKE.ItemView_DownCast(BaseHandle.getCPtr(handle)), true);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 public uint GetLayoutCount() {
185 uint ret = NDalicPINVOKE.ItemView_GetLayoutCount(swigCPtr);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public void AddLayout(ItemLayout layout) {
191 NDalicPINVOKE.ItemView_AddLayout(swigCPtr, ItemLayout.getCPtr(layout));
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public void RemoveLayout(uint layoutIndex) {
196 NDalicPINVOKE.ItemView_RemoveLayout(swigCPtr, layoutIndex);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t GetLayout(uint layoutIndex) {
201 SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t ret = new SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t(NDalicPINVOKE.ItemView_GetLayout(swigCPtr, layoutIndex), true);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t GetActiveLayout() {
207 SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t ret = new SWIGTYPE_p_Dali__IntrusivePtrT_Dali__Toolkit__ItemLayout_t(NDalicPINVOKE.ItemView_GetActiveLayout(swigCPtr), true);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 public float GetCurrentLayoutPosition(uint itemId) {
213 float ret = NDalicPINVOKE.ItemView_GetCurrentLayoutPosition(swigCPtr, itemId);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 public void ActivateLayout(uint layoutIndex, Vector3 targetSize, float durationSeconds) {
219 NDalicPINVOKE.ItemView_ActivateLayout(swigCPtr, layoutIndex, Vector3.getCPtr(targetSize), durationSeconds);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public void DeactivateCurrentLayout() {
224 NDalicPINVOKE.ItemView_DeactivateCurrentLayout(swigCPtr);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public void SetMinimumSwipeSpeed(float speed) {
229 NDalicPINVOKE.ItemView_SetMinimumSwipeSpeed(swigCPtr, speed);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public float GetMinimumSwipeSpeed() {
234 float ret = NDalicPINVOKE.ItemView_GetMinimumSwipeSpeed(swigCPtr);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 public void SetMinimumSwipeDistance(float distance) {
240 NDalicPINVOKE.ItemView_SetMinimumSwipeDistance(swigCPtr, distance);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 public float GetMinimumSwipeDistance() {
245 float ret = NDalicPINVOKE.ItemView_GetMinimumSwipeDistance(swigCPtr);
246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 public void SetWheelScrollDistanceStep(float step) {
251 NDalicPINVOKE.ItemView_SetWheelScrollDistanceStep(swigCPtr, step);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 public float GetWheelScrollDistanceStep() {
256 float ret = NDalicPINVOKE.ItemView_GetWheelScrollDistanceStep(swigCPtr);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 public void SetAnchoring(bool enabled) {
262 NDalicPINVOKE.ItemView_SetAnchoring(swigCPtr, enabled);
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 public bool GetAnchoring() {
267 bool ret = NDalicPINVOKE.ItemView_GetAnchoring(swigCPtr);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 public void SetAnchoringDuration(float durationSeconds) {
273 NDalicPINVOKE.ItemView_SetAnchoringDuration(swigCPtr, durationSeconds);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 public float GetAnchoringDuration() {
278 float ret = NDalicPINVOKE.ItemView_GetAnchoringDuration(swigCPtr);
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 public void ScrollToItem(uint itemId, float durationSeconds) {
284 NDalicPINVOKE.ItemView_ScrollToItem(swigCPtr, itemId, durationSeconds);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 public void SetRefreshInterval(float intervalLayoutPositions) {
289 NDalicPINVOKE.ItemView_SetRefreshInterval(swigCPtr, intervalLayoutPositions);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 public float GetRefreshInterval() {
294 float ret = NDalicPINVOKE.ItemView_GetRefreshInterval(swigCPtr);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 public void Refresh() {
300 NDalicPINVOKE.ItemView_Refresh(swigCPtr);
301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 public Actor GetItem(uint itemId) {
305 Actor ret = new Actor(NDalicPINVOKE.ItemView_GetItem(swigCPtr, itemId), true);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 public uint GetItemId(Actor actor) {
311 uint ret = NDalicPINVOKE.ItemView_GetItemId(swigCPtr, Actor.getCPtr(actor));
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 public void InsertItem(Item newItem, float durationSeconds) {
317 NDalicPINVOKE.ItemView_InsertItem(swigCPtr, Item.getCPtr(newItem), durationSeconds);
318 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 public void InsertItems(ItemContainer newItems, float durationSeconds) {
322 NDalicPINVOKE.ItemView_InsertItems(swigCPtr, ItemContainer.getCPtr(newItems), durationSeconds);
323 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 public void RemoveItem(uint itemId, float durationSeconds) {
327 NDalicPINVOKE.ItemView_RemoveItem(swigCPtr, itemId, durationSeconds);
328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 public void RemoveItems(ItemIdContainer itemIds, float durationSeconds) {
332 NDalicPINVOKE.ItemView_RemoveItems(swigCPtr, ItemIdContainer.getCPtr(itemIds), durationSeconds);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 public void ReplaceItem(Item replacementItem, float durationSeconds) {
337 NDalicPINVOKE.ItemView_ReplaceItem(swigCPtr, Item.getCPtr(replacementItem), durationSeconds);
338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 public void ReplaceItems(ItemContainer replacementItems, float durationSeconds) {
342 NDalicPINVOKE.ItemView_ReplaceItems(swigCPtr, ItemContainer.getCPtr(replacementItems), durationSeconds);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 public void SetItemsParentOrigin(Vector3 parentOrigin) {
347 NDalicPINVOKE.ItemView_SetItemsParentOrigin(swigCPtr, Vector3.getCPtr(parentOrigin));
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 public Vector3 GetItemsParentOrigin() {
352 Vector3 ret = new Vector3(NDalicPINVOKE.ItemView_GetItemsParentOrigin(swigCPtr), true);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 public void SetItemsAnchorPoint(Vector3 anchorPoint) {
358 NDalicPINVOKE.ItemView_SetItemsAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362 public Vector3 GetItemsAnchorPoint() {
363 Vector3 ret = new Vector3(NDalicPINVOKE.ItemView_GetItemsAnchorPoint(swigCPtr), true);
364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368 public void GetItemsRange(ItemRange range) {
369 NDalicPINVOKE.ItemView_GetItemsRange(swigCPtr, ItemRange.getCPtr(range));
370 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 public VoidSignal LayoutActivatedSignal() {
374 VoidSignal ret = new VoidSignal(NDalicPINVOKE.ItemView_LayoutActivatedSignal(swigCPtr), false);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 public enum PropertyRange {
380 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
381 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000,
382 ANIMATABLE_PROPERTY_START_INDEX = PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
383 ANIMATABLE_PROPERTY_END_INDEX = PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX+1000
386 public float MinimumSwipeSpeed
391 GetProperty( ItemView.Property.MINIMUM_SWIPE_SPEED).Get( ref temp );
396 SetProperty( ItemView.Property.MINIMUM_SWIPE_SPEED, new Dali.Property.Value( value ) );
399 public float MinimumSwipeDistance
404 GetProperty( ItemView.Property.MINIMUM_SWIPE_DISTANCE).Get( ref temp );
409 SetProperty( ItemView.Property.MINIMUM_SWIPE_DISTANCE, new Dali.Property.Value( value ) );
412 public float WheelScrollDistanceStep
417 GetProperty( ItemView.Property.WHEEL_SCROLL_DISTANCE_STEP).Get( ref temp );
422 SetProperty( ItemView.Property.WHEEL_SCROLL_DISTANCE_STEP, new Dali.Property.Value( value ) );
425 public bool SnapToItemEnabled
430 GetProperty( ItemView.Property.SNAP_TO_ITEM_ENABLED).Get( ref temp );
435 SetProperty( ItemView.Property.SNAP_TO_ITEM_ENABLED, new Dali.Property.Value( value ) );
438 public float RefreshInterval
443 GetProperty( ItemView.Property.REFRESH_INTERVAL).Get( ref temp );
448 SetProperty( ItemView.Property.REFRESH_INTERVAL, new Dali.Property.Value( value ) );
451 public float LayoutPosition
456 GetProperty( ItemView.Property.LAYOUT_POSITION).Get( ref temp );
461 SetProperty( ItemView.Property.LAYOUT_POSITION, new Dali.Property.Value( value ) );
464 public float ScrollSpeed
469 GetProperty( ItemView.Property.SCROLL_SPEED).Get( ref temp );
474 SetProperty( ItemView.Property.SCROLL_SPEED, new Dali.Property.Value( value ) );
477 public float Overshoot
482 GetProperty( ItemView.Property.OVERSHOOT).Get( ref temp );
487 SetProperty( ItemView.Property.OVERSHOOT, new Dali.Property.Value( value ) );
490 public Vector2 ScrollDirection
494 Vector2 temp = new Vector2(0.0f,0.0f);
495 GetProperty( ItemView.Property.SCROLL_DIRECTION).Get( temp );
500 SetProperty( ItemView.Property.SCROLL_DIRECTION, new Dali.Property.Value( value ) );
503 public int LayoutOrientation
508 GetProperty( ItemView.Property.LAYOUT_ORIENTATION).Get( ref temp );
513 SetProperty( ItemView.Property.LAYOUT_ORIENTATION, new Dali.Property.Value( value ) );
516 public float ScrollContentSize
521 GetProperty( ItemView.Property.SCROLL_CONTENT_SIZE).Get( ref temp );
526 SetProperty( ItemView.Property.SCROLL_CONTENT_SIZE, new Dali.Property.Value( value ) );