Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / events / pan-gesture-detector.cpp
index dffbb99..a129a81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
 #include <dali/public-api/events/pan-gesture-detector.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/events/pan-gesture-detector-impl.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.h>
 
 namespace Dali
 {
-
-const char* const PanGestureDetector::SIGNAL_PAN_DETECTED = "pan-detected";
-
-const Radian PanGestureDetector::DIRECTION_LEFT( -Math::PI );
-const Radian PanGestureDetector::DIRECTION_RIGHT( 0.0f );
-const Radian PanGestureDetector::DIRECTION_UP( -0.5f * Math::PI );
-const Radian PanGestureDetector::DIRECTION_DOWN( 0.5f * Math::PI );
-const Radian PanGestureDetector::DIRECTION_HORIZONTAL( Math::PI );
-const Radian PanGestureDetector::DIRECTION_VERTICAL( -0.5f * Math::PI );
-const Radian PanGestureDetector::DEFAULT_THRESHOLD( 0.25f * Math::PI );
+const Radian PanGestureDetector::DIRECTION_LEFT(-Math::PI);
+const Radian PanGestureDetector::DIRECTION_RIGHT(0.0f);
+const Radian PanGestureDetector::DIRECTION_UP(-0.5f * Math::PI);
+const Radian PanGestureDetector::DIRECTION_DOWN(0.5f * Math::PI);
+const Radian PanGestureDetector::DIRECTION_HORIZONTAL(Math::PI);
+const Radian PanGestureDetector::DIRECTION_VERTICAL(-0.5f * Math::PI);
+const Radian PanGestureDetector::DEFAULT_THRESHOLD(0.25f * Math::PI);
 
 PanGestureDetector::PanGestureDetector(Internal::PanGestureDetector* internal)
 : GestureDetector(internal)
 {
 }
 
-PanGestureDetector::PanGestureDetector()
-{
-}
+PanGestureDetector::PanGestureDetector() = default;
 
 PanGestureDetector PanGestureDetector::New()
 {
@@ -50,19 +45,14 @@ PanGestureDetector PanGestureDetector::New()
   return PanGestureDetector(internal.Get());
 }
 
-PanGestureDetector PanGestureDetector::DownCast( BaseHandle handle )
+PanGestureDetector PanGestureDetector::DownCast(BaseHandle handle)
 {
-  return PanGestureDetector( dynamic_cast<Dali::Internal::PanGestureDetector*>(handle.GetObjectPtr()) );
+  return PanGestureDetector(dynamic_cast<Dali::Internal::PanGestureDetector*>(handle.GetObjectPtr()));
 }
 
-PanGestureDetector::~PanGestureDetector()
-{
-}
+PanGestureDetector::~PanGestureDetector() = default;
 
-PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle)
-: GestureDetector(handle)
-{
-}
+PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle) = default;
 
 PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
 {
@@ -70,39 +60,44 @@ PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
   return *this;
 }
 
-void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
+void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
 {
   GetImplementation(*this).SetMinimumTouchesRequired(minimum);
 }
 
-void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
+void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
 {
   GetImplementation(*this).SetMaximumTouchesRequired(maximum);
 }
 
-unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
+uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
 {
   return GetImplementation(*this).GetMinimumTouchesRequired();
 }
 
-unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
+uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
 {
   return GetImplementation(*this).GetMaximumTouchesRequired();
 }
 
-void PanGestureDetector::AddAngle( Radian angle, Radian threshold )
+void PanGestureDetector::AddAngle(Radian angle, Radian threshold)
+{
+  GetImplementation(*this).AddAngle(angle, threshold);
+}
+
+void PanGestureDetector::AddDirection(Radian direction, Radian threshold)
 {
-  GetImplementation(*this).AddAngle( angle, threshold );
+  GetImplementation(*this).AddDirection(direction, threshold);
 }
 
-void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
+size_t PanGestureDetector::GetAngleCount() const
 {
-  GetImplementation(*this).AddDirection( direction, threshold );
+  return GetImplementation(*this).GetAngleCount();
 }
 
-const PanGestureDetector::AngleContainer& PanGestureDetector::GetAngles() const
+PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
 {
-  return GetImplementation(*this).GetAngles();
+  return GetImplementation(*this).GetAngle(static_cast<uint32_t>(index));
 }
 
 void PanGestureDetector::ClearAngles()
@@ -110,24 +105,24 @@ void PanGestureDetector::ClearAngles()
   GetImplementation(*this).ClearAngles();
 }
 
-void PanGestureDetector::RemoveAngle( Radian angle )
+void PanGestureDetector::RemoveAngle(Radian angle)
 {
-  GetImplementation(*this).RemoveAngle( angle );
+  GetImplementation(*this).RemoveAngle(angle);
 }
 
-void PanGestureDetector::RemoveDirection( Radian direction )
+void PanGestureDetector::RemoveDirection(Radian direction)
 {
-  GetImplementation(*this).RemoveDirection( direction );
+  GetImplementation(*this).RemoveDirection(direction);
 }
 
-PanGestureDetector::DetectedSignalV2& PanGestureDetector::DetectedSignal()
+PanGestureDetector::DetectedSignalType& PanGestureDetector::DetectedSignal()
 {
   return GetImplementation(*this).DetectedSignal();
 }
 
-void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
+void PanGestureDetector::SetPanGestureProperties(const Dali::PanGesture& pan)
 {
-  Internal::PanGestureDetector::SetPanGestureProperties( pan );
+  Internal::PanGestureDetector::SetPanGestureProperties(pan);
 }
 
 } // namespace Dali