Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[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) 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 // 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  * @DEPRECATED_1_1.37 Use TouchData instead
34  *
35  * @brief Touch events are a collection of touch points at a specific moment in time.
36  *
37  * When a multi-touch event occurs, each touch point represents the points that are currently being
38  * touched or the points where a touch has stopped.
39  * @SINCE_1_0.0
40  */
41 struct DALI_CORE_API TouchEvent
42 {
43   // Construction & Destruction
44
45   /**
46    * @DEPRECATED_1_1.37
47    * @brief Default constructor.
48    * @SINCE_1_0.0
49    */
50   TouchEvent() DALI_DEPRECATED_API;
51
52   /**
53    * @DEPRECATED_1_1.37
54    * @brief Constructor.
55    * @SINCE_1_0.0
56    * @param[in] time The time the event occurred
57    */
58   TouchEvent(unsigned long time) DALI_DEPRECATED_API;
59
60   /**
61    * @DEPRECATED_1_1.37
62    * @brief Destructor.
63    * @SINCE_1_0.0
64    */
65   ~TouchEvent() DALI_DEPRECATED_API;
66
67   // Data
68
69   /**
70    * @DEPRECATED_1_1.37
71    * @brief This is a container of points for this touch event.
72    *
73    * The first point in the set is always the
74    * primary touch point (i.e. the first point touched in a multi-touch event).
75    */
76   TouchPointContainer points;
77
78   /**
79    * @DEPRECATED_1_1.37
80    * @brief The time (in ms) that the touch event occurred.
81    */
82   unsigned long time;
83
84   // Convenience Methods
85
86   /**
87    * @DEPRECATED_1_1.37
88    * @brief Returns the total number of points in this TouchEvent.
89    *
90    * @SINCE_1_0.0
91    * @return Total number of Points
92    */
93   uint32_t GetPointCount() const DALI_DEPRECATED_API;
94
95   /**
96    * @DEPRECATED_1_1.37
97    * @brief Returns a touch point at the index requested.
98    *
99    * The first point in the set is always the primary
100    * touch point (i.e. the first point touched in a multi-touch event).
101    * @SINCE_1_0.0
102    * @param[in] point The index of the required Point
103    * @return Point requested
104    * @note "point" should be less than the value returned by GetPointCount().
105    *       If out of range, then program asserts.
106    */
107   const TouchPoint& GetPoint( uint32_t point ) const DALI_DEPRECATED_API;
108 };
109
110 /**
111  * @}
112  */
113 } // namespace Dali
114
115 #endif // __DALI_TOUCH_EVENT_H__