X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fevents%2Flong-press-gesture.h;h=10f0b40ae42f59613ac72d56b3de31b2d4e98d85;hb=c4750afbf79f15bf71e2aa8ef54f84750463aae2;hp=2fc9bc4e371b1f0b2cfe841d2656107142f9a19f;hpb=4bd2fbea750e7dc85627868d8d276cc416b01b5a;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/events/long-press-gesture.h b/dali/public-api/events/long-press-gesture.h index 2fc9bc4..10f0b40 100644 --- a/dali/public-api/events/long-press-gesture.h +++ b/dali/public-api/events/long-press-gesture.h @@ -1,8 +1,8 @@ -#ifndef __DALI_LONG_PRESS_GESTURE_H__ -#define __DALI_LONG_PRESS_GESTURE_H__ +#ifndef DALI_LONG_PRESS_GESTURE_H +#define DALI_LONG_PRESS_GESTURE_H /* - * Copyright (c) 2015 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. @@ -24,6 +24,11 @@ namespace Dali { +namespace Internal DALI_INTERNAL +{ +class LongPressGesture; +} + /** * @addtogroup dali_core_events * @{ @@ -32,61 +37,98 @@ namespace Dali /** * @brief A LongPressGesture is emitted when the user touches and holds the screen with the stated number of fingers. * - * This gesture can be in one of two states, when the long-press gesture is first detected: "Started"; - * and when the long-press gesture ends: "Finished". + * This gesture can be in one of two states, when the long-press gesture is first detected: GestureState::STARTED + * and when the long-press gesture ends: GestureState::FINISHED. * * Long press gesture finishes when all touches have been released. * + * @SINCE_1_9.28 * @see LongPressGestureDetector */ -struct DALI_IMPORT_API LongPressGesture : public Gesture +class DALI_CORE_API LongPressGesture : public Gesture { - // Construction & Destruction - +public: /** - * @brief Constructor + * @brief Creates an uninitialized LongPressGesture handle. * - * @param[in] state The state of the gesture + * Calling member functions with an uninitialized Actor handle is not allowed. + * @SINCE_1_9.28 */ - LongPressGesture(Gesture::State state); + LongPressGesture(); /** - * @brief Copy constructor + * @brief Copy constructor. + * @SINCE_1_9.28 + * @param[in] rhs A reference to the copied handle */ - LongPressGesture( const LongPressGesture& rhs ); + LongPressGesture(const LongPressGesture& rhs); /** - * @brief Assignment operator + * @brief Move constructor. + * @SINCE_1_9.28 + * @param[in] rhs A reference to the handle to move */ - LongPressGesture& operator=( const LongPressGesture& rhs ); + LongPressGesture(LongPressGesture&& rhs) noexcept; /** - * @brief Virtual destructor + * @brief Assignment operator. + * @SINCE_1_9.28 + * @param[in] rhs A reference to the copied handle + * @return A reference to this */ - virtual ~LongPressGesture(); + LongPressGesture& operator=(const LongPressGesture& rhs); - // Data + /** + * @brief Move assignment operator. + * @SINCE_1_9.28 + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + LongPressGesture& operator=(LongPressGesture&& rhs) noexcept; /** - * @brief The number of touch points in this long press gesture, i.e. the number of fingers the user had - * on the screen to generate the long press gesture. + * @brief Non virtual destructor. + * @SINCE_1_9.28 */ - unsigned int numberOfTouches; + ~LongPressGesture(); + + /** + * @brief The number of touch points in this long press gesture. + * + * In other words, the number of fingers the user had on the screen to generate the long press gesture. + * @SINCE_1_9.28 + * @return The number of touch points + */ + uint32_t GetNumberOfTouches() const; /** * @brief This is the point, in screen coordinates, where the long press occurred. * * If a multi-touch long press, then this is the centroid of all the touch points. + * @SINCE_1_9.28 + * @return The point where the long press occurred (in screen coordinates) */ - Vector2 screenPoint; + const Vector2& GetScreenPoint() const; /** * @brief This is the point, in local actor coordinates, where the long press occurred. * * If a multi-touch long press, then this is the centroid of all the touch points. - * @return The point where tap has occurred (in local actor coordinates). + * @SINCE_1_9.28 + * @return The point where tap has occurred (in local actor coordinates) + */ + const Vector2& GetLocalPoint() const; + +public: // Not intended for application developers + /// @cond internal + /** + * @brief This constructor is used internally to Create an initialized LongPressGesture handle. + * + * @param[in] longPressGesture A pointer to a newly allocated Dali resource + * @SINCE_1_9.28 */ - Vector2 localPoint; + explicit DALI_INTERNAL LongPressGesture(Internal::LongPressGesture* longPressGesture); + /// @endcond }; /** @@ -94,4 +136,4 @@ struct DALI_IMPORT_API LongPressGesture : public Gesture */ } // namespace Dali -#endif // __DALI_LONG_PRESS_GESTURE_H__ +#endif // DALI_LONG_PRESS_GESTURE_H