|
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/. */ |
|
6 |
|
7 #ifndef mozilla_dom_WheelEvent_h_ |
|
8 #define mozilla_dom_WheelEvent_h_ |
|
9 |
|
10 #include "nsIDOMWheelEvent.h" |
|
11 #include "mozilla/dom/MouseEvent.h" |
|
12 #include "mozilla/dom/WheelEventBinding.h" |
|
13 #include "mozilla/EventForwards.h" |
|
14 |
|
15 namespace mozilla { |
|
16 namespace dom { |
|
17 |
|
18 class WheelEvent : public MouseEvent, |
|
19 public nsIDOMWheelEvent |
|
20 { |
|
21 public: |
|
22 WheelEvent(EventTarget* aOwner, |
|
23 nsPresContext* aPresContext, |
|
24 WidgetWheelEvent* aWheelEvent); |
|
25 |
|
26 NS_DECL_ISUPPORTS_INHERITED |
|
27 |
|
28 // nsIDOMWheelEvent Interface |
|
29 NS_DECL_NSIDOMWHEELEVENT |
|
30 |
|
31 // Forward to base class |
|
32 NS_FORWARD_TO_MOUSEEVENT |
|
33 |
|
34 static |
|
35 already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal, |
|
36 const nsAString& aType, |
|
37 const WheelEventInit& aParam, |
|
38 ErrorResult& aRv); |
|
39 |
|
40 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
|
41 { |
|
42 return WheelEventBinding::Wrap(aCx, this); |
|
43 } |
|
44 |
|
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(); |
|
52 |
|
53 private: |
|
54 int32_t mAppUnitsPerDevPixel; |
|
55 }; |
|
56 |
|
57 } // namespace dom |
|
58 } // namespace mozilla |
|
59 |
|
60 #endif // mozilla_dom_WheelEvent_h_ |