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 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
101 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
102 public void CopyFrom(Extents that)
104 Interop.Extents.Extents_start_set(swigCPtr, that.Start);
105 Interop.Extents.Extents_end_set(swigCPtr, that.End);
106 Interop.Extents.Extents_top_set(swigCPtr, that.Top);
107 Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom);
113 /// <param name="start"></param>
114 /// <param name="end"></param>
115 /// <param name="top"></param>
116 /// <param name="bottom"></param>
117 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
118 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
119 public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
120 private ExtentsChangedCallback callback = null;
123 /// The Start extent.
125 /// <since_tizen> 4 </since_tizen>
126 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
131 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
132 Interop.Extents.Extents_start_set(swigCPtr, value);
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 callback?.Invoke(Start, End, Top, Bottom);
139 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 /// <since_tizen> 4 </since_tizen>
149 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
154 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
156 Interop.Extents.Extents_end_set(swigCPtr, value);
157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 callback?.Invoke(Start, End, Top, Bottom);
163 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 /// <since_tizen> 4 </since_tizen>
173 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
178 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
180 Interop.Extents.Extents_top_set(swigCPtr, value);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 callback?.Invoke(Start, End, Top, Bottom);
187 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 /// The Bottom Extend.
196 /// <since_tizen> 4 </since_tizen>
197 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor")]
202 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Extents(...) constructor");
204 Interop.Extents.Extents_bottom_set(swigCPtr, value);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 callback?.Invoke(Start, End, Top, Bottom);
211 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Equality operator.
220 /// <param name="rhs">The Extents to test against.</param>
221 /// <returns>True if the extents are not equal.</returns>
222 /// <since_tizen> 4 </since_tizen>
223 public bool EqualTo(Extents rhs)
225 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 /// Inequality operator.
233 /// <param name="rhs">The Extents to test against.</param>
234 /// <returns>True if the extents are not equal.</returns>
235 /// <since_tizen> 4 </since_tizen>
236 public bool NotEqualTo(Extents rhs)
238 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 [EditorBrowsable(EditorBrowsableState.Never)]
245 public object Clone() => new Extents(this);
247 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
249 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
252 internal Extents Assign(SWIGTYPE_p_uint16_t array)
254 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 internal Extents Assign(Extents copy)
261 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 /// This will not be public opened.
267 [EditorBrowsable(EditorBrowsableState.Never)]
268 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
270 Interop.Extents.delete_Extents(swigCPtr);