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 : #ifndef mozilla_dom_SimpleGestureEvent_h_
8 : #define mozilla_dom_SimpleGestureEvent_h_
9 :
10 : #include "nsIDOMSimpleGestureEvent.h"
11 : #include "mozilla/dom/MouseEvent.h"
12 : #include "mozilla/dom/SimpleGestureEventBinding.h"
13 : #include "mozilla/EventForwards.h"
14 :
15 : class nsPresContext;
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 : class SimpleGestureEvent : public MouseEvent,
21 : public nsIDOMSimpleGestureEvent
22 : {
23 : public:
24 : SimpleGestureEvent(EventTarget* aOwner,
25 : nsPresContext* aPresContext,
26 : WidgetSimpleGestureEvent* aEvent);
27 :
28 : NS_DECL_ISUPPORTS_INHERITED
29 :
30 : NS_DECL_NSIDOMSIMPLEGESTUREEVENT
31 :
32 : // Forward to base class
33 0 : NS_FORWARD_TO_MOUSEEVENT
34 :
35 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
36 : {
37 0 : return SimpleGestureEventBinding::Wrap(aCx, this, aGivenProto);
38 : }
39 :
40 : uint32_t AllowedDirections();
41 : uint32_t Direction();
42 : double Delta();
43 : uint32_t ClickCount();
44 :
45 : void InitSimpleGestureEvent(const nsAString& aType,
46 : bool aCanBubble,
47 : bool aCancelable,
48 : nsGlobalWindow* aView,
49 : int32_t aDetail,
50 : int32_t aScreenX,
51 : int32_t aScreenY,
52 : int32_t aClientX,
53 : int32_t aClientY,
54 : bool aCtrlKey,
55 : bool aAltKey,
56 : bool aShiftKey,
57 : bool aMetaKey,
58 : uint16_t aButton,
59 : EventTarget* aRelatedTarget,
60 : uint32_t aAllowedDirections,
61 : uint32_t aDirection,
62 : double aDelta,
63 : uint32_t aClickCount);
64 :
65 : protected:
66 0 : ~SimpleGestureEvent() {}
67 : };
68 :
69 : } // namespace dom
70 : } // namespace mozilla
71 :
72 : already_AddRefed<mozilla::dom::SimpleGestureEvent>
73 : NS_NewDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
74 : nsPresContext* aPresContext,
75 : mozilla::WidgetSimpleGestureEvent* aEvent);
76 :
77 : #endif // mozilla_dom_SimpleGestureEvent_h_
|