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 <cstdint> // uint32_t
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/events/gesture-enumerations.h>
27 #include <dali/public-api/object/base-handle.h>
32 * @addtogroup dali_core_events
36 namespace Internal DALI_INTERNAL
42 * @brief Base structure for different gestures that an application can receive.
44 * A gesture is an event that is produced from a combination of
45 * several touch events in a particular order or within a certain time
48 * To receive a particular gesture, the application has to create and connect to the appropriate
52 * @note An instance of this class cannot be created.
53 * @see GestureDetector
56 class DALI_CORE_API Gesture : public BaseHandle
60 * @brief Creates an uninitialized Gesture handle.
62 * Calling member functions with an uninitialized Actor handle is not allowed.
68 * @brief Copy constructor.
70 * @param[in] rhs A reference to the copied handle
72 Gesture(const Gesture& rhs);
75 * @brief Move constructor.
77 * @param[in] rhs A reference to the handle to move
79 Gesture(Gesture&& rhs) noexcept;
82 * @brief Assignment operator.
84 * @param[in] rhs A reference to the copied handle
85 * @return A reference to this
87 Gesture& operator=(const Gesture& rhs);
90 * @brief Move assignment operator.
92 * @param[in] rhs A reference to the handle to move
93 * @return A reference to this
95 Gesture& operator=(Gesture&& rhs) noexcept;
98 * @brief Non virtual destructor.
104 * @brief The gesture type.
106 * @return The gesture type
108 GestureType::Value GetType() const;
111 * @brief The gesture state.
113 * Please see the description in the sub-classes to see the states
114 * used by the actual gesture.
116 * @return The state of the gesture
118 GestureState GetState() const;
121 * @brief The time the gesture took place.
123 * @return The time the gesture took place
125 uint32_t GetTime() const;
128 * @brief Gets the value of which source the gesture was started with. (ex : mouse)
130 * @return The gesture input source.
132 GestureSourceType GetSourceType() const;
135 * @brief Gets the data of the source type.
137 * @return The gesture source data.
139 GestureSourceData GetSourceData() const;
141 public: // Not intended for application developers
144 * @brief Internal constructor.
146 * @param[in] gesture Pointer to internal gesture
148 explicit DALI_INTERNAL Gesture(Internal::Gesture* gesture);
157 #endif // DALI_GESTURE_H