1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
27 using Tizen.NUI.BaseComponents;
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>
37 public class FlexContainer : View
39 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 internal FlexContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.FlexContainer_SWIGUpcast(cPtr), cMemoryOwn)
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;
48 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FlexContainer obj)
50 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
53 protected override void Dispose(DisposeTypes type)
60 if(type == DisposeTypes.Explicit)
63 //Release your own managed resources here.
64 //You should release all of your own disposable objects here.
67 //Release your own unmanaged resources here.
68 //You should not access any managed member here except static instance.
69 //because the execution order of Finalizes is non-deterministic.
71 if (swigCPtr.Handle != global::System.IntPtr.Zero)
76 NDalicPINVOKE.delete_FlexContainer(swigCPtr);
78 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
85 internal class Property
87 internal static readonly int CONTENT_DIRECTION = NDalicPINVOKE.FlexContainer_Property_CONTENT_DIRECTION_get();
88 internal static readonly int FLEX_DIRECTION = NDalicPINVOKE.FlexContainer_Property_FLEX_DIRECTION_get();
89 internal static readonly int FLEX_WRAP = NDalicPINVOKE.FlexContainer_Property_FLEX_WRAP_get();
90 internal static readonly int JUSTIFY_CONTENT = NDalicPINVOKE.FlexContainer_Property_JUSTIFY_CONTENT_get();
91 internal static readonly int ALIGN_ITEMS = NDalicPINVOKE.FlexContainer_Property_ALIGN_ITEMS_get();
92 internal static readonly int ALIGN_CONTENT = NDalicPINVOKE.FlexContainer_Property_ALIGN_CONTENT_get();
97 /// Enumeration for the instance of child properties belonging to the FlexContainer class.
99 public class ChildProperty
101 internal static readonly int FLEX = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_get();
102 internal static readonly int ALIGN_SELF = NDalicPINVOKE.FlexContainer_ChildProperty_ALIGN_SELF_get();
103 internal static readonly int FLEX_MARGIN = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_MARGIN_get();
107 /// Creates a FlexContainer handle.
108 /// Calling member functions with an uninitialized handle is not allowed.
110 public FlexContainer() : this(NDalicPINVOKE.FlexContainer_New(), true)
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 internal new static FlexContainer DownCast(BaseHandle handle)
118 FlexContainer ret = new FlexContainer(NDalicPINVOKE.FlexContainer_DownCast(BaseHandle.getCPtr(handle)), true);
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 /// Enumeration for the direction of the main axis in the flex container. This determines
125 /// the direction that flex items are laid out in the flex container.
127 public enum FlexDirectionType
136 /// Enumeration for the primary direction in which content is ordered in the flex container
137 /// and on which sides the ?�start??and ?�end??are.
139 public enum ContentDirectionType
147 /// Enumeration for the alignment of the flex items when the items do not use all available
148 /// space on the main-axis.
150 public enum Justification
160 /// Enumeration for the alignment of the flex items or lines when the items or lines do not
161 /// use all the available space on the cross-axis.
163 public enum Alignment
173 /// Enumeration for the wrap type of the flex container when there is no enough room for
174 /// all the items on one flex line.
183 /// The primary direction in which content is ordered
185 public ContentDirectionType ContentDirection
190 GetProperty(FlexContainer.Property.CONTENT_DIRECTION).Get(out temp);
191 return (ContentDirectionType)temp;
195 SetProperty(FlexContainer.Property.CONTENT_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
200 /// The direction of the main-axis which determines the direction that flex items are laid out
202 public FlexDirectionType FlexDirection
207 GetProperty(FlexContainer.Property.FLEX_DIRECTION).Get(out temp);
208 return (FlexDirectionType)temp;
212 SetProperty(FlexContainer.Property.FLEX_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
217 /// Whether the flex items should wrap or not if there is no enough room for them on one flex line
219 public WrapType FlexWrap
224 GetProperty(FlexContainer.Property.FLEX_WRAP).Get(out temp);
225 return (WrapType)temp;
229 SetProperty(FlexContainer.Property.FLEX_WRAP, new Tizen.NUI.PropertyValue((int)value));
234 /// The alignment of flex items when the items do not use all available space on the main-axis
236 public Justification JustifyContent
241 GetProperty(FlexContainer.Property.JUSTIFY_CONTENT).Get(out temp);
242 return (Justification)temp;
246 SetProperty(FlexContainer.Property.JUSTIFY_CONTENT, new Tizen.NUI.PropertyValue((int)value));
251 /// The alignment of flex items when the items do not use all available space on the cross-axis
253 public Alignment AlignItems
258 GetProperty(FlexContainer.Property.ALIGN_ITEMS).Get(out temp);
259 return (Alignment)temp;
263 SetProperty(FlexContainer.Property.ALIGN_ITEMS, new Tizen.NUI.PropertyValue((int)value));
268 /// Similar to "alignItems", but it aligns flex lines, so only works when there are multiple lines
270 public Alignment AlignContent
275 GetProperty(FlexContainer.Property.ALIGN_CONTENT).Get(out temp);
276 return (Alignment)temp;
280 SetProperty(FlexContainer.Property.ALIGN_CONTENT, new Tizen.NUI.PropertyValue((int)value));