dom/events/SimpleGestureEvent.h

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:d85224373a55
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifndef mozilla_dom_SimpleGestureEvent_h_
6 #define mozilla_dom_SimpleGestureEvent_h_
7
8 #include "nsIDOMSimpleGestureEvent.h"
9 #include "mozilla/dom/MouseEvent.h"
10 #include "mozilla/dom/SimpleGestureEventBinding.h"
11 #include "mozilla/EventForwards.h"
12
13 class nsPresContext;
14
15 namespace mozilla {
16 namespace dom {
17
18 class SimpleGestureEvent : public MouseEvent,
19 public nsIDOMSimpleGestureEvent
20 {
21 public:
22 SimpleGestureEvent(EventTarget* aOwner,
23 nsPresContext* aPresContext,
24 WidgetSimpleGestureEvent* aEvent);
25
26 NS_DECL_ISUPPORTS_INHERITED
27
28 NS_DECL_NSIDOMSIMPLEGESTUREEVENT
29
30 // Forward to base class
31 NS_FORWARD_TO_MOUSEEVENT
32
33 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
34 {
35 return SimpleGestureEventBinding::Wrap(aCx, this);
36 }
37
38 uint32_t AllowedDirections();
39 uint32_t Direction();
40 double Delta();
41 uint32_t ClickCount();
42
43 void InitSimpleGestureEvent(const nsAString& aType,
44 bool aCanBubble,
45 bool aCancelable,
46 nsIDOMWindow* aView,
47 int32_t aDetail,
48 int32_t aScreenX,
49 int32_t aScreenY,
50 int32_t aClientX,
51 int32_t aClientY,
52 bool aCtrlKey,
53 bool aAltKey,
54 bool aShiftKey,
55 bool aMetaKey,
56 uint16_t aButton,
57 EventTarget* aRelatedTarget,
58 uint32_t aAllowedDirections,
59 uint32_t aDirection,
60 double aDelta,
61 uint32_t aClickCount,
62 ErrorResult& aRv)
63 {
64 aRv = InitSimpleGestureEvent(aType, aCanBubble, aCancelable,
65 aView, aDetail, aScreenX, aScreenY,
66 aClientX, aClientY, aCtrlKey, aAltKey,
67 aShiftKey, aMetaKey, aButton,
68 aRelatedTarget, aAllowedDirections,
69 aDirection, aDelta, aClickCount);
70 }
71 };
72
73 } // namespace dom
74 } // namespace mozilla
75
76 #endif // mozilla_dom_SimpleGestureEvent_h_

mercurial