1 #ifndef __DALI_GESTURE_H__
2 #define __DALI_GESTURE_H__
5 * Copyright (c) 2015 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/common/dali-common.h>
27 * @addtogroup dali_core_events
32 * @brief Base structure for different gestures that an application can receive.
34 * A gesture is an event that is produced from a combination of
35 * several touch events in a particular order or within a certain time
38 * To receive a particular gesture, the application has to create and connect to the appropriate
42 * @note An instance of this class cannot be created.
43 * @see GestureDetector
46 struct DALI_IMPORT_API Gesture
49 * @brief Copy constructor.
52 Gesture( const Gesture& rhs );
55 * @brief Assignment operator.
58 Gesture& operator=( const Gesture& rhs );
63 * @brief Virtual destructor.
69 * @brief Type of gesture.
74 Pinch = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_0.0
75 Pan = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_0.0
76 Tap = 1 << 2, ///< When the user taps the screen. @SINCE_1_0.0
77 LongPress = 1 << 3 ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
81 * @brief State of the gesture.
86 Clear, ///< There is no state associated with this gesture. @SINCE_1_0.0
87 Started, ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_0.0
88 Continuing, ///< The gesture is continuing. @SINCE_1_0.0
89 Finished, ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_0.0
90 Cancelled, ///< The gesture has been cancelled. @SINCE_1_0.0
91 Possible ///< A gesture is possible. @SINCE_1_0.0
97 * @brief The gesture type.
102 * @brief The gesture state.
104 * Please see the description in the sub-classes to see the states
105 * used by the actual gesture.
110 * @brief The time the gesture took place.
114 protected: // Creation
117 * @brief This constructor is only used by derived classes.
120 * @param[in] gestureType The type of gesture event.
121 * @param[in] gestureState The state of the gesture event.
123 Gesture(Type gestureType, State gestureState);
132 #endif // __DALI_GESTURE_H__