Merge "Clean up the code to build successfully on macOS" into devel/master
[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) 2020 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 namespace Dali
25 {
26
27 namespace Internal
28 {
29
30 /**
31  * This structure specifies the gesture type required (or no longer required) by Core.
32  */
33 struct GestureRequest
34 {
35   // Creation & Destruction
36
37   /**
38    * Default Constructor
39    * @param[in]  typeRequired  The gesture type required
40    */
41   GestureRequest( GestureType::Value typeRequired )
42   : type( typeRequired )
43   {
44   }
45
46   /**
47    * Virtual destructor
48    */
49   virtual ~GestureRequest() = default;
50
51   // Data Members
52
53   GestureType::Value type; ///< The type of gesture required.
54 };
55
56 /**
57  * This is used by Core when a pan gesture is required.
58  */
59 struct PanGestureRequest : public GestureRequest
60 {
61   // Creation & Destruction
62
63   /**
64    * Default Constructor
65    */
66   PanGestureRequest()
67   : GestureRequest(GestureType::PAN),
68     minTouches(1),
69     maxTouches(1)
70   {
71   }
72
73   /**
74    * Virtual destructor
75    */
76   ~PanGestureRequest() override = default;
77
78   // Data Members
79
80   unsigned int minTouches; ///< The minimum number of touch points required for a pan gesture.
81   unsigned int maxTouches; ///< The maximum number of touch points required for a pan gesture.
82 };
83
84 /**
85  * This is used by Core when a tap gesture is required.
86  */
87 struct TapGestureRequest : public GestureRequest
88 {
89   // Creation & Destruction
90
91   /**
92    * Default Constructor
93    */
94   TapGestureRequest()
95   : GestureRequest(GestureType::TAP),
96     minTaps(1),
97     maxTaps(1),
98     minTouches(1),
99     maxTouches(1)
100   {
101   }
102
103   /**
104    * Virtual destructor
105    */
106   ~TapGestureRequest() override = default;
107
108   // Data Members
109
110   unsigned int minTaps;    ///< The minimum number of taps required.
111   unsigned int maxTaps;    ///< The maximum number of taps required.
112   unsigned int minTouches; ///< The minimum number of touch points required for our tap gesture.
113   unsigned int maxTouches; ///< The maximum number of touch points required for our tap gesture.
114 };
115
116 /**
117  * This is used by Core when a long press gesture is required.
118  */
119 struct LongPressGestureRequest : public GestureRequest
120 {
121   // Creation & Destruction
122
123   /**
124    * Default Constructor
125    */
126   LongPressGestureRequest()
127   : GestureRequest(GestureType::LONG_PRESS),
128     minTouches(1),
129     maxTouches(1)
130   {
131   }
132
133   /**
134    * Virtual destructor
135    */
136   ~LongPressGestureRequest() override = default;
137
138   // Data Members
139
140   unsigned int minTouches; ///< The minimum number of touch points required for a long press gesture.
141   unsigned int maxTouches; ///< The maximum number of touch points required for a long press gesture.
142 };
143
144 } // namespace Internal
145
146 } // namespace Dali
147
148 #endif // DALI_INTERNAL_GESTURE_REQUESTS_H