Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / events / CommandEvent.h
blob944b708c3a1247281715906100e9a1fb0428d6ab
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_CommandEvent_h_
8 #define mozilla_dom_CommandEvent_h_
10 #include "mozilla/EventForwards.h"
11 #include "mozilla/dom/CommandEventBinding.h"
12 #include "mozilla/dom/Event.h"
14 namespace mozilla::dom {
16 class CommandEvent : public Event {
17 public:
18 CommandEvent(EventTarget* aOwner, nsPresContext* aPresContext,
19 WidgetCommandEvent* aEvent);
21 NS_INLINE_DECL_REFCOUNTING_INHERITED(CommandEvent, Event)
23 virtual JSObject* WrapObjectInternal(
24 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
25 return CommandEvent_Binding::Wrap(aCx, this, aGivenProto);
28 void GetCommand(nsAString& aCommand);
30 protected:
31 ~CommandEvent() = default;
34 } // namespace mozilla::dom
36 already_AddRefed<mozilla::dom::CommandEvent> NS_NewDOMCommandEvent(
37 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
38 mozilla::WidgetCommandEvent* aEvent);
40 #endif // mozilla_dom_CommandEvent_h_