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