Revert "[Tizen] Not execute the remove callback"
[platform/core/uifw/dali-core.git] / dali / internal / event / events / gesture-requests.h
1 #ifndef DALI_INTERNAL_GESTURE_REQUESTS_H
2 #define DALI_INTERNAL_GESTURE_REQUESTS_H
3
4 /*
5  * Copyright (c) 2022 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 // INTERNAL INCLUDES
22 #include <dali/public-api/events/gesture.h>
23
24 // EXTERNAL INCLUDES
25 #include <limits> // for numeric_limits::max();
26
27 namespace Dali
28 {
29 namespace Internal
30 {
31 /**
32  * This structure specifies the gesture type required (or no longer required) by Core.
33  */
34 struct GestureRequest
35 {
36   // Creation & Destruction
37
38   /**
39    * Default Constructor
40    * @param[in]  typeRequired  The gesture type required
41    */
42   GestureRequest(GestureType::Value typeRequired)
43   : type(typeRequired)
44   {
45   }
46
47   /**
48    * Virtual destructor
49    */
50   virtual ~GestureRequest() = default;
51
52   // Data Members
53
54   GestureType::Value type; ///< The type of gesture required.
55 };
56
57 /**
58  * This is used by Core when a pan gesture is required.
59  */
60 struct PanGestureRequest : public GestureRequest
61 {
62   // Creation & Destruction
63
64   /**
65    * Default Constructor
66    */
67   PanGestureRequest()
68   : GestureRequest(GestureType::PAN),
69     minTouches(1),
70     maxTouches(1),
71     maxMotionEventAge(std::numeric_limits<uint32_t>::max())
72   {
73   }
74
75   /**
76    * Virtual destructor
77    */
78   ~PanGestureRequest() override = default;
79
80   // Data Members
81
82   uint32_t minTouches;        ///< The minimum number of touch points required for a pan gesture.
83   uint32_t maxTouches;        ///< The maximum number of touch points required for a pan gesture.
84   uint32_t maxMotionEventAge; ///< The maximum age of motion events as milliseconds.
85 };
86
87 /**
88  * This is used by Core when a tap gesture is required.
89  */
90 struct TapGestureRequest : public GestureRequest
91 {
92   // Creation & Destruction
93
94   /**
95    * Default Constructor
96    */
97   TapGestureRequest()
98   : GestureRequest(GestureType::TAP),
99     minTaps(1),
100     maxTaps(1),
101     minTouches(1),
102     maxTouches(1)
103   {
104   }
105
106   /**
107    * Virtual destructor
108    */
109   ~TapGestureRequest() override = default;
110
111   // Data Members
112
113   unsigned int minTaps;    ///< The minimum number of taps required.
114   unsigned int maxTaps;    ///< The maximum number of taps required.
115   unsigned int minTouches; ///< The minimum number of touch points required for our tap gesture.
116   unsigned int maxTouches; ///< The maximum number of touch points required for our tap gesture.
117 };
118
119 /**
120  * This is used by Core when a long press gesture is required.
121  */
122 struct LongPressGestureRequest : public GestureRequest
123 {
124   // Creation & Destruction
125
126   /**
127    * Default Constructor
128    */
129   LongPressGestureRequest()
130   : GestureRequest(GestureType::LONG_PRESS),
131     minTouches(1),
132     maxTouches(1)
133   {
134   }
135
136   /**
137    * Virtual destructor
138    */
139   ~LongPressGestureRequest() override = default;
140
141   // Data Members
142
143   unsigned int minTouches; ///< The minimum number of touch points required for a long press gesture.
144   unsigned int maxTouches; ///< The maximum number of touch points required for a long press gesture.
145 };
146
147 } // namespace Internal
148
149 } // namespace Dali
150
151 #endif // DALI_INTERNAL_GESTURE_REQUESTS_H