2 * Copyright (c) 2019 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.
17 using System.ComponentModel;
18 using Tizen.NUI.Binding;
23 /// Extents class describing the a collection of uint16_t.
25 /// <since_tizen> 4 </since_tizen>
26 [Binding.TypeConverter(typeof(ExtentsTypeConverter))]
27 public class Extents : Disposable
34 /// <since_tizen> 4 </since_tizen>
35 public Extents() : this(Interop.Extents.new_Extents__SWIG_0(), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
43 /// <param name="copy">A reference to the copied Extents.</param>
44 /// <since_tizen> 4 </since_tizen>
45 public Extents(Extents copy) : this(Interop.Extents.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
47 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 /// <param name="start">Start extent.</param>
53 /// <param name="end">End extent.</param>
54 /// <param name="top">Top extent.</param>
55 /// <param name="bottom">Bottom extent.</param>
57 /// <since_tizen> 4 </since_tizen>
58 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
63 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
70 /// <param name="cb"></param>
71 /// <param name="start"></param>
72 /// <param name="end"></param>
73 /// <param name="top"></param>
74 /// <param name="bottom"></param>
75 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
76 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
77 public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
80 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84 /// Copy other extents
86 /// <param name="that"></param>
87 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
88 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
89 public void CopyFrom(Extents that)
91 Interop.Extents.Extents_start_set(swigCPtr, that.Start);
92 Interop.Extents.Extents_end_set(swigCPtr, that.End);
93 Interop.Extents.Extents_top_set(swigCPtr, that.Top);
94 Interop.Extents.Extents_bottom_set(swigCPtr, that.End);
100 /// <param name="start"></param>
101 /// <param name="end"></param>
102 /// <param name="top"></param>
103 /// <param name="bottom"></param>
104 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
105 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
106 public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
107 private ExtentsChangedCallback callback = null;
110 /// The Start extent.
112 /// <since_tizen> 4 </since_tizen>
117 Interop.Extents.Extents_start_set(swigCPtr, value);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 callback?.Invoke(Start, End, Top, Bottom);
124 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 /// <since_tizen> 4 </since_tizen>
138 Interop.Extents.Extents_end_set(swigCPtr, value);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 callback?.Invoke(Start, End, Top, Bottom);
145 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 /// <since_tizen> 4 </since_tizen>
159 Interop.Extents.Extents_top_set(swigCPtr, value);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 callback?.Invoke(Start, End, Top, Bottom);
166 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 /// The Bottom Extend.
175 /// <since_tizen> 4 </since_tizen>
180 Interop.Extents.Extents_bottom_set(swigCPtr, value);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 callback?.Invoke(Start, End, Top, Bottom);
187 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 /// Equality operator.
196 /// <param name="rhs">The Extents to test against.</param>
197 /// <returns>True if the extents are not equal.</returns>
198 /// <since_tizen> 4 </since_tizen>
199 public bool EqualTo(Extents rhs)
201 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 /// Inequality operator.
209 /// <param name="rhs">The Extents to test against.</param>
210 /// <returns>True if the extents are not equal.</returns>
211 /// <since_tizen> 4 </since_tizen>
212 public bool NotEqualTo(Extents rhs)
214 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
221 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
224 internal Extents Assign(SWIGTYPE_p_uint16_t array)
226 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 internal Extents Assign(Extents copy)
233 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 /// This will not be public opened.
239 [EditorBrowsable(EditorBrowsableState.Never)]
240 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
242 Interop.Extents.delete_Extents(swigCPtr);