Moved Gesture::State and -::Type to gesture-enumerations.h.
[platform/core/uifw/dali-core.git] / dali / public-api / events / long-press-gesture.h
1 #ifndef DALI_LONG_PRESS_GESTURE_H
2 #define DALI_LONG_PRESS_GESTURE_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/events/gesture.h>
23 #include <dali/public-api/math/vector2.h>
24
25 namespace Dali
26 {
27
28 namespace Internal DALI_INTERNAL
29 {
30 class LongPressGesture;
31 }
32
33 /**
34  * @addtogroup dali_core_events
35  * @{
36  */
37
38 /**
39  * @brief A LongPressGesture is emitted when the user touches and holds the screen with the stated number of fingers.
40  *
41  * This gesture can be in one of two states, when the long-press gesture is first detected: GestureState::STARTED
42  * and when the long-press gesture ends: GestureState::FINISHED.
43  *
44  * Long press gesture finishes when all touches have been released.
45  *
46  * @SINCE_1_9.28
47  * @see LongPressGestureDetector
48  */
49 class DALI_CORE_API LongPressGesture : public Gesture
50 {
51 public:
52
53   /**
54    * @brief Creates an uninitialized LongPressGesture handle.
55    *
56    * Calling member functions with an uninitialized Actor handle is not allowed.
57    * @SINCE_1_9.28
58    */
59   LongPressGesture();
60
61   /**
62    * @brief Copy constructor.
63    * @SINCE_1_9.28
64    * @param[in] rhs A reference to the copied handle
65    */
66   LongPressGesture( const LongPressGesture& rhs );
67
68   /**
69    * @brief Move constructor.
70    * @SINCE_1_9.28
71    * @param[in] rhs A reference to the handle to move
72    */
73   LongPressGesture( LongPressGesture&& rhs );
74
75   /**
76    * @brief Assignment operator.
77    * @SINCE_1_9.28
78    * @param[in] rhs A reference to the copied handle
79    * @return A reference to this
80    */
81   LongPressGesture& operator=( const LongPressGesture& rhs );
82
83   /**
84    * @brief Move assignment operator.
85    * @SINCE_1_9.28
86    * @param[in] rhs A reference to the moved handle
87    * @return A reference to this
88    */
89   LongPressGesture& operator=( LongPressGesture&& rhs );
90
91   /**
92    * @brief Non virtual destructor.
93    * @SINCE_1_9.28
94    */
95   ~LongPressGesture();
96
97   /**
98    * @brief The number of touch points in this long press gesture.
99    *
100    * In other words, the number of fingers the user had on the screen to generate the long press gesture.
101    * @SINCE_1_9.28
102    * @return The number of touch points
103    */
104   uint32_t GetNumberOfTouches() const;
105
106   /**
107    * @brief This is the point, in screen coordinates, where the long press occurred.
108    *
109    * If a multi-touch long press, then this is the centroid of all the touch points.
110    * @SINCE_1_9.28
111    * @return The point where the long press occurred (in screen coordinates)
112    */
113   const Vector2& GetScreenPoint() const;
114
115   /**
116    * @brief This is the point, in local actor coordinates, where the long press occurred.
117    *
118    * If a multi-touch long press, then this is the centroid of all the touch points.
119    * @SINCE_1_9.28
120    * @return The point where tap has occurred (in local actor coordinates)
121    */
122   const Vector2& GetLocalPoint() const;
123
124 public: // Not intended for application developers
125
126   /// @cond internal
127   /**
128    * @brief This constructor is used internally to Create an initialized LongPressGesture handle.
129    *
130    * @param[in] longPressGesture A pointer to a newly allocated Dali resource
131    * @SINCE_1_9.28
132    */
133   explicit DALI_INTERNAL LongPressGesture( Internal::LongPressGesture* longPressGesture );
134   /// @endcond
135
136 };
137
138 /**
139  * @}
140  */
141 } // namespace Dali
142
143 #endif // DALI_LONG_PRESS_GESTURE_H