Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / events / SimpleGestureEvent.h
blob8b3cb99702a5c03c2ce6b13a9cf4010f048ed829
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/. */
7 #ifndef mozilla_dom_SimpleGestureEvent_h_
8 #define mozilla_dom_SimpleGestureEvent_h_
10 #include "mozilla/dom/MouseEvent.h"
11 #include "mozilla/dom/SimpleGestureEventBinding.h"
12 #include "mozilla/EventForwards.h"
14 class nsPresContext;
16 namespace mozilla::dom {
18 class SimpleGestureEvent : public MouseEvent {
19 public:
20 SimpleGestureEvent(EventTarget* aOwner, nsPresContext* aPresContext,
21 WidgetSimpleGestureEvent* aEvent);
23 NS_INLINE_DECL_REFCOUNTING_INHERITED(SimpleGestureEvent, MouseEvent)
25 virtual JSObject* WrapObjectInternal(
26 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
27 return SimpleGestureEvent_Binding::Wrap(aCx, this, aGivenProto);
30 uint32_t AllowedDirections() const;
31 void SetAllowedDirections(uint32_t aAllowedDirections);
32 uint32_t Direction() const;
33 double Delta() const;
34 uint32_t ClickCount() const;
36 void InitSimpleGestureEvent(const nsAString& aType, bool aCanBubble,
37 bool aCancelable, nsGlobalWindowInner* aView,
38 int32_t aDetail, int32_t aScreenX,
39 int32_t aScreenY, int32_t aClientX,
40 int32_t aClientY, bool aCtrlKey, bool aAltKey,
41 bool aShiftKey, bool aMetaKey, uint16_t aButton,
42 EventTarget* aRelatedTarget,
43 uint32_t aAllowedDirections, uint32_t aDirection,
44 double aDelta, uint32_t aClickCount);
46 protected:
47 ~SimpleGestureEvent() = default;
50 } // namespace mozilla::dom
52 already_AddRefed<mozilla::dom::SimpleGestureEvent> NS_NewDOMSimpleGestureEvent(
53 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
54 mozilla::WidgetSimpleGestureEvent* aEvent);
56 #endif // mozilla_dom_SimpleGestureEvent_h_