OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 20 matching lines...) Expand all Loading... |
31 #ifndef WebInputEventConversion_h | 31 #ifndef WebInputEventConversion_h |
32 #define WebInputEventConversion_h | 32 #define WebInputEventConversion_h |
33 | 33 |
34 #include "platform/PlatformGestureEvent.h" | 34 #include "platform/PlatformGestureEvent.h" |
35 #include "platform/PlatformKeyboardEvent.h" | 35 #include "platform/PlatformKeyboardEvent.h" |
36 #include "platform/PlatformMouseEvent.h" | 36 #include "platform/PlatformMouseEvent.h" |
37 #include "platform/PlatformTouchEvent.h" | 37 #include "platform/PlatformTouchEvent.h" |
38 #include "platform/PlatformWheelEvent.h" | 38 #include "platform/PlatformWheelEvent.h" |
39 #include "public/web/WebInputEvent.h" | 39 #include "public/web/WebInputEvent.h" |
40 | 40 |
41 namespace WebCore { | 41 namespace blink { |
42 class GestureEvent; | 42 class GestureEvent; |
43 class KeyboardEvent; | 43 class KeyboardEvent; |
44 class MouseEvent; | 44 class MouseEvent; |
45 class RenderObject; | 45 class RenderObject; |
46 class ScrollView; | 46 class ScrollView; |
47 class TouchEvent; | 47 class TouchEvent; |
48 class WheelEvent; | 48 class WheelEvent; |
49 class Widget; | 49 class Widget; |
50 } | 50 } |
51 | 51 |
52 namespace blink { | 52 namespace blink { |
53 | 53 |
54 class WebMouseEvent; | 54 class WebMouseEvent; |
55 class WebMouseWheelEvent; | 55 class WebMouseWheelEvent; |
56 class WebKeyboardEvent; | 56 class WebKeyboardEvent; |
57 class WebTouchEvent; | 57 class WebTouchEvent; |
58 class WebGestureEvent; | 58 class WebGestureEvent; |
59 | 59 |
60 // These classes are used to convert from WebInputEvent subclasses to | 60 // These classes are used to convert from WebInputEvent subclasses to |
61 // corresponding WebCore events. | 61 // corresponding WebCore events. |
62 | 62 |
63 class PlatformMouseEventBuilder : public WebCore::PlatformMouseEvent { | 63 class PlatformMouseEventBuilder : public blink::PlatformMouseEvent { |
64 public: | 64 public: |
65 PlatformMouseEventBuilder(WebCore::Widget*, const WebMouseEvent&); | 65 PlatformMouseEventBuilder(blink::Widget*, const WebMouseEvent&); |
66 }; | 66 }; |
67 | 67 |
68 class PlatformWheelEventBuilder : public WebCore::PlatformWheelEvent { | 68 class PlatformWheelEventBuilder : public blink::PlatformWheelEvent { |
69 public: | 69 public: |
70 PlatformWheelEventBuilder(WebCore::Widget*, const WebMouseWheelEvent&); | 70 PlatformWheelEventBuilder(blink::Widget*, const WebMouseWheelEvent&); |
71 }; | 71 }; |
72 | 72 |
73 class PlatformGestureEventBuilder : public WebCore::PlatformGestureEvent { | 73 class PlatformGestureEventBuilder : public blink::PlatformGestureEvent { |
74 public: | 74 public: |
75 PlatformGestureEventBuilder(WebCore::Widget*, const WebGestureEvent&); | 75 PlatformGestureEventBuilder(blink::Widget*, const WebGestureEvent&); |
76 }; | 76 }; |
77 | 77 |
78 class PlatformKeyboardEventBuilder : public WebCore::PlatformKeyboardEvent { | 78 class PlatformKeyboardEventBuilder : public blink::PlatformKeyboardEvent { |
79 public: | 79 public: |
80 PlatformKeyboardEventBuilder(const WebKeyboardEvent&); | 80 PlatformKeyboardEventBuilder(const WebKeyboardEvent&); |
81 void setKeyType(Type); | 81 void setKeyType(Type); |
82 bool isCharacterKey() const; | 82 bool isCharacterKey() const; |
83 }; | 83 }; |
84 | 84 |
85 // Converts a WebTouchPoint to a WebCore::PlatformTouchPoint. | 85 // Converts a WebTouchPoint to a blink::PlatformTouchPoint. |
86 class PlatformTouchPointBuilder : public WebCore::PlatformTouchPoint { | 86 class PlatformTouchPointBuilder : public blink::PlatformTouchPoint { |
87 public: | 87 public: |
88 PlatformTouchPointBuilder(WebCore::Widget*, const WebTouchPoint&); | 88 PlatformTouchPointBuilder(blink::Widget*, const WebTouchPoint&); |
89 }; | 89 }; |
90 | 90 |
91 // Converts a WebTouchEvent to a WebCore::PlatformTouchEvent. | 91 // Converts a WebTouchEvent to a blink::PlatformTouchEvent. |
92 class PlatformTouchEventBuilder : public WebCore::PlatformTouchEvent { | 92 class PlatformTouchEventBuilder : public blink::PlatformTouchEvent { |
93 public: | 93 public: |
94 PlatformTouchEventBuilder(WebCore::Widget*, const WebTouchEvent&); | 94 PlatformTouchEventBuilder(blink::Widget*, const WebTouchEvent&); |
95 }; | 95 }; |
96 | 96 |
97 class WebMouseEventBuilder : public WebMouseEvent { | 97 class WebMouseEventBuilder : public WebMouseEvent { |
98 public: | 98 public: |
99 // Converts a WebCore::MouseEvent to a corresponding WebMouseEvent. | 99 // Converts a blink::MouseEvent to a corresponding WebMouseEvent. |
100 // NOTE: This is only implemented for mousemove, mouseover, mouseout, | 100 // NOTE: This is only implemented for mousemove, mouseover, mouseout, |
101 // mousedown and mouseup. If the event mapping fails, the event type will | 101 // mousedown and mouseup. If the event mapping fails, the event type will |
102 // be set to Undefined. | 102 // be set to Undefined. |
103 WebMouseEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, c
onst WebCore::MouseEvent&); | 103 WebMouseEventBuilder(const blink::Widget*, const blink::RenderObject*, const
blink::MouseEvent&); |
104 WebMouseEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, c
onst WebCore::TouchEvent&); | 104 WebMouseEventBuilder(const blink::Widget*, const blink::RenderObject*, const
blink::TouchEvent&); |
105 | 105 |
106 // Converts a WebCore::PlatformMouseEvent to a corresponding WebMouseEvent. | 106 // Converts a blink::PlatformMouseEvent to a corresponding WebMouseEvent. |
107 // NOTE: This is only implemented for mousepressed, mousereleased, and | 107 // NOTE: This is only implemented for mousepressed, mousereleased, and |
108 // mousemoved. If the event mapping fails, the event type will be set to | 108 // mousemoved. If the event mapping fails, the event type will be set to |
109 // Undefined. | 109 // Undefined. |
110 WebMouseEventBuilder(const WebCore::Widget*, const WebCore::PlatformMouseEve
nt&); | 110 WebMouseEventBuilder(const blink::Widget*, const blink::PlatformMouseEvent&)
; |
111 }; | 111 }; |
112 | 112 |
113 // Converts a WebCore::WheelEvent to a corresponding WebMouseWheelEvent. | 113 // Converts a blink::WheelEvent to a corresponding WebMouseWheelEvent. |
114 // If the event mapping fails, the event type will be set to Undefined. | 114 // If the event mapping fails, the event type will be set to Undefined. |
115 class WebMouseWheelEventBuilder : public WebMouseWheelEvent { | 115 class WebMouseWheelEventBuilder : public WebMouseWheelEvent { |
116 public: | 116 public: |
117 WebMouseWheelEventBuilder(const WebCore::Widget*, const WebCore::RenderObjec
t*, const WebCore::WheelEvent&); | 117 WebMouseWheelEventBuilder(const blink::Widget*, const blink::RenderObject*,
const blink::WheelEvent&); |
118 }; | 118 }; |
119 | 119 |
120 // Converts a WebCore::KeyboardEvent or WebCore::PlatformKeyboardEvent to a | 120 // Converts a blink::KeyboardEvent or blink::PlatformKeyboardEvent to a |
121 // corresponding WebKeyboardEvent. | 121 // corresponding WebKeyboardEvent. |
122 // NOTE: For WebCore::KeyboardEvent, this is only implemented for keydown, | 122 // NOTE: For blink::KeyboardEvent, this is only implemented for keydown, |
123 // keyup, and keypress. If the event mapping fails, the event type will be set | 123 // keyup, and keypress. If the event mapping fails, the event type will be set |
124 // to Undefined. | 124 // to Undefined. |
125 class WebKeyboardEventBuilder : public WebKeyboardEvent { | 125 class WebKeyboardEventBuilder : public WebKeyboardEvent { |
126 public: | 126 public: |
127 WebKeyboardEventBuilder(const WebCore::KeyboardEvent&); | 127 WebKeyboardEventBuilder(const blink::KeyboardEvent&); |
128 WebKeyboardEventBuilder(const WebCore::PlatformKeyboardEvent&); | 128 WebKeyboardEventBuilder(const blink::PlatformKeyboardEvent&); |
129 }; | 129 }; |
130 | 130 |
131 // Converts a WebCore::TouchEvent to a corresponding WebTouchEvent. | 131 // Converts a blink::TouchEvent to a corresponding WebTouchEvent. |
132 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points | 132 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points |
133 // exceeding that cap will be dropped. | 133 // exceeding that cap will be dropped. |
134 class WebTouchEventBuilder : public WebTouchEvent { | 134 class WebTouchEventBuilder : public WebTouchEvent { |
135 public: | 135 public: |
136 WebTouchEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, c
onst WebCore::TouchEvent&); | 136 WebTouchEventBuilder(const blink::Widget*, const blink::RenderObject*, const
blink::TouchEvent&); |
137 }; | 137 }; |
138 | 138 |
139 // Converts WebCore::GestureEvent to a corresponding WebGestureEvent. | 139 // Converts blink::GestureEvent to a corresponding WebGestureEvent. |
140 // NOTE: If event mapping fails, the type will be set to Undefined. | 140 // NOTE: If event mapping fails, the type will be set to Undefined. |
141 class WebGestureEventBuilder : public WebGestureEvent { | 141 class WebGestureEventBuilder : public WebGestureEvent { |
142 public: | 142 public: |
143 WebGestureEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*,
const WebCore::GestureEvent&); | 143 WebGestureEventBuilder(const blink::Widget*, const blink::RenderObject*, con
st blink::GestureEvent&); |
144 }; | 144 }; |
145 | 145 |
146 } // namespace blink | 146 } // namespace blink |
147 | 147 |
148 #endif | 148 #endif |
OLD | NEW |