2 * Copyright (c) 2017 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 : global::System.IDisposable
29 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33 /// <since_tizen> 4 </since_tizen>
34 protected bool swigCMemOwn;
36 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn)
38 swigCMemOwn = cMemoryOwn;
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
44 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47 //A Flag to check who called Dispose(). (By User or DisposeQueue)
48 private bool isDisposeQueued = false;
50 /// A Flat to check if it is already disposed.
52 /// <since_tizen> 4 </since_tizen>
53 protected bool disposed = false;
58 /// <since_tizen> 4 </since_tizen>
63 isDisposeQueued = true;
64 DisposeQueue.Instance.Add(this);
69 /// To make a Extents instance be disposed.
71 /// <since_tizen> 4 </since_tizen>
74 //Throw excpetion if Dispose() is called in separate thread.
75 if (!Window.IsInstalled())
77 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
82 Dispose(DisposeTypes.Implicit);
86 Dispose(DisposeTypes.Explicit);
87 System.GC.SuppressFinalize(this);
92 /// To make a Extents instance be disposed.
94 /// <param name="type">Extents type</param>
95 /// <since_tizen> 4 </since_tizen>
96 protected virtual void Dispose(DisposeTypes type)
103 if (type == DisposeTypes.Explicit)
106 //Release your own managed resources here.
107 //You should release all of your own disposable objects here.
110 //Release your own unmanaged resources here.
111 //You should not access any managed member here except static instance.
112 //because the execution order of Finalizes is non-deterministic.
114 if (swigCPtr.Handle != global::System.IntPtr.Zero)
119 NDalicPINVOKE.delete_Extents(swigCPtr);
121 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
129 /// <since_tizen> 4 </since_tizen>
130 public Extents() : this(NDalicPINVOKE.new_Extents__SWIG_0(), true)
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 /// <param name="copy">A reference to the copied Extents.</param>
139 /// <since_tizen> 4 </since_tizen>
140 public Extents(Extents copy) : this(NDalicPINVOKE.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 /// <param name="start">Start extent.</param>
148 /// <param name="end">End extent.</param>
149 /// <param name="top">Top extent.</param>
150 /// <param name="bottom">Bottom extent.</param>
152 /// <since_tizen> 4 </since_tizen>
153 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(NDalicPINVOKE.new_Extents__SWIG_2(start, end, top, bottom), true)
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 internal Extents Assign(SWIGTYPE_p_uint16_t array)
160 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 internal Extents Assign(Extents copy)
167 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 /// Equality operator.
175 /// <param name="rhs">The Extents to test against.</param>
176 /// <returns>True if the extents are not equal.</returns>
177 /// <since_tizen> 4 </since_tizen>
178 public bool EqualTo(Extents rhs)
180 bool ret = NDalicPINVOKE.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 /// Inequality operator.
188 /// <param name="rhs">The Extents to test against.</param>
189 /// <returns>True if the extents are not equal.</returns>
190 /// <since_tizen> 4 </since_tizen>
191 public bool NotEqualTo(Extents rhs)
193 bool ret = NDalicPINVOKE.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 /// The Start extent.
201 /// <since_tizen> 4 </since_tizen>
206 NDalicPINVOKE.Extents_start_set(swigCPtr, value);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 ushort ret = NDalicPINVOKE.Extents_start_get(swigCPtr);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 /// <since_tizen> 4 </since_tizen>
225 NDalicPINVOKE.Extents_end_set(swigCPtr, value);
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 ushort ret = NDalicPINVOKE.Extents_end_get(swigCPtr);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 /// <since_tizen> 4 </since_tizen>
244 NDalicPINVOKE.Extents_top_set(swigCPtr, value);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 ushort ret = NDalicPINVOKE.Extents_top_get(swigCPtr);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 /// The Bottom Extend.
258 /// <since_tizen> 4 </since_tizen>
263 NDalicPINVOKE.Extents_bottom_set(swigCPtr, value);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 ushort ret = NDalicPINVOKE.Extents_bottom_get(swigCPtr);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();