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 21 matching lines...) Expand all Loading... |
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 blink { | 41 namespace blink { |
| 42 |
42 class GestureEvent; | 43 class GestureEvent; |
43 class KeyboardEvent; | 44 class KeyboardEvent; |
44 class MouseEvent; | 45 class MouseEvent; |
45 class RenderObject; | 46 class RenderObject; |
46 class ScrollView; | 47 class ScrollView; |
47 class TouchEvent; | 48 class TouchEvent; |
48 class WheelEvent; | |
49 class Widget; | |
50 } | |
51 | |
52 namespace blink { | |
53 | |
54 class WebMouseEvent; | 49 class WebMouseEvent; |
55 class WebMouseWheelEvent; | 50 class WebMouseWheelEvent; |
56 class WebKeyboardEvent; | 51 class WebKeyboardEvent; |
57 class WebTouchEvent; | 52 class WebTouchEvent; |
58 class WebGestureEvent; | 53 class WebGestureEvent; |
| 54 class WheelEvent; |
| 55 class Widget; |
59 | 56 |
60 // These classes are used to convert from WebInputEvent subclasses to | 57 // These classes are used to convert from WebInputEvent subclasses to |
61 // corresponding WebCore events. | 58 // corresponding WebCore events. |
62 | 59 |
63 class PlatformMouseEventBuilder : public blink::PlatformMouseEvent { | 60 class PlatformMouseEventBuilder : public PlatformMouseEvent { |
64 public: | 61 public: |
65 PlatformMouseEventBuilder(blink::Widget*, const WebMouseEvent&); | 62 PlatformMouseEventBuilder(Widget*, const WebMouseEvent&); |
66 }; | 63 }; |
67 | 64 |
68 class PlatformWheelEventBuilder : public blink::PlatformWheelEvent { | 65 class PlatformWheelEventBuilder : public PlatformWheelEvent { |
69 public: | 66 public: |
70 PlatformWheelEventBuilder(blink::Widget*, const WebMouseWheelEvent&); | 67 PlatformWheelEventBuilder(Widget*, const WebMouseWheelEvent&); |
71 }; | 68 }; |
72 | 69 |
73 class PlatformGestureEventBuilder : public blink::PlatformGestureEvent { | 70 class PlatformGestureEventBuilder : public PlatformGestureEvent { |
74 public: | 71 public: |
75 PlatformGestureEventBuilder(blink::Widget*, const WebGestureEvent&); | 72 PlatformGestureEventBuilder(Widget*, const WebGestureEvent&); |
76 }; | 73 }; |
77 | 74 |
78 class PlatformKeyboardEventBuilder : public blink::PlatformKeyboardEvent { | 75 class PlatformKeyboardEventBuilder : public PlatformKeyboardEvent { |
79 public: | 76 public: |
80 PlatformKeyboardEventBuilder(const WebKeyboardEvent&); | 77 PlatformKeyboardEventBuilder(const WebKeyboardEvent&); |
81 void setKeyType(Type); | 78 void setKeyType(Type); |
82 bool isCharacterKey() const; | 79 bool isCharacterKey() const; |
83 }; | 80 }; |
84 | 81 |
85 // Converts a WebTouchPoint to a blink::PlatformTouchPoint. | 82 // Converts a WebTouchPoint to a PlatformTouchPoint. |
86 class PlatformTouchPointBuilder : public blink::PlatformTouchPoint { | 83 class PlatformTouchPointBuilder : public PlatformTouchPoint { |
87 public: | 84 public: |
88 PlatformTouchPointBuilder(blink::Widget*, const WebTouchPoint&); | 85 PlatformTouchPointBuilder(Widget*, const WebTouchPoint&); |
89 }; | 86 }; |
90 | 87 |
91 // Converts a WebTouchEvent to a blink::PlatformTouchEvent. | 88 // Converts a WebTouchEvent to a PlatformTouchEvent. |
92 class PlatformTouchEventBuilder : public blink::PlatformTouchEvent { | 89 class PlatformTouchEventBuilder : public PlatformTouchEvent { |
93 public: | 90 public: |
94 PlatformTouchEventBuilder(blink::Widget*, const WebTouchEvent&); | 91 PlatformTouchEventBuilder(Widget*, const WebTouchEvent&); |
95 }; | 92 }; |
96 | 93 |
97 class WebMouseEventBuilder : public WebMouseEvent { | 94 class WebMouseEventBuilder : public WebMouseEvent { |
98 public: | 95 public: |
99 // Converts a blink::MouseEvent to a corresponding WebMouseEvent. | 96 // Converts a MouseEvent to a corresponding WebMouseEvent. |
100 // NOTE: This is only implemented for mousemove, mouseover, mouseout, | 97 // NOTE: This is only implemented for mousemove, mouseover, mouseout, |
101 // mousedown and mouseup. If the event mapping fails, the event type will | 98 // mousedown and mouseup. If the event mapping fails, the event type will |
102 // be set to Undefined. | 99 // be set to Undefined. |
103 WebMouseEventBuilder(const blink::Widget*, const blink::RenderObject*, const
blink::MouseEvent&); | 100 WebMouseEventBuilder(const Widget*, const RenderObject*, const MouseEvent&); |
104 WebMouseEventBuilder(const blink::Widget*, const blink::RenderObject*, const
blink::TouchEvent&); | 101 WebMouseEventBuilder(const Widget*, const RenderObject*, const TouchEvent&); |
105 | 102 |
106 // Converts a blink::PlatformMouseEvent to a corresponding WebMouseEvent. | 103 // Converts a PlatformMouseEvent to a corresponding WebMouseEvent. |
107 // NOTE: This is only implemented for mousepressed, mousereleased, and | 104 // NOTE: This is only implemented for mousepressed, mousereleased, and |
108 // mousemoved. If the event mapping fails, the event type will be set to | 105 // mousemoved. If the event mapping fails, the event type will be set to |
109 // Undefined. | 106 // Undefined. |
110 WebMouseEventBuilder(const blink::Widget*, const blink::PlatformMouseEvent&)
; | 107 WebMouseEventBuilder(const Widget*, const PlatformMouseEvent&); |
111 }; | 108 }; |
112 | 109 |
113 // Converts a blink::WheelEvent to a corresponding WebMouseWheelEvent. | 110 // Converts a WheelEvent to a corresponding WebMouseWheelEvent. |
114 // If the event mapping fails, the event type will be set to Undefined. | 111 // If the event mapping fails, the event type will be set to Undefined. |
115 class WebMouseWheelEventBuilder : public WebMouseWheelEvent { | 112 class WebMouseWheelEventBuilder : public WebMouseWheelEvent { |
116 public: | 113 public: |
117 WebMouseWheelEventBuilder(const blink::Widget*, const blink::RenderObject*,
const blink::WheelEvent&); | 114 WebMouseWheelEventBuilder(const Widget*, const RenderObject*, const WheelEve
nt&); |
118 }; | 115 }; |
119 | 116 |
120 // Converts a blink::KeyboardEvent or blink::PlatformKeyboardEvent to a | 117 // Converts a KeyboardEvent or PlatformKeyboardEvent to a |
121 // corresponding WebKeyboardEvent. | 118 // corresponding WebKeyboardEvent. |
122 // NOTE: For blink::KeyboardEvent, this is only implemented for keydown, | 119 // NOTE: For KeyboardEvent, this is only implemented for keydown, |
123 // keyup, and keypress. If the event mapping fails, the event type will be set | 120 // keyup, and keypress. If the event mapping fails, the event type will be set |
124 // to Undefined. | 121 // to Undefined. |
125 class WebKeyboardEventBuilder : public WebKeyboardEvent { | 122 class WebKeyboardEventBuilder : public WebKeyboardEvent { |
126 public: | 123 public: |
127 WebKeyboardEventBuilder(const blink::KeyboardEvent&); | 124 WebKeyboardEventBuilder(const KeyboardEvent&); |
128 WebKeyboardEventBuilder(const blink::PlatformKeyboardEvent&); | 125 WebKeyboardEventBuilder(const PlatformKeyboardEvent&); |
129 }; | 126 }; |
130 | 127 |
131 // Converts a blink::TouchEvent to a corresponding WebTouchEvent. | 128 // Converts a TouchEvent to a corresponding WebTouchEvent. |
132 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points | 129 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points |
133 // exceeding that cap will be dropped. | 130 // exceeding that cap will be dropped. |
134 class WebTouchEventBuilder : public WebTouchEvent { | 131 class WebTouchEventBuilder : public WebTouchEvent { |
135 public: | 132 public: |
136 WebTouchEventBuilder(const blink::Widget*, const blink::RenderObject*, const
blink::TouchEvent&); | 133 WebTouchEventBuilder(const Widget*, const RenderObject*, const TouchEvent&); |
137 }; | 134 }; |
138 | 135 |
139 // Converts blink::GestureEvent to a corresponding WebGestureEvent. | 136 // Converts GestureEvent to a corresponding WebGestureEvent. |
140 // NOTE: If event mapping fails, the type will be set to Undefined. | 137 // NOTE: If event mapping fails, the type will be set to Undefined. |
141 class WebGestureEventBuilder : public WebGestureEvent { | 138 class WebGestureEventBuilder : public WebGestureEvent { |
142 public: | 139 public: |
143 WebGestureEventBuilder(const blink::Widget*, const blink::RenderObject*, con
st blink::GestureEvent&); | 140 WebGestureEventBuilder(const Widget*, const RenderObject*, const GestureEven
t&); |
144 }; | 141 }; |
145 | 142 |
146 } // namespace blink | 143 } // namespace blink |
147 | 144 |
148 #endif | 145 #endif |
OLD | NEW |