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.
19 using System.ComponentModel;
20 using Tizen.NUI.Binding;
25 /// Extents class describing the a collection of uint16_t.
27 /// <since_tizen> 4 </since_tizen>
28 [Binding.TypeConverter(typeof(ExtentsTypeConverter))]
29 public class Extents : Disposable, ICloneable
36 /// <since_tizen> 4 </since_tizen>
37 public Extents() : this(Interop.Extents.new_Extents__SWIG_0(), true)
39 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
45 /// <param name="copy">A reference to the copied Extents.</param>
46 /// <since_tizen> 4 </since_tizen>
47 public Extents(Extents copy) : this(Interop.Extents.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53 /// The type cast operator, ushort to Extents.
55 /// <param name="value">A value of ushort type.</param>
56 /// <returns>return a Extents instance</returns>
57 [EditorBrowsable(EditorBrowsableState.Never)]
58 public static implicit operator Extents(ushort value)
60 return new Extents(value, value, value, value);
65 /// <param name="start">Start extent.</param>
66 /// <param name="end">End extent.</param>
67 /// <param name="top">Top extent.</param>
68 /// <param name="bottom">Bottom extent.</param>
70 /// <since_tizen> 4 </since_tizen>
71 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
83 /// <param name="cb"></param>
84 /// <param name="start"></param>
85 /// <param name="end"></param>
86 /// <param name="top"></param>
87 /// <param name="bottom"></param>
88 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
89 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
90 public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
93 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97 /// Copy other extents
99 /// <param name="that"></param>
100 /// <exception cref="ArgumentNullException"> Thrown when that is null. </exception>
101 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
102 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
103 public void CopyFrom(Extents that)
107 throw new ArgumentNullException(nameof(that));
109 Interop.Extents.Extents_start_set(swigCPtr, that.Start);
110 Interop.Extents.Extents_end_set(swigCPtr, that.End);
111 Interop.Extents.Extents_top_set(swigCPtr, that.Top);
112 Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom);
118 /// <param name="start"></param>
119 /// <param name="end"></param>
120 /// <param name="top"></param>
121 /// <param name="bottom"></param>
122 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
123 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
124 public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
125 private ExtentsChangedCallback callback = null;
128 /// The Start extent.
130 /// <since_tizen> 4 </since_tizen>
131 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
136 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
137 Interop.Extents.Extents_start_set(swigCPtr, value);
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 callback?.Invoke(Start, End, Top, Bottom);
144 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 /// <since_tizen> 4 </since_tizen>
154 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
159 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
161 Interop.Extents.Extents_end_set(swigCPtr, value);
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 callback?.Invoke(Start, End, Top, Bottom);
168 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 /// <since_tizen> 4 </since_tizen>
178 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
183 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
185 Interop.Extents.Extents_top_set(swigCPtr, value);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 callback?.Invoke(Start, End, Top, Bottom);
192 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 /// The Bottom Extend.
201 /// <since_tizen> 4 </since_tizen>
202 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
207 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
209 Interop.Extents.Extents_bottom_set(swigCPtr, value);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 callback?.Invoke(Start, End, Top, Bottom);
216 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// Equality operator.
225 /// <param name="rhs">The Extents to test against.</param>
226 /// <returns>True if the extents are not equal.</returns>
227 /// <since_tizen> 4 </since_tizen>
228 public bool EqualTo(Extents rhs)
230 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 /// Inequality operator.
238 /// <param name="rhs">The Extents to test against.</param>
239 /// <returns>True if the extents are not equal.</returns>
240 /// <since_tizen> 4 </since_tizen>
241 public bool NotEqualTo(Extents rhs)
243 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 [EditorBrowsable(EditorBrowsableState.Never)]
250 public object Clone() => new Extents(this);
252 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
254 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
257 internal Extents Assign(SWIGTYPE_p_uint16_t array)
259 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
260 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 internal Extents Assign(Extents copy)
266 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// This will not be public opened.
272 [EditorBrowsable(EditorBrowsableState.Never)]
273 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
275 Interop.Extents.delete_Extents(swigCPtr);