X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fevents%2Fpan-gesture.cpp;h=44b0317447fb1b92ddda88703f496de3de9ce556;hb=adae31cf70bdeed19789edc694d4baaf2fc67f21;hp=3608d34d8a2d4d760320284eceadc0a873a90818;hpb=df59eea2434495c32414fcf9ffafe4cb7dff5324;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/events/pan-gesture.cpp b/dali/public-api/events/pan-gesture.cpp index 3608d34..44b0317 100644 --- a/dali/public-api/events/pan-gesture.cpp +++ b/dali/public-api/events/pan-gesture.cpp @@ -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. @@ -19,65 +19,81 @@ #include // INTERNAL INCLUDES +#include #include namespace Dali { +PanGesture::PanGesture(Internal::PanGesture* internal) +: Gesture(internal) +{ +} + +PanGesture::PanGesture() = default; + +PanGesture::PanGesture(const PanGesture& rhs) = default; + +PanGesture::PanGesture(PanGesture&& rhs) noexcept = default; + +PanGesture& PanGesture::operator=(const PanGesture& rhs) = default; + +PanGesture& PanGesture::operator=(PanGesture&& rhs) noexcept = default; + +PanGesture::~PanGesture() = default; + +const Vector2& PanGesture::GetVelocity() const +{ + return GetImplementation(*this).GetVelocity(); +} + +const Vector2& PanGesture::GetDisplacement() const +{ + return GetImplementation(*this).GetDisplacement(); +} + +const Vector2& PanGesture::GetPosition() const +{ + return GetImplementation(*this).GetPosition(); +} -PanGesture::PanGesture(Gesture::State state) -: Gesture(Gesture::Pan, state), - numberOfTouches(1) +const Vector2& PanGesture::GetScreenVelocity() const { + return GetImplementation(*this).GetScreenVelocity(); } -PanGesture::PanGesture( const PanGesture& rhs ) -: Gesture( rhs ), - velocity( rhs.velocity ), - displacement( rhs.displacement ), - position( rhs.position ), - screenVelocity( rhs.screenVelocity ), - screenDisplacement( rhs.screenDisplacement ), - screenPosition( rhs.screenPosition ), - numberOfTouches( rhs.numberOfTouches ) +const Vector2& PanGesture::GetScreenDisplacement() const { + return GetImplementation(*this).GetScreenDisplacement(); } -PanGesture& PanGesture::operator=( const PanGesture& rhs ) +const Vector2& PanGesture::GetScreenPosition() const { - Gesture::operator=(rhs); - velocity = rhs.velocity; - displacement = rhs.displacement; - position = rhs.position; - screenVelocity = rhs.screenVelocity; - screenDisplacement = rhs.screenDisplacement; - screenPosition = rhs.screenPosition; - numberOfTouches = rhs.numberOfTouches; - - return *this; + return GetImplementation(*this).GetScreenPosition(); } -PanGesture::~PanGesture() +uint32_t PanGesture::GetNumberOfTouches() const { + return GetImplementation(*this).GetNumberOfTouches(); } float PanGesture::GetSpeed() const { - return velocity.Length(); + return GetImplementation(*this).GetSpeed(); } float PanGesture::GetDistance() const { - return displacement.Length(); + return GetImplementation(*this).GetDistance(); } float PanGesture::GetScreenSpeed() const { - return screenVelocity.Length(); + return GetImplementation(*this).GetScreenSpeed(); } float PanGesture::GetScreenDistance() const { - return screenDisplacement.Length(); + return GetImplementation(*this).GetScreenDistance(); } } // namespace Dali