Release 4.0.0-preview1-00301
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PaddingType.cs
index b0e3019..edcf4e0 100755 (executable)
@@ -1,25 +1,31 @@
-/** Copyright (c) 2017 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.
-*
-*/
+/*
+ * Copyright(c) 2017 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.
+ *
+ */
 
 namespace Tizen.NUI
 {
-
+    /// <summary>
+    /// The gesture state.
+    /// </summary>
     public class PaddingType : global::System.IDisposable
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        /// <summary>
+        /// swigCMemOwn
+        /// </summary>
         protected bool swigCMemOwn;
 
         internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn)
@@ -35,10 +41,15 @@ namespace Tizen.NUI
 
         //A Flag to check who called Dispose(). (By User or DisposeQueue)
         private bool isDisposeQueued = false;
-        //A Flat to check if it is already disposed.
+        /// <summary>
+        /// A Flat to check if it is already disposed.
+        /// </summary>
         protected bool disposed = false;
 
-
+        /// <summary>
+        /// Dispose.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         ~PaddingType()
         {
             if (!isDisposeQueued)
@@ -48,6 +59,10 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Dispose.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public void Dispose()
         {
             //Throw excpetion if Dispose() is called in separate thread.
@@ -67,6 +82,10 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Dispose.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         protected virtual void Dispose(DisposeTypes type)
         {
             if (disposed)
@@ -99,6 +118,10 @@ namespace Tizen.NUI
             disposed = true;
         }
 
+        /// <summary>
+        /// Equality operator
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public static bool operator ==(PaddingType a, PaddingType b)
         {
             // If both are null, or both are same instance, return true.
@@ -120,12 +143,55 @@ namespace Tizen.NUI
                    (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top));
         }
 
+        /// <summary>
+        /// Inequality operator. Returns Null if either operand is Null
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public static bool operator !=(PaddingType a, PaddingType b)
         {
             return !(a == b);
         }
 
-        ///< The Left value
+
+        /// <summary>
+        /// Equals
+        /// </summary>
+        /// <param name="o">The object should be compared.</param>
+        /// <returns>True if equal.</returns>
+        /// <since_tizen> 4 </since_tizen>
+        public override bool Equals(object o)
+        {
+            if(o == null)
+            {
+                return false;
+            }
+            if(!(o is PaddingType))
+            {
+                return false;
+            }
+            PaddingType p = (PaddingType)o;
+
+            // Return true if the fields match:
+            return (System.Math.Abs(Left - p.Left) < NDalic.GetRangedEpsilon(Left, p.Left)) &&
+                   (System.Math.Abs(Right - p.Right) < NDalic.GetRangedEpsilon(Right, p.Right)) &&
+                   (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) &&
+                   (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top));
+        }
+
+        /// <summary>
+        /// Gets the the hash code of this baseHandle.
+        /// </summary>
+        /// <returns>The Hash Code.</returns>
+        /// <since_tizen> 4 </since_tizen>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
+        /// <summary>
+        /// The Left value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public float Left
         {
             set
@@ -138,7 +204,10 @@ namespace Tizen.NUI
             }
         }
 
-        ///< The Right value
+        /// <summary>
+        /// The Right value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public float Right
         {
             set
@@ -151,7 +220,10 @@ namespace Tizen.NUI
             }
         }
 
-        ///< The Bottom value
+        /// <summary>
+        /// The Bottom value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public float Bottom
         {
             set
@@ -164,7 +236,10 @@ namespace Tizen.NUI
             }
         }
 
-        ///< The Top value
+        /// <summary>
+        /// The Top value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public float Top
         {
             set
@@ -177,17 +252,36 @@ namespace Tizen.NUI
             }
         }
 
-
+        /// <summary>
+        /// Create an instance of paddingType.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Create an instance of BaseHandle.
+        /// </summary>
+        /// <param name="x">The x value.</param>
+        /// <param name="y">The y value.</param>
+        /// <param name="width">The width value.</param>
+        /// <param name="height">The height value.</param>
+        /// <since_tizen> 3 </since_tizen>
         public PaddingType(float x, float y, float width, float height) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(x, y, width, height), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Set the x, y, width, height of this paddingtype.
+        /// </summary>
+        /// <param name="newX">The x value.</param>
+        /// <param name="newY">The y value.</param>
+        /// <param name="newWidth">The width value.</param>
+        /// <param name="newHeight">The height value.</param>
+        /// <since_tizen> 3 </since_tizen>
         public void Set(float newX, float newY, float newWidth, float newHeight)
         {
             NDalicPINVOKE.PaddingType_Set(swigCPtr, newX, newY, newWidth, newHeight);
@@ -316,4 +410,4 @@ namespace Tizen.NUI
 
     }
 
-}
+}
\ No newline at end of file