e5c9f48adbe7fa4c7fd018f3e7fb14437d108f94
[platform/core/uifw/dali-core.git] / dali / public-api / events / hover-event.h
1 #ifndef __DALI_HOVER_EVENT_H__
2 #define __DALI_HOVER_EVENT_H__
3
4 /*
5  * Copyright (c) 2018 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> // uint32_t
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/events/touch-point.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_core_events
32  * @{
33  */
34
35 /**
36  * @brief Hover events are a collection of touch points at a specific moment in time.
37  *
38  * When a multi-touch event occurs, each touch point represents the points that are currently being
39  * hovered or the points where a hover has stopped.
40  * @SINCE_1_0.0
41  */
42 struct DALI_CORE_API HoverEvent
43 {
44   // Construction & Destruction
45
46   /**
47    * @brief Default constructor.
48    * @SINCE_1_0.0
49    */
50   HoverEvent();
51
52   /**
53    * @brief Constructor.
54    * @SINCE_1_0.0
55    * @param[in] time The time the event occurred
56    */
57   HoverEvent(unsigned long time);
58
59   /**
60    * @brief Destructor.
61    * @SINCE_1_0.0
62    */
63   ~HoverEvent();
64
65   // Data
66
67   /**
68    * @brief This is a container of points for this hover event.
69    *
70    * The first point in the set is always the
71    * primary touch point (i.e. the first point touched in a multi-touch event).
72    */
73   TouchPointContainer points;
74
75   /**
76    * @brief The time (in ms) that the hover event occurred.
77    */
78   unsigned long time;
79
80   // Convenience Methods
81
82   /**
83    * @brief Returns the total number of points in this HoverEvent.
84    *
85    * @SINCE_1_0.0
86    * @return Total number of Points
87    */
88   uint32_t GetPointCount() const;
89
90   /**
91    * @brief Returns a touch point at the index requested.
92    *
93    * The first point in the set is always the primary
94    * touch point (i.e. the first point touched in a multi-touch event).
95    * @SINCE_1_0.0
96    * @param[in] point The index of the required Point
97    * @return Point requested
98    * @note "point" should be less than the value returned by GetPointCount().
99    *       If out of range, then program asserts.
100    */
101   const TouchPoint& GetPoint( uint32_t point) const;
102 };
103
104 /**
105  * @}
106  */
107 } // namespace Dali
108
109 #endif // __DALI_HOVER_EVENT_H__