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 HoverEvent::~HoverEvent()
51 unsigned long HoverEvent::GetTime() const
56 std::size_t HoverEvent::GetPointCount() const
58 return mPoints.size();
61 int32_t HoverEvent::GetDeviceId( std::size_t point ) const
63 if( point < mPoints.size() )
65 return mPoints[ point ].GetDeviceId();
70 PointState::Type HoverEvent::GetState( std::size_t point ) const
72 if( point < mPoints.size() )
74 return mPoints[ point ].GetState();
76 return PointState::FINISHED;
79 Dali::Actor HoverEvent::GetHitActor( std::size_t point ) const
81 if( point < mPoints.size() )
83 return mPoints[ point ].GetHitActor();
88 const Vector2& HoverEvent::GetLocalPosition( std::size_t point ) const
90 if( point < mPoints.size() )
92 return mPoints[ point ].GetLocalPosition();
97 const Vector2& HoverEvent::GetScreenPosition( std::size_t point ) const
99 if( point < mPoints.size() )
101 return mPoints[ point ].GetScreenPosition();
103 return Vector2::ZERO;
106 const Integration::Point& HoverEvent::GetPoint( std::size_t point ) const
108 DALI_ASSERT_DEBUG( point < mPoints.size() && "No point at index" );
109 return mPoints[ point ];
112 Integration::Point& HoverEvent::GetPoint( std::size_t point )
114 DALI_ASSERT_DEBUG( point < mPoints.size() && "No point at index" );
115 return mPoints[ point ];
118 void HoverEvent::AddPoint( const Integration::Point& point )
120 mPoints.push_back( point );
123 } // namsespace Internal