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);
76 internal Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 internal delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort botton);
83 private ExtentsChangedCallback callback = null;
88 /// <since_tizen> 4 </since_tizen>
93 Interop.Extents.Extents_start_set(swigCPtr, value);
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96 callback?.Invoke(Start, End, Top, Bottom);
100 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 /// <since_tizen> 4 </since_tizen>
114 Interop.Extents.Extents_end_set(swigCPtr, value);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 callback?.Invoke(Start, End, Top, Bottom);
121 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 /// <since_tizen> 4 </since_tizen>
135 Interop.Extents.Extents_top_set(swigCPtr, value);
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 callback?.Invoke(Start, End, Top, Bottom);
142 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 /// The Bottom Extend.
151 /// <since_tizen> 4 </since_tizen>
156 Interop.Extents.Extents_bottom_set(swigCPtr, value);
157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 callback?.Invoke(Start, End, Top, Bottom);
163 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 /// Equality operator.
172 /// <param name="rhs">The Extents to test against.</param>
173 /// <returns>True if the extents are not equal.</returns>
174 /// <since_tizen> 4 </since_tizen>
175 public bool EqualTo(Extents rhs)
177 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 /// Inequality operator.
185 /// <param name="rhs">The Extents to test against.</param>
186 /// <returns>True if the extents are not equal.</returns>
187 /// <since_tizen> 4 </since_tizen>
188 public bool NotEqualTo(Extents rhs)
190 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
197 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
200 internal Extents Assign(SWIGTYPE_p_uint16_t array)
202 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 internal Extents Assign(Extents copy)
209 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 /// To make a Extents instance be disposed.
217 /// <param name="type">Extents type</param>
218 /// <since_tizen> 4 </since_tizen>
219 protected override void Dispose(DisposeTypes type)
226 //Release your own unmanaged resources here.
227 //You should not access any managed member here except static instance.
228 //because the execution order of Finalizes is non-deterministic.
230 if (swigCPtr.Handle != global::System.IntPtr.Zero)
235 Interop.Extents.delete_Extents(swigCPtr);
237 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);