Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[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) 2018 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  * @addtogroup dali_core_events
29  * @{
30  */
31
32 /**
33  * @brief A LongPressGesture is emitted when the user touches and holds the screen with the stated number of fingers.
34  *
35  * This gesture can be in one of two states, when the long-press gesture is first detected: Gesture::Started
36  * and when the long-press gesture ends: Gesture::Finished.
37  *
38  * Long press gesture finishes when all touches have been released.
39  *
40  * @SINCE_1_0.0
41  * @see LongPressGestureDetector
42  */
43 struct DALI_CORE_API LongPressGesture : public Gesture
44 {
45   // Construction & Destruction
46
47   /**
48    * @brief Constructor.
49    *
50    * @SINCE_1_0.0
51    * @param[in] state The state of the gesture
52    */
53   LongPressGesture(Gesture::State state);
54
55   /**
56    * @brief Copy constructor.
57    * @SINCE_1_0.0
58    * @param[in] rhs A reference to the copied handle
59    */
60   LongPressGesture( const LongPressGesture& rhs );
61
62   /**
63    * @brief Assignment operator.
64    * @SINCE_1_0.0
65    * @param[in] rhs A reference to the copied handle
66    * @return A reference to this
67    */
68   LongPressGesture& operator=( const LongPressGesture& rhs );
69
70   /**
71    * @brief Virtual destructor.
72    * @SINCE_1_0.0
73    */
74   virtual ~LongPressGesture();
75
76   // Data
77
78   /**
79    * @brief The number of touch points in this long press gesture, i.e. the number of fingers the user had
80    * on the screen to generate the long press gesture.
81    */
82   uint32_t numberOfTouches;
83
84   /**
85    * @brief This is the point, in screen coordinates, where the long press occurred.
86    *
87    * If a multi-touch long press, then this is the centroid of all the touch points.
88    */
89   Vector2 screenPoint;
90
91   /**
92    * @brief This is the point, in local actor coordinates, where the long press occurred.
93    *
94    * If a multi-touch long press, then this is the centroid of all the touch points.
95    * @return The point where tap has occurred (in local actor coordinates)
96    */
97   Vector2 localPoint;
98 };
99
100 /**
101  * @}
102  */
103 } // namespace Dali
104
105 #endif // __DALI_LONG_PRESS_GESTURE_H__