-#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.
namespace Dali
{
+namespace Internal DALI_INTERNAL
+{
+class LongPressGesture;
+}
+
/**
* @addtogroup dali_core_events
* @{
/**
* @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: Gesture::Started
- * and when the long-press gesture ends: Gesture::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_0.0
+ * @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.
*
- * @SINCE_1_0.0
- * @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.
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
* @param[in] rhs A reference to the copied handle
*/
- LongPressGesture( const LongPressGesture& rhs );
+ LongPressGesture(const LongPressGesture& rhs);
+
+ /**
+ * @brief Move constructor.
+ * @SINCE_1_9.28
+ * @param[in] rhs A reference to the handle to move
+ */
+ LongPressGesture(LongPressGesture&& rhs) noexcept;
/**
* @brief Assignment operator.
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
* @param[in] rhs A reference to the copied handle
* @return A reference to this
*/
- LongPressGesture& operator=( const LongPressGesture& rhs );
+ LongPressGesture& operator=(const LongPressGesture& rhs);
/**
- * @brief Virtual destructor.
- * @SINCE_1_0.0
+ * @brief Move assignment operator.
+ * @SINCE_1_9.28
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
*/
- virtual ~LongPressGesture();
+ LongPressGesture& operator=(LongPressGesture&& rhs) noexcept;
- // Data
+ /**
+ * @brief Non virtual destructor.
+ * @SINCE_1_9.28
+ */
+ ~LongPressGesture();
/**
- * @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 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
*/
- unsigned int numberOfTouches;
+ 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.
+ * @SINCE_1_9.28
* @return The point where tap has occurred (in local actor coordinates)
*/
- Vector2 localPoint;
+ 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
+ */
+ explicit DALI_INTERNAL LongPressGesture(Internal::LongPressGesture* longPressGesture);
+ /// @endcond
};
/**
*/
} // namespace Dali
-#endif // __DALI_LONG_PRESS_GESTURE_H__
+#endif // DALI_LONG_PRESS_GESTURE_H