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