2 * Copyright(c) 2021 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.
20 using System.ComponentModel;
23 /// The gesture state.
25 /// <since_tizen> 3 </since_tizen>
26 public class PaddingType : Disposable
30 /// Creates an uninitialized PaddingType.
32 /// <since_tizen> 3 </since_tizen>
33 public PaddingType() : this(Interop.PaddingType.NewPaddingType(), true)
35 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
39 /// PaddingType Constructor.
41 /// <param name="start">Start padding or X coordinate</param>
42 /// <param name="end">End padding or Y coordinate</param>
43 /// <param name="top">Top padding or Height</param>
44 /// <param name="bottom">Bottom padding or Width</param>
45 /// <since_tizen> 3 </since_tizen>
46 public PaddingType(float start, float end, float top, float bottom) : this(Interop.PaddingType.NewPaddingType(start, end, top, bottom), true)
48 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51 internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
58 /// <since_tizen> 4 </since_tizen>
74 /// <since_tizen> 4 </since_tizen>
90 /// <since_tizen> 3 </since_tizen>
104 /// The Bottom value.
106 /// <since_tizen> 3 </since_tizen>
123 Interop.PaddingType.LeftSet(SwigCPtr, value);
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 float ret = Interop.PaddingType.LeftGet(SwigCPtr);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 Interop.PaddingType.StartSet(SwigCPtr, value);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 float ret = Interop.PaddingType.StartGet(SwigCPtr);
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 Interop.PaddingType.RightSet(SwigCPtr, value);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 float ret = Interop.PaddingType.RightGet(SwigCPtr);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 Interop.PaddingType.EndSet(SwigCPtr, value);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 float ret = Interop.PaddingType.EndGet(SwigCPtr);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 Interop.PaddingType.TopSet(SwigCPtr, value);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 float ret = Interop.PaddingType.TopGet(SwigCPtr);
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 Interop.PaddingType.BottomSet(SwigCPtr, value);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 float ret = Interop.PaddingType.BottomGet(SwigCPtr);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 /// Equality operator.
212 /// <param name="a">First operand</param>
213 /// <param name="b">Second operand</param>
214 /// <returns>True if the values are identical</returns>
215 /// <since_tizen> 3 </since_tizen>
216 public static bool operator ==(PaddingType a, PaddingType b)
218 // If both are null, or both are same instance, return true.
219 if (System.Object.ReferenceEquals(a, b))
224 // If one is null, but not both, return false.
225 if (((object)a == null) || ((object)b == null))
230 // Return true if the fields match:
231 return (System.Math.Abs(a.Start - b.Start) < NDalic.GetRangedEpsilon(a.Start, b.Start)) &&
232 (System.Math.Abs(a.End - b.End) < NDalic.GetRangedEpsilon(a.End, b.End)) &&
233 (System.Math.Abs(a.Bottom - b.Bottom) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom)) &&
234 (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top));
238 /// Inequality operator.
240 /// <param name="a">First operand</param>
241 /// <param name="b">Second operand</param>
242 /// <returns>True if the values are not identical</returns>
243 /// <since_tizen> 3 </since_tizen>
244 public static bool operator !=(PaddingType a, PaddingType b)
252 /// <param name="o">The object should be compared.</param>
253 /// <returns>True if equal.</returns>
254 /// <since_tizen> 4 </since_tizen>
255 public override bool Equals(object o)
261 if (!(o is PaddingType))
265 PaddingType p = (PaddingType)o;
267 // Return true if the fields match:
268 return (System.Math.Abs(Start - p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) &&
269 (System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) &&
270 (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) &&
271 (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top));
275 /// Gets the hash code of this baseHandle.
277 /// <returns>The Hash Code.</returns>
278 /// <since_tizen> 4 </since_tizen>
279 public override int GetHashCode()
281 return base.GetHashCode();
285 /// Assignment from individual values.
287 /// <param name="newStart">Start padding or X coordinate</param>
288 /// <param name="newEnd">End padding or Y coordinate</param>
289 /// <param name="newTop">Top padding or Height</param>
290 /// <param name="newBottom">Bottom padding or Width</param>
291 /// <since_tizen> 3 </since_tizen>
292 public void Set(float newStart, float newEnd, float newTop, float newBottom)
294 Interop.PaddingType.Set(SwigCPtr, newStart, newEnd, newTop, newBottom);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 /// This will not be public opened.
299 [EditorBrowsable(EditorBrowsableState.Never)]
300 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
302 Interop.PaddingType.DeletePaddingType(swigCPtr);