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.
18 using Tizen.NUI.Binding;
23 /// Extents class describing the a collection of uint16_t.
25 /// <since_tizen> 4 </since_tizen>
26 [TypeConverter(typeof(ExtentsTypeConverter))]
27 public class Extents : Disposable
33 /// <since_tizen> 4 </since_tizen>
34 protected bool swigCMemOwn;
36 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 /// <since_tizen> 4 </since_tizen>
42 public Extents() : this(Interop.Extents.new_Extents__SWIG_0(), true)
44 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50 /// <param name="copy">A reference to the copied Extents.</param>
51 /// <since_tizen> 4 </since_tizen>
52 public Extents(Extents copy) : this(Interop.Extents.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 /// <param name="start">Start extent.</param>
60 /// <param name="end">End extent.</param>
61 /// <param name="top">Top extent.</param>
62 /// <param name="bottom">Bottom extent.</param>
64 /// <since_tizen> 4 </since_tizen>
65 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
67 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn)
72 swigCMemOwn = cMemoryOwn;
73 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
79 /// <param name="cb"></param>
80 /// <param name="start"></param>
81 /// <param name="end"></param>
82 /// <param name="top"></param>
83 /// <param name="bottom"></param>
84 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
85 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
86 public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 /// Copy other extents
95 /// <param name="that"></param>
96 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
97 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
98 public void CopyFrom(Extents that)
100 Interop.Extents.Extents_start_set(swigCPtr, that.Start);
101 Interop.Extents.Extents_end_set(swigCPtr, that.End);
102 Interop.Extents.Extents_top_set(swigCPtr, that.Top);
103 Interop.Extents.Extents_bottom_set(swigCPtr, that.End);
109 /// <param name="start"></param>
110 /// <param name="end"></param>
111 /// <param name="top"></param>
112 /// <param name="bottom"></param>
113 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
114 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
115 public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
116 private ExtentsChangedCallback callback = null;
119 /// The Start extent.
121 /// <since_tizen> 4 </since_tizen>
126 Interop.Extents.Extents_start_set(swigCPtr, value);
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 callback?.Invoke(Start, End, Top, Bottom);
133 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 /// <since_tizen> 4 </since_tizen>
147 Interop.Extents.Extents_end_set(swigCPtr, value);
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 callback?.Invoke(Start, End, Top, Bottom);
154 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 /// <since_tizen> 4 </since_tizen>
168 Interop.Extents.Extents_top_set(swigCPtr, value);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 callback?.Invoke(Start, End, Top, Bottom);
175 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 /// The Bottom Extend.
184 /// <since_tizen> 4 </since_tizen>
189 Interop.Extents.Extents_bottom_set(swigCPtr, value);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 callback?.Invoke(Start, End, Top, Bottom);
196 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 /// Equality operator.
205 /// <param name="rhs">The Extents to test against.</param>
206 /// <returns>True if the extents are not equal.</returns>
207 /// <since_tizen> 4 </since_tizen>
208 public bool EqualTo(Extents rhs)
210 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 /// Inequality operator.
218 /// <param name="rhs">The Extents to test against.</param>
219 /// <returns>True if the extents are not equal.</returns>
220 /// <since_tizen> 4 </since_tizen>
221 public bool NotEqualTo(Extents rhs)
223 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
230 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
233 internal Extents Assign(SWIGTYPE_p_uint16_t array)
235 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 internal Extents Assign(Extents copy)
242 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 /// To make a Extents instance be disposed.
250 /// <param name="type">Extents type</param>
251 /// <since_tizen> 4 </since_tizen>
252 protected override void Dispose(DisposeTypes type)
259 //Release your own unmanaged resources here.
260 //You should not access any managed member here except static instance.
261 //because the execution order of Finalizes is non-deterministic.
263 if (swigCPtr.Handle != global::System.IntPtr.Zero)
268 Interop.Extents.delete_Extents(swigCPtr);
270 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);