1 /** Copyright (c) 2018 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 using System.ComponentModel;
21 /// [Draft] This class implements a linear box layout, automatically handling right to left or left to right direction change.
23 internal class LinearLayout : LayoutGroupWrapper
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal LinearLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.LinearLayout_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LinearLayout obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 if (type == DisposeTypes.Explicit)
47 //Release your own managed resources here.
48 //You should release all of your own disposable objects here.
52 //Release your own unmanaged resources here.
53 //You should not access any managed member here except static instance.
54 //because the execution order of Finalizes is non-deterministic.
55 if (swigCPtr.Handle != global::System.IntPtr.Zero)
60 LayoutPINVOKE.delete_LinearLayout(swigCPtr);
62 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
67 internal static class ChildProperty
69 internal static readonly int WEIGHT = LayoutPINVOKE.LinearLayout_ChildProperty_WEIGHT_get();
71 public LinearLayout() : this(LayoutPINVOKE.LinearLayout_New(), true)
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 public new static LinearLayout DownCast(BaseHandle handle)
78 LinearLayout ret = new LinearLayout(LayoutPINVOKE.LinearLayout_DownCast(BaseHandle.getCPtr(handle)), true);
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 internal LinearLayout(LinearLayout other) : this(LayoutPINVOKE.new_LinearLayout__SWIG_1(LinearLayout.getCPtr(other)), true)
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 internal LinearLayout Assign(LinearLayout other)
90 LinearLayout ret = new LinearLayout(LayoutPINVOKE.LinearLayout_Assign(swigCPtr, LinearLayout.getCPtr(other)), false);
91 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 internal void SetCellPadding(LayoutSize size)
97 LayoutPINVOKE.LinearLayout_SetCellPadding(swigCPtr, LayoutSize.getCPtr(size));
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101 internal LayoutSize GetCellPadding()
103 LayoutSize ret = new LayoutSize(LayoutPINVOKE.LinearLayout_GetCellPadding(swigCPtr), true);
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 internal void SetOrientation(LinearLayout.Orientation orientation)
111 LayoutPINVOKE.LinearLayout_SetOrientation(swigCPtr, (int)orientation);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 internal LinearLayout.Orientation GetOrientation()
117 LinearLayout.Orientation ret = (LinearLayout.Orientation)LayoutPINVOKE.LinearLayout_GetOrientation(swigCPtr);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 internal void SetAlignment(LinearLayout.Alignment alignment)
124 LayoutPINVOKE.LinearLayout_SetAlignment(swigCPtr, (uint)alignment);
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 internal LinearLayout.Alignment GetAlignment()
130 LinearLayout.Alignment ret = (LinearLayout.Alignment)LayoutPINVOKE.LinearLayout_GetAlignment(swigCPtr);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 internal enum PropertyRange
137 CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX,
138 CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000
142 /// [Draft] Get/Set the orientation in the layout
144 public LinearLayout.Orientation LinearOrientation
148 return GetOrientation();
152 SetOrientation(value);
157 /// [Draft] Get/Set the padding between cells in the layout
159 public LayoutSize CellPadding
163 return GetCellPadding();
167 SetCellPadding(value);
172 /// [Draft] Get/Set the alignment in the layout
174 public LinearLayout.Alignment LinearAlignment
178 return GetAlignment();
187 /// [Draft] Enumeration for the direction in which the content is laid out
189 public enum Orientation
196 /// Vertical (column)
202 /// [Draft] Enumeration for the alignment of the linear layout items
204 public enum Alignment
207 /// At the left/right edge of the container (maps to LTR/RTL direction for horizontal orientation)
211 /// At the right/left edge of the container (maps to LTR/RTL direction for horizontal orientation)
215 /// At the horizontal center of the container
217 CenterHorizontal = 0x4,
219 /// At the top edge of the container
223 /// At the bottom edge of the container
227 /// At the vertical center of the container
229 CenterVertical = 0x20