[NUI] Sync with dalihub (#970)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / ItemLayout.cs
1 /*
2  * Copyright(c) 2017 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 using Tizen.NUI.BaseComponents;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23
24     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public class ItemLayout : RefObject
27     {
28         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29
30         internal ItemLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ItemLayout.ItemLayout_SWIGUpcast(cPtr), cMemoryOwn)
31         {
32             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33         }
34
35         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemLayout obj)
36         {
37             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
38         }
39
40         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
41         [EditorBrowsable(EditorBrowsableState.Never)]
42         protected override void Dispose(DisposeTypes type)
43         {
44             if (disposed)
45             {
46                 return;
47             }
48
49             if (type == DisposeTypes.Explicit)
50             {
51                 //Called by User
52                 //Release your own managed resources here.
53                 //You should release all of your own disposable objects here.
54
55             }
56
57             //Release your own unmanaged resources here.
58             //You should not access any managed member here except static instance.
59             //because the execution order of Finalizes is non-deterministic.
60
61             if (swigCPtr.Handle != global::System.IntPtr.Zero)
62             {
63                 if (swigCMemOwn)
64                 {
65                     swigCMemOwn = false;
66                     Interop.ItemLayout.delete_ItemLayout(swigCPtr);
67                 }
68                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69             }
70
71             base.Dispose(type);
72         }
73
74
75         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
76         [EditorBrowsable(EditorBrowsableState.Never)]
77         public void SetLayoutProperties(PropertyMap properties)
78         {
79             Interop.ItemLayout.ItemLayout_SetLayoutProperties(swigCPtr, PropertyMap.getCPtr(properties));
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81         }
82
83         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
84         [EditorBrowsable(EditorBrowsableState.Never)]
85         public PropertyMap GetLayoutProperties()
86         {
87             PropertyMap ret = new PropertyMap(Interop.ItemLayout.ItemLayout_GetLayoutProperties(swigCPtr), true);
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89             return ret;
90         }
91
92         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
93         [EditorBrowsable(EditorBrowsableState.Never)]
94         public void GetItemSize(uint itemId, Vector3 layoutSize, Vector3 itemSize)
95         {
96             Interop.ItemLayout.ItemLayout_GetItemSize(swigCPtr, itemId, Vector3.getCPtr(layoutSize), Vector3.getCPtr(itemSize));
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98         }
99
100         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
101         [EditorBrowsable(EditorBrowsableState.Never)]
102         public void SetItemSize(Vector3 itemSize)
103         {
104             Interop.ItemLayout.ItemLayout_SetItemSize(swigCPtr, Vector3.getCPtr(itemSize));
105             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106         }
107
108         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
109         [EditorBrowsable(EditorBrowsableState.Never)]
110         public virtual float GetMinimumLayoutPosition(uint numberOfItems, Vector3 layoutSize)
111         {
112             float ret = Interop.ItemLayout.ItemLayout_GetMinimumLayoutPosition(swigCPtr, numberOfItems, Vector3.getCPtr(layoutSize));
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114             return ret;
115         }
116
117         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
118         [EditorBrowsable(EditorBrowsableState.Never)]
119         public virtual float GetClosestAnchorPosition(float layoutPosition)
120         {
121             float ret = Interop.ItemLayout.ItemLayout_GetClosestAnchorPosition(swigCPtr, layoutPosition);
122             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123             return ret;
124         }
125
126         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
127         [EditorBrowsable(EditorBrowsableState.Never)]
128         public virtual float GetItemScrollToPosition(uint itemId)
129         {
130             float ret = Interop.ItemLayout.ItemLayout_GetItemScrollToPosition(swigCPtr, itemId);
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132             return ret;
133         }
134
135         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
136         [EditorBrowsable(EditorBrowsableState.Never)]
137         public virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize)
138         {
139             ItemRange ret = new ItemRange(Interop.ItemLayout.ItemLayout_GetItemsWithinArea(swigCPtr, firstItemPosition, Vector3.getCPtr(layoutSize)), true);
140             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141             return ret;
142         }
143
144         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
145         [EditorBrowsable(EditorBrowsableState.Never)]
146         public virtual float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, Vector3 layoutSize)
147         {
148             float ret = Interop.ItemLayout.ItemLayout_GetClosestOnScreenLayoutPosition(swigCPtr, itemID, currentLayoutPosition, Vector3.getCPtr(layoutSize));
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150             return ret;
151         }
152
153         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
154         [EditorBrowsable(EditorBrowsableState.Never)]
155         public virtual uint GetReserveItemCount(Vector3 layoutSize)
156         {
157             uint ret = Interop.ItemLayout.ItemLayout_GetReserveItemCount(swigCPtr, Vector3.getCPtr(layoutSize));
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159             return ret;
160         }
161
162         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
163         [EditorBrowsable(EditorBrowsableState.Never)]
164         public virtual void GetDefaultItemSize(uint itemId, Vector3 layoutSize, Vector3 itemSize)
165         {
166             Interop.ItemLayout.ItemLayout_GetDefaultItemSize(swigCPtr, itemId, Vector3.getCPtr(layoutSize), Vector3.getCPtr(itemSize));
167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168         }
169
170         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
171         [EditorBrowsable(EditorBrowsableState.Never)]
172         public virtual Degree GetScrollDirection()
173         {
174             Degree ret = new Degree(Interop.ItemLayout.ItemLayout_GetScrollDirection(swigCPtr), true);
175             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176             return ret;
177         }
178
179         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
180         [EditorBrowsable(EditorBrowsableState.Never)]
181         public virtual float GetScrollSpeedFactor()
182         {
183             float ret = Interop.ItemLayout.ItemLayout_GetScrollSpeedFactor(swigCPtr);
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185             return ret;
186         }
187
188         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
189         [EditorBrowsable(EditorBrowsableState.Never)]
190         public virtual float GetMaximumSwipeSpeed()
191         {
192             float ret = Interop.ItemLayout.ItemLayout_GetMaximumSwipeSpeed(swigCPtr);
193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194             return ret;
195         }
196
197         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
198         [EditorBrowsable(EditorBrowsableState.Never)]
199         public virtual float GetItemFlickAnimationDuration()
200         {
201             float ret = Interop.ItemLayout.ItemLayout_GetItemFlickAnimationDuration(swigCPtr);
202             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203             return ret;
204         }
205
206         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
207         [EditorBrowsable(EditorBrowsableState.Never)]
208         public virtual int GetNextFocusItemID(int itemID, int maxItems, View.FocusDirection direction, bool loopEnabled)
209         {
210             int ret = Interop.ItemLayout.ItemLayout_GetNextFocusItemID(swigCPtr, itemID, maxItems, (int)direction, loopEnabled);
211             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212             return ret;
213         }
214
215         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
216         [EditorBrowsable(EditorBrowsableState.Never)]
217         public virtual float GetFlickSpeedFactor()
218         {
219             float ret = Interop.ItemLayout.ItemLayout_GetFlickSpeedFactor(swigCPtr);
220             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221             return ret;
222         }
223
224         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
225         [EditorBrowsable(EditorBrowsableState.Never)]
226         public virtual void ApplyConstraints(View view, int itemId, Vector3 layoutSize, View itemView)
227         {
228             Interop.ItemLayout.ItemLayout_ApplyConstraints(swigCPtr, View.getCPtr(view), itemId, Vector3.getCPtr(layoutSize), View.getCPtr(itemView));
229             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230         }
231
232         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
233         [EditorBrowsable(EditorBrowsableState.Never)]
234         public virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, Vector3 layoutSize)
235         {
236             Vector3 ret = new Vector3(Interop.ItemLayout.ItemLayout_GetItemPosition(swigCPtr, itemID, currentLayoutPosition, Vector3.getCPtr(layoutSize)), true);
237             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238             return ret;
239         }
240
241     }
242
243 }