]>
git.saurik.com Git - iphone-api.git/blob - WebCore/TouchEvent.h
2 * Copyright (C) 2008, Apple Inc. All rights reserved.
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.
12 #include <wtf/Platform.h>
14 #if ENABLE(TOUCH_EVENTS)
16 #include <wtf/RefPtr.h>
17 #include "MouseRelatedEvent.h"
18 #include "TouchList.h"
22 class TouchEvent
: public MouseRelatedEvent
{
24 static PassRefPtr
<TouchEvent
> create()
26 return adoptRef(new TouchEvent
);
28 static PassRefPtr
<TouchEvent
> create(
29 const AtomicString
& type
, bool canBubble
, bool cancelable
, AbstractView
* view
, int detail
,
30 int screenX
, int screenY
, int pageX
, int pageY
,
31 bool ctrlKey
, bool altKey
, bool shiftKey
, bool metaKey
,
32 TouchList
* touches
, TouchList
* targetTouches
, TouchList
* changedTouches
,
33 float scale
, float rotation
, bool isSimulated
= false)
35 return adoptRef(new TouchEvent(type
, canBubble
, cancelable
, view
, detail
,
36 screenX
, screenY
, pageX
, pageY
,
37 ctrlKey
, altKey
, shiftKey
, metaKey
,
38 touches
, targetTouches
, changedTouches
,
39 scale
, rotation
, isSimulated
));
41 virtual ~TouchEvent() {}
43 void initTouchEvent(const AtomicString
& type
, bool canBubble
, bool cancelable
, AbstractView
* view
, int detail
,
44 int screenX
, int screenY
, int clientX
, int clientY
,
45 bool ctrlKey
, bool altKey
, bool shiftKey
, bool metaKey
,
46 TouchList
* touches
, TouchList
* targetTouches
, TouchList
* changedTouches
,
47 float scale
, float rotation
);
49 virtual bool isTouchEvent() const { return true; }
51 TouchList
* touches() const { return m_touches
.get(); }
52 TouchList
* targetTouches() const { return m_targetTouches
.get(); }
53 TouchList
* changedTouches() const { return m_changedTouches
.get(); }
55 float scale() const { return m_scale
; }
56 float rotation() const { return m_rotation
; }
60 TouchEvent(const AtomicString
& type
, bool canBubble
, bool cancelable
, AbstractView
* view
, int detail
,
61 int screenX
, int screenY
, int pageX
, int pageY
,
62 bool ctrlKey
, bool altKey
, bool shiftKey
, bool metaKey
,
63 TouchList
* touches
, TouchList
* targetTouches
, TouchList
* changedTouches
,
64 float scale
, float rotation
, bool isSimulated
= false);
66 RefPtr
<TouchList
> m_touches
;
67 RefPtr
<TouchList
> m_targetTouches
;
68 RefPtr
<TouchList
> m_changedTouches
;
73 } // namespace WebCore
75 #endif // ENABLE(TOUCH_EVENTS)
77 #endif // TouchEvent_h