[NUI] Split NUI Interop class (#804)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Layouting / LayoutItemPtr.cs
1 /*
2  * Copyright (c) 2018 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
20 namespace Tizen.NUI
21 {
22     internal class LayoutItemPtr : global::System.IDisposable
23     {
24         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25         protected bool swigCMemOwn;
26
27         internal LayoutItemPtr(global::System.IntPtr cPtr, bool cMemoryOwn)
28         {
29             swigCMemOwn = cMemoryOwn;
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LayoutItemPtr obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         ~LayoutItemPtr()
39         {
40             Dispose();
41         }
42
43         public virtual void Dispose()
44         {
45             lock(this) {
46                 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
47                     if (swigCMemOwn) {
48                         swigCMemOwn = false;
49                         Interop.LayoutItemPtr.delete_LayoutItemPtr(swigCPtr);
50                     }
51                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
52                 }
53                 global::System.GC.SuppressFinalize(this);
54             }
55         }
56
57         public LayoutItemPtr() : this(Interop.LayoutItemPtr.new_LayoutItemPtr__SWIG_0(), true)
58         {
59             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60         }
61
62         internal LayoutItemPtr(LayoutItemWrapperImpl p) : this(Interop.LayoutItemPtr.new_LayoutItemPtr__SWIG_1(LayoutItemWrapperImpl.getCPtr(p)), true)
63         {
64             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65         }
66
67         public LayoutItemPtr(LayoutItemPtr rhs) : this(Interop.LayoutItemPtr.new_LayoutItemPtr__SWIG_2(LayoutItemPtr.getCPtr(rhs)), true)
68         {
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70         }
71
72         internal LayoutItemWrapperImpl Get()
73         {
74             global::System.IntPtr cPtr = Interop.LayoutItemPtr.LayoutItemPtr_Get(swigCPtr);
75             LayoutItemWrapperImpl ret = (cPtr == global::System.IntPtr.Zero) ? null : new LayoutItemWrapperImpl(cPtr, false);
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77             return ret;
78         }
79
80         internal LayoutItemWrapperImpl __deref__()
81         {
82             global::System.IntPtr cPtr = Interop.LayoutItemPtr.LayoutItemPtr___deref__(swigCPtr);
83             LayoutItemWrapperImpl ret = (cPtr == global::System.IntPtr.Zero) ? null : new LayoutItemWrapperImpl(cPtr, false);
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85             return ret;
86         }
87
88         internal LayoutItemWrapperImpl __ref__()
89         {
90             LayoutItemWrapperImpl ret = new LayoutItemWrapperImpl(Interop.LayoutItemPtr.LayoutItemPtr___ref__(swigCPtr), false);
91             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92             return ret;
93         }
94
95         public void Reset()
96         {
97             Interop.LayoutItemPtr.LayoutItemPtr_Reset__SWIG_0(swigCPtr);
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99         }
100
101         internal void Reset(LayoutItemWrapperImpl rhs)
102         {
103             Interop.LayoutItemPtr.LayoutItemPtr_Reset__SWIG_1(swigCPtr, LayoutItemWrapperImpl.getCPtr(rhs));
104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105         }
106
107         internal LayoutItemWrapperImpl Detach()
108         {
109             global::System.IntPtr cPtr = Interop.LayoutItemPtr.LayoutItemPtr_Detach(swigCPtr);
110             LayoutItemWrapperImpl ret = (cPtr == global::System.IntPtr.Zero) ? null : new LayoutItemWrapperImpl(cPtr, false);
111             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112             return ret;
113         }
114
115         /*public LayoutItemPtr New(Handle owner)
116         {
117             LayoutItemPtr ret = new LayoutItemPtr(Interop.LayoutItemPtr.LayoutItemPtr_New(swigCPtr, Handle.getCPtr(owner)), true);
118             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119             return ret;
120         }
121
122         public void Initialize(Handle owner, string containerType)
123         {
124             Interop.LayoutItemPtr.LayoutItemPtr_Initialize(swigCPtr, Handle.getCPtr(owner), containerType);
125             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126         }*/
127
128         public void Unparent()
129         {
130             Interop.LayoutItemPtr.LayoutItemPtr_Unparent(swigCPtr);
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132         }
133
134         public void SetAnimateLayout(bool animateLayout)
135         {
136             Interop.LayoutItemPtr.LayoutItemPtr_SetAnimateLayout(swigCPtr, animateLayout);
137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138         }
139
140         public bool IsLayoutAnimated()
141         {
142             bool ret = Interop.LayoutItemPtr.LayoutItemPtr_IsLayoutAnimated(swigCPtr);
143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144             return ret;
145         }
146
147         public void Measure(LayoutMeasureSpec widthMeasureSpec, LayoutMeasureSpec heightMeasureSpec)
148         {
149             Interop.LayoutItemPtr.LayoutItemPtr_Measure(swigCPtr, LayoutMeasureSpec.getCPtr(widthMeasureSpec), LayoutMeasureSpec.getCPtr(heightMeasureSpec));
150             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151         }
152
153         public void Layout(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
154         {
155             Interop.LayoutItemPtr.LayoutItemPtr_Layout(swigCPtr, LayoutLength.getCPtr(left), LayoutLength.getCPtr(top), LayoutLength.getCPtr(right), LayoutLength.getCPtr(bottom));
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157         }
158
159         public LayoutLength GetDefaultSize(LayoutLength size, LayoutMeasureSpec measureSpec)
160         {
161             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetDefaultSize(swigCPtr, LayoutLength.getCPtr(size), LayoutMeasureSpec.getCPtr(measureSpec)), true);
162             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163             return ret;
164         }
165
166         /*public LayoutParent GetParent()
167         {
168             global::System.IntPtr cPtr = (SwigDerivedClassHasMethod("GetParent", swigMethodTypes0) ? Interop.LayoutItemPtr.LayoutItemPtr_GetParentSwigExplicitLayoutItemWrapperImpl(swigCPtr) : Interop.LayoutItemPtr.LayoutItemPtr_GetParent(swigCPtr));
169             LayoutParent ret = (cPtr == global::System.IntPtr.Zero) ? null : new LayoutParent(cPtr, false);
170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             return ret;
172         }*/
173
174         public void RequestLayout()
175         {
176             Interop.LayoutItemPtr.LayoutItemPtr_RequestLayout(swigCPtr);
177             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178         }
179
180         public bool IsLayoutRequested()
181         {
182             bool ret = Interop.LayoutItemPtr.LayoutItemPtr_IsLayoutRequested(swigCPtr);
183             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184             return ret;
185         }
186
187         public LayoutLength GetMeasuredWidth()
188         {
189             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetMeasuredWidth(swigCPtr), true);
190             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191             return ret;
192         }
193
194         public LayoutLength GetMeasuredHeight()
195         {
196             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetMeasuredHeight(swigCPtr), true);
197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198             return ret;
199         }
200
201         public MeasuredSize GetMeasuredWidthAndState()
202         {
203             MeasuredSize ret = new MeasuredSize(Interop.LayoutItemPtr.LayoutItemPtr_GetMeasuredWidthAndState(swigCPtr), true);
204             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205             return ret;
206         }
207
208         public MeasuredSize GetMeasuredHeightAndState()
209         {
210             MeasuredSize ret = new MeasuredSize(Interop.LayoutItemPtr.LayoutItemPtr_GetMeasuredHeightAndState(swigCPtr), true);
211             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212             return ret;
213         }
214
215         public LayoutLength GetSuggestedMinimumWidth()
216         {
217             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetSuggestedMinimumWidth(swigCPtr), true);
218             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219             return ret;
220         }
221
222         public LayoutLength GetSuggestedMinimumHeight()
223         {
224             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetSuggestedMinimumHeight(swigCPtr), true);
225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226             return ret;
227         }
228
229         public void SetMinimumWidth(LayoutLength minWidth)
230         {
231             Interop.LayoutItemPtr.LayoutItemPtr_SetMinimumWidth(swigCPtr, LayoutLength.getCPtr(minWidth));
232             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233         }
234
235         public void SetMinimumHeight(LayoutLength minHeight)
236         {
237             Interop.LayoutItemPtr.LayoutItemPtr_SetMinimumHeight(swigCPtr, LayoutLength.getCPtr(minHeight));
238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239         }
240
241         public LayoutLength GetMinimumWidth()
242         {
243             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetMinimumWidth(swigCPtr), true);
244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245             return ret;
246         }
247
248         public LayoutLength GetMinimumHeight()
249         {
250             LayoutLength ret = new LayoutLength(Interop.LayoutItemPtr.LayoutItemPtr_GetMinimumHeight(swigCPtr), true);
251             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             return ret;
253         }
254
255         public Extents GetPadding()
256         {
257             Extents ret = new Extents(Interop.LayoutItemPtr.LayoutItemPtr_GetPadding(swigCPtr), true);
258             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259             return ret;
260         }
261
262         public void SetMeasuredDimensions(MeasuredSize measuredWidth, MeasuredSize measuredHeight)
263         {
264             Interop.LayoutItemPtr.LayoutItemPtr_SetMeasuredDimensions(swigCPtr, MeasuredSize.getCPtr(measuredWidth), MeasuredSize.getCPtr(measuredHeight));
265             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266         }
267
268         public bool DoAction(string actionName, PropertyMap attributes)
269         {
270             bool ret = Interop.LayoutItemPtr.LayoutItemPtr_DoAction(swigCPtr, actionName, PropertyMap.getCPtr(attributes));
271             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272             return ret;
273         }
274
275         public string GetTypeName()
276         {
277             string ret = Interop.LayoutItemPtr.LayoutItemPtr_GetTypeName(swigCPtr);
278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279             return ret;
280         }
281
282         public bool GetTypeInfo(TypeInfo info)
283         {
284             bool ret = Interop.LayoutItemPtr.LayoutItemPtr_GetTypeInfo(swigCPtr, TypeInfo.getCPtr(info));
285             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286             return ret;
287         }
288
289         public void Reference()
290         {
291             Interop.LayoutItemPtr.LayoutItemPtr_Reference(swigCPtr);
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293         }
294
295         public void Unreference()
296         {
297             Interop.LayoutItemPtr.LayoutItemPtr_Unreference(swigCPtr);
298             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299         }
300
301         public int ReferenceCount()
302         {
303             int ret = Interop.LayoutItemPtr.LayoutItemPtr_ReferenceCount(swigCPtr);
304             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305             return ret;
306         }
307
308     }
309 }