Bug 1032573 part 4 - Add AnimationTimeline::ToTimelineTime helper method; r=dbaron
[gecko.git] / dom / events / WheelEvent.h
blob41f8424aa5ac2e840d34f7998e491bffeea0cf65
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_WheelEvent_h_
8 #define mozilla_dom_WheelEvent_h_
10 #include "nsIDOMWheelEvent.h"
11 #include "mozilla/dom/MouseEvent.h"
12 #include "mozilla/dom/WheelEventBinding.h"
13 #include "mozilla/EventForwards.h"
15 namespace mozilla {
16 namespace dom {
18 class WheelEvent : public MouseEvent,
19 public nsIDOMWheelEvent
21 public:
22 WheelEvent(EventTarget* aOwner,
23 nsPresContext* aPresContext,
24 WidgetWheelEvent* aWheelEvent);
26 NS_DECL_ISUPPORTS_INHERITED
28 // nsIDOMWheelEvent Interface
29 NS_DECL_NSIDOMWHEELEVENT
31 // Forward to base class
32 NS_FORWARD_TO_MOUSEEVENT
34 static
35 already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal,
36 const nsAString& aType,
37 const WheelEventInit& aParam,
38 ErrorResult& aRv);
40 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
42 return WheelEventBinding::Wrap(aCx, this);
45 // NOTE: DeltaX(), DeltaY() and DeltaZ() return CSS pixels when deltaMode is
46 // DOM_DELTA_PIXEL. (The internal event's delta values are device pixels
47 // if it's dispatched by widget)
48 double DeltaX();
49 double DeltaY();
50 double DeltaZ();
51 uint32_t DeltaMode();
53 protected:
54 ~WheelEvent() {}
56 private:
57 int32_t mAppUnitsPerDevPixel;
60 } // namespace dom
61 } // namespace mozilla
63 #endif // mozilla_dom_WheelEvent_h_