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