| 1 | /* |
| 2 | * Copyright (C) 2010, 2011, 2014-2015 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | #ifndef JSEventSendingController_h |
| 26 | #define JSEventSendingController_h |
| 27 | |
| 28 | #include "JSWrapper.h" |
| 29 | |
| 30 | namespace WTR { |
| 31 | |
| 32 | class EventSendingController; |
| 33 | |
| 34 | class JSEventSendingController : public JSWrapper { |
| 35 | public: |
| 36 | static JSClassRef eventSendingControllerClass(); |
| 37 | |
| 38 | private: |
| 39 | static const JSStaticFunction* staticFunctions(); |
| 40 | static const JSStaticValue* staticValues(); |
| 41 | |
| 42 | // Functions |
| 43 | |
| 44 | static JSValueRef mouseDown(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 45 | static JSValueRef mouseUp(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 46 | static JSValueRef mouseMoveTo(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 47 | static JSValueRef mouseForceClick(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 48 | static JSValueRef startAndCancelMouseForceClick(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 49 | static JSValueRef mouseForceDown(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 50 | static JSValueRef mouseForceUp(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 51 | static JSValueRef mouseForceChanged(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 52 | static JSValueRef mouseScrollBy(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 53 | static JSValueRef mouseScrollByWithWheelAndMomentumPhases(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 54 | static JSValueRef continuousMouseScrollBy(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 55 | static JSValueRef contextClick(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 56 | static JSValueRef scheduleAsynchronousClick(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 57 | static JSValueRef leapForward(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 58 | static JSValueRef keyDown(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 59 | static JSValueRef scheduleAsynchronousKeyDown(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 60 | static JSValueRef textZoomIn(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 61 | static JSValueRef textZoomOut(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 62 | static JSValueRef zoomPageIn(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 63 | static JSValueRef zoomPageOut(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 64 | static JSValueRef scalePageBy(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 65 | static JSValueRef monitorWheelEvents(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 66 | static JSValueRef callAfterScrollingCompletes(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 67 | static JSValueRef addTouchPoint(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 68 | static JSValueRef updateTouchPoint(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 69 | static JSValueRef setTouchModifier(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 70 | static JSValueRef setTouchPointRadius(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 71 | static JSValueRef touchStart(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 72 | static JSValueRef touchMove(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 73 | static JSValueRef touchEnd(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 74 | static JSValueRef touchCancel(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 75 | static JSValueRef clearTouchPoints(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 76 | static JSValueRef releaseTouchPoint(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 77 | static JSValueRef cancelTouchPoint(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*); |
| 78 | }; |
| 79 | |
| 80 | EventSendingController* toEventSendingController(JSContextRef, JSValueRef); |
| 81 | |
| 82 | } // namespace WTR |
| 83 | |
| 84 | #endif // JSEventSendingController_h |
| 85 | |