michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_WheelEvent_h_ michael@0: #define mozilla_dom_WheelEvent_h_ michael@0: michael@0: #include "nsIDOMWheelEvent.h" michael@0: #include "mozilla/dom/MouseEvent.h" michael@0: #include "mozilla/dom/WheelEventBinding.h" michael@0: #include "mozilla/EventForwards.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class WheelEvent : public MouseEvent, michael@0: public nsIDOMWheelEvent michael@0: { michael@0: public: michael@0: WheelEvent(EventTarget* aOwner, michael@0: nsPresContext* aPresContext, michael@0: WidgetWheelEvent* aWheelEvent); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: // nsIDOMWheelEvent Interface michael@0: NS_DECL_NSIDOMWHEELEVENT michael@0: michael@0: // Forward to base class michael@0: NS_FORWARD_TO_MOUSEEVENT michael@0: michael@0: static michael@0: already_AddRefed Constructor(const GlobalObject& aGlobal, michael@0: const nsAString& aType, michael@0: const WheelEventInit& aParam, michael@0: ErrorResult& aRv); michael@0: michael@0: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE michael@0: { michael@0: return WheelEventBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: // NOTE: DeltaX(), DeltaY() and DeltaZ() return CSS pixels when deltaMode is michael@0: // DOM_DELTA_PIXEL. (The internal event's delta values are device pixels michael@0: // if it's dispatched by widget) michael@0: double DeltaX(); michael@0: double DeltaY(); michael@0: double DeltaZ(); michael@0: uint32_t DeltaMode(); michael@0: michael@0: private: michael@0: int32_t mAppUnitsPerDevPixel; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_WheelEvent_h_