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