Replaces TextArray type definition.
[platform/core/uifw/dali-core.git] / dali / integration-api / events / touch-event-integ.h
1 #ifndef __DALI_INTEGRATION_TOUCH_EVENT_H__
2 #define __DALI_INTEGRATION_TOUCH_EVENT_H__
3
4 /*
5  * Copyright (c) 2014 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/public-api/events/touch-event.h>
25 #include <dali/public-api/events/touch-point.h>
26
27 namespace Dali DALI_IMPORT_API
28 {
29
30 namespace Integration
31 {
32
33 /**
34  * An instance of this structure should be used by the adaptor to send a touch event to Dali core.
35  *
36  * This class can contain one or many touch points. It also contains the time at which the
37  * event occurred.
38  */
39 struct TouchEvent : public Event
40 {
41   // Construction & Destruction
42
43   /**
44    * Default Constructor
45    */
46   TouchEvent();
47
48   /**
49    * Constructor
50    * @param[in]  time  The time the event occurred.
51    */
52   TouchEvent(unsigned long time);
53
54   /**
55    * Virtual destructor
56    */
57   virtual ~TouchEvent();
58
59   // Data
60
61   /**
62    * @copydoc Dali::TouchEvent::points
63    */
64   std::vector<TouchPoint> points;
65
66   /**
67    * @copydoc Dali::TouchEvent::time
68    */
69   unsigned long time;
70
71   // Convenience Methods
72
73   /**
74    * Adds a point to the TouchEvent.
75    * @param[in]  point  The point to add.
76    */
77   void AddPoint(const TouchPoint& point);
78
79   /**
80    * @copydoc Dali::TouchEvent::GetPoint()
81    */
82   TouchPoint& GetPoint(unsigned int point);
83
84   /**
85    * @copydoc Dali::TouchEvent::GetPoint()
86    */
87   const TouchPoint& GetPoint(unsigned int point) const;
88
89   /**
90    * @copydoc Dali::TouchEvent::GetPointCount() const
91    */
92   unsigned int GetPointCount() const;
93 };
94
95 } // namespace Integration
96
97 } // namespace Dali
98
99 #endif // __DALI_INTEGRATION_TOUCH_EVENT_H__