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 System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
24 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public class LayoutMeasureSpec : global::System.IDisposable
28 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 protected bool swigCMemOwn;
33 internal LayoutMeasureSpec(global::System.IntPtr cPtr, bool cMemoryOwn)
35 swigCMemOwn = cMemoryOwn;
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LayoutMeasureSpec obj)
41 return (obj.Equals(null)) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
45 [EditorBrowsable(EditorBrowsableState.Never)]
51 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
52 [EditorBrowsable(EditorBrowsableState.Never)]
53 public virtual void Dispose()
57 if (swigCPtr.Handle != global::System.IntPtr.Zero)
62 LayoutPINVOKE.delete_MeasureSpec(swigCPtr);
64 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 public LayoutMeasureSpec(LayoutLength measureSpec, LayoutMeasureSpec.ModeType mode) : this(LayoutPINVOKE.new_MeasureSpec__SWIG_0(LayoutLength.getCPtr(measureSpec), (int)mode), true)
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
77 [EditorBrowsable(EditorBrowsableState.Never)]
78 public LayoutMeasureSpec(int measureSpec) : this(LayoutPINVOKE.new_MeasureSpec__SWIG_1(measureSpec), true)
80 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
84 [EditorBrowsable(EditorBrowsableState.Never)]
85 public static bool operator ==(LayoutMeasureSpec r1, LayoutMeasureSpec r2)
87 return r1.EqualTo(r2);
90 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
91 [EditorBrowsable(EditorBrowsableState.Never)]
92 public static bool operator !=(LayoutMeasureSpec r1, LayoutMeasureSpec r2)
94 return !r1.EqualTo(r2);
97 private bool EqualTo(LayoutMeasureSpec value)
99 bool ret = LayoutPINVOKE.MeasureSpec_EqualTo(swigCPtr, LayoutMeasureSpec.getCPtr(value));
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 private bool NotEqualTo(LayoutMeasureSpec value)
106 bool ret = LayoutPINVOKE.MeasureSpec_NotEqualTo(swigCPtr, LayoutMeasureSpec.getCPtr(value));
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 private LayoutMeasureSpec.ModeType GetMode()
113 LayoutMeasureSpec.ModeType ret = (LayoutMeasureSpec.ModeType)LayoutPINVOKE.MeasureSpec_GetMode(swigCPtr);
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 private int GetSize()
120 int ret = LayoutPINVOKE.MeasureSpec_GetSize(swigCPtr);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
126 [EditorBrowsable(EditorBrowsableState.Never)]
127 public static LayoutMeasureSpec Adjust(LayoutMeasureSpec measureSpec, int delta)
129 LayoutMeasureSpec ret = new LayoutMeasureSpec(LayoutPINVOKE.MeasureSpec_Adjust(LayoutMeasureSpec.getCPtr(measureSpec), delta), true);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
135 [EditorBrowsable(EditorBrowsableState.Never)]
140 LayoutPINVOKE.MeasureSpec_mSize_set(swigCPtr, value);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 int ret = LayoutPINVOKE.MeasureSpec_mSize_get(swigCPtr);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 public LayoutMeasureSpec.ModeType Mode
157 LayoutPINVOKE.MeasureSpec_mMode_set(swigCPtr, (int)value);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 LayoutMeasureSpec.ModeType ret = (LayoutMeasureSpec.ModeType)LayoutPINVOKE.MeasureSpec_mMode_get(swigCPtr);
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
169 [EditorBrowsable(EditorBrowsableState.Never)]
172 UNSPECIFIED, ///< This is used by a parent to determine the desired dimension of a child layout.
173 EXACTLY, /** This is used by a parent to impose an exact size on the child. The child must use
174 this size, and guarantee that all of its descendants will fit within this size. */
175 AT_MOST /** This is used by the parent to impose a maximum size on the child. The child must guarantee
176 * that it and all of it's descendants will fit within this size. */