Add GetMouseButton to identify right/left mouse button click
[platform/core/uifw/dali-core.git] / dali / internal / event / events / touch-data-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index a041c82..481407a
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -159,6 +159,33 @@ void TouchData::AddPoint( const Integration::Point& point )
   mPoints.push_back( point );
 }
 
+Device::Class::Type TouchData::GetDeviceClass( std::size_t point ) const
+{
+  if( point < mPoints.size() )
+  {
+    return mPoints[ point ].GetDeviceClass();
+  }
+  return Device::Class::NONE;
+}
+
+Device::Subclass::Type TouchData::GetDeviceSubclass( std::size_t point ) const
+{
+  if( point < mPoints.size() )
+  {
+    return mPoints[ point ].GetDeviceSubclass();
+  }
+  return Device::Subclass::NONE;
+}
+
+MouseButton::Type TouchData::GetMouseButton( std::size_t point ) const
+{
+  if( point < mPoints.size() )
+  {
+    return mPoints[ point ].GetMouseButton();
+  }
+  return MouseButton::INVALID;
+}
+
 } // namsespace Internal
 
 } // namespace Dali