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;
23 internal class ItemLayout : RefObject
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal ItemLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ItemLayout_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemLayout obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 if (type == DisposeTypes.Explicit)
47 //Release your own managed resources here.
48 //You should release all of your own disposable objects here.
52 //Release your own unmanaged resources here.
53 //You should not access any managed member here except static instance.
54 //because the execution order of Finalizes is non-deterministic.
56 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61 NDalicPINVOKE.delete_ItemLayout(swigCPtr);
63 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 public void SetLayoutProperties(PropertyMap properties)
72 NDalicPINVOKE.ItemLayout_SetLayoutProperties(swigCPtr, PropertyMap.getCPtr(properties));
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 public PropertyMap GetLayoutProperties()
78 PropertyMap ret = new PropertyMap(NDalicPINVOKE.ItemLayout_GetLayoutProperties(swigCPtr), true);
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 public void GetItemSize(uint itemId, Vector3 layoutSize, Vector3 itemSize)
85 NDalicPINVOKE.ItemLayout_GetItemSize(swigCPtr, itemId, Vector3.getCPtr(layoutSize), Vector3.getCPtr(itemSize));
86 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 public void SetItemSize(Vector3 itemSize)
91 NDalicPINVOKE.ItemLayout_SetItemSize(swigCPtr, Vector3.getCPtr(itemSize));
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 public virtual float GetMinimumLayoutPosition(uint numberOfItems, Vector3 layoutSize)
97 float ret = NDalicPINVOKE.ItemLayout_GetMinimumLayoutPosition(swigCPtr, numberOfItems, Vector3.getCPtr(layoutSize));
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 public virtual float GetClosestAnchorPosition(float layoutPosition)
104 float ret = NDalicPINVOKE.ItemLayout_GetClosestAnchorPosition(swigCPtr, layoutPosition);
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 public virtual float GetItemScrollToPosition(uint itemId)
111 float ret = NDalicPINVOKE.ItemLayout_GetItemScrollToPosition(swigCPtr, itemId);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 public virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize)
118 ItemRange ret = new ItemRange(NDalicPINVOKE.ItemLayout_GetItemsWithinArea(swigCPtr, firstItemPosition, Vector3.getCPtr(layoutSize)), true);
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 public virtual float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, Vector3 layoutSize)
125 float ret = NDalicPINVOKE.ItemLayout_GetClosestOnScreenLayoutPosition(swigCPtr, itemID, currentLayoutPosition, Vector3.getCPtr(layoutSize));
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 public virtual uint GetReserveItemCount(Vector3 layoutSize)
132 uint ret = NDalicPINVOKE.ItemLayout_GetReserveItemCount(swigCPtr, Vector3.getCPtr(layoutSize));
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 public virtual void GetDefaultItemSize(uint itemId, Vector3 layoutSize, Vector3 itemSize)
139 NDalicPINVOKE.ItemLayout_GetDefaultItemSize(swigCPtr, itemId, Vector3.getCPtr(layoutSize), Vector3.getCPtr(itemSize));
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 public virtual Degree GetScrollDirection()
145 Degree ret = new Degree(NDalicPINVOKE.ItemLayout_GetScrollDirection(swigCPtr), true);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public virtual float GetScrollSpeedFactor()
152 float ret = NDalicPINVOKE.ItemLayout_GetScrollSpeedFactor(swigCPtr);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 public virtual float GetMaximumSwipeSpeed()
159 float ret = NDalicPINVOKE.ItemLayout_GetMaximumSwipeSpeed(swigCPtr);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 public virtual float GetItemFlickAnimationDuration()
166 float ret = NDalicPINVOKE.ItemLayout_GetItemFlickAnimationDuration(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public virtual int GetNextFocusItemID(int itemID, int maxItems, View.FocusDirection direction, bool loopEnabled)
173 int ret = NDalicPINVOKE.ItemLayout_GetNextFocusItemID(swigCPtr, itemID, maxItems, (int)direction, loopEnabled);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public virtual float GetFlickSpeedFactor()
180 float ret = NDalicPINVOKE.ItemLayout_GetFlickSpeedFactor(swigCPtr);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 public virtual void ApplyConstraints(View view, int itemId, Vector3 layoutSize, View itemView)
187 NDalicPINVOKE.ItemLayout_ApplyConstraints(swigCPtr, View.getCPtr(view), itemId, Vector3.getCPtr(layoutSize), View.getCPtr(itemView));
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, Vector3 layoutSize)
193 Vector3 ret = new Vector3(NDalicPINVOKE.ItemLayout_GetItemPosition(swigCPtr, itemID, currentLayoutPosition, Vector3.getCPtr(layoutSize)), true);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();