|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 * |
|
5 * Portions Copyright 2013 Microsoft Open Technologies, Inc. */ |
|
6 |
|
7 #ifndef mozilla_dom_PointerEvent_h_ |
|
8 #define mozilla_dom_PointerEvent_h_ |
|
9 |
|
10 #include "mozilla/dom/MouseEvent.h" |
|
11 #include "mozilla/dom/PointerEventBinding.h" |
|
12 |
|
13 class nsPresContext; |
|
14 |
|
15 namespace mozilla { |
|
16 namespace dom { |
|
17 |
|
18 class PointerEvent : public MouseEvent |
|
19 { |
|
20 public: |
|
21 PointerEvent(EventTarget* aOwner, |
|
22 nsPresContext* aPresContext, |
|
23 WidgetPointerEvent* aEvent); |
|
24 |
|
25 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
|
26 { |
|
27 return PointerEventBinding::Wrap(aCx, this); |
|
28 } |
|
29 |
|
30 static already_AddRefed<PointerEvent> |
|
31 Constructor(const GlobalObject& aGlobal, |
|
32 const nsAString& aType, |
|
33 const PointerEventInit& aParam, |
|
34 ErrorResult& aRv); |
|
35 |
|
36 static already_AddRefed<PointerEvent> |
|
37 Constructor(EventTarget* aOwner, |
|
38 const nsAString& aType, |
|
39 const PointerEventInit& aParam); |
|
40 |
|
41 int32_t PointerId(); |
|
42 int32_t Width(); |
|
43 int32_t Height(); |
|
44 float Pressure(); |
|
45 int32_t TiltX(); |
|
46 int32_t TiltY(); |
|
47 bool IsPrimary(); |
|
48 void GetPointerType(nsAString& aPointerType); |
|
49 }; |
|
50 |
|
51 } // namespace dom |
|
52 } // namespace mozilla |
|
53 |
|
54 #endif // mozilla_dom_PointerEvent_h_ |