X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fevents%2Ftap-gesture%2Ftap-gesture-detector-impl.h;h=fd7db72dd62fd1fa50a166481589d8feacfacca7;hb=017a0045f7628be3cbb2e77d21388632236c567f;hp=5d368b28b36fab875eb2caafbbb11b92739983f3;hpb=05878c24a70080018266949b76ce0b82a07ee9f3;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h b/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h index 5d368b2..fd7db72 100644 --- a/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h +++ b/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_TAP_GESTURE_DETECTOR_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,21 +19,18 @@ */ // INTERNAL INCLUDES -#include #include +#include +#include namespace Dali { - -struct TapGesture; - namespace Internal { - class TapGestureDetector; -typedef IntrusivePtr TapGestureDetectorPtr; -typedef DerivedGestureDetectorContainer::type TapGestureDetectorContainer; +using TapGestureDetectorPtr = IntrusivePtr; +using TapGestureDetectorContainer = DerivedGestureDetectorContainer::type; /** * @copydoc Dali::TapGestureDetector @@ -41,7 +38,6 @@ typedef DerivedGestureDetectorContainer::type TapGestureDete class TapGestureDetector : public GestureDetector { public: // Creation - /** * Create a new gesture detector. * @return A smart-pointer to the newly allocated detector. @@ -53,7 +49,7 @@ public: // Creation * @param[in] tapsRequired The number of taps required. * @return A smart-pointer to the newly allocated detector. */ - static TapGestureDetectorPtr New( unsigned int tapsRequired ); + static TapGestureDetectorPtr New(unsigned int tapsRequired); /** * Construct a new GestureDetector. @@ -64,10 +60,9 @@ public: // Creation * Construct a new GestureDetector with the specified parameters. * @param[in] tapsRequired The number of taps required. */ - TapGestureDetector( unsigned int tapsRequired ); + TapGestureDetector(unsigned int tapsRequired); public: - /** * @copydoc Dali::TapGestureDetector::SetTouchesRequired(unsigned int) */ @@ -76,12 +71,12 @@ public: /** * @copydoc Dali::TapGestureDetector::SetMinimumTapsRequired() */ - void SetMinimumTapsRequired( unsigned int minTaps ); + void SetMinimumTapsRequired(unsigned int minTaps); /** * @copydoc Dali::TapGestureDetector::SetMaximumTapsRequired() */ - void SetMaximumTapsRequired( unsigned int maxTaps ); + void SetMaximumTapsRequired(unsigned int maxTaps); /** * @copydoc Dali::TapGestureDetector::GetMinimumTapsRequired() @@ -99,17 +94,15 @@ public: unsigned int GetTouchesRequired() const; public: - /** * Called by the TapGestureProcessor when a tap gesture event occurs within the bounds of our * attached actor. * @param[in] tappedActor The tapped actor. * @param[in] tap The tap gesture. */ - void EmitTapGestureSignal(Dali::Actor tappedActor, const TapGesture& tap); + void EmitTapGestureSignal(Dali::Actor tappedActor, const Dali::TapGesture& tap); public: // Signals - /** * @copydoc Dali::TapGestureDetector::DetectedSignal() */ @@ -127,45 +120,50 @@ public: // Signals * @return True if the signal was connected. * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor); protected: - /** * A reference counted object may only be deleted by calling Unreference() */ - virtual ~TapGestureDetector(); + ~TapGestureDetector() override; private: - // Undefined TapGestureDetector(const TapGestureDetector&); TapGestureDetector& operator=(const TapGestureDetector& rhs); -private: // GestureDetector overrides + /** + * Timer Callback + * @return will return false; one-shot timer. + */ + bool TimerCallback(); +private: // GestureDetector overrides /** * @copydoc Dali::Internal::GestureDetector::OnActorAttach(Actor&) */ - virtual void OnActorAttach(Actor& actor); + void OnActorAttach(Actor& actor) override; /** * @copydoc Dali::Internal::GestureDetector::OnActorDetach(Actor&) */ - virtual void OnActorDetach(Actor& actor); + void OnActorDetach(Actor& actor) override; /** * @copydoc Dali::Internal::GestureDetector::OnActorDestroyed(Object&) */ - virtual void OnActorDestroyed(Object& object); + void OnActorDestroyed(Object& object) override; private: - Dali::TapGestureDetector::DetectedSignalType mDetectedSignal; - unsigned int mMinimumTapsRequired; - unsigned int mMaximumTapsRequired; - unsigned int mTouchesRequired; + unsigned int mMinimumTapsRequired; + unsigned int mMaximumTapsRequired; + unsigned int mTouchesRequired; + uint32_t mTimerId; + Dali::Actor mTappedActor; + Dali::TapGesture mTap; }; } // namespace Internal @@ -174,7 +172,7 @@ private: inline Internal::TapGestureDetector& GetImplementation(Dali::TapGestureDetector& detector) { - DALI_ASSERT_ALWAYS( detector && "TapGestureDetector handle is empty" ); + DALI_ASSERT_ALWAYS(detector && "TapGestureDetector handle is empty"); BaseObject& handle = detector.GetBaseObject(); @@ -183,7 +181,7 @@ inline Internal::TapGestureDetector& GetImplementation(Dali::TapGestureDetector& inline const Internal::TapGestureDetector& GetImplementation(const Dali::TapGestureDetector& detector) { - DALI_ASSERT_ALWAYS( detector && "TapGestureDetector handle is empty" ); + DALI_ASSERT_ALWAYS(detector && "TapGestureDetector handle is empty"); const BaseObject& handle = detector.GetBaseObject(); @@ -192,4 +190,4 @@ inline const Internal::TapGestureDetector& GetImplementation(const Dali::TapGest } // namespace Dali -#endif // DALI_INTERNAL_TAP_GESTURE_DETECTOR_H +#endif // DALI_INTERNAL_TAP_GESTURE_DETECTOR_H \ No newline at end of file