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.
18 using System.ComponentModel;
19 using Tizen.NUI.Binding;
24 /// Extents class describing the a collection of uint16_t.
26 /// <since_tizen> 4 </since_tizen>
27 [Binding.TypeConverter(typeof(ExtentsTypeConverter))]
28 public class Extents : Disposable, ICloneable
35 /// <since_tizen> 4 </since_tizen>
36 public Extents() : this(Interop.Extents.new_Extents__SWIG_0(), true)
38 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44 /// <param name="copy">A reference to the copied Extents.</param>
45 /// <since_tizen> 4 </since_tizen>
46 public Extents(Extents copy) : this(Interop.Extents.new_Extents__SWIG_1(Extents.getCPtr(copy)), true)
48 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 /// The type cast operator, ushort to Extents.
54 /// <param name="value">A value of ushort type.</param>
55 /// <returns>return a Extents instance</returns>
56 [EditorBrowsable(EditorBrowsableState.Never)]
57 public static implicit operator Extents(ushort value)
59 return new Extents(value, value, value, value);
64 /// <param name="start">Start extent.</param>
65 /// <param name="end">End extent.</param>
66 /// <param name="top">Top extent.</param>
67 /// <param name="bottom">Bottom extent.</param>
69 /// <since_tizen> 4 </since_tizen>
70 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75 internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
82 /// <param name="cb"></param>
83 /// <param name="start"></param>
84 /// <param name="end"></param>
85 /// <param name="top"></param>
86 /// <param name="bottom"></param>
87 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
88 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
89 public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96 /// Copy other extents
98 /// <param name="that"></param>
99 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
100 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
101 public void CopyFrom(Extents that)
103 Interop.Extents.Extents_start_set(swigCPtr, that.Start);
104 Interop.Extents.Extents_end_set(swigCPtr, that.End);
105 Interop.Extents.Extents_top_set(swigCPtr, that.Top);
106 Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom);
112 /// <param name="start"></param>
113 /// <param name="end"></param>
114 /// <param name="top"></param>
115 /// <param name="bottom"></param>
116 /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
117 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
118 public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
119 private ExtentsChangedCallback callback = null;
122 /// The Start extent.
124 /// <since_tizen> 4 </since_tizen>
129 Interop.Extents.Extents_start_set(swigCPtr, value);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132 callback?.Invoke(Start, End, Top, Bottom);
136 ushort ret = Interop.Extents.Extents_start_get(swigCPtr);
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 /// <since_tizen> 4 </since_tizen>
150 Interop.Extents.Extents_end_set(swigCPtr, value);
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 callback?.Invoke(Start, End, Top, Bottom);
157 ushort ret = Interop.Extents.Extents_end_get(swigCPtr);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// <since_tizen> 4 </since_tizen>
171 Interop.Extents.Extents_top_set(swigCPtr, value);
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 callback?.Invoke(Start, End, Top, Bottom);
178 ushort ret = Interop.Extents.Extents_top_get(swigCPtr);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 /// The Bottom Extend.
187 /// <since_tizen> 4 </since_tizen>
192 Interop.Extents.Extents_bottom_set(swigCPtr, value);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 callback?.Invoke(Start, End, Top, Bottom);
199 ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr);
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 /// Equality operator.
208 /// <param name="rhs">The Extents to test against.</param>
209 /// <returns>True if the extents are not equal.</returns>
210 /// <since_tizen> 4 </since_tizen>
211 public bool EqualTo(Extents rhs)
213 bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs));
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 /// Inequality operator.
221 /// <param name="rhs">The Extents to test against.</param>
222 /// <returns>True if the extents are not equal.</returns>
223 /// <since_tizen> 4 </since_tizen>
224 public bool NotEqualTo(Extents rhs)
226 bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs));
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 [EditorBrowsable(EditorBrowsableState.Never)]
233 public object Clone() => new Extents(this);
235 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj)
237 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
240 internal Extents Assign(SWIGTYPE_p_uint16_t array)
242 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 internal Extents Assign(Extents copy)
249 Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 /// This will not be public opened.
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
258 Interop.Extents.delete_Extents(swigCPtr);