#define DALI_INTERNAL_EVENT_EVENTS_TAP_GESTURE_RECOGNIZER_H
/*
- * Copyright (c) 2020 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.
*/
// EXTERNAL INCLUDES
-#include <cstdint>
-#include <dali/public-api/common/vector-wrapper.h>
#include <dali/integration-api/events/point.h>
-
+#include <dali/public-api/common/vector-wrapper.h>
+#include <cstdint>
// INTERNAL INCLUDES
#include <dali/internal/event/events/gesture-recognizer.h>
namespace Dali
{
-
namespace Integration
{
struct TouchEvent;
class TapGestureRecognizer : public GestureRecognizer
{
public:
-
using Observer = RecognizerObserver<TapGestureEvent>;
/**
~TapGestureRecognizer() override;
public:
-
/**
* @copydoc Dali::Internal::GestureDetector::SendEvent(const Integration::TouchEvent&)
*/
void Update(const GestureRequest& request) override;
private:
-
/**
* Checks if registered taps are within required bounds and emits tap gesture if they are.
*
* @param[in] state current state of incomplete gesture
* @param[in] time time of this latest touch event
*/
- void EmitGesture( GestureState state, uint32_t time );
+ void EmitGesture(GestureState state, uint32_t time);
/**
* Initialises tap gesture detector for next tap sequence
* @param[in] event registered touch event
* @param[in] point position touch event occurred
*/
- void SetupForTouchDown( const Integration::TouchEvent& event, const Integration::Point& point );
+ void SetupForTouchDown(const Integration::TouchEvent& event, const Integration::Point& point);
/**
* Emit a touch down event for hit testing
*
* @param[in] event registered touch event
*/
- void EmitPossibleState( const Integration::TouchEvent& event );
+ void EmitPossibleState(const Integration::TouchEvent& event);
/**
* Force a touch event sequence to be treated as a single tap
* @param[in] time time of this latest touch event
* @param[in] point position touch event occurred
*/
- void EmitSingleTap( uint32_t time, const Integration::Point& point );
+ void EmitSingleTap(uint32_t time, const Integration::Point& point);
/**
* Emit a tap event
* @param[in] time time of this latest touch event
* @param[in] event registered touch event
*/
- void EmitTap( uint32_t time, TapGestureEvent& event );
+ void EmitTap(uint32_t time, TapGestureEvent& event);
/**
* Send the event for processing
*
* @param[in] tap event for processing
*/
- void ProcessEvent( TapGestureEvent& event );
+ void ProcessEvent(TapGestureEvent& event);
private:
-
// Reference to the gesture processor for this recognizer
Observer& mObserver;
int mMaximumTapsRequired; ///< Maximum number of taps required.
int mTapsRegistered; ///< In current detection, the number of taps registered.
- Vector2 mTouchPosition; ///< The initial touch down position.
- uint32_t mTouchTime; ///< The initial touch down time.
- uint32_t mLastTapTime; ///< Time last tap gesture was registered
+ Vector2 mTouchPosition; ///< The initial touch down position.
+ uint32_t mTouchTime; ///< The initial touch down time.
+ uint32_t mLastTapTime; ///< Time last tap gesture was registered
+ GestureSourceType mGestureSourceType; /// < Gesture input source type value.
};
} // namespace Internal
} // namespace Dali
-
#endif // DALI_INTERNAL_EVENT_EVENTS_TAP_GESTURE_RECOGNIZER_H