]> git.saurik.com Git - iphone-api.git/blob - WebCore/PlatformTouchEvent.h
Adding the WebCore headers (for Cydget).
[iphone-api.git] / WebCore / PlatformTouchEvent.h
1 /*
2 * Copyright (C) 2008, Apple Inc. All rights reserved.
3 *
4 * No license or rights are granted by Apple expressly or by implication,
5 * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade
6 * secrets or other rights.
7 */
8
9 #ifndef PlatformTouchEvent_h
10 #define PlatformTouchEvent_h
11
12 #include <JavaScriptCore/Platform.h>
13
14 #if ENABLE(TOUCH_EVENTS)
15
16 #include <GraphicsServices/GSEvent.h>
17 #include <wtf/Vector.h>
18
19 #include "IntPoint.h"
20
21 namespace WebCore {
22
23 enum TouchEventType { TouchEventBegin, TouchEventChange, TouchEventEnd, TouchEventCancel };
24
25 class PlatformTouchEvent {
26 public:
27 PlatformTouchEvent(GSEventRef);
28
29 TouchEventType eventType() const;
30 double timestamp() const;
31 unsigned touchCount() const;
32 IntPoint touchLocationAtIndex(unsigned) const;
33 IntPoint globalTouchLocationAtIndex(unsigned) const;
34 unsigned touchIdentifierAtIndex(unsigned) const;
35
36 bool gestureChanged() const;
37
38 float scaleAbsolute() const;
39 float rotationAbsolute() const;
40
41 GSEventRef platformEvent() const { return m_gsEvent; }
42 private:
43 GSEventRef m_gsEvent;
44 unsigned m_fingerCount;
45 Vector<GSEventPathInfo> m_pathData;
46 };
47 } // namespace WebCore
48
49 #endif // ENABLE(TOUCH_EVENTS)
50
51 #endif // PlatformTouchEvent_h