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.
17 using System.ComponentModel;
18 using Tizen.NUI.Binding;
23 /// Extents class describing the a collection of uint16_t.
25 /// <since_tizen> 4 </since_tizen>
26 [Binding.TypeConverter(typeof(ExtentsTypeConverter))]
27 public class Extents : Disposable, ISelectorItem
34 /// <since_tizen> 4 </since_tizen>
35 public Extents() : this(Interop.Extents.new_Extents__SWIG_0(), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
43 /// <param name="copy">A reference to the copied Extents.</param>
44 /// <since_tizen> 4 </since_tizen>
45 public Extents(Extents copy) : this(Interop.Extents.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
47 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51 /// The type cast operator, ushort to Extents.
53 /// <param name="value">A value of ushort type.</param>
54 /// <returns>return a Extents instance</returns>
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public static implicit operator Extents(ushort value)
58 return new Extents(value, value, value, value);
63 /// <param name="start">Start extent.</param>
64 /// <param name="end">End extent.</param>
65 /// <param name="top">Top extent.</param>
66 /// <param name="bottom">Bottom extent.</param>
68 /// <since_tizen> 4 </since_tizen>
69 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
81 /// <param name="cb"></param>
82 /// <param name="start"></param>
83 /// <param name="end"></param>
84 /// <param name="top"></param>
85 /// <param name="bottom"></param>
86 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
87 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
88 public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
91 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 /// Copy other extents
97 /// <param name="that"></param>
98 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
99 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
100 public void CopyFrom(Extents that)
102 Interop.Extents.Extents_start_set(swigCPtr, that.Start);
103 Interop.Extents.Extents_end_set(swigCPtr, that.End);
104 Interop.Extents.Extents_top_set(swigCPtr, that.Top);
105 Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom);
111 /// <param name="start"></param>
112 /// <param name="end"></param>
113 /// <param name="top"></param>
114 /// <param name="bottom"></param>
115 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
116 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
117 public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
118 private ExtentsChangedCallback callback = null;
121 /// The Start extent.
123 /// <since_tizen> 4 </since_tizen>
128 Interop.Extents.Extents_start_set(swigCPtr, value);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 callback?.Invoke(Start, End, Top, Bottom);
135 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 /// <since_tizen> 4 </since_tizen>
149 Interop.Extents.Extents_end_set(swigCPtr, value);
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152 callback?.Invoke(Start, End, Top, Bottom);
156 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 /// <since_tizen> 4 </since_tizen>
170 Interop.Extents.Extents_top_set(swigCPtr, value);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 callback?.Invoke(Start, End, Top, Bottom);
177 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 /// The Bottom Extend.
186 /// <since_tizen> 4 </since_tizen>
191 Interop.Extents.Extents_bottom_set(swigCPtr, value);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 callback?.Invoke(Start, End, Top, Bottom);
198 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 /// Equality operator.
207 /// <param name="rhs">The Extents to test against.</param>
208 /// <returns>True if the extents are not equal.</returns>
209 /// <since_tizen> 4 </since_tizen>
210 public bool EqualTo(Extents rhs)
212 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Inequality 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 NotEqualTo(Extents rhs)
225 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public object Clone() => new Extents(this);
234 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
236 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
239 internal Extents Assign(SWIGTYPE_p_uint16_t array)
241 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 internal Extents Assign(Extents copy)
248 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 /// This will not be public opened.
254 [EditorBrowsable(EditorBrowsableState.Never)]
255 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
257 Interop.Extents.delete_Extents(swigCPtr);