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