Add Touch source type for gesture
[platform/core/uifw/dali-core.git] / dali / public-api / events / gesture-enumerations.h
1 #ifndef DALI_GESTURE_ENUMERATIONS_H
2 #define DALI_GESTURE_ENUMERATIONS_H
3
4 /*
5  * Copyright (c) 2023 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 // EXTERNAL INCLUDES
22 #include <cstdint>
23
24 namespace Dali
25 {
26 /**
27  * @brief Enumeration for type of gesture.
28  * @SINCE_1_9.28
29  */
30 namespace GestureType
31 {
32 enum Value : uint8_t
33 {
34   PINCH      = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_9.28
35   PAN        = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_9.28
36   TAP        = 1 << 2, ///< When the user taps the screen. @SINCE_1_9.28
37   LONG_PRESS = 1 << 3, ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_9.28
38   ROTATION   = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen. @SINCE_1_9.28
39 };
40 } // namespace GestureType
41
42 /**
43  * @brief Enumeration for state of the gesture.
44  * @SINCE_1_9.28
45  */
46 enum class GestureState : uint8_t
47 {
48   CLEAR,      ///< There is no state associated with this gesture. @SINCE_1_9.28
49   STARTED,    ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_9.28
50   CONTINUING, ///< The gesture is continuing. @SINCE_1_9.28
51   FINISHED,   ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_9.28
52   CANCELLED,  ///< The gesture has been cancelled. @SINCE_1_9.28
53   POSSIBLE    ///< A gesture is possible. @SINCE_1_9.28
54 };
55
56 /**
57  * @brief Enumeration for gesture input source type.
58  * @SINCE_2_2.0
59  */
60 enum class GestureSourceType : int8_t
61 {
62   INVALID, ///< invalid data
63   MOUSE,   ///< mouse
64   TOUCH,   ///< touch
65 };
66
67 /**
68  * @brief Enumeration for data of gesture input source type.
69  * @SINCE_2_2.0
70  */
71 enum class GestureSourceData : int8_t
72 {
73   INVALID         = -1, ///< invalid data
74   MOUSE_PRIMARY   = 1,  /**< Primary(Left) mouse button */
75   MOUSE_SECONDARY = 3,  /**< Secondary(Right) mouse button */
76   MOUSE_TERTIARY  = 2,  /**< Center(Wheel) mouse button */
77 };
78
79 } // namespace Dali
80
81 #endif // DALI_GESTURE_ENUMERATIONS_H