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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_VRDisplayEvent_h_
8 #define mozilla_dom_VRDisplayEvent_h_
10 #include "js/RootingAPI.h"
11 #include "mozilla/AlreadyAddRefed.h"
12 #include "mozilla/Assertions.h"
13 #include "mozilla/Maybe.h"
14 #include "mozilla/RefPtr.h"
15 #include "mozilla/dom/Event.h"
16 #include "mozilla/dom/Nullable.h"
17 #include "mozilla/dom/VRDisplay.h"
18 #include "mozilla/dom/VRDisplayEventBinding.h"
19 #include "nsCycleCollectionParticipant.h"
20 #include "nsISupports.h"
21 #include "nsStringFwd.h"
32 class VRDisplayEvent final
: public Event
{
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(VRDisplayEvent
, Event
)
38 Nullable
<VRDisplayEventReason
> GetReason() const;
41 virtual ~VRDisplayEvent() = default;
42 explicit VRDisplayEvent(mozilla::dom::EventTarget
* aOwner
);
43 VRDisplayEvent(EventTarget
* aOwner
, nsPresContext
* aPresContext
,
44 InternalClipboardEvent
* aEvent
);
46 Maybe
<VRDisplayEventReason
> mReason
;
47 RefPtr
<VRDisplay
> mDisplay
;
50 virtual JSObject
* WrapObjectInternal(
51 JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
;
53 static already_AddRefed
<VRDisplayEvent
> Constructor(
54 mozilla::dom::EventTarget
* aOwner
, const nsAString
& aType
,
55 const VRDisplayEventInit
& aEventInitDict
);
57 static already_AddRefed
<VRDisplayEvent
> Constructor(
58 const GlobalObject
& aGlobal
, const nsAString
& aType
,
59 const VRDisplayEventInit
& aEventInitDict
);
63 } // namespace mozilla