2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/internal/event/events/hover-event-impl.h>
27 HoverEvent::HoverEvent()
33 HoverEvent::HoverEvent( unsigned long time )
39 HoverEventPtr HoverEvent::Clone( const HoverEvent& rhs )
41 HoverEventPtr hoverEvent( new HoverEvent );
42 hoverEvent->mPoints = rhs.mPoints;
43 hoverEvent->mTime = rhs.mTime;
47 unsigned long HoverEvent::GetTime() const
52 std::size_t HoverEvent::GetPointCount() const
54 return mPoints.size();
57 int32_t HoverEvent::GetDeviceId( std::size_t point ) const
59 if( point < mPoints.size() )
61 return mPoints[ point ].GetDeviceId();
66 PointState::Type HoverEvent::GetState( std::size_t point ) const
68 if( point < mPoints.size() )
70 return mPoints[ point ].GetState();
72 return PointState::FINISHED;
75 Dali::Actor HoverEvent::GetHitActor( std::size_t point ) const
77 if( point < mPoints.size() )
79 return mPoints[ point ].GetHitActor();
84 const Vector2& HoverEvent::GetLocalPosition( std::size_t point ) const
86 if( point < mPoints.size() )
88 return mPoints[ point ].GetLocalPosition();
93 const Vector2& HoverEvent::GetScreenPosition( std::size_t point ) const
95 if( point < mPoints.size() )
97 return mPoints[ point ].GetScreenPosition();
102 const Integration::Point& HoverEvent::GetPoint( std::size_t point ) const
104 DALI_ASSERT_DEBUG( point < mPoints.size() && "No point at index" );
105 return mPoints[ point ];
108 Integration::Point& HoverEvent::GetPoint( std::size_t point )
110 DALI_ASSERT_DEBUG( point < mPoints.size() && "No point at index" );
111 return mPoints[ point ];
114 void HoverEvent::AddPoint( const Integration::Point& point )
116 mPoints.push_back( point );
119 } // namsespace Internal