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