2 * Copyright(c) 2017 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
32 /// <since_tizen> 3 </since_tizen>
33 protected bool swigCMemOwn;
35 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38 /// Creates an uninitialized PaddingType.
40 /// <since_tizen> 3 </since_tizen>
41 public PaddingType() : this(Interop.PaddingType.new_PaddingType__SWIG_0(), true)
43 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47 /// PaddingType Constructor.
49 /// <param name="start">Start padding or X coordinate</param>
50 /// <param name="end">End padding or Y coordinate</param>
51 /// <param name="top">Top padding or Height</param>
52 /// <param name="bottom">Bottom padding or Width</param>
53 /// <since_tizen> 3 </since_tizen>
54 public PaddingType(float start, float end, float top, float bottom) : this(Interop.PaddingType.new_PaddingType__SWIG_1(start, end, top, bottom), true)
56 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn)
61 swigCMemOwn = cMemoryOwn;
62 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
68 /// <since_tizen> 4 </since_tizen>
84 /// <since_tizen> 4 </since_tizen>
100 /// <since_tizen> 3 </since_tizen>
114 /// The Bottom value.
116 /// <since_tizen> 3 </since_tizen>
133 Interop.PaddingType.PaddingType_left_set(swigCPtr, value);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 float ret = Interop.PaddingType.PaddingType_left_get(swigCPtr);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 Interop.PaddingType.PaddingType_start_set(swigCPtr, value);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 float ret = Interop.PaddingType.PaddingType_start_get(swigCPtr);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 Interop.PaddingType.PaddingType_right_set(swigCPtr, value);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 float ret = Interop.PaddingType.PaddingType_right_get(swigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 Interop.PaddingType.PaddingType_end_set(swigCPtr, value);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 float ret = Interop.PaddingType.PaddingType_end_get(swigCPtr);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 Interop.PaddingType.PaddingType_top_set(swigCPtr, value);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 float ret = Interop.PaddingType.PaddingType_top_get(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 Interop.PaddingType.PaddingType_bottom_set(swigCPtr, value);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 float ret = Interop.PaddingType.PaddingType_bottom_get(swigCPtr);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 /// Equality operator.
222 /// <param name="a">First operand</param>
223 /// <param name="b">Second operand</param>
224 /// <returns>True if the values are identical</returns>
225 /// <since_tizen> 3 </since_tizen>
226 public static bool operator ==(PaddingType a, PaddingType b)
228 // If both are null, or both are same instance, return true.
229 if (System.Object.ReferenceEquals(a, b))
234 // If one is null, but not both, return false.
235 if (((object)a == null) || ((object)b == null))
240 // Return true if the fields match:
241 return (System.Math.Abs(a.Start - b.Start) < NDalic.GetRangedEpsilon(a.Start, b.Start)) &&
242 (System.Math.Abs(a.End - b.End) < NDalic.GetRangedEpsilon(a.End, b.End)) &&
243 (System.Math.Abs(a.Bottom - b.Bottom) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom)) &&
244 (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top));
248 /// Inequality operator.
250 /// <param name="a">First operand</param>
251 /// <param name="b">Second operand</param>
252 /// <returns>True if the values are not identical</returns>
253 /// <since_tizen> 3 </since_tizen>
254 public static bool operator !=(PaddingType a, PaddingType b)
262 /// <param name="o">The object should be compared.</param>
263 /// <returns>True if equal.</returns>
264 /// <since_tizen> 4 </since_tizen>
265 public override bool Equals(object o)
271 if(!(o is PaddingType))
275 PaddingType p = (PaddingType)o;
277 // Return true if the fields match:
278 return (System.Math.Abs(Start- p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) &&
279 (System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) &&
280 (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) &&
281 (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top));
285 /// Gets the the hash code of this baseHandle.
287 /// <returns>The Hash Code.</returns>
288 /// <since_tizen> 4 </since_tizen>
289 public override int GetHashCode()
291 return base.GetHashCode();
295 /// Assignment from individual values.
297 /// <param name="newStart">Start padding or X coordinate</param>
298 /// <param name="newEnd">End padding or Y coordinate</param>
299 /// <param name="newTop">Top padding or Height</param>
300 /// <param name="newBottom">Bottom padding or Width</param>
301 /// <since_tizen> 3 </since_tizen>
302 public void Set(float newStart, float newEnd, float newTop, float newBottom)
304 Interop.PaddingType.PaddingType_Set(swigCPtr, newStart, newEnd, newTop, newBottom);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PaddingType obj)
310 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
316 /// <since_tizen> 3 </since_tizen>
317 protected override void Dispose(DisposeTypes type)
324 //Release your own unmanaged resources here.
325 //You should not access any managed member here except static instance.
326 //because the execution order of Finalizes is non-deterministic.
328 if (swigCPtr.Handle != global::System.IntPtr.Zero)
333 Interop.PaddingType.delete_PaddingType(swigCPtr);
335 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);