MouseScrollEvent.h (2656B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_MouseScrollEvent_h_ 8 #define mozilla_dom_MouseScrollEvent_h_ 9 10 #include "mozilla/dom/MouseEvent.h" 11 #include "mozilla/dom/MouseScrollEventBinding.h" 12 13 namespace mozilla::dom { 14 15 class MouseScrollEvent : public MouseEvent { 16 public: 17 MouseScrollEvent(EventTarget* aOwner, nsPresContext* aPresContext, 18 WidgetMouseScrollEvent* aEvent); 19 20 NS_INLINE_DECL_REFCOUNTING_INHERITED(MouseScrollEvent, MouseEvent) 21 22 virtual JSObject* WrapObjectInternal( 23 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override { 24 return MouseScrollEvent_Binding::Wrap(aCx, this, aGivenProto); 25 } 26 27 int32_t Axis(); 28 29 void InitMouseScrollEvent(const nsAString& aType, bool aCanBubble, 30 bool aCancelable, nsGlobalWindowInner* aView, 31 int32_t aDetail, int32_t aScreenX, int32_t aScreenY, 32 int32_t aClientX, int32_t aClientY, bool aCtrlKey, 33 bool aAltKey, bool aShiftKey, bool aMetaKey, 34 uint16_t aButton, EventTarget* aRelatedTarget, 35 int32_t aAxis) { 36 InitMouseScrollEventInternal(aType, aCanBubble, aCancelable, aView, aDetail, 37 aScreenX, aScreenY, aClientX, aClientY, 38 aCtrlKey, aAltKey, aShiftKey, aMetaKey, 39 aButton, aRelatedTarget, aAxis); 40 } 41 42 protected: 43 ~MouseScrollEvent() = default; 44 45 void InitMouseScrollEventInternal(const nsAString& aType, bool aCanBubble, 46 bool aCancelable, 47 nsGlobalWindowInner* aView, int32_t aDetail, 48 double aScreenX, double aScreenY, 49 double aClientX, double aClientY, 50 bool aCtrlKey, bool aAltKey, bool aShiftKey, 51 bool aMetaKey, uint16_t aButton, 52 EventTarget* aRelatedTarget, int32_t aAxis); 53 }; 54 55 } // namespace mozilla::dom 56 57 already_AddRefed<mozilla::dom::MouseScrollEvent> NS_NewDOMMouseScrollEvent( 58 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, 59 mozilla::WidgetMouseScrollEvent* aEvent); 60 61 #endif // mozilla_dom_MouseScrollEvent_h_