[NUI] Add GetMouseButton in Touch (#302)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Touch.cs
index 635c679..df95248 100755 (executable)
  * limitations under the License.
  *
  */
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
 
 namespace Tizen.NUI
 {
-    using System.Runtime.InteropServices;
-    using Tizen.NUI.BaseComponents;
     /// <summary>
     /// Touch events are a collection of points at a specific moment in time.<br />
     /// When a multi-touch event occurs, each point represents the points that are currently being
@@ -45,12 +46,12 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         protected override void Dispose(DisposeTypes type)
         {
-            if(disposed)
+            if (disposed)
             {
                 return;
             }
 
-            if(type == DisposeTypes.Explicit)
+            if (type == DisposeTypes.Explicit)
             {
                 //Called by User
                 //Release your own managed resources here.
@@ -260,6 +261,48 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+        /// <summary>
+        /// Get mouse device's button value (ex: right/left button)
+        /// </summary>
+        /// <param name="point">The point required</param>
+        /// <returns></returns>
+        /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public MouseButtonType GetMouseButton(uint point)
+        {
+            int ret = NDalicManualPINVOKE.Touch_GetMouseButton(swigCPtr, point);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return (MouseButtonType)ret;
+        }
+    }
 
+    /// <summary>
+    /// Mouse device button type
+    /// </summary>
+    /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public enum MouseButtonType
+    {
+        /// <summary>
+        /// No mouse button event or invalid data
+        /// </summary>
+        Invalid = -1,
+        /// <summary>
+        /// Left mouse button
+        /// </summary>
+        LeftButton = 1,
+        /// <summary>
+        /// Center(Wheel) mouse button
+        /// </summary>
+        CenterButton = 2,
+        /// <summary>
+        /// Right mouse button
+        /// </summary>
+        RightButton = 3,
+        /// <summary>
+        /// Reserved mouse button for different mouse devices
+        /// </summary>
+        Reserved = 4,
     }
+
 }
\ No newline at end of file