Moved Gesture::State and -::Type to gesture-enumerations.h.
[platform/core/uifw/dali-core.git] / dali / public-api / events / long-press-gesture.h
index a71df01..82355fd 100644 (file)
@@ -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.
 
 namespace Dali
 {
+
+namespace Internal DALI_INTERNAL
+{
+class LongPressGesture;
+}
+
 /**
  * @addtogroup dali_core_events
  * @{
@@ -32,69 +38,101 @@ 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: 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
+   * @brief Copy constructor.
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    */
   LongPressGesture( const LongPressGesture& rhs );
 
   /**
-   * @brief Assignment operator
-   * @SINCE_1_0.0
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the handle to move
+   */
+  LongPressGesture( LongPressGesture&& rhs );
+
+  /**
+   * @brief Assignment operator.
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   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 );
 
-  // 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.
-   * @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
+
 };
 
 /**
@@ -102,4 +140,4 @@ struct DALI_IMPORT_API LongPressGesture : public Gesture
  */
 } // namespace Dali
 
-#endif // __DALI_LONG_PRESS_GESTURE_H__
+#endif // DALI_LONG_PRESS_GESTURE_H