HTMLAudioElement.h (1502B)
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 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #ifndef mozilla_dom_HTMLAudioElement_h 7 #define mozilla_dom_HTMLAudioElement_h 8 9 #include "mozilla/dom/HTMLMediaElement.h" 10 #include "mozilla/dom/TypedArray.h" 11 12 typedef uint16_t nsMediaNetworkState; 13 typedef uint16_t nsMediaReadyState; 14 15 namespace mozilla::dom { 16 17 class HTMLAudioElement final : public HTMLMediaElement { 18 public: 19 typedef mozilla::dom::NodeInfo NodeInfo; 20 21 NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLAudioElement, audio) 22 23 explicit HTMLAudioElement(already_AddRefed<NodeInfo>&& aNodeInfo); 24 25 // Element 26 virtual bool IsInteractiveHTMLContent() const override; 27 28 // nsIDOMHTMLMediaElement 29 using HTMLMediaElement::GetPaused; 30 31 virtual nsresult Clone(NodeInfo*, nsINode** aResult) const override; 32 virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel) override; 33 34 // WebIDL 35 36 static already_AddRefed<HTMLAudioElement> Audio( 37 const GlobalObject& aGlobal, const Optional<nsAString>& aSrc, 38 ErrorResult& aRv); 39 40 protected: 41 virtual ~HTMLAudioElement(); 42 43 virtual JSObject* WrapNode(JSContext* aCx, 44 JS::Handle<JSObject*> aGivenProto) override; 45 }; 46 47 } // namespace mozilla::dom 48 49 #endif // mozilla_dom_HTMLAudioElement_h