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