dom/events/WheelEvent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/WheelEvent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_dom_WheelEvent_h_
    1.11 +#define mozilla_dom_WheelEvent_h_
    1.12 +
    1.13 +#include "nsIDOMWheelEvent.h"
    1.14 +#include "mozilla/dom/MouseEvent.h"
    1.15 +#include "mozilla/dom/WheelEventBinding.h"
    1.16 +#include "mozilla/EventForwards.h"
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace dom {
    1.20 +
    1.21 +class WheelEvent : public MouseEvent,
    1.22 +                   public nsIDOMWheelEvent
    1.23 +{
    1.24 +public:
    1.25 +  WheelEvent(EventTarget* aOwner,
    1.26 +             nsPresContext* aPresContext,
    1.27 +             WidgetWheelEvent* aWheelEvent);
    1.28 +
    1.29 +  NS_DECL_ISUPPORTS_INHERITED
    1.30 +
    1.31 +  // nsIDOMWheelEvent Interface
    1.32 +  NS_DECL_NSIDOMWHEELEVENT
    1.33 +  
    1.34 +  // Forward to base class
    1.35 +  NS_FORWARD_TO_MOUSEEVENT
    1.36 +
    1.37 +  static
    1.38 +  already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal,
    1.39 +                                           const nsAString& aType,
    1.40 +                                           const WheelEventInit& aParam,
    1.41 +                                           ErrorResult& aRv);
    1.42 +
    1.43 +  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
    1.44 +  {
    1.45 +    return WheelEventBinding::Wrap(aCx, this);
    1.46 +  }
    1.47 +
    1.48 +  // NOTE: DeltaX(), DeltaY() and DeltaZ() return CSS pixels when deltaMode is
    1.49 +  //       DOM_DELTA_PIXEL. (The internal event's delta values are device pixels
    1.50 +  //       if it's dispatched by widget)
    1.51 +  double DeltaX();
    1.52 +  double DeltaY();
    1.53 +  double DeltaZ();
    1.54 +  uint32_t DeltaMode();
    1.55 +
    1.56 +private:
    1.57 +  int32_t mAppUnitsPerDevPixel;
    1.58 +};
    1.59 +
    1.60 +} // namespace dom
    1.61 +} // namespace mozilla
    1.62 +
    1.63 +#endif // mozilla_dom_WheelEvent_h_

mercurial