Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=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
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 : *
7 : * Portions Copyright 2013 Microsoft Open Technologies, Inc. */
8 :
9 : #ifndef mozilla_dom_PointerEvent_h_
10 : #define mozilla_dom_PointerEvent_h_
11 :
12 : #include "mozilla/dom/MouseEvent.h"
13 : #include "mozilla/dom/PointerEventBinding.h"
14 :
15 : class nsPresContext;
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 0 : class PointerEvent : public MouseEvent
21 : {
22 : public:
23 : PointerEvent(EventTarget* aOwner,
24 : nsPresContext* aPresContext,
25 : WidgetPointerEvent* aEvent);
26 :
27 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
28 : {
29 0 : return PointerEventBinding::Wrap(aCx, this, aGivenProto);
30 : }
31 :
32 : static already_AddRefed<PointerEvent>
33 : Constructor(const GlobalObject& aGlobal,
34 : const nsAString& aType,
35 : const PointerEventInit& aParam,
36 : ErrorResult& aRv);
37 :
38 : static already_AddRefed<PointerEvent>
39 : Constructor(EventTarget* aOwner,
40 : const nsAString& aType,
41 : const PointerEventInit& aParam);
42 :
43 : int32_t PointerId();
44 : int32_t Width();
45 : int32_t Height();
46 : float Pressure();
47 : float TangentialPressure();
48 : int32_t TiltX();
49 : int32_t TiltY();
50 : int32_t Twist();
51 : bool IsPrimary();
52 : void GetPointerType(nsAString& aPointerType);
53 : };
54 :
55 : void ConvertPointerTypeToString(uint16_t aPointerTypeSrc, nsAString& aPointerTypeDest);
56 :
57 : } // namespace dom
58 : } // namespace mozilla
59 :
60 : already_AddRefed<mozilla::dom::PointerEvent>
61 : NS_NewDOMPointerEvent(mozilla::dom::EventTarget* aOwner,
62 : nsPresContext* aPresContext,
63 : mozilla::WidgetPointerEvent* aEvent);
64 :
65 : #endif // mozilla_dom_PointerEvent_h_
|