dom/events/SimpleGestureEvent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/SimpleGestureEvent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,76 @@
     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 +#ifndef mozilla_dom_SimpleGestureEvent_h_
     1.9 +#define mozilla_dom_SimpleGestureEvent_h_
    1.10 +
    1.11 +#include "nsIDOMSimpleGestureEvent.h"
    1.12 +#include "mozilla/dom/MouseEvent.h"
    1.13 +#include "mozilla/dom/SimpleGestureEventBinding.h"
    1.14 +#include "mozilla/EventForwards.h"
    1.15 +
    1.16 +class nsPresContext;
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace dom {
    1.20 +
    1.21 +class SimpleGestureEvent : public MouseEvent,
    1.22 +                           public nsIDOMSimpleGestureEvent
    1.23 +{
    1.24 +public:
    1.25 +  SimpleGestureEvent(EventTarget* aOwner,
    1.26 +                     nsPresContext* aPresContext,
    1.27 +                     WidgetSimpleGestureEvent* aEvent);
    1.28 +
    1.29 +  NS_DECL_ISUPPORTS_INHERITED
    1.30 +
    1.31 +  NS_DECL_NSIDOMSIMPLEGESTUREEVENT
    1.32 +
    1.33 +  // Forward to base class
    1.34 +  NS_FORWARD_TO_MOUSEEVENT
    1.35 +
    1.36 +  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
    1.37 +  {
    1.38 +    return SimpleGestureEventBinding::Wrap(aCx, this);
    1.39 +  }
    1.40 +
    1.41 +  uint32_t AllowedDirections();
    1.42 +  uint32_t Direction();
    1.43 +  double Delta();
    1.44 +  uint32_t ClickCount();
    1.45 +
    1.46 +  void InitSimpleGestureEvent(const nsAString& aType,
    1.47 +                              bool aCanBubble,
    1.48 +                              bool aCancelable,
    1.49 +                              nsIDOMWindow* aView,
    1.50 +                              int32_t aDetail,
    1.51 +                              int32_t aScreenX,
    1.52 +                              int32_t aScreenY,
    1.53 +                              int32_t aClientX,
    1.54 +                              int32_t aClientY,
    1.55 +                              bool aCtrlKey,
    1.56 +                              bool aAltKey,
    1.57 +                              bool aShiftKey,
    1.58 +                              bool aMetaKey,
    1.59 +                              uint16_t aButton,
    1.60 +                              EventTarget* aRelatedTarget,
    1.61 +                              uint32_t aAllowedDirections,
    1.62 +                              uint32_t aDirection,
    1.63 +                              double aDelta,
    1.64 +                              uint32_t aClickCount,
    1.65 +                              ErrorResult& aRv)
    1.66 +  {
    1.67 +    aRv = InitSimpleGestureEvent(aType, aCanBubble, aCancelable,
    1.68 +                                 aView, aDetail, aScreenX, aScreenY,
    1.69 +                                 aClientX, aClientY, aCtrlKey, aAltKey,
    1.70 +                                 aShiftKey, aMetaKey, aButton,
    1.71 +                                 aRelatedTarget, aAllowedDirections,
    1.72 +                                 aDirection, aDelta, aClickCount);
    1.73 +  }
    1.74 +};
    1.75 +
    1.76 +} // namespace dom
    1.77 +} // namespace mozilla
    1.78 +
    1.79 +#endif // mozilla_dom_SimpleGestureEvent_h_

mercurial