]> git.saurik.com Git - iphone-api.git/blob - WebCore/GestureEvent.h
Adding the WebCore headers (for Cydget).
[iphone-api.git] / WebCore / GestureEvent.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 GestureEvent_h
10 #define GestureEvent_h
11
12 #include <wtf/Platform.h>
13
14 #if ENABLE(TOUCH_EVENTS)
15
16 #include <wtf/RefPtr.h>
17 #include "MouseRelatedEvent.h"
18 #include "EventTarget.h"
19
20 namespace WebCore {
21
22 class GestureEvent : public MouseRelatedEvent {
23 public:
24 static PassRefPtr<GestureEvent> create()
25 {
26 return adoptRef(new GestureEvent);
27 }
28 static PassRefPtr<GestureEvent> 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 EventTarget* target, float scale, float rotation, bool isSimulated = false)
33 {
34 return adoptRef(new GestureEvent(
35 type, canBubble, cancelable, view, detail,
36 screenX, screenY, pageX, pageY,
37 ctrlKey, altKey, shiftKey, metaKey,
38 target, scale, rotation, isSimulated));
39 }
40 virtual ~GestureEvent() {}
41
42 void initGestureEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail,
43 int screenX, int screenY, int clientX, int clientY,
44 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
45 EventTarget* target, float scale, float rotation);
46
47 virtual bool isGestureEvent() const { return true; }
48
49 float scale() const { return m_scale; }
50 float rotation() const { return m_rotation; }
51
52 private:
53 GestureEvent() { }
54 GestureEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail,
55 int screenX, int screenY, int pageX, int pageY,
56 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
57 EventTarget* target, float scale, float rotation, bool isSimulated = false);
58
59 float m_scale;
60 float m_rotation;
61 };
62
63 } // namespace WebCore
64
65 #endif // ENABLE(TOUCH_EVENTS)
66
67 #endif // GestureEvent_h