]>
git.saurik.com Git - iphone-api.git/blob - WebCore/Touch.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/RefCounted.h>
17 #include <wtf/PassRefPtr.h>
18 #include <wtf/RefPtr.h>
19 #include "EventTarget.h"
20 #include "DOMWindow.h"
26 class Touch
: public RefCounted
<Touch
> {
28 static PassRefPtr
<Touch
> create()
30 return adoptRef(new Touch());
32 static PassRefPtr
<Touch
> create(DOMWindow
* view
, EventTarget
* target
, unsigned identifier
, int pageX
, int pageY
, int screenX
, int screenY
)
34 return adoptRef(new Touch(view
, target
, identifier
, pageX
, pageY
, screenX
, screenY
));
37 EventTarget
* target() const { return m_target
.get(); }
39 bool updateLocation(int pageX
, int pageY
, int screenX
, int screenY
);
41 unsigned identifier() const { return m_identifier
; }
43 int clientX() const { return m_clientX
; }
44 int clientY() const { return m_clientY
; }
45 int pageX() const { return m_pageX
; }
46 int pageY() const { return m_pageY
; }
47 int screenX() const { return m_screenX
; }
48 int screenY() const { return m_screenY
; }
52 Touch(DOMWindow
* view
, EventTarget
* target
, unsigned identifier
, int pageX
, int pageY
, int screenX
, int screenY
);
54 DOMWindow
* view() const { return m_view
.get(); }
56 RefPtr
<DOMWindow
> m_view
;
57 RefPtr
<EventTarget
> m_target
;
59 unsigned m_identifier
;
68 } // namespace WebCore
70 #endif // ENABLE(TOUCH_EVENTS)