1 #ifndef __DALI_GESTURE_H__
2 #define __DALI_GESTURE_H__
5 * Copyright (c) 2018 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>
30 * @addtogroup dali_core_events
35 * @brief Base structure for different gestures that an application can receive.
37 * A gesture is an event that is produced from a combination of
38 * several touch events in a particular order or within a certain time
41 * To receive a particular gesture, the application has to create and connect to the appropriate
45 * @note An instance of this class cannot be created.
46 * @see GestureDetector
49 struct DALI_CORE_API Gesture
52 * @brief Copy constructor.
54 * @param[in] rhs A reference to the copied handle
56 Gesture( const Gesture& rhs );
59 * @brief Assignment operator.
61 * @param[in] rhs A reference to the copied handle
62 * @return A reference to this
64 Gesture& operator=( const Gesture& rhs );
69 * @brief Virtual destructor.
75 * @brief Enumeration for type of gesture.
80 Pinch = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_0.0
81 Pan = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_0.0
82 Tap = 1 << 2, ///< When the user taps the screen. @SINCE_1_0.0
83 LongPress = 1 << 3 ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
87 * @brief Enumeration for state of the gesture.
92 Clear, ///< There is no state associated with this gesture. @SINCE_1_0.0
93 Started, ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_0.0
94 Continuing, ///< The gesture is continuing. @SINCE_1_0.0
95 Finished, ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_0.0
96 Cancelled, ///< The gesture has been cancelled. @SINCE_1_0.0
97 Possible ///< A gesture is possible. @SINCE_1_0.0
103 * @brief The gesture type.
108 * @brief The gesture state.
110 * Please see the description in the sub-classes to see the states
111 * used by the actual gesture.
116 * @brief The time the gesture took place.
120 protected: // Creation
123 * @brief This constructor is only used by derived classes.
126 * @param[in] gestureType The type of gesture event.
127 * @param[in] gestureState The state of the gesture event.
129 Gesture(Type gestureType, State gestureState);
138 #endif // __DALI_GESTURE_H__