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_CommandEvent_h_
8 : #define mozilla_dom_CommandEvent_h_
9 :
10 : #include "mozilla/EventForwards.h"
11 : #include "mozilla/dom/CommandEventBinding.h"
12 : #include "mozilla/dom/Event.h"
13 : #include "nsIDOMCommandEvent.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 : class CommandEvent : public Event,
19 : public nsIDOMCommandEvent
20 : {
21 : public:
22 : CommandEvent(EventTarget* aOwner,
23 : nsPresContext* aPresContext,
24 : WidgetCommandEvent* aEvent);
25 :
26 : NS_DECL_ISUPPORTS_INHERITED
27 :
28 : NS_DECL_NSIDOMCOMMANDEVENT
29 :
30 : // Forward to base class
31 0 : NS_FORWARD_TO_EVENT
32 :
33 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
34 : {
35 0 : return CommandEventBinding::Wrap(aCx, this, aGivenProto);
36 : }
37 :
38 : void InitCommandEvent(const nsAString& aType,
39 : bool aCanBubble,
40 : bool aCancelable,
41 : const nsAString& aCommand,
42 : ErrorResult& aRv)
43 : {
44 : aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aCommand);
45 : }
46 :
47 : protected:
48 0 : ~CommandEvent() {}
49 : };
50 :
51 : } // namespace dom
52 : } // namespace mozilla
53 :
54 : already_AddRefed<mozilla::dom::CommandEvent>
55 : NS_NewDOMCommandEvent(mozilla::dom::EventTarget* aOwner,
56 : nsPresContext* aPresContext,
57 : mozilla::WidgetCommandEvent* aEvent);
58 :
59 : #endif // mozilla_dom_CommandEvent_h_
|