Ensure BaseHandle class move noexcept (core public-api)
[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) 2022 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 namespace Internal DALI_INTERNAL
28 {
29 class TapGesture;
30 }
31
32 /**
33  * @addtogroup dali_core_events
34  * @{
35  */
36
37 /**
38  * @brief A TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
39  *
40  * This is a discrete gesture so does not have any state information.
41  * @SINCE_1_9.28
42  * @see TapGestureDetector
43  */
44 class DALI_CORE_API TapGesture : public Gesture
45 {
46 public:
47   /**
48    * @brief Creates an uninitialized TapGesture handle.
49    *
50    * Calling member functions with an uninitialized Actor handle is not allowed.
51    * @SINCE_1_9.28
52    */
53   TapGesture();
54
55   /**
56    * @brief Copy constructor.
57    * @SINCE_1_9.28
58    * @param rhs A reference to the copied handle
59    */
60   TapGesture(const TapGesture& rhs);
61
62   /**
63    * @brief Move constructor.
64    * @SINCE_1_9.28
65    * @param rhs The handle to move.
66    */
67   TapGesture(TapGesture&& rhs) noexcept;
68
69   /**
70    * @brief Assignment operator.
71    * @SINCE_1_9.28
72    * @param rhs A reference to the copied handle
73    * @return A reference to this
74    */
75   TapGesture& operator=(const TapGesture& rhs);
76
77   /**
78    * @brief Move assignment operator.
79    * @SINCE_1_9.28
80    * @param rhs The handle to move.
81    */
82   TapGesture& operator=(TapGesture&& rhs) noexcept;
83
84   /**
85    * @brief Non virtual destructor.
86    * @SINCE_1_9.28
87    */
88   ~TapGesture();
89
90   /**
91    * @brief The number of taps in this tap gesture.
92    * @SINCE_1_9.28
93    * @return The number of taps
94    */
95   uint32_t GetNumberOfTaps() const;
96
97   /**
98    * @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the
99    * screen to generate the tap gesture.
100    * @SINCE_1_9.28
101    * @return The number of touchs
102    */
103   uint32_t GetNumberOfTouches() const;
104
105   /**
106    * @brief This is the point, in screen coordinates, where the tap occurred.
107    *
108    * If a multi-touch tap, then this is the centroid of all the touch points.
109    * @SINCE_1_9.28
110    * @return The point where tap has occurred( in screen coordinates)
111    */
112   const Vector2& GetScreenPoint() const;
113
114   /**
115    * @brief This is the point, in local actor coordinates, where the tap occurred.
116    *
117    * If a multi-touch tap, then this is the centroid of all the touch points.
118    * @SINCE_1_9.28
119    * @return The point where tap has occurred (in local actor coordinates)
120    */
121   const Vector2& GetLocalPoint() const;
122
123 public: // Not intended for application developers
124   /// @cond internal
125   /**
126    * @brief This constructor is used internally to Create an initialized TapGesture handle.
127    *
128    * @param[in] tapGesture A pointer to a newly allocated Dali resource
129    * @SINCE_1_9.28
130    */
131   explicit DALI_INTERNAL TapGesture(Internal::TapGesture* tapGesture);
132   /// @endcond
133 };
134
135 /**
136  * @}
137  */
138 } // namespace Dali
139
140 #endif // DALI_TAP_GESTURE_H