MouseScrollEvent.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_MouseScrollEvent_h_
  6. #define mozilla_dom_MouseScrollEvent_h_
  7. #include "mozilla/dom/MouseEvent.h"
  8. #include "mozilla/dom/MouseScrollEventBinding.h"
  9. namespace mozilla {
  10. namespace dom {
  11. class MouseScrollEvent : public MouseEvent
  12. {
  13. public:
  14. MouseScrollEvent(EventTarget* aOwner,
  15. nsPresContext* aPresContext,
  16. WidgetMouseScrollEvent* aEvent);
  17. NS_DECL_ISUPPORTS_INHERITED
  18. // Forward to base class
  19. NS_FORWARD_TO_MOUSEEVENT
  20. virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
  21. {
  22. return MouseScrollEventBinding::Wrap(aCx, this, aGivenProto);
  23. }
  24. int32_t Axis();
  25. void InitMouseScrollEvent(const nsAString& aType, bool aCanBubble,
  26. bool aCancelable, nsGlobalWindow* aView,
  27. int32_t aDetail, int32_t aScreenX, int32_t aScreenY,
  28. int32_t aClientX, int32_t aClientY,
  29. bool aCtrlKey, bool aAltKey, bool aShiftKey,
  30. bool aMetaKey, uint16_t aButton,
  31. EventTarget* aRelatedTarget,
  32. int32_t aAxis);
  33. protected:
  34. ~MouseScrollEvent() {}
  35. };
  36. } // namespace dom
  37. } // namespace mozilla
  38. already_AddRefed<mozilla::dom::MouseScrollEvent>
  39. NS_NewDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
  40. nsPresContext* aPresContext,
  41. mozilla::WidgetMouseScrollEvent* aEvent);
  42. #endif // mozilla_dom_MouseScrollEvent_h_