[NUI] Rebase DevelNUI (#2507)
[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.Upcast(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.DeleteAlignment(swigCPtr);
38         }
39
40         public new class Padding : Disposable
41         {
42
43             internal Padding(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
44             {
45             }
46
47             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Padding obj)
48             {
49                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
50             }
51
52             protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
53             {
54                 Interop.Alignment.DeleteAlignmentPadding(swigCPtr);
55             }
56
57             public Padding() : this(Interop.Alignment.NewAlignmentPadding(), true)
58             {
59                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60             }
61
62             public Padding(float l, float r, float t, float b) : this(Interop.Alignment.NewAlignmentPadding(l, r, t, b), true)
63             {
64                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65             }
66
67             public float left
68             {
69                 set
70                 {
71                     Interop.Alignment.PaddingLeftSet(SwigCPtr, value);
72                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73                 }
74                 get
75                 {
76                     float ret = Interop.Alignment.PaddingLeftGet(SwigCPtr);
77                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78                     return ret;
79                 }
80             }
81
82             public float right
83             {
84                 set
85                 {
86                     Interop.Alignment.PaddingRightSet(SwigCPtr, value);
87                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88                 }
89                 get
90                 {
91                     float ret = Interop.Alignment.PaddingRightGet(SwigCPtr);
92                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93                     return ret;
94                 }
95             }
96
97             public float top
98             {
99                 set
100                 {
101                     Interop.Alignment.PaddingTopSet(SwigCPtr, value);
102                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103                 }
104                 get
105                 {
106                     float ret = Interop.Alignment.PaddingTopGet(SwigCPtr);
107                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108                     return ret;
109                 }
110             }
111
112             public float bottom
113             {
114                 set
115                 {
116                     Interop.Alignment.PaddingBottomSet(SwigCPtr, value);
117                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118                 }
119                 get
120                 {
121                     float ret = Interop.Alignment.PaddingBottomGet(SwigCPtr);
122                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123                     return ret;
124                 }
125             }
126         }
127
128         public Alignment(Alignment.Type horizontal, Alignment.Type vertical) : this(Interop.Alignment.New((int)horizontal, (int)vertical), true)
129         {
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131
132         }
133         public Alignment(Alignment.Type horizontal) : this(Interop.Alignment.New((int)horizontal), true)
134         {
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136
137         }
138         public Alignment() : this(Interop.Alignment.New(), true)
139         {
140             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141
142         }
143         public Alignment(Alignment alignment) : this(Interop.Alignment.NewAlignment(Alignment.getCPtr(alignment)), true)
144         {
145             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146         }
147
148         public static Alignment DownCast(BaseHandle handle)
149         {
150             Alignment ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Alignment;
151             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152             return ret;
153         }
154
155         public void SetAlignmentType(Alignment.Type type)
156         {
157             Interop.Alignment.SetAlignmentType(SwigCPtr, (int)type);
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159         }
160
161         public Alignment.Type GetAlignmentType()
162         {
163             Alignment.Type ret = (Alignment.Type)Interop.Alignment.GetAlignmentType(SwigCPtr);
164             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165             return ret;
166         }
167
168         public void SetScaling(Alignment.Scaling scaling)
169         {
170             Interop.Alignment.SetScaling(SwigCPtr, (int)scaling);
171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172         }
173
174         public Alignment.Scaling GetScaling()
175         {
176             Alignment.Scaling ret = (Alignment.Scaling)Interop.Alignment.GetScaling(SwigCPtr);
177             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178             return ret;
179         }
180
181         public void SetPadding(Alignment.Padding padding)
182         {
183             Interop.Alignment.SetPadding(SwigCPtr, Alignment.Padding.getCPtr(padding));
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185         }
186
187         public Alignment.Padding GetPadding()
188         {
189             Alignment.Padding ret = new Alignment.Padding(Interop.Alignment.GetPadding(SwigCPtr), false);
190             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191             return ret;
192         }
193
194         public Alignment Assign(Alignment alignment)
195         {
196             Alignment ret = new Alignment(Interop.Alignment.Assign(SwigCPtr, Alignment.getCPtr(alignment)), false);
197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198             return ret;
199         }
200
201         public enum Type
202         {
203             HorizontalLeft = 1,
204             HorizontalCenter = 2,
205             HorizontalRight = 4,
206             VerticalTop = 8,
207             VerticalCenter = 16,
208             VerticalBottom = 32
209         }
210
211         public enum Scaling
212         {
213             ScaleNone,
214             ScaleToFill,
215             ScaleToFitKeepAspect,
216             ScaleToFillKeepAspect,
217             ShrinkToFit,
218             ShrinkToFitKeepAspect
219         }
220     }
221 }