WebCore::PanRecognizer Class Reference

Pan gesture recognizer. More...

#include <PanRecognizer.h>

Inheritance diagram for WebCore::PanRecognizer:
Inheritance graph
[legend]
Collaboration diagram for WebCore::PanRecognizer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const IntPoint & panPos () const
 Get the pan position.
int panOffsetX () const
 Get the horizontal pan offset.
int panOffsetY () const
 Get the vertical pan offset.
int panSpeedX () const
 Get the horizontal pan speed.
int panSpeedY () const
 Get the horizontal pan speed.
virtual void reset ()
 Reset the gesture.
virtual void touchEvent (const PlatformTouchEvent &)
 Feed new data.

Private Member Functions

IntPoint calcPanPos (const Vector< PlatformTouchPoint > &ps)
 Calculates pan position.

Private Attributes

IntPoint m_panPos
int m_panOffsetX
int m_panOffsetY
GestureSpeedCalc m_speedX
GestureSpeedCalc m_speedY

Detailed Description

Pan gesture recognizer.

Definition at line 30 of file PanRecognizer.h.


Member Function Documentation

IntPoint WebCore::PanRecognizer::calcPanPos ( const Vector< PlatformTouchPoint > &  ps  )  [private]

Calculates pan position.

Calculates the pan position using the supplied touch points. If the touch event only contains one touch point, its coordinates are used as the pan position. Otherwise the pan position is in the middle of the first two touch points.

Parameters:
ps Touch point(s) to calculate from.
Returns:
calculated pan position.

Definition at line 85 of file PanRecognizer.cpp.

References WebCore::GestureRecognizer::m_id1i, and WebCore::GestureRecognizer::m_id2i.

WebCore::PanRecognizer::panOffsetX (  )  const [inline]

Get the horizontal pan offset.

Returns:
horizontal pan offset in pixels.

Definition at line 35 of file PanRecognizer.h.

References m_panOffsetX.

WebCore::PanRecognizer::panOffsetY (  )  const [inline]

Get the vertical pan offset.

Returns:
vertical pan offset in pixels.

Definition at line 36 of file PanRecognizer.h.

References m_panOffsetY.

WebCore::PanRecognizer::panPos (  )  const [inline]

Get the pan position.

Returns:
current pan position.

Definition at line 34 of file PanRecognizer.h.

References m_panPos.

WebCore::PanRecognizer::panSpeedX (  )  const [inline]

Get the horizontal pan speed.

Returns:
horizontal speed in pixels per second

Definition at line 37 of file PanRecognizer.h.

References m_speedX, and WebCore::GestureSpeedCalc::speed().

Here is the call graph for this function:

WebCore::PanRecognizer::panSpeedY (  )  const [inline]

Get the horizontal pan speed.

Returns:
vertical speed in pixels per second

Definition at line 38 of file PanRecognizer.h.

References m_speedY, and WebCore::GestureSpeedCalc::speed().

Here is the call graph for this function:

void WebCore::PanRecognizer::reset (  )  [virtual]

Reset the gesture.

Resets the gesture data e.g. when the gesture starts over.

Reimplemented from WebCore::GestureRecognizer.

Definition at line 32 of file PanRecognizer.cpp.

References m_panOffsetX, m_panOffsetY, m_panPos, and WebCore::GestureRecognizer::m_refresh.

void WebCore::PanRecognizer::touchEvent ( const PlatformTouchEvent &  ev  )  [virtual]

Feed new data.

Processes a new touch event and calculates new data for the pan gesture.

Parameters:
ev Platform touch event.

Implements WebCore::GestureRecognizer.

Definition at line 46 of file PanRecognizer.cpp.

References calcPanPos(), WebCore::GestureSpeedCalc::firstSample(), WebCore::GestureSpeedCalc::insertSample(), m_panOffsetX, m_panOffsetY, m_panPos, WebCore::GestureRecognizer::m_refresh, m_speedX, m_speedY, WebCore::GestureRecognizer::selectValidPoints(), and WebCore::GestureRecognizer::updateRefreshState().

Here is the call graph for this function:


Member Data Documentation

Definition at line 47 of file PanRecognizer.h.

Definition at line 48 of file PanRecognizer.h.

Definition at line 46 of file PanRecognizer.h.

Definition at line 49 of file PanRecognizer.h.

Definition at line 50 of file PanRecognizer.h.


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208