Source code

Revision control

Other Tools

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/. */
6
7
#ifndef mozilla_dom_VRDisplayEvent_h_
8
#define mozilla_dom_VRDisplayEvent_h_
9
10
#include "mozilla/Attributes.h"
11
#include "mozilla/ErrorResult.h"
12
#include "mozilla/dom/VRDisplayEventBinding.h"
13
#include "mozilla/dom/BindingUtils.h"
14
#include "mozilla/dom/Event.h"
15
16
#include "gfxVR.h"
17
18
struct JSContext;
19
20
namespace mozilla {
21
namespace gfx {
22
class VRDisplay;
23
} // namespace gfx
24
25
namespace dom {
26
27
class VRDisplayEvent final : public Event {
28
public:
29
NS_DECL_ISUPPORTS_INHERITED
30
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(VRDisplayEvent, Event)
31
32
VRDisplay* Display();
33
Nullable<VRDisplayEventReason> GetReason() const;
34
35
protected:
36
virtual ~VRDisplayEvent() = default;
37
explicit VRDisplayEvent(mozilla::dom::EventTarget* aOwner);
38
VRDisplayEvent(EventTarget* aOwner, nsPresContext* aPresContext,
39
InternalClipboardEvent* aEvent);
40
41
Maybe<VRDisplayEventReason> mReason;
42
RefPtr<VRDisplay> mDisplay;
43
44
public:
45
virtual JSObject* WrapObjectInternal(
46
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
47
48
static already_AddRefed<VRDisplayEvent> Constructor(
49
mozilla::dom::EventTarget* aOwner, const nsAString& aType,
50
const VRDisplayEventInit& aEventInitDict);
51
52
static already_AddRefed<VRDisplayEvent> Constructor(
53
const GlobalObject& aGlobal, const nsAString& aType,
54
const VRDisplayEventInit& aEventInitDict);
55
};
56
57
} // namespace dom
58
} // namespace mozilla
59
60
#endif