X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fevents%2Ftap-gesture-detector.h;h=0d2b8295335962cd2da62c9c41b332a9b03ffe21;hb=646f736e77b085c86e982c0d1d4b895c2a431330;hp=cb9af813780c8eed3da842d5a54698f875ab50fa;hpb=07ea065f32fd048ae0bbbac66df89f79bc957d3d;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/events/tap-gesture-detector.h b/dali/public-api/events/tap-gesture-detector.h index cb9af81..0d2b829 100644 --- a/dali/public-api/events/tap-gesture-detector.h +++ b/dali/public-api/events/tap-gesture-detector.h @@ -2,7 +2,7 @@ #define __DALI_TAP_GESTURE_DETECTOR_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -18,12 +18,19 @@ * */ +// EXTERNAL INCLUDES +#include // uint32_t + // INTERNAL INCLUDES #include -#include +#include namespace Dali { +/** + * @addtogroup dali_core_events + * @{ + */ namespace Internal DALI_INTERNAL { @@ -36,9 +43,10 @@ struct TapGesture; * @brief This class emits a signal when a tap gesture occurs that meets the requirements set by the * application. * - * See TapGestureDetector::SetTapsRequired and TapGestureDetector::SetTouchesRequired. + * See @ref TapGestureDetector::SetMinimumTapsRequired + * See @ref TapGestureDetector::SetMaximumTapsRequired * - * A Tap Gesture is a discrete gesture, which means it does not have any state information attached + * A TapGesture is a discrete gesture, which means it does not have any state information attached * to it. Please see TapGesture for more information. * * The application programmer can use this gesture detector as follows: @@ -48,74 +56,87 @@ struct TapGesture; * detector.DetectedSignal().Connect(this, &MyApplication::OnTap); * @endcode * + * @SINCE_1_0.0 + * @note Multi-touch taps (two or more points of contact with the surface) are not currently + * supported. However, multiple taps (double & triple tap etc.) are supported. + * + * Signals + * | %Signal Name | Method | + * |--------------|-----------------------| + * | tapDetected | @ref DetectedSignal() | * @see TapGesture + * */ -class DALI_IMPORT_API TapGestureDetector : public GestureDetector +class DALI_CORE_API TapGestureDetector : public GestureDetector { public: // Typedefs /** * @brief Signal type for detected signal. + * @SINCE_1_0.0 */ - typedef SignalV2< void ( Actor, const TapGesture& ) > DetectedSignalV2; - - //Signal Names - static const char* const SIGNAL_TAP_DETECTED; ///< name "tap-detected" + typedef Signal< void ( Actor, const TapGesture& ) > DetectedSignalType; public: // Creation & Destruction /** - * @brief Create an uninitialized TapGestureDetector; this can be initialized with TapGestureDetector::New(). + * @brief Creates an uninitialized TapGestureDetector; this can be initialized with TapGestureDetector::New(). * - * Calling member functions with an uninitialized Dali::Object is not allowed. + * Calling member functions with an uninitialized TapGestureDetector handle is not allowed. + * @SINCE_1_0.0 */ TapGestureDetector(); /** - * @brief Create an initialized TapGestureDetector. + * @brief Creates an initialized TapGestureDetector. * * By default, this would create a gesture detector which requires one tap with one touch. - * @return A handle to a newly allocated Dali resource. + * @SINCE_1_0.0 + * @return A handle to a newly allocated Dali resource */ static TapGestureDetector New(); /** - * @brief Create an initialized TapGestureDetector with the specified parameters. + * @brief Creates an initialized TapGestureDetector with the specified parameters. * - * @param[in] tapsRequired The number of taps required. - * @param[in] touchesRequired The number of touches required. - * @return A handle to a newly allocated Dali resource. + * @SINCE_1_0.0 + * @param[in] tapsRequired The minimum & maximum number of taps required + * @return A handle to a newly allocated Dali resource */ - static TapGestureDetector New(unsigned int tapsRequired, unsigned int touchesRequired); + static TapGestureDetector New( uint32_t tapsRequired ); /** - * @brief Downcast an Object handle to TapGestureDetector handle. + * @brief Downcasts a handle to TapGestureDetector handle. * - * If handle points to a TapGestureDetector object the - * downcast produces valid handle. If not the returned handle is left uninitialized. - * @param[in] handle to An object - * @return handle to a TapGestureDetector object or an uninitialized handle + * If handle points to a TapGestureDetector object, the + * downcast produces valid handle. If not, the returned handle is left uninitialized. + * @SINCE_1_0.0 + * @param[in] handle Handle to an object + * @return Handle to a TapGestureDetector object or an uninitialized handle */ static TapGestureDetector DownCast( BaseHandle handle ); /** - * @brief Destructor + * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_0.0 */ ~TapGestureDetector(); /** * @brief This copy constructor is required for (smart) pointer semantics. * - * @param [in] handle A reference to the copied handle + * @SINCE_1_0.0 + * @param[in] handle A reference to the copied handle */ TapGestureDetector(const TapGestureDetector& handle); /** * @brief This assignment operator is required for (smart) pointer semantics. * - * @param [in] rhs A reference to the copied handle + * @SINCE_1_0.0 + * @param[in] rhs A reference to the copied handle * @return A reference to this */ TapGestureDetector& operator=(const TapGestureDetector& rhs); @@ -123,42 +144,46 @@ public: // Creation & Destruction public: // Setters /** - * @brief Set the number of taps required. + * @brief Sets the minimum number of taps required. * * The tap count is the number of times a user should "tap" the screen. - * @param[in] taps Taps required. + * @SINCE_1_0.0 + * @param[in] minimumTaps The minimum taps required * @pre The gesture detector has been initialized. * @note The default is '1'. */ - void SetTapsRequired(unsigned int taps); + void SetMinimumTapsRequired( uint32_t minimumTaps ); /** - * @brief Set the number of touches required. + * @brief Sets the maximum number of taps required. * - * The number of touches corresponds to the number of fingers a user has on the screen. - * @param[in] touches Touches required. + * The tap count is the number of times a user should "tap" the screen. + * @SINCE_1_0.0 + * @param[in] maximumTaps The maximum taps required * @pre The gesture detector has been initialized. * @note The default is '1'. */ - void SetTouchesRequired(unsigned int touches); + void SetMaximumTapsRequired( uint32_t maximumTaps ); public: // Getters /** - * @brief Retrieves the number of taps required. + * @brief Retrieves the minimum number of taps required. * - * @return The taps required. + * @SINCE_1_0.0 + * @return The minimum taps required * @pre The gesture detector has been initialized. */ - unsigned int GetTapsRequired() const; + uint32_t GetMinimumTapsRequired() const; /** - * @brief Retrieves the number of touches required. + * @brief Retrieves the maximum number of taps required. * - * @return The number of touches required. + * @SINCE_1_0.0 + * @return The maximum taps required * @pre The gesture detector has been initialized. */ - unsigned int GetTouchesRequired() const; + uint32_t GetMaximumTapsRequired() const; public: // Signals @@ -169,21 +194,29 @@ public: // Signals * @code * void YourCallbackName( Actor actor, const TapGesture& gesture ); * @endcode + * @SINCE_1_0.0 + * @return The signal to connect to * @pre The gesture detector has been initialized. - * @return The signal to connect to. */ - DetectedSignalV2& DetectedSignal(); + DetectedSignalType& DetectedSignal(); public: // Not intended for Application developers + /// @cond internal /** - * @brief This constructor is used by Dali New() methods. + * @brief This constructor is used by TapGestureDetector::New() methods. * - * @param [in] internal A pointer to a newly allocated Dali resource. + * @SINCE_1_0.0 + * @param[in] internal A pointer to a newly allocated Dali resource */ explicit DALI_INTERNAL TapGestureDetector(Internal::TapGestureDetector* internal); + /// @endcond }; +/** + * @} + */ + } // namespace Dali #endif // __DALI_TAP_GESTURE_DETECTOR_H__