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 public class Extents : global::System.IDisposable
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26 protected bool swigCMemOwn;
28 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn)
30 swigCMemOwn = cMemoryOwn;
31 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
34 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
36 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
39 //A Flag to check who called Dispose(). (By User or DisposeQueue)
40 private bool isDisposeQueued = false;
41 //A Flat to check if it is already disposed.
42 protected bool disposed = false;
47 /// <since_tizen> 4 </since_tizen>
52 isDisposeQueued = true;
53 DisposeQueue.Instance.Add(this);
58 /// To make a Extents instance be disposed.
60 /// <since_tizen> 4 </since_tizen>
63 //Throw excpetion if Dispose() is called in separate thread.
64 if (!Window.IsInstalled())
66 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
71 Dispose(DisposeTypes.Implicit);
75 Dispose(DisposeTypes.Explicit);
76 System.GC.SuppressFinalize(this);
80 protected virtual void Dispose(DisposeTypes type)
87 if (type == DisposeTypes.Explicit)
90 //Release your own managed resources here.
91 //You should release all of your own disposable objects here.
94 //Release your own unmanaged resources here.
95 //You should not access any managed member here except static instance.
96 //because the execution order of Finalizes is non-deterministic.
98 if (swigCPtr.Handle != global::System.IntPtr.Zero)
103 NDalicPINVOKE.delete_Extents(swigCPtr);
105 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
113 /// <since_tizen> 4 </since_tizen>
114 public Extents() : this(NDalicPINVOKE.new_Extents__SWIG_0(), true)
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 /// <param name="copy">A reference to the copied Extents.</param>
123 /// <since_tizen> 4 </since_tizen>
124 public Extents(Extents copy) : this(NDalicPINVOKE.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// <param name="start">Start extent.</param>
132 /// <param name="end">End extent.</param>
133 /// <param name="top">Top extent.</param>
134 /// <param name="bottom">Bottom extent.</param>
136 /// <since_tizen> 4 </since_tizen>
137 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(NDalicPINVOKE.new_Extents__SWIG_2(start, end, top, bottom), true)
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 internal Extents Assign(SWIGTYPE_p_uint16_t array)
144 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 internal Extents Assign(Extents copy)
151 Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 /// Equality operator.
159 /// <param name="rhs">The Extents to test against.</param>
160 /// <returns>True if the extents are not equal.</returns>
161 /// <since_tizen> 4 </since_tizen>
162 public bool EqualTo(Extents rhs)
164 bool ret = NDalicPINVOKE.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 /// Inequality 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 NotEqualTo(Extents rhs)
177 bool ret = NDalicPINVOKE.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 /// The Start extent.
185 /// <since_tizen> 4 </since_tizen>
190 NDalicPINVOKE.Extents_start_set(swigCPtr, value);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 ushort ret = NDalicPINVOKE.Extents_start_get(swigCPtr);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// <since_tizen> 4 </since_tizen>
209 NDalicPINVOKE.Extents_end_set(swigCPtr, value);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 ushort ret = NDalicPINVOKE.Extents_end_get(swigCPtr);
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// <since_tizen> 4 </since_tizen>
228 NDalicPINVOKE.Extents_top_set(swigCPtr, value);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 ushort ret = NDalicPINVOKE.Extents_top_get(swigCPtr);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// The Bottom Extend.
242 /// <since_tizen> 4 </since_tizen>
247 NDalicPINVOKE.Extents_bottom_set(swigCPtr, value);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 ushort ret = NDalicPINVOKE.Extents_bottom_get(swigCPtr);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();