7b8e6c44122a43ec16da5808f676e1cf941b48d0
[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 internal class Alignment : View {
32   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33
34   internal Alignment(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Alignment_SWIGUpcast(cPtr), cMemoryOwn) {
35     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
36   }
37
38   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Alignment obj) {
39     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
40   }
41
42   public override void Dispose() {
43     if (!Window.IsInstalled()) {
44       DisposeQueue.Instance.Add(this);
45       return;
46     }
47
48     lock(this) {
49       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
50         if (swigCMemOwn) {
51           swigCMemOwn = false;
52           NDalicPINVOKE.delete_Alignment(swigCPtr);
53         }
54         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
55       }
56       global::System.GC.SuppressFinalize(this);
57       base.Dispose();
58     }
59   }
60
61
62   public class Padding : global::System.IDisposable {
63     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
64     protected bool swigCMemOwn;
65   
66     internal Padding(global::System.IntPtr cPtr, bool cMemoryOwn) {
67       swigCMemOwn = cMemoryOwn;
68       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
69     }
70   
71     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Padding obj) {
72       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
73     }
74   
75     ~Padding() {
76       DisposeQueue.Instance.Add(this);
77     }
78   
79     public virtual void Dispose() {
80       if (!Window.IsInstalled()) {
81         DisposeQueue.Instance.Add(this);
82         return;
83       }
84
85       lock(this) {
86         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
87           if (swigCMemOwn) {
88             swigCMemOwn = false;
89             NDalicPINVOKE.delete_Alignment_Padding(swigCPtr);
90           }
91           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
92         }
93         global::System.GC.SuppressFinalize(this);
94       }
95     }
96   
97     public Padding() : this(NDalicPINVOKE.new_Alignment_Padding__SWIG_0(), true) {
98       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99     }
100   
101     public Padding(float l, float r, float t, float b) : this(NDalicPINVOKE.new_Alignment_Padding__SWIG_1(l, r, t, b), true) {
102       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103     }
104   
105     public float left {
106       set {
107         NDalicPINVOKE.Alignment_Padding_left_set(swigCPtr, value);
108         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109       } 
110       get {
111         float ret = NDalicPINVOKE.Alignment_Padding_left_get(swigCPtr);
112         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113         return ret;
114       } 
115     }
116   
117     public float right {
118       set {
119         NDalicPINVOKE.Alignment_Padding_right_set(swigCPtr, value);
120         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121       } 
122       get {
123         float ret = NDalicPINVOKE.Alignment_Padding_right_get(swigCPtr);
124         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125         return ret;
126       } 
127     }
128   
129     public float top {
130       set {
131         NDalicPINVOKE.Alignment_Padding_top_set(swigCPtr, value);
132         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133       } 
134       get {
135         float ret = NDalicPINVOKE.Alignment_Padding_top_get(swigCPtr);
136         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137         return ret;
138       } 
139     }
140   
141     public float bottom {
142       set {
143         NDalicPINVOKE.Alignment_Padding_bottom_set(swigCPtr, value);
144         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145       } 
146       get {
147         float ret = NDalicPINVOKE.Alignment_Padding_bottom_get(swigCPtr);
148         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149         return ret;
150       } 
151     }
152   
153   }
154
155   public Alignment (Alignment.Type horizontal, Alignment.Type vertical) : this (NDalicPINVOKE.Alignment_New__SWIG_0((int)horizontal, (int)vertical), true) {
156       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157
158   }
159   public Alignment (Alignment.Type horizontal) : this (NDalicPINVOKE.Alignment_New__SWIG_1((int)horizontal), true) {
160       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161
162   }
163   public Alignment () : this (NDalicPINVOKE.Alignment_New__SWIG_2(), true) {
164       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165
166   }
167   public Alignment(Alignment alignment) : this(NDalicPINVOKE.new_Alignment__SWIG_1(Alignment.getCPtr(alignment)), true) {
168     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169   }
170
171   public new static Alignment DownCast(BaseHandle handle) {
172     Alignment ret = new Alignment(NDalicPINVOKE.Alignment_DownCast(BaseHandle.getCPtr(handle)), true);
173     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174     return ret;
175   }
176
177   public void SetAlignmentType(Alignment.Type type) {
178     NDalicPINVOKE.Alignment_SetAlignmentType(swigCPtr, (int)type);
179     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180   }
181
182   public Alignment.Type GetAlignmentType() {
183     Alignment.Type ret = (Alignment.Type)NDalicPINVOKE.Alignment_GetAlignmentType(swigCPtr);
184     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185     return ret;
186   }
187
188   public void SetScaling(Alignment.Scaling scaling) {
189     NDalicPINVOKE.Alignment_SetScaling(swigCPtr, (int)scaling);
190     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191   }
192
193   public Alignment.Scaling GetScaling() {
194     Alignment.Scaling ret = (Alignment.Scaling)NDalicPINVOKE.Alignment_GetScaling(swigCPtr);
195     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196     return ret;
197   }
198
199   public void SetPadding(Alignment.Padding padding) {
200     NDalicPINVOKE.Alignment_SetPadding(swigCPtr, Alignment.Padding.getCPtr(padding));
201     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202   }
203
204   public Alignment.Padding GetPadding() {
205     Alignment.Padding ret = new Alignment.Padding(NDalicPINVOKE.Alignment_GetPadding(swigCPtr), false);
206     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207     return ret;
208   }
209
210   public Alignment Assign(Alignment alignment) {
211     Alignment ret = new Alignment(NDalicPINVOKE.Alignment_Assign(swigCPtr, Alignment.getCPtr(alignment)), false);
212     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213     return ret;
214   }
215
216   public enum Type {
217     HorizontalLeft = 1,
218     HorizontalCenter = 2,
219     HorizontalRight = 4,
220     VerticalTop = 8,
221     VerticalCenter = 16,
222     VerticalBottom = 32
223   }
224
225   public enum Scaling {
226     ScaleNone,
227     ScaleToFill,
228     ScaleToFitKeepAspect,
229     ScaleToFillKeepAspect,
230     ShrinkToFit,
231     ShrinkToFitKeepAspect
232   }
233
234 }
235
236 }