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