|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef mozilla_dom_CommandEvent_h_ |
|
7 #define mozilla_dom_CommandEvent_h_ |
|
8 |
|
9 #include "mozilla/EventForwards.h" |
|
10 #include "mozilla/dom/CommandEventBinding.h" |
|
11 #include "mozilla/dom/Event.h" |
|
12 #include "nsIDOMCommandEvent.h" |
|
13 |
|
14 namespace mozilla { |
|
15 namespace dom { |
|
16 |
|
17 class CommandEvent : public Event, |
|
18 public nsIDOMCommandEvent |
|
19 { |
|
20 public: |
|
21 CommandEvent(EventTarget* aOwner, |
|
22 nsPresContext* aPresContext, |
|
23 WidgetCommandEvent* aEvent); |
|
24 |
|
25 NS_DECL_ISUPPORTS_INHERITED |
|
26 |
|
27 NS_DECL_NSIDOMCOMMANDEVENT |
|
28 |
|
29 // Forward to base class |
|
30 NS_FORWARD_TO_EVENT |
|
31 |
|
32 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
|
33 { |
|
34 return CommandEventBinding::Wrap(aCx, this); |
|
35 } |
|
36 |
|
37 void InitCommandEvent(const nsAString& aType, |
|
38 bool aCanBubble, |
|
39 bool aCancelable, |
|
40 const nsAString& aCommand, |
|
41 ErrorResult& aRv) |
|
42 { |
|
43 aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aCommand); |
|
44 } |
|
45 }; |
|
46 |
|
47 } // namespace dom |
|
48 } // namespace mozilla |
|
49 |
|
50 #endif // mozilla_dom_CommandEvent_h_ |