nui 0.2.32 manual merge, mapping to dali 1.2.32
[platform/core/csapi/tizenfx.git] / NUISamples / Tizen.NUI / src / public / FlexContainer.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 namespace Tizen.NUI
28 {
29
30     public class FlexContainer : View
31     {
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33
34         internal FlexContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.FlexContainer_SWIGUpcast(cPtr), cMemoryOwn)
35         {
36             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37         }
38
39         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FlexContainer obj)
40         {
41             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42         }
43
44         ~FlexContainer()
45         {
46             DisposeQueue.Instance.Add(this);
47         }
48
49         public override void Dispose()
50         {
51             if (!Stage.IsInstalled())
52             {
53                 DisposeQueue.Instance.Add(this);
54                 return;
55             }
56
57             lock (this)
58             {
59                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
60                 {
61                     if (swigCMemOwn)
62                     {
63                         swigCMemOwn = false;
64                         NDalicPINVOKE.delete_FlexContainer(swigCPtr);
65                     }
66                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
67                 }
68                 global::System.GC.SuppressFinalize(this);
69                 base.Dispose();
70             }
71         }
72
73
74         internal class Property : global::System.IDisposable
75         {
76             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
77             protected bool swigCMemOwn;
78
79             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
80             {
81                 swigCMemOwn = cMemoryOwn;
82                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
83             }
84
85             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
86             {
87                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
88             }
89
90             ~Property()
91             {
92                 Dispose();
93             }
94
95             public virtual void Dispose()
96             {
97                 lock (this)
98                 {
99                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
100                     {
101                         if (swigCMemOwn)
102                         {
103                             swigCMemOwn = false;
104                             NDalicPINVOKE.delete_FlexContainer_Property(swigCPtr);
105                         }
106                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
107                     }
108                     global::System.GC.SuppressFinalize(this);
109                 }
110             }
111
112             internal Property() : this(NDalicPINVOKE.new_FlexContainer_Property(), true)
113             {
114                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115             }
116
117             internal static readonly int CONTENT_DIRECTION = NDalicPINVOKE.FlexContainer_Property_CONTENT_DIRECTION_get();
118             internal static readonly int FLEX_DIRECTION = NDalicPINVOKE.FlexContainer_Property_FLEX_DIRECTION_get();
119             internal static readonly int FLEX_WRAP = NDalicPINVOKE.FlexContainer_Property_FLEX_WRAP_get();
120             internal static readonly int JUSTIFY_CONTENT = NDalicPINVOKE.FlexContainer_Property_JUSTIFY_CONTENT_get();
121             internal static readonly int ALIGN_ITEMS = NDalicPINVOKE.FlexContainer_Property_ALIGN_ITEMS_get();
122             internal static readonly int ALIGN_CONTENT = NDalicPINVOKE.FlexContainer_Property_ALIGN_CONTENT_get();
123
124         }
125
126         /// <summary>
127         /// Enumeration for the instance of child properties belonging to the FlexContainer class.
128         /// </summary>
129         public class ChildProperty : global::System.IDisposable
130         {
131             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
132             protected bool swigCMemOwn;
133
134             internal ChildProperty(global::System.IntPtr cPtr, bool cMemoryOwn)
135             {
136                 swigCMemOwn = cMemoryOwn;
137                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
138             }
139
140             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ChildProperty obj)
141             {
142                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
143             }
144
145             ~ChildProperty()
146             {
147                 Dispose();
148             }
149
150             public virtual void Dispose()
151             {
152                 lock (this)
153                 {
154                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
155                     {
156                         if (swigCMemOwn)
157                         {
158                             swigCMemOwn = false;
159                             NDalicPINVOKE.delete_FlexContainer_ChildProperty(swigCPtr);
160                         }
161                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
162                     }
163                     global::System.GC.SuppressFinalize(this);
164                 }
165             }
166
167             internal ChildProperty() : this(NDalicPINVOKE.new_FlexContainer_ChildProperty(), true)
168             {
169                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170             }
171
172             internal static readonly int FLEX = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_get();
173             internal static readonly int ALIGN_SELF = NDalicPINVOKE.FlexContainer_ChildProperty_ALIGN_SELF_get();
174             internal static readonly int FLEX_MARGIN = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_MARGIN_get();
175
176         }
177
178         /// <summary>
179         /// Creates a FlexContainer handle.
180         /// Calling member functions with an uninitialized handle is not allowed.
181         /// </summary>
182         public FlexContainer() : this(NDalicPINVOKE.FlexContainer_New(), true)
183         {
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185
186         }
187         internal FlexContainer(FlexContainer handle) : this(NDalicPINVOKE.new_FlexContainer__SWIG_1(FlexContainer.getCPtr(handle)), true)
188         {
189             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190         }
191
192         internal FlexContainer Assign(FlexContainer handle)
193         {
194             FlexContainer ret = new FlexContainer(NDalicPINVOKE.FlexContainer_Assign(swigCPtr, FlexContainer.getCPtr(handle)), false);
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196             return ret;
197         }
198
199         internal new static FlexContainer DownCast(BaseHandle handle)
200         {
201             FlexContainer ret = new FlexContainer(NDalicPINVOKE.FlexContainer_DownCast(BaseHandle.getCPtr(handle)), true);
202             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203             return ret;
204         }
205
206         /// <summary>
207         /// Enumeration for the direction of the main axis in the flex container. This determines
208         /// the direction that flex items are laid out in the flex container.
209         /// </summary>
210         public enum FlexDirectionType
211         {
212             Column,
213             ColumnReverse,
214             Row,
215             RowReverse
216         }
217
218         /// <summary>
219         /// Enumeration for the primary direction in which content is ordered in the flex container
220         /// and on which sides the ?\9cstart??and ?\9cend??are.
221         /// </summary>
222         public enum ContentDirectionType
223         {
224             Inherit,
225             LTR,
226             RTL
227         }
228
229         /// <summary>
230         /// Enumeration for the alignment of the flex items when the items do not use all available
231         /// space on the main-axis.
232         /// </summary>
233         public enum Justification
234         {
235             JustifyFlexStart,
236             JustifyCenter,
237             JustifyFlexEnd,
238             JustifySpaceBetween,
239             JustifySpaceAround
240         }
241
242         /// <summary>
243         /// Enumeration for the alignment of the flex items or lines when the items or lines do not
244         /// use all the available space on the cross-axis.
245         /// </summary>
246         public enum Alignment
247         {
248             AlignAuto,
249             AlignFlexStart,
250             AlignCenter,
251             AlignFlexEnd,
252             AlignStretch
253         }
254
255         /// <summary>
256         /// Enumeration for the wrap type of the flex container when there is no enough room for
257         /// all the items on one flex line.
258         /// </summary>
259         public enum WrapType
260         {
261             NoWrap,
262             Wrap
263         }
264
265         internal enum PropertyRange
266         {
267             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
268             PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000,
269             CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX,
270             CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000
271         }
272
273         /// <summary>
274         /// The primary direction in which content is ordered
275         /// </summary>
276         public ContentDirectionType ContentDirection
277         {
278             get
279             {
280                 int temp = 0;
281                 GetProperty(FlexContainer.Property.CONTENT_DIRECTION).Get(ref temp);
282                 return (ContentDirectionType)temp;
283             }
284             set
285             {
286                 SetProperty(FlexContainer.Property.CONTENT_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
287             }
288         }
289
290         /// <summary>
291         /// The direction of the main-axis which determines the direction that flex items are laid out
292         /// </summary>
293         public FlexDirectionType FlexDirection
294         {
295             get
296             {
297                 int temp = 0;
298                 GetProperty(FlexContainer.Property.FLEX_DIRECTION).Get(ref temp);
299                 return (FlexDirectionType)temp;
300             }
301             set
302             {
303                 SetProperty(FlexContainer.Property.FLEX_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
304             }
305         }
306
307         /// <summary>
308         /// Whether the flex items should wrap or not if there is no enough room for them on one flex line
309         /// </summary>
310         public WrapType FlexWrap
311         {
312             get
313             {
314                 int temp = 0;
315                 GetProperty(FlexContainer.Property.FLEX_WRAP).Get(ref temp);
316                 return (WrapType)temp;
317             }
318             set
319             {
320                 SetProperty(FlexContainer.Property.FLEX_WRAP, new Tizen.NUI.PropertyValue((int)value));
321             }
322         }
323
324         /// <summary>
325         /// The alignment of flex items when the items do not use all available space on the main-axis
326         /// </summary>
327         public Justification JustifyContent
328         {
329             get
330             {
331                 int temp = 0;
332                 GetProperty(FlexContainer.Property.JUSTIFY_CONTENT).Get(ref temp);
333                 return (Justification)temp;
334             }
335             set
336             {
337                 SetProperty(FlexContainer.Property.JUSTIFY_CONTENT, new Tizen.NUI.PropertyValue((int)value));
338             }
339         }
340
341         /// <summary>
342         /// The alignment of flex items when the items do not use all available space on the cross-axis
343         /// </summary>
344         public Alignment AlignItems
345         {
346             get
347             {
348                 int temp = 0;
349                 GetProperty(FlexContainer.Property.ALIGN_ITEMS).Get(ref temp);
350                 return (Alignment)temp;
351             }
352             set
353             {
354                 SetProperty(FlexContainer.Property.ALIGN_ITEMS, new Tizen.NUI.PropertyValue((int)value));
355             }
356         }
357
358         /// <summary>
359         /// Similar to "alignItems", but it aligns flex lines, so only works when there are multiple lines
360         /// </summary>
361         public Alignment AlignContent
362         {
363             get
364             {
365                 int temp = 0;
366                 GetProperty(FlexContainer.Property.ALIGN_CONTENT).Get(ref temp);
367                 return (Alignment)temp;
368             }
369             set
370             {
371                 SetProperty(FlexContainer.Property.ALIGN_CONTENT, new Tizen.NUI.PropertyValue((int)value));
372             }
373         }
374
375     }
376
377 }