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.
21 using System.ComponentModel;
24 /// The gesture state.
26 /// <since_tizen> 3 </since_tizen>
27 public class PaddingType : Disposable
31 /// Creates an uninitialized PaddingType.
33 /// <since_tizen> 3 </since_tizen>
34 public PaddingType() : this(Interop.PaddingType.new_PaddingType__SWIG_0(), true)
36 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40 /// PaddingType Constructor.
42 /// <param name="start">Start padding or X coordinate</param>
43 /// <param name="end">End padding or Y coordinate</param>
44 /// <param name="top">Top padding or Height</param>
45 /// <param name="bottom">Bottom padding or Width</param>
46 /// <since_tizen> 3 </since_tizen>
47 public PaddingType(float start, float end, float top, float bottom) : this(Interop.PaddingType.new_PaddingType__SWIG_1(start, end, top, bottom), true)
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
59 /// <since_tizen> 4 </since_tizen>
75 /// <since_tizen> 4 </since_tizen>
91 /// <since_tizen> 3 </since_tizen>
105 /// The Bottom value.
107 /// <since_tizen> 3 </since_tizen>
124 Interop.PaddingType.PaddingType_left_set(swigCPtr, value);
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 float ret = Interop.PaddingType.PaddingType_left_get(swigCPtr);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 Interop.PaddingType.PaddingType_start_set(swigCPtr, value);
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 float ret = Interop.PaddingType.PaddingType_start_get(swigCPtr);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 Interop.PaddingType.PaddingType_right_set(swigCPtr, value);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 float ret = Interop.PaddingType.PaddingType_right_get(swigCPtr);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 Interop.PaddingType.PaddingType_end_set(swigCPtr, value);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 float ret = Interop.PaddingType.PaddingType_end_get(swigCPtr);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 Interop.PaddingType.PaddingType_top_set(swigCPtr, value);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 float ret = Interop.PaddingType.PaddingType_top_get(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 Interop.PaddingType.PaddingType_bottom_set(swigCPtr, value);
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 float ret = Interop.PaddingType.PaddingType_bottom_get(swigCPtr);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// Equality operator.
213 /// <param name="a">First operand</param>
214 /// <param name="b">Second operand</param>
215 /// <returns>True if the values are identical</returns>
216 /// <since_tizen> 3 </since_tizen>
217 public static bool operator ==(PaddingType a, PaddingType b)
219 // If both are null, or both are same instance, return true.
220 if (System.Object.ReferenceEquals(a, b))
225 // If one is null, but not both, return false.
226 if (((object)a == null) || ((object)b == null))
231 // Return true if the fields match:
232 return (System.Math.Abs(a.Start - b.Start) < NDalic.GetRangedEpsilon(a.Start, b.Start)) &&
233 (System.Math.Abs(a.End - b.End) < NDalic.GetRangedEpsilon(a.End, b.End)) &&
234 (System.Math.Abs(a.Bottom - b.Bottom) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom)) &&
235 (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top));
239 /// Inequality operator.
241 /// <param name="a">First operand</param>
242 /// <param name="b">Second operand</param>
243 /// <returns>True if the values are not identical</returns>
244 /// <since_tizen> 3 </since_tizen>
245 public static bool operator !=(PaddingType a, PaddingType b)
253 /// <param name="o">The object should be compared.</param>
254 /// <returns>True if equal.</returns>
255 /// <since_tizen> 4 </since_tizen>
256 public override bool Equals(object o)
262 if(!(o is PaddingType))
266 PaddingType p = (PaddingType)o;
268 // Return true if the fields match:
269 return (System.Math.Abs(Start- p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) &&
270 (System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) &&
271 (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) &&
272 (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top));
276 /// Gets the the hash code of this baseHandle.
278 /// <returns>The Hash Code.</returns>
279 /// <since_tizen> 4 </since_tizen>
280 public override int GetHashCode()
282 return base.GetHashCode();
286 /// Assignment from individual values.
288 /// <param name="newStart">Start padding or X coordinate</param>
289 /// <param name="newEnd">End padding or Y coordinate</param>
290 /// <param name="newTop">Top padding or Height</param>
291 /// <param name="newBottom">Bottom padding or Width</param>
292 /// <since_tizen> 3 </since_tizen>
293 public void Set(float newStart, float newEnd, float newTop, float newBottom)
295 Interop.PaddingType.PaddingType_Set(swigCPtr, newStart, newEnd, newTop, newBottom);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PaddingType obj)
301 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
304 /// This will not be public opened.
305 [EditorBrowsable(EditorBrowsableState.Never)]
306 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
308 Interop.PaddingType.delete_PaddingType(swigCPtr);