Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / events / CustomEvent.h
blob35717a808de01add865d4776ab3ee73bb8acd2de
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"
11 namespace mozilla {
12 namespace dom {
14 struct CustomEventInit;
16 class CustomEvent MOZ_FINAL : public Event,
17 public nsIDOMCustomEvent
19 private:
20 virtual ~CustomEvent();
22 nsCOMPtr<nsIVariant> mDetail;
24 public:
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)
31 NS_FORWARD_TO_EVENT
32 NS_DECL_NSIDOMCUSTOMEVENT
34 static already_AddRefed<CustomEvent>
35 Constructor(const GlobalObject& aGlobal,
36 const nsAString& aType,
37 const CustomEventInit& aParam,
38 ErrorResult& aRv);
40 virtual JSObject*
41 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
43 void
44 GetDetail(JSContext* aCx,
45 JS::MutableHandle<JS::Value> aRetval);
47 void
48 InitCustomEvent(JSContext* aCx,
49 const nsAString& aType,
50 bool aCanBubble,
51 bool aCancelable,
52 JS::Handle<JS::Value> aDetail,
53 ErrorResult& aRv);
56 } // namespace dom
57 } // namespace mozilla
59 #endif // CustomEvent_h__