[NUI] Fix build warning CA1062 (#2234)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Size.cs
index 68a217e..f65e33c 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
  *
  */
 
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
 namespace Tizen.NUI
 {
-
     /// <summary>
-    /// Three dimensional size
+    /// A three-dimensional size.
     /// </summary>
-    public class Size : global::System.IDisposable
+    /// <since_tizen> 5 </since_tizen>
+    [Tizen.NUI.Binding.TypeConverter(typeof(SizeTypeConverter))]
+    public class Size : Disposable, ICloneable
     {
-        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-        protected bool swigCMemOwn;
 
-        internal Size(global::System.IntPtr cPtr, bool cMemoryOwn)
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <remarks>
+        /// Size2D and Size are implicitly converted to each other, so these are compatible and can be replaced without any type casting. <br />
+        /// For example, the followings are possible. <br />
+        /// view.Size2D = new Size(10.0f, 10.0f, 10.0f); // be aware that here the depth value(10.0f) will be lost. <br />
+        /// view.Size = new Size2D(10, 10); // be aware that here the depth value is 0.0f by default. <br />
+        /// view.MinimumSize = new Size(10, 10, 0); <br />
+        /// Size Tmp = view.MaximumSize; //here Tmp.Depth will be 0.0f. <br />
+        /// </remarks>
+        /// <since_tizen> 5 </since_tizen>
+        public Size() : this(Interop.Vector3.new_Vector3__SWIG_0(), true)
         {
-            swigCMemOwn = cMemoryOwn;
-            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj)
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <param name="width">The width component.</param>
+        /// <param name="height">The height component.</param>
+        /// <param name="depth">The depth component(optional).</param>
+        /// <remarks>
+        /// Size2D and Size are implicitly converted to each other, so these are compatible and can be replaced without any type casting. <br />
+        /// For example, the followings are possible. <br />
+        /// view.Size2D = new Size(10.0f, 10.0f, 10.0f); // be aware that here the depth value(10.0f) will be lost. <br />
+        /// view.Size = new Size2D(10, 10); // be aware that here the depth value is 0.0f by default. <br />
+        /// view.MinimumSize = new Size(10, 10, 0); <br />
+        /// Size Tmp = view.MaximumSize; //here Tmp.Depth will be 0.0f. <br />
+        /// </remarks>
+        /// <since_tizen> 5 </since_tizen>
+        public Size(float width, float height, float depth = 0.0f) : this(Interop.Vector3.new_Vector3__SWIG_1(width, height, depth), true)
         {
-            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <param name="size2d">Size2D with width and height.</param>
+        /// <since_tizen> 5 </since_tizen>
+        public Size(Size2D size2d) : this(Interop.Vector3.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// The Zero constant, (0.0f, 0.0f, 0.0f).
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public static Size Zero
+        {
+            get
+            {
+                global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZERO_get();
+                Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
         }
 
-        ~Size()
+        /// <summary>
+        /// The Width property for the width component of size
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor")]
+        public float Width
         {
-            DisposeQueue.Instance.Add(this);
+            set
+            {
+                Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor");
+
+                Interop.Vector3.Vector3_Width_set(swigCPtr, value);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+                callback?.Invoke(value, null, null);
+            }
+            get
+            {
+                float ret = Interop.Vector3.Vector3_Width_get(swigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
         }
 
         /// <summary>
-        /// Dispose
+        /// The Height property for the height component of size.
         /// </summary>
-        public virtual void Dispose()
+        /// <since_tizen> 5 </since_tizen>
+        [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor")]
+        public float Height
         {
-            if (!Stage.IsInstalled())
+            set
             {
-                DisposeQueue.Instance.Add(this);
-                return;
+                Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor");
+
+                Interop.Vector3.Vector3_Height_set(swigCPtr, value);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+                callback?.Invoke(null, value, null);
             }
+            get
+            {
+                float ret = Interop.Vector3.Vector3_Height_get(swigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
+        }
+
+        /// <summary>
+        /// The Depth property for the depth component of size.
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor")]
+        public float Depth
+        {
+            set
+            {
+                Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor");
 
-            lock (this)
+                Interop.Vector3.Vector3_Depth_set(swigCPtr, value);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+                callback?.Invoke(null, null, value);
+            }
+            get
             {
-                if (swigCPtr.Handle != global::System.IntPtr.Zero)
-                {
-                    if (swigCMemOwn)
-                    {
-                        swigCMemOwn = false;
-                        NDalicPINVOKE.delete_Vector3(swigCPtr);
-                    }
-                    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-                }
-                global::System.GC.SuppressFinalize(this);
+                float ret = Interop.Vector3.Vector3_Depth_get(swigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
             }
         }
 
         /// <summary>
-        /// Addition operator for A+B
+        /// The addition operator for A+B.
         /// </summary>
-        /// <param name="arg1">Size, A</param>
-        /// <param name="arg2">Size to assign, B</param>
-        /// <returns>A Size containing the result of the addition</returns>
+        /// <param name="arg1">Size to assign A.</param>
+        /// <param name="arg2">Size to assign B.</param>
+        /// <returns>A size containing the result of the addition.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator +(Size arg1, Size arg2)
         {
-            return arg1.Add(arg2);
+            return arg1?.Add(arg2);
         }
 
         /// <summary>
-        /// Subtraction operator for A-B
+        /// The subtraction operator for A-B.
         /// </summary>
-        /// <param name="arg1">Size, A</param>
-        /// <param name="arg2">Size to subtract, B</param>
-        /// <returns>A Size containing the result of the subtraction</returns>
+        /// <param name="arg1">Size to subtract A.</param>
+        /// <param name="arg2">Size to subtract B.</param>
+        /// <returns>The size containing the result of the subtraction.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator -(Size arg1, Size arg2)
         {
-            return arg1.Subtract(arg2);
+            return arg1?.Subtract(arg2);
         }
 
         /// <summary>
-        /// Unary negation operator.
+        /// The unary negation operator.
         /// </summary>
-        /// <param name="arg1">Size for unary negation</param>
-        /// <returns>A Size containg the negation</returns>
+        /// <param name="arg1">Size for unary negation.</param>
+        /// <returns>A size containing the negation.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator -(Size arg1)
         {
-            return arg1.Subtract();
+            return arg1?.Subtract();
         }
 
         /// <summary>
-        /// Multiplication operator.
+        /// The multiplication operator.
         /// </summary>
-        /// <param name="arg1">Size for multiplication</param>
-        /// <param name="arg2">The Size to multipl</param>
-        /// <returns>A Size containing the result of the multiplication</returns>
+        /// <param name="arg1">Size for multiplication.</param>
+        /// <param name="arg2">The size to multiply.</param>
+        /// <returns>A size containing the result of the multiplication.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator *(Size arg1, Size arg2)
         {
-            return arg1.Multiply(arg2);
+            return arg1?.Multiply(arg2);
         }
 
         /// <summary>
-        /// Multiplication operator.
+        /// The multiplication operator.
         /// </summary>
-        /// <param name="arg1">Size for multiplication</param>
-        /// <param name="arg2">The float value to scale the Size</param>
-        /// <returns>A Size containing the result of the scaling</returns>
+        /// <param name="arg1">Size for multiplication.</param>
+        /// <param name="arg2">The float value to scale the size.</param>
+        /// <returns>A size containing the result of the scaling.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator *(Size arg1, float arg2)
         {
-            return arg1.Multiply(arg2);
+            return arg1?.Multiply(arg2);
         }
 
         /// <summary>
-        /// Division operator.
+        /// The division operator.
         /// </summary>
-        /// <param name="arg1">Size for division</param>
-        /// <param name="arg2">The Size to divide</param>
-        /// <returns>A Size containing the result of the division></returns>
+        /// <param name="arg1">Size for division.</param>
+        /// <param name="arg2">The size to divide.</param>
+        /// <returns>A size containing the result of the division.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator /(Size arg1, Size arg2)
         {
-            return arg1.Divide(arg2);
+            return arg1?.Divide(arg2);
         }
 
         /// <summary>
-        /// Division operator.
+        /// The division operator.
         /// </summary>
-        /// <param name="arg1">Size for division</param>
-        /// <param name="arg2">The float value to scale the Size by</param>
-        /// <returns>A Size containing the result of the scaling</returns>
+        /// <param name="arg1">Size for division.</param>
+        /// <param name="arg2">The float value to scale the size by.</param>
+        /// <returns>A Size containing the result of the scaling.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public static Size operator /(Size arg1, float arg2)
         {
-            return arg1.Divide(arg2);
+            return arg1?.Divide(arg2);
         }
 
         /// <summary>
-        /// Array subscript operator.
+        /// The array subscript operator.
         /// </summary>
-        /// <param name="index">Subscript index</param>
-        /// <returns>The float at the given index</returns>
+        /// <param name="index">Subscript index.</param>
+        /// <returns>The float at the given index.</returns>
+        /// <since_tizen> 5 </since_tizen>
         public float this[uint index]
         {
             get
@@ -158,214 +261,188 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Get Size from pointer.
+        /// Determines whether the specified object is equal to the current object.
         /// </summary>
-        /// <param name="cPtr">Pointer of the Size</param>
-        /// <returns>Size</returns>
-        public static Size GetSizeFromPtr(global::System.IntPtr cPtr)
+        /// <param name="obj">The object to compare with the current object.</param>
+        /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
+        public override bool Equals(System.Object obj)
         {
-            Size ret = new Size(cPtr, false);
+            Size size = obj as Size;
+            bool equal = false;
+            if (Width == size?.Width && Height == size?.Height && Depth == size?.Depth)
+            {
+                equal = true;
+            }
+            return equal;
+        }
+
+        /// <summary>
+        /// Gets the the hash code of this Size.
+        /// </summary>
+        /// <returns>The Hash Code.</returns>
+        /// <since_tizen> 6 </since_tizen>
+        public override int GetHashCode()
+        {
+            return swigCPtr.Handle.GetHashCode();
+        }
+
+        /// <summary>
+        /// Checks equality.<br />
+        /// Utilizes appropriate machine epsilon values.<br />
+        /// </summary>
+        /// <param name="rhs">The size to test against.</param>
+        /// <returns>True if the sizes are equal.</returns>
+        /// <since_tizen> 5 </since_tizen>
+        public bool EqualTo(Size rhs)
+        {
+            bool ret = Interop.Vector3.Vector3_EqualTo(swigCPtr, Size.getCPtr(rhs));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         /// <summary>
-        /// Constructor.
+        /// Checks inequality.<br />
+        /// Utilizes appropriate machine epsilon values.<br />
         /// </summary>
-        public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
+        /// <param name="rhs">The size to test against.</param>
+        /// <returns>True if the sizes are not equal.</returns>
+        /// <since_tizen> 5 </since_tizen>
+        public bool NotEqualTo(Size rhs)
         {
+            bool ret = Interop.Vector3.Vector3_NotEqualTo(swigCPtr, Size.getCPtr(rhs));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public object Clone() => new Size(Width, Height, Depth);
+
         /// <summary>
-        /// Constructor.
+        /// The type cast operator, Size to Vector3.
         /// </summary>
-        /// <param name="x">x (or width) component</param>
-        /// <param name="y">y (or height) component</param>
-        /// <param name="z">z (or depth) component</param>
-        public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
+        /// <param name="size">The object of size type.</param>
+        /// <since_tizen> 5 </since_tizen>
+        public static implicit operator Vector3(Size size)
         {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return new Vector3((float)size?.Width, (float)size.Height, (float)size.Depth);
         }
 
         /// <summary>
-        /// Constructor.
+        /// The type cast operator, Vector3 to Size type.
         /// </summary>
-        /// <param name="size2d">Size2D with x (width) and y (height)</param>
-        public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true)
+        /// <param name="vec">The object of Vector3 type.</param>
+        /// <since_tizen> 5 </since_tizen>
+        public static implicit operator Size(Vector3 vec)
         {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return new Size((int)vec?.Width, (int)vec.Height, (int)vec.Depth);
         }
 
         /// <summary>
-        /// Zero constant, (0.0f, 0.0f, 0.0f).
+        /// Implicit type cast operator, Size2D to Size
         /// </summary>
-        public static Size Zero
+        /// <param name="size2d">The object of Size2D type.</param>
+        /// <since_tizen> none </since_tizen>
+        /// This will be public opened in tizen_next by ACR.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static implicit operator Size(Size2D size2d)
         {
-            get
-            {
-                global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
-                Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                return ret;
-            }
+            return new Size((int)size2d?.Width, (int)size2d.Height, 0);
         }
 
-        private Size Add(Size rhs)
+
+        internal static Size GetSizeFromPtr(global::System.IntPtr cPtr)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true);
+            Size ret = new Size(cPtr, false);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        private Size Subtract(Size rhs)
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
         }
 
-        private Size Multiply(Size rhs)
+        internal Size(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
-        private Size Multiply(float rhs)
+        /// This will not be public opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            Interop.Vector3.delete_Vector3(swigCPtr);
         }
 
-        private Size Divide(Size rhs)
+        private Size Add(Size rhs)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
+            Size ret = new Size(Interop.Vector3.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        private Size Divide(float rhs)
+        private Size Subtract(Size rhs)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
+            Size ret = new Size(Interop.Vector3.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        private Size Subtract()
+        private Size Multiply(Size rhs)
         {
-            Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
+            Size ret = new Size(Interop.Vector3.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        private float ValueOfIndex(uint index)
+        private Size Multiply(float rhs)
         {
-            float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
+            Size ret = new Size(Interop.Vector3.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        /// <summary>
-        /// Check equality.
-        /// Utilizes appropriate machine epsilon values.
-        /// </summary>
-        /// <param name="rhs">The Size to test against</param>
-        /// <returns>True if the Sizes are equal</returns>
-        public bool EqualTo(Size rhs)
+        private Size Divide(Size rhs)
         {
-            bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Size.getCPtr(rhs));
+            Size ret = new Size(Interop.Vector3.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        /// <summary>
-        /// Check inequality.
-        /// Utilizes appropriate machine epsilon values.
-        /// </summary>
-        /// <param name="rhs">The Size to test against</param>
-        /// <returns>True if the Sizes are not equal</returns>
-        public bool NotEqualTo(Size rhs)
+        private Size Divide(float rhs)
         {
-            bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Size.getCPtr(rhs));
+            Size ret = new Size(Interop.Vector3.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        /// <summary>
-        /// Width property for width component of Siz
-        /// </summary>
-        public float Width
+        private Size Subtract()
         {
-            set
-            {
-                NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            }
-            get
-            {
-                float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                return ret;
-            }
+            Size ret = new Size(Interop.Vector3.Vector3_Subtract__SWIG_1(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
         }
 
-        /// <summary>
-        /// Height property for height component of Size
-        /// </summary>
-        public float Height
+        private float ValueOfIndex(uint index)
         {
-            set
-            {
-                NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            }
-            get
-            {
-                float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                return ret;
-            }
+            float ret = Interop.Vector3.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
         }
 
-        /// <summary>
-        /// Depth property for depth component of Size
-        /// </summary>
-        public float Depth
-        {
-            set
-            {
-                NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            }
-            get
-            {
-                float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                return ret;
-            }
-        }
+        internal delegate void SizeChangedCallback(float? width, float? height, float? depth);
 
-        /// <summary>
-        /// Type cast operator, Size to Vector3.
-        /// </summary>
-        /// <param name="size">Object of Size type</param>
-        public static implicit operator Vector3(Size size)
+        internal Size(SizeChangedCallback cb, float w, float h, float d) : this(Interop.Vector3.new_Vector3__SWIG_1(w, h, d), true)
         {
-            return new Vector3(size.Width, size.Height, size.Depth);
+            callback = cb;
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// <summary>
-        /// Type cast operator, Vector3 to Size type.
-        /// </summary>
-        /// <param name="vec">Object of Vector3 type</param>
-        public static implicit operator Size(Vector3 vec)
+        internal Size(SizeChangedCallback cb, Size other) : this(cb, other.Width, other.Height, other.Depth)
         {
-            return new Size(vec.Width, vec.Height, vec.Depth);
         }
 
+        private SizeChangedCallback callback = null;
     }
-
 }