/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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()
{
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) = default;
+
+PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs) = default;
+
+PanGestureDetector::PanGestureDetector(PanGestureDetector&& handle) noexcept = default;
+
+PanGestureDetector& PanGestureDetector::operator=(PanGestureDetector&& rhs) noexcept = default;
+
+void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
{
+ GetImplementation(*this).SetMinimumTouchesRequired(minimum);
}
-PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle)
-: GestureDetector(handle)
+void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
{
+ GetImplementation(*this).SetMaximumTouchesRequired(maximum);
}
-PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
+void PanGestureDetector::SetMaximumMotionEventAge(uint32_t maximumAge)
{
- BaseHandle::operator=(rhs);
- return *this;
+ GetImplementation(*this).SetMaximumMotionEventAge(maximumAge);
}
-void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
+uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
{
- GetImplementation(*this).SetMinimumTouchesRequired(minimum);
+ return GetImplementation(*this).GetMinimumTouchesRequired();
}
-void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
+uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
{
- GetImplementation(*this).SetMaximumTouchesRequired(maximum);
+ return GetImplementation(*this).GetMaximumTouchesRequired();
}
-unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
+uint32_t PanGestureDetector::GetMaximumMotionEventAge() const
{
- return GetImplementation(*this).GetMinimumTouchesRequired();
+ return GetImplementation(*this).GetMaximumMotionEventAge();
}
-unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
+void PanGestureDetector::AddAngle(Radian angle, Radian threshold)
{
- return GetImplementation(*this).GetMaximumTouchesRequired();
+ GetImplementation(*this).AddAngle(angle, threshold);
}
-void PanGestureDetector::AddAngle( Radian angle, Radian 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()
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