/* * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System; using System.ComponentModel; using Tizen.NUI.Binding; namespace Tizen.NUI { /// /// Extents class describing the a collection of uint16_t. /// /// 4 [Binding.TypeConverter(typeof(ExtentsTypeConverter))] public class Extents : Disposable, ICloneable { /// /// Constructor. /// /// 4 public Extents() : this(Interop.Extents.new_Extents__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// Constructor. /// /// A reference to the copied Extents. /// 4 public Extents(Extents copy) : this(Interop.Extents.new_Extents__SWIG_1(Extents.getCPtr(copy)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// The type cast operator, ushort to Extents. /// /// A value of ushort type. /// return a Extents instance [EditorBrowsable(EditorBrowsableState.Never)] public static implicit operator Extents(ushort value) { return new Extents(value, value, value, value); } /// /// Constructor. /// Start extent. /// End extent. /// Top extent. /// Bottom extent. /// /// 4 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } /// /// Constructor /// /// /// /// /// /// /// Only used by Tizen.NUI.Components, will not be opened [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true) { callback = cb; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// Copy other extents /// /// /// Only used by Tizen.NUI.Components, will not be opened [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public void CopyFrom(Extents that) { Interop.Extents.Extents_start_set(swigCPtr, that.Start); Interop.Extents.Extents_end_set(swigCPtr, that.End); Interop.Extents.Extents_top_set(swigCPtr, that.Top); Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom); } /// /// Constructor /// /// /// /// /// /// Only used by Tizen.NUI.Components, will not be opened [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom); private ExtentsChangedCallback callback = null; /// /// The Start extent. /// /// 4 public ushort Start { set { Interop.Extents.Extents_start_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(Start, End, Top, Bottom); } get { ushort ret = Interop.Extents.Extents_start_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// The End extend. /// /// 4 public ushort End { set { Interop.Extents.Extents_end_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(Start, End, Top, Bottom); } get { ushort ret = Interop.Extents.Extents_end_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// The Top extend. /// /// 4 public ushort Top { set { Interop.Extents.Extents_top_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(Start, End, Top, Bottom); } get { ushort ret = Interop.Extents.Extents_top_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// The Bottom Extend. /// /// 4 public ushort Bottom { set { Interop.Extents.Extents_bottom_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(Start, End, Top, Bottom); } get { ushort ret = Interop.Extents.Extents_bottom_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// Equality operator. /// /// The Extents to test against. /// True if the extents are not equal. /// 4 public bool EqualTo(Extents rhs) { bool ret = Interop.Extents.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Inequality operator. /// /// The Extents to test against. /// True if the extents are not equal. /// 4 public bool NotEqualTo(Extents rhs) { bool ret = Interop.Extents.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// [EditorBrowsable(EditorBrowsableState.Never)] public object Clone() => new Extents(this); internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } internal Extents Assign(SWIGTYPE_p_uint16_t array) { Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal Extents Assign(Extents copy) { Extents ret = new Extents(Interop.Extents.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Extents.delete_Extents(swigCPtr); } } }