Use existing callback ID for recurring callbacks
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / accessibility-gesture-event.h
1 #ifndef DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
2 #define DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_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 #include <dali/public-api/math/vector2.h>
24
25 namespace Dali
26 {
27 struct AccessibilityGestureEvent
28 {
29   // Construction & Destruction
30
31   /**
32    * Virtual destructor
33    */
34   ~AccessibilityGestureEvent()
35   {
36   }
37
38   // Data
39
40   /**
41    * The previous touch position of the primary touch point in screen coordinates.
42    */
43   Vector2 previousPosition;
44
45   /**
46    * This current touch position of the primary touch point in screen coordinates.
47    */
48   Vector2 currentPosition;
49
50   /**
51    * The time difference between the previous and latest touch motion events (in ms).
52    */
53   unsigned long timeDelta;
54
55   /**
56    * The total number of fingers touching the screen in a pan gesture.
57    */
58   unsigned int numberOfTouches;
59
60   enum State
61   {
62     CLEAR,      ///< There is no state associated with this gesture. @SINCE_1_9.28
63     STARTED,    ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_9.28
64     CONTINUING, ///< The gesture is continuing. @SINCE_1_9.28
65     FINISHED,   ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_9.28
66     CANCELLED,  ///< The gesture has been cancelled. @SINCE_1_9.28
67     POSSIBLE    ///< A gesture is possible. @SINCE_1_9.28
68   };
69
70   State state;
71
72   uint32_t time;
73
74   /**
75    * Default Constructor
76    * @param[in]  state  The state of the gesture
77    */
78   AccessibilityGestureEvent(AccessibilityGestureEvent::State state)
79   : timeDelta(0),
80     numberOfTouches(0),
81     state(state),
82     time(0)
83   {
84   }
85 };
86
87 } // namespace Dali
88
89 #endif // DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H