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
33 /// <since_tizen> 4 </since_tizen>
34 protected bool swigCMemOwn;
37 /// A Flat to check if it is already disposed.
39 /// <since_tizen> 4 </since_tizen>
40 protected bool disposed = false;
42 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
44 //A Flag to check who called Dispose(). (By User or DisposeQueue)
45 private bool isDisposeQueued = false;
50 /// <since_tizen> 4 </since_tizen>
51 public Extents() : this(NDalicPINVOKE.new_Extents__SWIG_0(), true)
53 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 /// <param name="copy">A reference to the copied Extents.</param>
60 /// <since_tizen> 4 </since_tizen>
61 public Extents(Extents copy) : this(NDalicPINVOKE.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
63 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
68 /// <param name="start">Start extent.</param>
69 /// <param name="end">End extent.</param>
70 /// <param name="top">Top extent.</param>
71 /// <param name="bottom">Bottom extent.</param>
73 /// <since_tizen> 4 </since_tizen>
74 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(NDalicPINVOKE.new_Extents__SWIG_2(start, end, top, bottom), true)
76 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn)
81 swigCMemOwn = cMemoryOwn;
82 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
88 /// <since_tizen> 4 </since_tizen>
93 isDisposeQueued = true;
94 DisposeQueue.Instance.Add(this);
101 /// <since_tizen> 4 </since_tizen>
106 NDalicPINVOKE.Extents_start_set(swigCPtr, value);
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 ushort ret = NDalicPINVOKE.Extents_start_get(swigCPtr);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 /// <since_tizen> 4 </since_tizen>
125 NDalicPINVOKE.Extents_end_set(swigCPtr, value);
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 ushort ret = NDalicPINVOKE.Extents_end_get(swigCPtr);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// <since_tizen> 4 </since_tizen>
144 NDalicPINVOKE.Extents_top_set(swigCPtr, value);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 ushort ret = NDalicPINVOKE.Extents_top_get(swigCPtr);
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 /// The Bottom Extend.
158 /// <since_tizen> 4 </since_tizen>
163 NDalicPINVOKE.Extents_bottom_set(swigCPtr, value);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 ushort ret = NDalicPINVOKE.Extents_bottom_get(swigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 /// To make a Extents instance be disposed.
177 /// <since_tizen> 4 </since_tizen>
178 public void Dispose()
180 //Throw excpetion if Dispose() is called in separate thread.
181 if (!Window.IsInstalled())
183 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
188 Dispose(DisposeTypes.Implicit);
192 Dispose(DisposeTypes.Explicit);
193 System.GC.SuppressFinalize(this);
198 /// Equality operator.
200 /// <param name="rhs">The Extents to test against.</param>
201 /// <returns>True if the extents are not equal.</returns>
202 /// <since_tizen> 4 </since_tizen>
203 public bool EqualTo(Extents rhs)
205 bool ret = NDalicPINVOKE.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// Inequality operator.
213 /// <param name="rhs">The Extents to test against.</param>
214 /// <returns>True if the extents are not equal.</returns>
215 /// <since_tizen> 4 </since_tizen>
216 public bool NotEqualTo(Extents rhs)
218 bool ret = NDalicPINVOKE.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
225 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
228 internal Extents Assign(SWIGTYPE_p_uint16_t array)
230 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 internal Extents Assign(Extents copy)
237 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 /// To make a Extents instance be disposed.
245 /// <param name="type">Extents type</param>
246 /// <since_tizen> 4 </since_tizen>
247 protected virtual void Dispose(DisposeTypes type)
254 if (type == DisposeTypes.Explicit)
257 //Release your own managed resources here.
258 //You should release all of your own disposable objects here.
261 //Release your own unmanaged resources here.
262 //You should not access any managed member here except static instance.
263 //because the execution order of Finalizes is non-deterministic.
265 if (swigCPtr.Handle != global::System.IntPtr.Zero)
270 NDalicPINVOKE.delete_Extents(swigCPtr);
272 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);