14007a886d1b6ebdb419b1dcd337dc99c5a1d040
[platform/core/uifw/dali-core.git] / dali / integration-api / events / multi-point-event-integ.h
1 #ifndef DALI_INTEGRATION_MULTI_POINT_EVENT_H
2 #define DALI_INTEGRATION_MULTI_POINT_EVENT_H
3
4 /*
5  * Copyright (c) 2019 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/integration-api/events/event.h>
24 #include <dali/integration-api/events/point.h>
25
26 namespace Dali
27 {
28
29 namespace Integration
30 {
31 using PointContainer              = std::vector<Point>;             ///< Container of points
32 using PointContainerIterator      = PointContainer::iterator;       ///< Iterator for Dali::Integration::PointContainer
33 using PointContainerConstIterator = PointContainer::const_iterator; ///< Const iterator for Dali::Integration::PointContainer
34
35 /**
36  * An instance of this structure should be used by the adaptor to send a multi-point event to Dali core.
37  *
38  * This class can contain one or multiple touch points. It also contains the time at which the
39  * event occurred.
40  */
41 struct DALI_CORE_API MultiPointEvent : public Event
42 {
43   // Construction & Destruction
44
45 public:
46   /**
47    * Virtual destructor
48    */
49   virtual ~MultiPointEvent();
50
51 protected:
52   /**
53    * Default Constructor
54    */
55   MultiPointEvent(Type eventType);
56
57   /**
58    * Constructor
59    * @param[in]  time  The time the event occurred.
60    */
61   MultiPointEvent(Type eventType, uint32_t time);
62
63 public:
64
65   // Data
66
67   /**
68    * @brief A series of points
69    */
70   PointContainer points;
71
72   /**
73    * @brief The time
74    */
75   uint32_t time;
76
77   // Convenience Methods
78
79   /**
80    * @brief Adds a point to the MultiPointEvent.
81    * @param[in]  point  The point to add.
82    */
83   void AddPoint( const Point& point );
84
85   /**
86    * @brief Retrieves the Point at position point.
87    * @return The Point at position point.
88    */
89   Point& GetPoint( uint32_t point );
90
91   /**
92    * @brief Retrieves a const ref of the Point at position point.
93    * @return The const ref of the Point at position point.
94    */
95   const Point& GetPoint( uint32_t point ) const;
96
97   /**
98    * @brief The total number of Points in this TouchEvent.
99    * @return The point count.
100    */
101   uint32_t GetPointCount() const;
102 };
103
104 } // namespace Integration
105
106 } // namespace Dali
107
108 #endif // DALI_INTEGRATION_MULTI_POINT_EVENT_H