1 #ifndef DALI_TAP_GESTURE_H
2 #define DALI_TAP_GESTURE_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/events/gesture.h>
23 #include <dali/public-api/math/vector2.h>
27 namespace Internal DALI_INTERNAL
33 * @addtogroup dali_core_events
38 * @brief A TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
40 * This is a discrete gesture so does not have any state information.
42 * @see TapGestureDetector
44 class DALI_CORE_API TapGesture : public Gesture
48 * @brief Creates an uninitialized TapGesture handle.
50 * Calling member functions with an uninitialized Actor handle is not allowed.
56 * @brief Copy constructor.
58 * @param rhs A reference to the copied handle
60 TapGesture(const TapGesture& rhs);
63 * @brief Move constructor.
65 * @param rhs The handle to move.
67 TapGesture(TapGesture&& rhs) noexcept;
70 * @brief Assignment operator.
72 * @param rhs A reference to the copied handle
73 * @return A reference to this
75 TapGesture& operator=(const TapGesture& rhs);
78 * @brief Move assignment operator.
80 * @param rhs The handle to move.
82 TapGesture& operator=(TapGesture&& rhs) noexcept;
85 * @brief Non virtual destructor.
91 * @brief The number of taps in this tap gesture.
93 * @return The number of taps
95 uint32_t GetNumberOfTaps() const;
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.
101 * @return The number of touchs
103 uint32_t GetNumberOfTouches() const;
106 * @brief This is the point, in screen coordinates, where the tap occurred.
108 * If a multi-touch tap, then this is the centroid of all the touch points.
110 * @return The point where tap has occurred( in screen coordinates)
112 const Vector2& GetScreenPoint() const;
115 * @brief This is the point, in local actor coordinates, where the tap occurred.
117 * If a multi-touch tap, then this is the centroid of all the touch points.
119 * @return The point where tap has occurred (in local actor coordinates)
121 const Vector2& GetLocalPoint() const;
123 public: // Not intended for application developers
126 * @brief This constructor is used internally to Create an initialized TapGesture handle.
128 * @param[in] tapGesture A pointer to a newly allocated Dali resource
131 explicit DALI_INTERNAL TapGesture(Internal::TapGesture* tapGesture);
140 #endif // DALI_TAP_GESTURE_H