1/*
2    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License as published by the Free Software Foundation; either
7    version 2 of the License, or (at your option) any later version.
8
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Library General Public License for more details.
13
14    You should have received a copy of the GNU Library General Public License
15    along with this library; see the file COPYING.LIB.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17    Boston, MA 02110-1301, USA.
18*/
19
20#ifndef PlatformTouchPoint_h
21#define PlatformTouchPoint_h
22
23#include "IntPoint.h"
24#include <wtf/Vector.h>
25
26#if ENABLE(TOUCH_EVENTS)
27
28#if PLATFORM(QT)
29#include <QTouchEvent>
30#endif
31
32#if PLATFORM(BLACKBERRY)
33namespace BlackBerry {
34namespace Platform {
35class TouchPoint;
36};
37};
38#endif
39
40namespace WebCore {
41
42class PlatformTouchEvent;
43
44class PlatformTouchPoint {
45public:
46    enum State {
47        TouchReleased,
48        TouchPressed,
49        TouchMoved,
50        TouchStationary,
51        TouchCancelled,
52        TouchStateEnd // Placeholder: must remain the last item.
53    };
54
55    // This is necessary for us to be able to build synthetic events.
56    PlatformTouchPoint()
57        : m_id(0)
58        , m_radiusY(0)
59        , m_radiusX(0)
60        , m_rotationAngle(0)
61        , m_force(0)
62    {
63    }
64
65#if PLATFORM(BLACKBERRY)
66    PlatformTouchPoint(const BlackBerry::Platform::TouchPoint&);
67#endif
68
69    unsigned id() const { return m_id; }
70    State state() const { return m_state; }
71    IntPoint screenPos() const { return m_screenPos; }
72    IntPoint pos() const { return m_pos; }
73    int radiusX() const { return m_radiusX; }
74    int radiusY() const { return m_radiusY; }
75    float rotationAngle() const { return m_rotationAngle; }
76    float force() const { return m_force; }
77
78protected:
79    unsigned m_id;
80    State m_state;
81    IntPoint m_screenPos;
82    IntPoint m_pos;
83    int m_radiusY;
84    int m_radiusX;
85    float m_rotationAngle;
86    float m_force;
87};
88
89}
90
91#endif // ENABLE(TOUCH_EVENTS)
92
93#endif // PlatformTouchPoint_h
94