Change PositionUsesAnchorPoint property to PositionUsesPivotPoint
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Alignment.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 using Tizen.NUI.BaseComponents;
28
29 namespace Tizen.NUI
30 {
31
32     internal class Alignment : View
33     {
34         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
36         internal Alignment(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Alignment_SWIGUpcast(cPtr), cMemoryOwn)
37         {
38             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39         }
40
41         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Alignment obj)
42         {
43             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44         }
45
46         protected override void Dispose(DisposeTypes type)
47         {
48             if (disposed)
49             {
50                 return;
51             }
52
53             if (type == DisposeTypes.Explicit)
54             {
55                 //Called by User
56                 //Release your own managed resources here.
57                 //You should release all of your own disposable objects here.
58
59             }
60
61             //Release your own unmanaged resources here.
62             //You should not access any managed member here except static instance.
63             //because the execution order of Finalizes is non-deterministic.
64
65             if (swigCPtr.Handle != global::System.IntPtr.Zero)
66             {
67                 if (swigCMemOwn)
68                 {
69                     swigCMemOwn = false;
70                     NDalicPINVOKE.delete_Alignment(swigCPtr);
71                 }
72                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73             }
74
75             base.Dispose(type);
76         }
77
78
79
80         public class Padding : global::System.IDisposable
81         {
82             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
83             protected bool swigCMemOwn;
84
85             internal Padding(global::System.IntPtr cPtr, bool cMemoryOwn)
86             {
87                 swigCMemOwn = cMemoryOwn;
88                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
89             }
90
91             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Padding obj)
92             {
93                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
94             }
95
96             //A Flag to check who called Dispose(). (By User or DisposeQueue)
97             private bool isDisposeQueued = false;
98             //A Flat to check if it is already disposed.
99             protected bool disposed = false;
100
101             ~Padding()
102             {
103                 if (!isDisposeQueued)
104                 {
105                     isDisposeQueued = true;
106                     DisposeQueue.Instance.Add(this);
107                 }
108             }
109
110             public void Dispose()
111             {
112                 //Throw excpetion if Dispose() is called in separate thread.
113                 if (!Window.IsInstalled())
114                 {
115                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
116                 }
117
118                 if (isDisposeQueued)
119                 {
120                     Dispose(DisposeTypes.Implicit);
121                 }
122                 else
123                 {
124                     Dispose(DisposeTypes.Explicit);
125                     System.GC.SuppressFinalize(this);
126                 }
127             }
128
129             protected virtual void Dispose(DisposeTypes type)
130             {
131                 if (disposed)
132                 {
133                     return;
134                 }
135
136                 if (type == DisposeTypes.Explicit)
137                 {
138                     //Called by User
139                     //Release your own managed resources here.
140                     //You should release all of your own disposable objects here.
141
142                 }
143
144                 //Release your own unmanaged resources here.
145                 //You should not access any managed member here except static instance.
146                 //because the execution order of Finalizes is non-deterministic.
147
148                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
149                 {
150                     if (swigCMemOwn)
151                     {
152                         swigCMemOwn = false;
153                         NDalicPINVOKE.delete_Alignment_Padding(swigCPtr);
154                     }
155                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
156                 }
157
158                 disposed = true;
159             }
160
161             public Padding() : this(NDalicPINVOKE.new_Alignment_Padding__SWIG_0(), true)
162             {
163                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164             }
165
166             public Padding(float l, float r, float t, float b) : this(NDalicPINVOKE.new_Alignment_Padding__SWIG_1(l, r, t, b), true)
167             {
168                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169             }
170
171             public float left
172             {
173                 set
174                 {
175                     NDalicPINVOKE.Alignment_Padding_left_set(swigCPtr, value);
176                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177                 }
178                 get
179                 {
180                     float ret = NDalicPINVOKE.Alignment_Padding_left_get(swigCPtr);
181                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182                     return ret;
183                 }
184             }
185
186             public float right
187             {
188                 set
189                 {
190                     NDalicPINVOKE.Alignment_Padding_right_set(swigCPtr, value);
191                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192                 }
193                 get
194                 {
195                     float ret = NDalicPINVOKE.Alignment_Padding_right_get(swigCPtr);
196                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197                     return ret;
198                 }
199             }
200
201             public float top
202             {
203                 set
204                 {
205                     NDalicPINVOKE.Alignment_Padding_top_set(swigCPtr, value);
206                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207                 }
208                 get
209                 {
210                     float ret = NDalicPINVOKE.Alignment_Padding_top_get(swigCPtr);
211                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212                     return ret;
213                 }
214             }
215
216             public float bottom
217             {
218                 set
219                 {
220                     NDalicPINVOKE.Alignment_Padding_bottom_set(swigCPtr, value);
221                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222                 }
223                 get
224                 {
225                     float ret = NDalicPINVOKE.Alignment_Padding_bottom_get(swigCPtr);
226                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227                     return ret;
228                 }
229             }
230
231         }
232
233         public Alignment(Alignment.Type horizontal, Alignment.Type vertical) : this(NDalicPINVOKE.Alignment_New__SWIG_0((int)horizontal, (int)vertical), true)
234         {
235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236
237         }
238         public Alignment(Alignment.Type horizontal) : this(NDalicPINVOKE.Alignment_New__SWIG_1((int)horizontal), true)
239         {
240             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241
242         }
243         public Alignment() : this(NDalicPINVOKE.Alignment_New__SWIG_2(), true)
244         {
245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246
247         }
248         public Alignment(Alignment alignment) : this(NDalicPINVOKE.new_Alignment__SWIG_1(Alignment.getCPtr(alignment)), true)
249         {
250             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251         }
252
253         public new static Alignment DownCast(BaseHandle handle)
254         {
255             Alignment ret = new Alignment(NDalicPINVOKE.Alignment_DownCast(BaseHandle.getCPtr(handle)), true);
256             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257             return ret;
258         }
259
260         public void SetAlignmentType(Alignment.Type type)
261         {
262             NDalicPINVOKE.Alignment_SetAlignmentType(swigCPtr, (int)type);
263             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264         }
265
266         public Alignment.Type GetAlignmentType()
267         {
268             Alignment.Type ret = (Alignment.Type)NDalicPINVOKE.Alignment_GetAlignmentType(swigCPtr);
269             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270             return ret;
271         }
272
273         public void SetScaling(Alignment.Scaling scaling)
274         {
275             NDalicPINVOKE.Alignment_SetScaling(swigCPtr, (int)scaling);
276             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277         }
278
279         public Alignment.Scaling GetScaling()
280         {
281             Alignment.Scaling ret = (Alignment.Scaling)NDalicPINVOKE.Alignment_GetScaling(swigCPtr);
282             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283             return ret;
284         }
285
286         public void SetPadding(Alignment.Padding padding)
287         {
288             NDalicPINVOKE.Alignment_SetPadding(swigCPtr, Alignment.Padding.getCPtr(padding));
289             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290         }
291
292         public Alignment.Padding GetPadding()
293         {
294             Alignment.Padding ret = new Alignment.Padding(NDalicPINVOKE.Alignment_GetPadding(swigCPtr), false);
295             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296             return ret;
297         }
298
299         public Alignment Assign(Alignment alignment)
300         {
301             Alignment ret = new Alignment(NDalicPINVOKE.Alignment_Assign(swigCPtr, Alignment.getCPtr(alignment)), false);
302             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303             return ret;
304         }
305
306         public enum Type
307         {
308             HorizontalLeft = 1,
309             HorizontalCenter = 2,
310             HorizontalRight = 4,
311             VerticalTop = 8,
312             VerticalCenter = 16,
313             VerticalBottom = 32
314         }
315
316         public enum Scaling
317         {
318             ScaleNone,
319             ScaleToFill,
320             ScaleToFitKeepAspect,
321             ScaleToFillKeepAspect,
322             ShrinkToFit,
323             ShrinkToFitKeepAspect
324         }
325
326     }
327
328 }