2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using Tizen.NUI.BaseComponents;
22 internal class LayoutItemWrapperImpl : BaseObject, ILayoutParent
24 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26 public delegate void OnUnparentDelegate();
27 public delegate void OnRegisterChildPropertiesDelegate(string containerType);
28 public delegate void OnMeasureDelegate(LayoutMeasureSpec widthMeasureSpec, LayoutMeasureSpec heightMeasureSpec);
29 public delegate void OnLayoutDelegate(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom);
30 public delegate void OnSizeChangedDelegate(LayoutSize newSize, LayoutSize oldSize);
31 public delegate void OnInitializeDelegate();
33 public OnUnparentDelegate OnUnparent;
34 public OnRegisterChildPropertiesDelegate OnRegisterChildProperties;
35 public OnMeasureDelegate OnMeasure;
36 public OnLayoutDelegate OnLayout;
37 public OnSizeChangedDelegate OnSizeChanged;
38 public OnInitializeDelegate OnInitialize;
40 internal LayoutItemWrapperImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.LayoutItemWrapperImpl_SWIGUpcast(cPtr), cMemoryOwn)
42 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
45 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LayoutItemWrapperImpl obj)
47 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 protected override void Dispose(DisposeTypes type)
57 if (type == DisposeTypes.Explicit)
60 //Release your own managed resources here.
61 //You should release all of your own disposable objects here.
65 //Release your own unmanaged resources here.
66 //You should not access any managed member here except static instance.
67 //because the execution order of Finalizes is non-deterministic.
69 if (swigCPtr.Handle != global::System.IntPtr.Zero)
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
80 public LayoutItemWrapperImpl() : this(LayoutPINVOKE.new_LayoutItemWrapperImpl(), true)
82 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 SwigDirectorConnect();
86 /* public LayoutItemWrapperImpl (Handle owner) : this (NDalicPINVOKE.LayoutItemWrapperImpl_New(Handle.getCPtr(owner)), true)
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91 public void Initialize(View owner, string containerType)
93 LayoutPINVOKE.LayoutItemWrapperImpl_Initialize(swigCPtr, View.getCPtr(owner), containerType);
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97 public View GetOwner()
99 global::System.IntPtr cPtr = LayoutPINVOKE.LayoutItemWrapperImpl_GetOwner(swigCPtr);
100 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 internal void Unparent()
107 LayoutPINVOKE.LayoutItemWrapperImpl_Unparent(swigCPtr);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 internal void SetAnimateLayout(bool animateLayout)
113 LayoutPINVOKE.LayoutItemWrapperImpl_SetAnimateLayout(swigCPtr, animateLayout);
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 internal bool IsLayoutAnimated()
119 bool ret = LayoutPINVOKE.LayoutItemWrapperImpl_IsLayoutAnimated(swigCPtr);
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 internal void RegisterChildProperties(string containerType)
126 LayoutPINVOKE.LayoutItemWrapperImpl_RegisterChildProperties(swigCPtr, containerType);
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 internal void Measure(LayoutMeasureSpec widthMeasureSpec, LayoutMeasureSpec heightMeasureSpec)
132 LayoutPINVOKE.LayoutItemWrapperImpl_Measure(swigCPtr, LayoutMeasureSpec.getCPtr(widthMeasureSpec), LayoutMeasureSpec.getCPtr(heightMeasureSpec));
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 internal void Layout(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
138 LayoutPINVOKE.LayoutItemWrapperImpl_Layout(swigCPtr, LayoutLength.getCPtr(left), LayoutLength.getCPtr(top), LayoutLength.getCPtr(right), LayoutLength.getCPtr(bottom));
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 internal static LayoutLength GetDefaultSize(LayoutLength size, LayoutMeasureSpec measureSpec)
144 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetDefaultSize(LayoutLength.getCPtr(size), LayoutMeasureSpec.getCPtr(measureSpec)), true);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public ILayoutParent GetParent()
151 global::System.IntPtr cPtr = LayoutPINVOKE.LayoutItemWrapperImpl_GetParent(swigCPtr);
152 //ILayoutParent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ILayoutParent(cPtr, false);
153 ILayoutParent ret = (cPtr == global::System.IntPtr.Zero) ? null : new LayoutItemWrapperImpl(cPtr, false);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 internal void RequestLayout()
160 LayoutPINVOKE.LayoutItemWrapperImpl_RequestLayout(swigCPtr);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 internal bool IsLayoutRequested()
166 bool ret = LayoutPINVOKE.LayoutItemWrapperImpl_IsLayoutRequested(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 internal LayoutLength GetMeasuredWidth()
173 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetMeasuredWidth(swigCPtr), true);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 internal LayoutLength GetMeasuredHeight()
180 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetMeasuredHeight(swigCPtr), true);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 internal MeasuredSize GetMeasuredWidthAndState()
187 MeasuredSize ret = new MeasuredSize(LayoutPINVOKE.LayoutItemWrapperImpl_GetMeasuredWidthAndState(swigCPtr), true);
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 internal MeasuredSize GetMeasuredHeightAndState()
194 MeasuredSize ret = new MeasuredSize(LayoutPINVOKE.LayoutItemWrapperImpl_GetMeasuredHeightAndState(swigCPtr), true);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 internal LayoutLength GetSuggestedMinimumWidth()
201 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetSuggestedMinimumWidth(swigCPtr), true);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 internal LayoutLength GetSuggestedMinimumHeight()
208 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetSuggestedMinimumHeight(swigCPtr), true);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 internal void SetMinimumWidth(LayoutLength minWidth)
215 LayoutPINVOKE.LayoutItemWrapperImpl_SetMinimumWidth(swigCPtr, LayoutLength.getCPtr(minWidth));
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 internal void SetMinimumHeight(LayoutLength minHeight)
221 LayoutPINVOKE.LayoutItemWrapperImpl_SetMinimumHeight(swigCPtr, LayoutLength.getCPtr(minHeight));
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 internal LayoutLength GetMinimumWidth()
227 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetMinimumWidth(swigCPtr), true);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 internal LayoutLength GetMinimumHeight()
234 LayoutLength ret = new LayoutLength(LayoutPINVOKE.LayoutItemWrapperImpl_GetMinimumHeight(swigCPtr), true);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 public Extents GetPadding()
241 Extents ret = new Extents(LayoutPINVOKE.LayoutItemWrapperImpl_GetPadding(swigCPtr), true);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 internal void SetMeasuredDimensions(MeasuredSize measuredWidth, MeasuredSize measuredHeight)
248 LayoutPINVOKE.LayoutItemWrapperImpl_SetMeasuredDimensions(swigCPtr, MeasuredSize.getCPtr(measuredWidth), MeasuredSize.getCPtr(measuredHeight));
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 internal void OnUnparentNative()
254 LayoutPINVOKE.LayoutItemWrapperImpl_OnUnparent(swigCPtr);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 internal void OnRegisterChildPropertiesNative(string containerType)
260 LayoutPINVOKE.LayoutItemWrapperImpl_OnRegisterChildProperties(swigCPtr, containerType);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 internal void OnMeasureNative(LayoutMeasureSpec widthMeasureSpec, LayoutMeasureSpec heightMeasureSpec)
266 LayoutPINVOKE.LayoutItemWrapperImpl_OnMeasure(swigCPtr, LayoutMeasureSpec.getCPtr(widthMeasureSpec), LayoutMeasureSpec.getCPtr(heightMeasureSpec));
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 internal void OnLayoutNative(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
272 LayoutPINVOKE.LayoutItemWrapperImpl_OnLayout(swigCPtr, changed, LayoutLength.getCPtr(left), LayoutLength.getCPtr(top), LayoutLength.getCPtr(right), LayoutLength.getCPtr(bottom));
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 internal void OnSizeChangedNative(LayoutSize newSize, LayoutSize oldSize)
278 LayoutPINVOKE.LayoutItemWrapperImpl_OnSizeChanged(swigCPtr, LayoutSize.getCPtr(newSize), LayoutSize.getCPtr(oldSize));
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 internal void OnInitializeNative()
284 LayoutPINVOKE.LayoutItemWrapperImpl_OnInitialize(swigCPtr);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 protected void SwigDirectorConnect()
290 //swigDelegate0 = new SwigDelegateLayoutItemWrapperImpl_0(SwigDirectorGetParent);
291 swigDelegate1 = new SwigDelegateLayoutItemWrapperImpl_1(SwigDirectorOnUnparent);
292 swigDelegate2 = new SwigDelegateLayoutItemWrapperImpl_2(SwigDirectorOnRegisterChildProperties);
293 swigDelegate3 = new SwigDelegateLayoutItemWrapperImpl_3(SwigDirectorOnMeasure);
294 swigDelegate4 = new SwigDelegateLayoutItemWrapperImpl_4(SwigDirectorOnLayout);
295 swigDelegate5 = new SwigDelegateLayoutItemWrapperImpl_5(SwigDirectorOnSizeChanged);
296 swigDelegate6 = new SwigDelegateLayoutItemWrapperImpl_6(SwigDirectorOnInitialize);
298 LayoutPINVOKE.LayoutItemWrapperImpl_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6);
301 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
303 global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
304 bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(LayoutItemWrapperImpl));
305 return hasDerivedMethod;
308 /*private global::System.IntPtr SwigDirectorGetParent()
310 return ILayoutParent.getCPtr(GetParent()).Handle;
313 private void SwigDirectorOnUnparent()
318 private void SwigDirectorOnRegisterChildProperties(string containerType)
320 OnRegisterChildProperties(containerType);
323 private void SwigDirectorOnMeasure(global::System.IntPtr widthMeasureSpec, global::System.IntPtr heightMeasureSpec)
325 OnMeasure(new LayoutMeasureSpec(widthMeasureSpec, true), new LayoutMeasureSpec(heightMeasureSpec, true));
328 private void SwigDirectorOnLayout(bool changed, global::System.IntPtr left, global::System.IntPtr top, global::System.IntPtr right, global::System.IntPtr bottom)
330 OnLayout(changed, new LayoutLength(left, true), new LayoutLength(top, true), new LayoutLength(right, true), new LayoutLength(bottom, true));
333 private void SwigDirectorOnSizeChanged(global::System.IntPtr newSize, global::System.IntPtr oldSize)
335 OnSizeChanged(new LayoutSize(newSize, true), new LayoutSize(oldSize, true));
338 private void SwigDirectorOnInitialize()
343 public delegate global::System.IntPtr SwigDelegateLayoutItemWrapperImpl_0();
344 public delegate void SwigDelegateLayoutItemWrapperImpl_1();
345 public delegate void SwigDelegateLayoutItemWrapperImpl_2(string containerType);
346 public delegate void SwigDelegateLayoutItemWrapperImpl_3(global::System.IntPtr widthMeasureSpec, global::System.IntPtr heightMeasureSpec);
347 public delegate void SwigDelegateLayoutItemWrapperImpl_4(bool changed, global::System.IntPtr left, global::System.IntPtr top, global::System.IntPtr right, global::System.IntPtr bottom);
348 public delegate void SwigDelegateLayoutItemWrapperImpl_5(global::System.IntPtr newSize, global::System.IntPtr oldSize);
349 public delegate void SwigDelegateLayoutItemWrapperImpl_6();
351 private SwigDelegateLayoutItemWrapperImpl_0 swigDelegate0;
352 private SwigDelegateLayoutItemWrapperImpl_1 swigDelegate1;
353 private SwigDelegateLayoutItemWrapperImpl_2 swigDelegate2;
354 private SwigDelegateLayoutItemWrapperImpl_3 swigDelegate3;
355 private SwigDelegateLayoutItemWrapperImpl_4 swigDelegate4;
356 private SwigDelegateLayoutItemWrapperImpl_5 swigDelegate5;
357 private SwigDelegateLayoutItemWrapperImpl_6 swigDelegate6;
359 } // namespace Tizen.NUI