Add GetMouseButton to identify right/left mouse button click
[platform/core/uifw/dali-core.git] / dali / public-api / events / touch-data.cpp
1 /*
2  * Copyright (c) 2017 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/internal/event/events/touch-data-impl.h>
24
25 #include <cstdio>
26
27 namespace Dali
28 {
29
30 TouchData::TouchData()
31 : BaseHandle()
32 {
33 }
34
35 TouchData::TouchData( const TouchData& other )
36 : BaseHandle( other )
37 {
38 }
39
40 TouchData::~TouchData()
41 {
42 }
43
44 TouchData& TouchData::operator=( const TouchData& other )
45 {
46   BaseHandle::operator=( other );
47   return *this;
48 }
49
50 unsigned long TouchData::GetTime() const
51 {
52   return GetImplementation( *this ).GetTime();
53 }
54
55 std::size_t TouchData::GetPointCount() const
56 {
57   return GetImplementation( *this ).GetPointCount();
58 }
59
60 int32_t TouchData::GetDeviceId( std::size_t point ) const
61 {
62   return GetImplementation( *this ).GetDeviceId( point );
63 }
64
65 PointState::Type TouchData::GetState( std::size_t point ) const
66 {
67   return GetImplementation( *this ).GetState( point );
68 }
69
70 Actor TouchData::GetHitActor( std::size_t point ) const
71 {
72   return GetImplementation( *this ).GetHitActor( point );
73 }
74
75 const Vector2& TouchData::GetLocalPosition( std::size_t point ) const
76 {
77   return GetImplementation( *this ).GetLocalPosition( point );
78 }
79
80 const Vector2& TouchData::GetScreenPosition( std::size_t point ) const
81 {
82   return GetImplementation( *this ).GetScreenPosition( point );
83 }
84
85 float TouchData::GetRadius( std::size_t point ) const
86 {
87   return GetImplementation( *this ).GetRadius( point );
88 }
89
90 const Vector2& TouchData::GetEllipseRadius( std::size_t point ) const
91 {
92   return GetImplementation( *this ).GetEllipseRadius( point );
93 }
94
95 float TouchData::GetPressure( std::size_t point ) const
96 {
97   return GetImplementation( *this ).GetPressure( point );
98 }
99
100 Degree TouchData::GetAngle( std::size_t point ) const
101 {
102   return GetImplementation( *this ).GetAngle( point );
103 }
104
105 Device::Class::Type TouchData::GetDeviceClass( std::size_t point ) const
106 {
107   return GetImplementation( *this ).GetDeviceClass( point );
108 }
109
110 Device::Subclass::Type TouchData::GetDeviceSubclass( std::size_t point ) const
111 {
112   return GetImplementation( *this ).GetDeviceSubclass( point );
113 }
114
115 MouseButton::Type TouchData::GetMouseButton( std::size_t point ) const
116 {
117   return GetImplementation( *this ).GetMouseButton( point );
118 }
119
120 TouchData::TouchData( Internal::TouchData* internal )
121 : BaseHandle( internal )
122 {
123 }
124
125 } // namespace Dali