Add GetMouseButton to identify right/left mouse button click
[platform/core/uifw/dali-core.git] / dali / integration-api / events / point.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 485c4ed..7b52bc3
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -17,6 +17,7 @@
 
 // CLASS HEADER
 #include <dali/integration-api/events/point.h>
+#include <dali/public-api/events/mouse-button.h>
 
 namespace Dali
 {
@@ -28,8 +29,11 @@ Point::Point()
 : mTouchPoint( 0, TouchPoint::Started, 0.0f, 0.0f ),
   mEllipseRadius(),
   mAngle( 0.0f ),
+  mDeviceClass( Device::Class::NONE ),
+  mDeviceSubclass( Device::Subclass::NONE ),
   mPressure( 1.0f ),
-  mRadius( 0.0f )
+  mRadius( 0.0f ),
+  mMouseButton( MouseButton::INVALID )
 {
 }
 
@@ -37,8 +41,11 @@ Point::Point( const TouchPoint& touchPoint )
 : mTouchPoint( touchPoint ),
   mEllipseRadius(),
   mAngle( 0.0f ),
+  mDeviceClass( Device::Class::NONE ),
+  mDeviceSubclass( Device::Subclass::NONE ),
   mPressure( 1.0f ),
-  mRadius( 0.0f )
+  mRadius( 0.0f ),
+  mMouseButton( MouseButton::INVALID )
 {
 }
 
@@ -142,6 +149,37 @@ const TouchPoint& Point::GetTouchPoint() const
   return mTouchPoint;
 }
 
+void Point::SetDeviceClass( Device::Class::Type deviceClass )
+{
+  mDeviceClass = deviceClass;
+}
+
+void Point::SetDeviceSubclass( Device::Subclass::Type deviceSubclass )
+{
+  mDeviceSubclass = deviceSubclass;
+}
+
+Device::Class::Type Point::GetDeviceClass() const
+{
+  return mDeviceClass;
+}
+
+Device::Subclass::Type Point::GetDeviceSubclass() const
+{
+  return mDeviceSubclass;
+}
+
+MouseButton::Type Point::GetMouseButton() const
+{
+  return mMouseButton;
+}
+
+void Point::SetMouseButton(MouseButton::Type button)
+{
+  mMouseButton = button;
+}
+
+
 } // namespace Integration
 
 } // namespace Dali