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 Alignment : View
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal Alignment(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Alignment.Alignment_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Alignment 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 Interop.Alignment.delete_Alignment(swigCPtr);
63 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71 /// <since_tizen> 3 </since_tizen>
72 public new class Padding : global::System.IDisposable
74 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
75 /// <since_tizen> 3 </since_tizen>
76 protected bool swigCMemOwn;
78 internal Padding(global::System.IntPtr cPtr, bool cMemoryOwn)
80 swigCMemOwn = cMemoryOwn;
81 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
84 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Padding obj)
86 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
89 //A Flag to check who called Dispose(). (By User or DisposeQueue)
90 private bool isDisposeQueued = false;
91 //A Flat to check if it is already disposed.
92 /// <since_tizen> 3 </since_tizen>
93 protected bool disposed = false;
99 isDisposeQueued = true;
100 DisposeQueue.Instance.Add(this);
104 /// <since_tizen> 3 </since_tizen>
105 public void Dispose()
107 //Throw excpetion if Dispose() is called in separate thread.
108 if (!Window.IsInstalled())
110 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
115 Dispose(DisposeTypes.Implicit);
119 Dispose(DisposeTypes.Explicit);
120 System.GC.SuppressFinalize(this);
124 /// <since_tizen> 3 </since_tizen>
125 protected virtual void Dispose(DisposeTypes type)
132 if (type == DisposeTypes.Explicit)
135 //Release your own managed resources here.
136 //You should release all of your own disposable objects here.
140 //Release your own unmanaged resources here.
141 //You should not access any managed member here except static instance.
142 //because the execution order of Finalizes is non-deterministic.
144 if (swigCPtr.Handle != global::System.IntPtr.Zero)
149 Interop.Alignment.delete_Alignment_Padding(swigCPtr);
151 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
157 /// <since_tizen> 3 </since_tizen>
158 public Padding() : this(Interop.Alignment.new_Alignment_Padding__SWIG_0(), true)
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 /// <since_tizen> 3 </since_tizen>
164 public Padding(float l, float r, float t, float b) : this(Interop.Alignment.new_Alignment_Padding__SWIG_1(l, r, t, b), true)
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 /// <since_tizen> 3 </since_tizen>
174 Interop.Alignment.Alignment_Padding_left_set(swigCPtr, value);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 float ret = Interop.Alignment.Alignment_Padding_left_get(swigCPtr);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 /// <since_tizen> 3 </since_tizen>
190 Interop.Alignment.Alignment_Padding_right_set(swigCPtr, value);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 float ret = Interop.Alignment.Alignment_Padding_right_get(swigCPtr);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 /// <since_tizen> 3 </since_tizen>
206 Interop.Alignment.Alignment_Padding_top_set(swigCPtr, value);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 float ret = Interop.Alignment.Alignment_Padding_top_get(swigCPtr);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 /// <since_tizen> 3 </since_tizen>
222 Interop.Alignment.Alignment_Padding_bottom_set(swigCPtr, value);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 float ret = Interop.Alignment.Alignment_Padding_bottom_get(swigCPtr);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 public Alignment(Alignment.Type horizontal, Alignment.Type vertical) : this(Interop.Alignment.Alignment_New__SWIG_0((int)horizontal, (int)vertical), true)
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 public Alignment(Alignment.Type horizontal) : this(Interop.Alignment.Alignment_New__SWIG_1((int)horizontal), true)
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 public Alignment() : this(Interop.Alignment.Alignment_New__SWIG_2(), true)
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 public Alignment(Alignment alignment) : this(Interop.Alignment.new_Alignment__SWIG_1(Alignment.getCPtr(alignment)), true)
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 public static Alignment DownCast(BaseHandle handle)
257 Alignment ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Alignment;
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 public void SetAlignmentType(Alignment.Type type)
264 Interop.Alignment.Alignment_SetAlignmentType(swigCPtr, (int)type);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 public Alignment.Type GetAlignmentType()
270 Alignment.Type ret = (Alignment.Type)Interop.Alignment.Alignment_GetAlignmentType(swigCPtr);
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 public void SetScaling(Alignment.Scaling scaling)
277 Interop.Alignment.Alignment_SetScaling(swigCPtr, (int)scaling);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 public Alignment.Scaling GetScaling()
283 Alignment.Scaling ret = (Alignment.Scaling)Interop.Alignment.Alignment_GetScaling(swigCPtr);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 public void SetPadding(Alignment.Padding padding)
290 Interop.Alignment.Alignment_SetPadding(swigCPtr, Alignment.Padding.getCPtr(padding));
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 public Alignment.Padding GetPadding()
296 Alignment.Padding ret = new Alignment.Padding(Interop.Alignment.Alignment_GetPadding(swigCPtr), false);
297 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 public Alignment Assign(Alignment alignment)
303 Alignment ret = new Alignment(Interop.Alignment.Alignment_Assign(swigCPtr, Alignment.getCPtr(alignment)), false);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 /// <since_tizen> 3 </since_tizen>
312 HorizontalCenter = 2,
319 /// <since_tizen> 3 </since_tizen>
324 ScaleToFitKeepAspect,
325 ScaleToFillKeepAspect,
327 ShrinkToFitKeepAspect