dom/events/PointerEvent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/PointerEvent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 + *
     1.8 + * Portions Copyright 2013 Microsoft Open Technologies, Inc. */
     1.9 +
    1.10 +#ifndef mozilla_dom_PointerEvent_h_
    1.11 +#define mozilla_dom_PointerEvent_h_
    1.12 +
    1.13 +#include "mozilla/dom/MouseEvent.h"
    1.14 +#include "mozilla/dom/PointerEventBinding.h"
    1.15 +
    1.16 +class nsPresContext;
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace dom {
    1.20 +
    1.21 +class PointerEvent : public MouseEvent
    1.22 +{
    1.23 +public:
    1.24 +  PointerEvent(EventTarget* aOwner,
    1.25 +               nsPresContext* aPresContext,
    1.26 +               WidgetPointerEvent* aEvent);
    1.27 +
    1.28 +  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
    1.29 +  {
    1.30 +    return PointerEventBinding::Wrap(aCx, this);
    1.31 +  }
    1.32 +
    1.33 +  static already_AddRefed<PointerEvent>
    1.34 +  Constructor(const GlobalObject& aGlobal,
    1.35 +              const nsAString& aType,
    1.36 +              const PointerEventInit& aParam,
    1.37 +              ErrorResult& aRv);
    1.38 +
    1.39 +  static already_AddRefed<PointerEvent>
    1.40 +  Constructor(EventTarget* aOwner,
    1.41 +              const nsAString& aType,
    1.42 +              const PointerEventInit& aParam);
    1.43 +
    1.44 +  int32_t PointerId();
    1.45 +  int32_t Width();
    1.46 +  int32_t Height();
    1.47 +  float Pressure();
    1.48 +  int32_t TiltX();
    1.49 +  int32_t TiltY();
    1.50 +  bool IsPrimary();
    1.51 +  void GetPointerType(nsAString& aPointerType);
    1.52 +};
    1.53 +
    1.54 +} // namespace dom
    1.55 +} // namespace mozilla
    1.56 +
    1.57 +#endif // mozilla_dom_PointerEvent_h_

mercurial