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.
21 /// Extents class describing the a collection of uint16_t.
23 /// <since_tizen> 4 </since_tizen>
24 public class Extents : global::System.IDisposable
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 /// <since_tizen> 4 </since_tizen>
31 protected bool swigCMemOwn;
33 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn)
35 swigCMemOwn = cMemoryOwn;
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 //A Flag to check who called Dispose(). (By User or DisposeQueue)
45 private bool isDisposeQueued = false;
47 /// A Flat to check if it is already disposed.
49 /// <since_tizen> 4 </since_tizen>
50 protected bool disposed = false;
55 /// <since_tizen> 4 </since_tizen>
60 isDisposeQueued = true;
61 DisposeQueue.Instance.Add(this);
66 /// To make a Extents instance be disposed.
68 /// <since_tizen> 4 </since_tizen>
71 //Throw excpetion if Dispose() is called in separate thread.
72 if (!Window.IsInstalled())
74 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
79 Dispose(DisposeTypes.Implicit);
83 Dispose(DisposeTypes.Explicit);
84 System.GC.SuppressFinalize(this);
89 /// To make a Extents instance be disposed.
91 /// <param name="type">Extents type</param>
92 /// <since_tizen> 4 </since_tizen>
93 protected virtual void Dispose(DisposeTypes type)
100 if (type == DisposeTypes.Explicit)
103 //Release your own managed resources here.
104 //You should release all of your own disposable objects here.
107 //Release your own unmanaged resources here.
108 //You should not access any managed member here except static instance.
109 //because the execution order of Finalizes is non-deterministic.
111 if (swigCPtr.Handle != global::System.IntPtr.Zero)
116 NDalicPINVOKE.delete_Extents(swigCPtr);
118 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
126 /// <since_tizen> 4 </since_tizen>
127 public Extents() : this(NDalicPINVOKE.new_Extents__SWIG_0(), true)
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// <param name="copy">A reference to the copied Extents.</param>
136 /// <since_tizen> 4 </since_tizen>
137 public Extents(Extents copy) : this(NDalicPINVOKE.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 /// <param name="start">Start extent.</param>
145 /// <param name="end">End extent.</param>
146 /// <param name="top">Top extent.</param>
147 /// <param name="bottom">Bottom extent.</param>
149 /// <since_tizen> 4 </since_tizen>
150 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(NDalicPINVOKE.new_Extents__SWIG_2(start, end, top, bottom), true)
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 internal Extents Assign(SWIGTYPE_p_uint16_t array)
157 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 internal Extents Assign(Extents copy)
164 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
165 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 = NDalicPINVOKE.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 = NDalicPINVOKE.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 /// The Start extent.
198 /// <since_tizen> 4 </since_tizen>
203 NDalicPINVOKE.Extents_start_set(swigCPtr, value);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 ushort ret = NDalicPINVOKE.Extents_start_get(swigCPtr);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 /// <since_tizen> 4 </since_tizen>
222 NDalicPINVOKE.Extents_end_set(swigCPtr, value);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 ushort ret = NDalicPINVOKE.Extents_end_get(swigCPtr);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 /// <since_tizen> 4 </since_tizen>
241 NDalicPINVOKE.Extents_top_set(swigCPtr, value);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 ushort ret = NDalicPINVOKE.Extents_top_get(swigCPtr);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 /// The Bottom Extend.
255 /// <since_tizen> 4 </since_tizen>
260 NDalicPINVOKE.Extents_bottom_set(swigCPtr, value);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 ushort ret = NDalicPINVOKE.Extents_bottom_get(swigCPtr);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();