1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using Tizen.NUI.BaseComponents;
22 internal class Alignment : View
24 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26 internal Alignment(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Alignment_SWIGUpcast(cPtr), cMemoryOwn)
28 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Alignment obj)
33 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36 protected override void Dispose(DisposeTypes type)
43 if (type == DisposeTypes.Explicit)
46 //Release your own managed resources here.
47 //You should release all of your own disposable objects here.
51 //Release your own unmanaged resources here.
52 //You should not access any managed member here except static instance.
53 //because the execution order of Finalizes is non-deterministic.
55 if (swigCPtr.Handle != global::System.IntPtr.Zero)
60 NDalicPINVOKE.delete_Alignment(swigCPtr);
62 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 public class Padding : global::System.IDisposable
72 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
73 protected bool swigCMemOwn;
75 internal Padding(global::System.IntPtr cPtr, bool cMemoryOwn)
77 swigCMemOwn = cMemoryOwn;
78 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
81 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Padding obj)
83 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
86 //A Flag to check who called Dispose(). (By User or DisposeQueue)
87 private bool isDisposeQueued = false;
88 //A Flat to check if it is already disposed.
89 protected bool disposed = false;
95 isDisposeQueued = true;
96 DisposeQueue.Instance.Add(this);
100 public void Dispose()
102 //Throw excpetion if Dispose() is called in separate thread.
103 if (!Window.IsInstalled())
105 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
110 Dispose(DisposeTypes.Implicit);
114 Dispose(DisposeTypes.Explicit);
115 System.GC.SuppressFinalize(this);
119 protected virtual void Dispose(DisposeTypes type)
126 if (type == DisposeTypes.Explicit)
129 //Release your own managed resources here.
130 //You should release all of your own disposable objects here.
134 //Release your own unmanaged resources here.
135 //You should not access any managed member here except static instance.
136 //because the execution order of Finalizes is non-deterministic.
138 if (swigCPtr.Handle != global::System.IntPtr.Zero)
143 NDalicPINVOKE.delete_Alignment_Padding(swigCPtr);
145 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
151 public Padding() : this(NDalicPINVOKE.new_Alignment_Padding__SWIG_0(), true)
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public Padding(float l, float r, float t, float b) : this(NDalicPINVOKE.new_Alignment_Padding__SWIG_1(l, r, t, b), true)
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 NDalicPINVOKE.Alignment_Padding_left_set(swigCPtr, value);
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 float ret = NDalicPINVOKE.Alignment_Padding_left_get(swigCPtr);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 NDalicPINVOKE.Alignment_Padding_right_set(swigCPtr, value);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 float ret = NDalicPINVOKE.Alignment_Padding_right_get(swigCPtr);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 NDalicPINVOKE.Alignment_Padding_top_set(swigCPtr, value);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 float ret = NDalicPINVOKE.Alignment_Padding_top_get(swigCPtr);
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 NDalicPINVOKE.Alignment_Padding_bottom_set(swigCPtr, value);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 float ret = NDalicPINVOKE.Alignment_Padding_bottom_get(swigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public Alignment(Alignment.Type horizontal, Alignment.Type vertical) : this(NDalicPINVOKE.Alignment_New__SWIG_0((int)horizontal, (int)vertical), true)
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public Alignment(Alignment.Type horizontal) : this(NDalicPINVOKE.Alignment_New__SWIG_1((int)horizontal), true)
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public Alignment() : this(NDalicPINVOKE.Alignment_New__SWIG_2(), true)
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 public Alignment(Alignment alignment) : this(NDalicPINVOKE.new_Alignment__SWIG_1(Alignment.getCPtr(alignment)), true)
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public new static Alignment DownCast(BaseHandle handle)
245 Alignment ret = new Alignment(NDalicPINVOKE.Alignment_DownCast(BaseHandle.getCPtr(handle)), true);
246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 public void SetAlignmentType(Alignment.Type type)
252 NDalicPINVOKE.Alignment_SetAlignmentType(swigCPtr, (int)type);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 public Alignment.Type GetAlignmentType()
258 Alignment.Type ret = (Alignment.Type)NDalicPINVOKE.Alignment_GetAlignmentType(swigCPtr);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 public void SetScaling(Alignment.Scaling scaling)
265 NDalicPINVOKE.Alignment_SetScaling(swigCPtr, (int)scaling);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 public Alignment.Scaling GetScaling()
271 Alignment.Scaling ret = (Alignment.Scaling)NDalicPINVOKE.Alignment_GetScaling(swigCPtr);
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 public void SetPadding(Alignment.Padding padding)
278 NDalicPINVOKE.Alignment_SetPadding(swigCPtr, Alignment.Padding.getCPtr(padding));
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 public Alignment.Padding GetPadding()
284 Alignment.Padding ret = new Alignment.Padding(NDalicPINVOKE.Alignment_GetPadding(swigCPtr), false);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 public Alignment Assign(Alignment alignment)
291 Alignment ret = new Alignment(NDalicPINVOKE.Alignment_Assign(swigCPtr, Alignment.getCPtr(alignment)), false);
292 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 HorizontalCenter = 2,
310 ScaleToFitKeepAspect,
311 ScaleToFillKeepAspect,
313 ShrinkToFitKeepAspect