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