1dcdbd6fd5d8901981842b044d71c9db2864f7cc
[platform/core/uifw/dali-core.git] / dali / public-api / events / touch-data.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/events/touch-data.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/devel-api/events/touch-event-devel.h>
24 #include <dali/internal/event/events/touch-data-impl.h>
25
26 #include <cstdio>
27
28 namespace Dali
29 {
30
31 TouchData::TouchData()
32 : BaseHandle()
33 {
34 }
35
36 TouchData::TouchData( const TouchData& other )
37 : BaseHandle( other )
38 {
39 }
40
41 TouchData::~TouchData()
42 {
43 }
44
45 TouchData& TouchData::operator=( const TouchData& other )
46 {
47   BaseHandle::operator=( other );
48   return *this;
49 }
50
51 unsigned long TouchData::GetTime() const
52 {
53   return GetImplementation( *this ).GetTime();
54 }
55
56 std::size_t TouchData::GetPointCount() const
57 {
58   return GetImplementation( *this ).GetPointCount();
59 }
60
61 int32_t TouchData::GetDeviceId( std::size_t point ) const
62 {
63   return GetImplementation( *this ).GetDeviceId( point );
64 }
65
66 PointState::Type TouchData::GetState( std::size_t point ) const
67 {
68   return GetImplementation( *this ).GetState( point );
69 }
70
71 Actor TouchData::GetHitActor( std::size_t point ) const
72 {
73   return GetImplementation( *this ).GetHitActor( point );
74 }
75
76 const Vector2& TouchData::GetLocalPosition( std::size_t point ) const
77 {
78   return GetImplementation( *this ).GetLocalPosition( point );
79 }
80
81 const Vector2& TouchData::GetScreenPosition( std::size_t point ) const
82 {
83   return GetImplementation( *this ).GetScreenPosition( point );
84 }
85
86 float TouchData::GetRadius( std::size_t point ) const
87 {
88   return GetImplementation( *this ).GetRadius( point );
89 }
90
91 const Vector2& TouchData::GetEllipseRadius( std::size_t point ) const
92 {
93   return GetImplementation( *this ).GetEllipseRadius( point );
94 }
95
96 float TouchData::GetPressure( std::size_t point ) const
97 {
98   return GetImplementation( *this ).GetPressure( point );
99 }
100
101 Degree TouchData::GetAngle( std::size_t point ) const
102 {
103   return GetImplementation( *this ).GetAngle( point );
104 }
105
106 DevelDevice::Class::Type DevelTouchData::GetDeviceClass( const TouchData& touch, std::size_t point )
107 {
108   return GetImplementation( touch ).GetDeviceClass( point );
109 }
110
111 DevelDevice::Subclass::Type DevelTouchData::GetDeviceSubclass( const TouchData& touch, std::size_t point )
112 {
113   return GetImplementation( touch ).GetDeviceSubclass( point );
114 }
115
116 TouchData::TouchData( Internal::TouchData* internal )
117 : BaseHandle( internal )
118 {
119 }
120
121 } // namespace Dali