X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fevents%2Flong-press-gesture-detector.h;h=afdcf406873304427f1733ba9088296443d59d3f;hb=0b501ba800a263b97d99adf224fc42d0c2aa8b37;hp=014c8dc3a25d19a97b06a1657b6a41805f5c6f52;hpb=ea86ef9851ff0868616ea28825d9f257dd96cf88;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/events/long-press-gesture-detector.h b/dali/public-api/events/long-press-gesture-detector.h index 014c8dc..afdcf40 100644 --- a/dali/public-api/events/long-press-gesture-detector.h +++ b/dali/public-api/events/long-press-gesture-detector.h @@ -1,8 +1,8 @@ -#ifndef __DALI_LONG_PRESS_GESTURE_DETECTOR_H__ -#define __DALI_LONG_PRESS_GESTURE_DETECTOR_H__ +#ifndef DALI_LONG_PRESS_GESTURE_DETECTOR_H +#define DALI_LONG_PRESS_GESTURE_DETECTOR_H /* - * 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. @@ -18,27 +18,34 @@ * */ +// EXTERNAL INCLUDES +#include // uint32_t + // INTERNAL INCLUDES #include #include namespace Dali { +/** + * @addtogroup dali_core_events + * @{ + */ namespace Internal DALI_INTERNAL { class LongPressGestureDetector; } -struct LongPressGesture; +class LongPressGesture; /** * @brief This class emits a signals when a long press gesture occurs that meets the requirements set by the application. - * @see LongPressGestureDetector::SetTouchesRequired. + * @SINCE_1_0.0 * * For any valid long press, two signals will be emitted: - * - First identifying the beginning (state = Started) i.e. when fingers held down for the required time. - * - Second identifying the ending (state = Finished) i.e. when fingers are released. + * - First identifying the beginning (state = GestureState::STARTED) i.e. when fingers held down for the required time. + * - Second identifying the ending (state = GestureState::FINISHED) i.e. when fingers are released. * * The application programmer can use this gesture detector as follows: * @code @@ -50,100 +57,123 @@ struct LongPressGesture; * @see LongPressGesture * * Signals - * | %Signal Name | Method | - * |---------------------|-----------------------| - * | long-press-detected | @ref DetectedSignal() | + * | %Signal Name | Method | + * |-------------------|-----------------------| + * | longPressDetected | @ref DetectedSignal() | */ -class DALI_IMPORT_API LongPressGestureDetector : public GestureDetector +class DALI_CORE_API LongPressGestureDetector : public GestureDetector { -public: // Typedefs - - typedef Signal< void ( Actor, const LongPressGesture& ) > DetectedSignalType; ///< Gesture detected signal type +public: // Typedefs + using DetectedSignalType = Signal; ///< Gesture detected signal type @SINCE_1_0.0 public: // Creation & Destruction - /** - * @brief Create an uninitialized LongPressGestureDetector; this can be initialized with LongPressGestureDetector::New(). + * @brief Creates an uninitialized LongPressGestureDetector; this can be initialized with LongPressGestureDetector::New(). * - * Calling member functions with an uninitialized Dali::Object is not allowed. + * Calling member functions with an uninitialized LongPressGestureDetector handle is not allowed. + * @SINCE_1_0.0 */ LongPressGestureDetector(); /** - * @brief Create an initialized LongPressGestureDetector. + * @brief Creates an initialized LongPressGestureDetector. * * By default, this would create a gesture detector that requires only 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 LongPressGestureDetector New(); /** - * @brief Create an initialized LongPressGestureDetector with the number of touches required. + * @brief Creates an initialized LongPressGestureDetector with the number of touches required. * * A long press gesture will be emitted from this detector if the number of fingers touching the * screen is equal to the touches required. - * @param[in] touchesRequired The number of touches required. - * @return A handle to a newly allocated Dali resource. + * @SINCE_1_0.0 + * @param[in] touchesRequired The number of touches required + * @return A handle to a newly allocated Dali resource */ - static LongPressGestureDetector New(unsigned int touchesRequired); + static LongPressGestureDetector New(uint32_t touchesRequired); /** - * @brief Create an initialized LongPressGestureDetector with the minimum and maximum number of touches required. + * @brief Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required. * * A long press gesture will be emitted from this detector if the number of fingers touching the screen * falls between the minimum and maximum touches set. - * @param[in] minTouches The minimum number of touches required. - * @param[in] maxTouches The maximum number of touches required. - * @return A handle to a newly allocated Dali resource. + * @SINCE_1_0.0 + * @param[in] minTouches The minimum number of touches required + * @param[in] maxTouches The maximum number of touches required + * @return A handle to a newly allocated Dali resource */ - static LongPressGestureDetector New(unsigned int minTouches, unsigned int maxTouches); + static LongPressGestureDetector New(uint32_t minTouches, uint32_t maxTouches); /** - * @brief Downcast an Object handle to LongPressGestureDetector handle. + * @brief Downcasts a handle to LongPressGestureDetector handle. * - * If handle points to a LongPressGestureDetector object the - * downcast produces valid handle. If not the returned handle is left uninitialized. - * @param[in] handle to An object - * @return handle to a LongPressGestureDetector object or an uninitialized handle + * If handle points to a LongPressGestureDetector 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 LongPressGestureDetector object or an uninitialized handle */ - static LongPressGestureDetector DownCast( BaseHandle handle ); + static LongPressGestureDetector 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 */ ~LongPressGestureDetector(); /** * @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 */ LongPressGestureDetector(const LongPressGestureDetector& 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 */ LongPressGestureDetector& operator=(const LongPressGestureDetector& rhs); -public: // Setters + /** + * @brief This move constructor is required for (smart) pointer semantics. + * + * @SINCE_2_2.4 + * @param[in] handle A reference to the moved handle + */ + LongPressGestureDetector(LongPressGestureDetector&& handle) noexcept; /** - * @brief Set the number of touches required. + * @brief This move assignment operator is required for (smart) pointer semantics. + * + * @SINCE_2_2.4 + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + LongPressGestureDetector& operator=(LongPressGestureDetector&& rhs) noexcept; + +public: // Setters + /** + * @brief Sets the number of touches required. * * The number of touches corresponds to the number of fingers a user * has on the screen. This sets the minimum and maximum touches to * the input parameter. * - * @param[in] touches Touches required. + * @SINCE_1_0.0 + * @param[in] touches Touches required * @pre The gesture detector has been initialized. * @note The default is '1'. */ - void SetTouchesRequired(unsigned int touches); + void SetTouchesRequired(uint32_t touches); /** * @brief Sets the minimum and maximum touches required. @@ -151,56 +181,62 @@ public: // Setters * The number of touches corresponds to the number of fingers a user * has on the screen. * - * @param[in] minTouches Minimum Touches required. - * @param[in] maxTouches Maximum Touches required. + * @SINCE_1_0.0 + * @param[in] minTouches Minimum Touches required + * @param[in] maxTouches Maximum Touches required * @pre The gesture detector has been initialized. * @note The default is '1'. */ - void SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches); + void SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches); public: // Getters - /** * @brief Retrieves the minimum number of touches required. * - * @return The minimum number of touches required. + * @SINCE_1_0.0 + * @return The minimum number of touches required * @pre The gesture detector has been initialized. */ - unsigned int GetMinimumTouchesRequired() const; + uint32_t GetMinimumTouchesRequired() const; /** * @brief Retrieves the maximum number of touches required. * - * @return The maximum number of touches required. + * @SINCE_1_0.0 + * @return The maximum number of touches required * @pre The gesture detector has been initialized. */ - unsigned int GetMaximumTouchesRequired() const; + uint32_t GetMaximumTouchesRequired() const; public: // Signals - /** - * @brief This signal is emitted when the specified long press is detected on the attached actor. + * @brief This signal is emitted when the specified long press is detected on the attached actor. * * A callback of the following type may be connected: * @code * void YourCallbackName( Actor actor, const LongPressGesture& 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. */ 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 LongPressGestureDetector::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 LongPressGestureDetector(Internal::LongPressGestureDetector* internal); - + /// @endcond }; +/** + * @} + */ } // namespace Dali -#endif // __DALI_LONG_PRESS_GESTURE_DETECTOR_H__ +#endif // DALI_LONG_PRESS_GESTURE_DETECTOR_H