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/. */
5 #ifndef CustomEvent_h__
6 #define CustomEvent_h__
8 #include "mozilla/dom/Event.h"
9 #include "nsIDOMCustomEvent.h"
14 struct CustomEventInit
;
16 class CustomEvent MOZ_FINAL
: public Event
,
17 public nsIDOMCustomEvent
20 virtual ~CustomEvent();
22 nsCOMPtr
<nsIVariant
> mDetail
;
25 explicit CustomEvent(mozilla::dom::EventTarget
* aOwner
,
26 nsPresContext
* aPresContext
= nullptr,
27 mozilla::WidgetEvent
* aEvent
= nullptr);
29 NS_DECL_ISUPPORTS_INHERITED
30 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CustomEvent
, Event
)
32 NS_DECL_NSIDOMCUSTOMEVENT
34 static already_AddRefed
<CustomEvent
>
35 Constructor(const GlobalObject
& aGlobal
,
36 const nsAString
& aType
,
37 const CustomEventInit
& aParam
,
41 WrapObject(JSContext
* aCx
) MOZ_OVERRIDE
;
44 GetDetail(JSContext
* aCx
,
45 JS::MutableHandle
<JS::Value
> aRetval
);
48 InitCustomEvent(JSContext
* aCx
,
49 const nsAString
& aType
,
52 JS::Handle
<JS::Value
> aDetail
,
57 } // namespace mozilla
59 #endif // CustomEvent_h__