PlatformTouchPoint.h revision dcc8cf2e65d1aa555cce12431a16547e66b469ee
1f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch/*
2f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
4f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    This library is free software; you can redistribute it and/or
5f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    modify it under the terms of the GNU Library General Public
6f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    License as published by the Free Software Foundation; either
7f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    version 2 of the License, or (at your option) any later version.
8f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
9f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    This library is distributed in the hope that it will be useful,
10f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    but WITHOUT ANY WARRANTY; without even the implied warranty of
11f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    Library General Public License for more details.
13f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
14f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    You should have received a copy of the GNU Library General Public License
15f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    along with this library; see the file COPYING.LIB.  If not, write to
16f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    Boston, MA 02110-1301, USA.
18f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch*/
19f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
20f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#ifndef PlatformTouchPoint_h
21f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#define PlatformTouchPoint_h
22f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
23f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#include "IntPoint.h"
24f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#include <wtf/Vector.h>
25f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
26f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#if ENABLE(TOUCH_EVENTS)
27f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
28f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#if PLATFORM(QT)
29f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#include <QTouchEvent>
30f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#endif
31f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
32f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdochnamespace WebCore {
33f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
34f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdochclass PlatformTouchEvent;
35f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
36f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdochclass PlatformTouchPoint {
37f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdochpublic:
38f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    enum State {
39f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch        TouchReleased,
40f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch        TouchPressed,
41f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch        TouchMoved,
4202d657c513b78a755390e1c5bcf35f6f35f466caBen Murdoch        TouchStationary,
43f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch        TouchCancelled
44f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    };
45f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
46f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#if PLATFORM(QT)
47f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    PlatformTouchPoint(const QTouchEvent::TouchPoint&);
48f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#elif PLATFORM(ANDROID)
499c3f8716aa3ce8ca612b4200c02a8530cfd599baBen Murdoch    PlatformTouchPoint(const IntPoint& windowPos, State);
50f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#endif
51f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
52cd97be1e939c83f2a837fa63c24d06231a0097d9Ben Murdoch    unsigned id() const { return m_id; }
53f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    State state() const { return m_state; }
54f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    IntPoint screenPos() const { return m_screenPos; }
55f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    IntPoint pos() const { return m_pos; }
56f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
57dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block<<<<<<< HEAD
58f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdochprivate:
59dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block=======
60dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockprotected:
61dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block>>>>>>> webkit.org at r58033
62cd97be1e939c83f2a837fa63c24d06231a0097d9Ben Murdoch    unsigned m_id;
63f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    State m_state;
64f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    IntPoint m_screenPos;
65f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch    IntPoint m_pos;
66f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch};
67f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
68f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch}
69f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
70f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#endif // ENABLE(TOUCH_EVENTS)
71f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch
72f5306da72ab6bb63f7ae07371e687f72a75c2fb2Ben Murdoch#endif // PlatformTouchPoint_h
73