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