2 * Copyright (c) 2015 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/touch-data-impl.h>
22 #include <dali/public-api/actors/actor.h>
30 TouchData::TouchData()
36 TouchData::TouchData( unsigned long time )
42 TouchData::~TouchData()
46 unsigned long TouchData::GetTime() const
51 size_t TouchData::GetPointCount() const
53 return mPoints.size();
56 int32_t TouchData::GetDeviceId( size_t point ) const
58 if( point < mPoints.size() )
60 return mPoints[ point ].deviceId;
65 PointState::Type TouchData::GetState( size_t point ) const
67 if( point < mPoints.size() )
69 return static_cast< PointState::Type >( mPoints[ point ].state );
71 return PointState::FINISHED;
74 Dali::Actor TouchData::GetHitActor( size_t point ) const
76 if( point < mPoints.size() )
78 return mPoints[ point ].hitActor;
83 const Vector2& TouchData::GetLocalPosition( size_t point ) const
85 if( point < mPoints.size() )
87 return mPoints[ point ].local;
92 const Vector2& TouchData::GetScreenPosition( size_t point ) const
94 if( point < mPoints.size() )
96 return mPoints[ point ].screen;
101 const TouchPoint& TouchData::GetPoint( size_t point ) const
103 DALI_ASSERT_DEBUG( point < mPoints.size() && "No point at index" );
104 return mPoints[ point ];
107 void TouchData::AddPoint( const TouchPoint& point )
109 mPoints.push_back( point );
112 void TouchData::SetPoints( const TouchPointContainer& points )
117 } // namsespace Internal