Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / events / tap-gesture.h
1 #ifndef __DALI_TAP_GESTURE_H__
2 #define __DALI_TAP_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 TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
34  *
35  * This is a discrete gesture so does not have any state information.
36  * @SINCE_1_0.0
37  * @see TapGestureDetector
38  */
39 struct DALI_CORE_API TapGesture : public Gesture
40 {
41   // Construction & Destruction
42
43   /**
44    * @brief Default Constructor.
45    * @SINCE_1_0.0
46    */
47   TapGesture();
48
49   /**
50    * @brief Copy constructor.
51    * @SINCE_1_0.0
52    * @param rhs A reference to the copied handle
53    */
54   TapGesture( const TapGesture& rhs );
55
56   /**
57    * @brief Assignment operator.
58    * @SINCE_1_0.0
59    * @param rhs A reference to the copied handle
60    * @return A reference to this
61    */
62   TapGesture& operator=( const TapGesture& rhs );
63
64   /**
65    * @brief Virtual destructor.
66    * @SINCE_1_0.0
67    */
68   virtual ~TapGesture();
69
70   // Data
71
72   /**
73    * @brief The number of taps in this tap gesture.
74    */
75   uint32_t numberOfTaps;
76
77   /**
78    * @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the
79    * screen to generate the tap gesture.
80    */
81   uint32_t numberOfTouches;
82
83   /**
84    * @brief This is the point, in screen coordinates, where the tap occurred.
85    *
86    * If a multi-touch tap, then this is the centroid of all the touch points.
87    */
88   Vector2 screenPoint;
89
90   /**
91    * @brief This is the point, in local actor coordinates, where the tap occurred.
92    *
93    * If a multi-touch tap, then this is the centroid of all the touch points.
94    * @return The point where tap has occurred (in local actor coordinates)
95    */
96   Vector2 localPoint;
97 };
98
99 /**
100  * @}
101  */
102 } // namespace Dali
103
104 #endif // __DALI_TAP_GESTURE_H__