| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebInputEventConversion_h | 31 #ifndef WebInputEventConversion_h |
| 32 #define WebInputEventConversion_h | 32 #define WebInputEventConversion_h |
| 33 | 33 |
| 34 #include <vector> | 34 #include <vector> |
| 35 #include "core/CoreExport.h" |
| 35 #include "platform/scroll/ScrollTypes.h" | 36 #include "platform/scroll/ScrollTypes.h" |
| 36 #include "platform/wtf/Compiler.h" | 37 #include "platform/wtf/Compiler.h" |
| 37 #include "public/platform/WebInputEvent.h" | 38 #include "public/platform/WebInputEvent.h" |
| 38 #include "public/platform/WebKeyboardEvent.h" | 39 #include "public/platform/WebKeyboardEvent.h" |
| 39 #include "public/platform/WebMouseWheelEvent.h" | 40 #include "public/platform/WebMouseWheelEvent.h" |
| 40 #include "public/platform/WebTouchEvent.h" | 41 #include "public/platform/WebTouchEvent.h" |
| 41 #include "web/WebExport.h" | |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 class FrameView; | 45 class FrameView; |
| 46 class KeyboardEvent; | 46 class KeyboardEvent; |
| 47 class MouseEvent; | 47 class MouseEvent; |
| 48 class LayoutItem; | 48 class LayoutItem; |
| 49 class TouchEvent; | 49 class TouchEvent; |
| 50 class WebGestureEvent; | 50 class WebGestureEvent; |
| 51 class WebKeyboardEvent; | 51 class WebKeyboardEvent; |
| 52 | 52 |
| 53 // These classes are used to convert from WebInputEvent subclasses to | 53 // These classes are used to convert from WebInputEvent subclasses to |
| 54 // corresponding WebCore events. | 54 // corresponding WebCore events. |
| 55 | 55 |
| 56 | 56 class CORE_EXPORT WebMouseEventBuilder |
| 57 class WEB_EXPORT WebMouseEventBuilder | |
| 58 : NON_EXPORTED_BASE(public WebMouseEvent) { | 57 : NON_EXPORTED_BASE(public WebMouseEvent) { |
| 59 public: | 58 public: |
| 60 // Converts a MouseEvent to a corresponding WebMouseEvent. | 59 // Converts a MouseEvent to a corresponding WebMouseEvent. |
| 61 // NOTE: This is only implemented for mousemove, mouseover, mouseout, | 60 // NOTE: This is only implemented for mousemove, mouseover, mouseout, |
| 62 // mousedown and mouseup. If the event mapping fails, the event type will | 61 // mousedown and mouseup. If the event mapping fails, the event type will |
| 63 // be set to Undefined. | 62 // be set to Undefined. |
| 64 WebMouseEventBuilder(const FrameView*, const LayoutItem, const MouseEvent&); | 63 WebMouseEventBuilder(const FrameView*, const LayoutItem, const MouseEvent&); |
| 65 WebMouseEventBuilder(const FrameView*, const LayoutItem, const TouchEvent&); | 64 WebMouseEventBuilder(const FrameView*, const LayoutItem, const TouchEvent&); |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 // Converts a KeyboardEvent to a corresponding WebKeyboardEvent. | 67 // Converts a KeyboardEvent to a corresponding WebKeyboardEvent. |
| 69 // NOTE: For KeyboardEvent, this is only implemented for keydown, | 68 // NOTE: For KeyboardEvent, this is only implemented for keydown, |
| 70 // keyup, and keypress. If the event mapping fails, the event type will be set | 69 // keyup, and keypress. If the event mapping fails, the event type will be set |
| 71 // to Undefined. | 70 // to Undefined. |
| 72 class WEB_EXPORT WebKeyboardEventBuilder | 71 class CORE_EXPORT WebKeyboardEventBuilder |
| 73 : NON_EXPORTED_BASE(public WebKeyboardEvent) { | 72 : NON_EXPORTED_BASE(public WebKeyboardEvent) { |
| 74 public: | 73 public: |
| 75 WebKeyboardEventBuilder(const KeyboardEvent&); | 74 WebKeyboardEventBuilder(const KeyboardEvent&); |
| 76 }; | 75 }; |
| 77 | 76 |
| 78 // Converts a TouchEvent to a corresponding WebTouchEvent. | 77 // Converts a TouchEvent to a corresponding WebTouchEvent. |
| 79 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points | 78 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points |
| 80 // exceeding that cap will be dropped. | 79 // exceeding that cap will be dropped. |
| 81 class WEB_EXPORT WebTouchEventBuilder | 80 class CORE_EXPORT WebTouchEventBuilder |
| 82 : NON_EXPORTED_BASE(public WebTouchEvent) { | 81 : NON_EXPORTED_BASE(public WebTouchEvent) { |
| 83 public: | 82 public: |
| 84 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); | 83 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 // Return a new transformed WebGestureEvent by applying the Widget's scale | 86 // Return a new transformed WebGestureEvent by applying the Widget's scale |
| 88 // and translation. | 87 // and translation. |
| 89 WEB_EXPORT WebGestureEvent TransformWebGestureEvent(FrameView*, | 88 CORE_EXPORT WebGestureEvent TransformWebGestureEvent(FrameView*, |
| 90 const WebGestureEvent&); | 89 const WebGestureEvent&); |
| 91 WEB_EXPORT WebMouseEvent TransformWebMouseEvent(FrameView*, | 90 CORE_EXPORT WebMouseEvent TransformWebMouseEvent(FrameView*, |
| 92 const WebMouseEvent&); | 91 const WebMouseEvent&); |
| 93 | 92 |
| 94 WEB_EXPORT WebMouseWheelEvent | 93 CORE_EXPORT WebMouseWheelEvent |
| 95 TransformWebMouseWheelEvent(FrameView*, const WebMouseWheelEvent&); | 94 TransformWebMouseWheelEvent(FrameView*, const WebMouseWheelEvent&); |
| 96 | 95 |
| 97 WEB_EXPORT WebTouchEvent TransformWebTouchEvent(FrameView*, | 96 CORE_EXPORT WebTouchEvent TransformWebTouchEvent(FrameView*, |
| 98 const WebTouchEvent&); | 97 const WebTouchEvent&); |
| 99 | 98 |
| 100 Vector<WebMouseEvent> WEB_EXPORT | 99 Vector<WebMouseEvent> CORE_EXPORT |
| 101 TransformWebMouseEventVector(FrameView*, | 100 TransformWebMouseEventVector(FrameView*, |
| 102 const std::vector<const WebInputEvent*>&); | 101 const std::vector<const WebInputEvent*>&); |
| 103 Vector<WebTouchEvent> WEB_EXPORT | 102 Vector<WebTouchEvent> CORE_EXPORT |
| 104 TransformWebTouchEventVector(FrameView*, | 103 TransformWebTouchEventVector(FrameView*, |
| 105 const std::vector<const WebInputEvent*>&); | 104 const std::vector<const WebInputEvent*>&); |
| 106 | 105 |
| 107 } // namespace blink | 106 } // namespace blink |
| 108 | 107 |
| 109 #endif | 108 #endif |
| OLD | NEW |