1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
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/. */
6 
7 #ifndef mozilla_dom_MIDIOutputMap_h
8 #define mozilla_dom_MIDIOutputMap_h
9 
10 #include "nsCOMPtr.h"
11 #include "nsWrapperCache.h"
12 
13 class nsPIDOMWindowInner;
14 
15 namespace mozilla {
16 namespace dom {
17 
18 /**
19  * Maplike DOM object that holds a list of all MIDI output ports available for
20  * access. Almost all functions are implemented automatically by WebIDL.
21  *
22  */
23 class MIDIOutputMap final : public nsISupports, public nsWrapperCache {
24  public:
25   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
26   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MIDIOutputMap)
27 
28   explicit MIDIOutputMap(nsPIDOMWindowInner* aParent);
29 
GetParentObject()30   nsPIDOMWindowInner* GetParentObject() const { return mParent; }
31 
32   JSObject* WrapObject(JSContext* aCx,
33                        JS::Handle<JSObject*> aGivenProto) override;
34 
35  private:
36   ~MIDIOutputMap() = default;
37   nsCOMPtr<nsPIDOMWindowInner> mParent;
38 };
39 
40 }  // namespace dom
41 }  // namespace mozilla
42 
43 #endif  // mozilla_dom_MIDIOutputMap_h
44