michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "SpeechGrammarList.h" michael@0: michael@0: #include "mozilla/dom/SpeechGrammarListBinding.h" michael@0: #include "mozilla/ErrorResult.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(SpeechGrammarList, mParent) michael@0: NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGrammarList) michael@0: NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammarList) michael@0: NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammarList) michael@0: NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY michael@0: NS_INTERFACE_MAP_ENTRY(nsISupports) michael@0: NS_INTERFACE_MAP_END michael@0: michael@0: SpeechGrammarList::SpeechGrammarList(nsISupports* aParent) michael@0: : mParent(aParent) michael@0: { michael@0: SetIsDOMBinding(); michael@0: } michael@0: michael@0: SpeechGrammarList::~SpeechGrammarList() michael@0: { michael@0: } michael@0: michael@0: SpeechGrammarList* michael@0: SpeechGrammarList::Constructor(const GlobalObject& aGlobal, michael@0: ErrorResult& aRv) michael@0: { michael@0: return new SpeechGrammarList(aGlobal.GetAsSupports()); michael@0: } michael@0: michael@0: JSObject* michael@0: SpeechGrammarList::WrapObject(JSContext* aCx) michael@0: { michael@0: return SpeechGrammarListBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: nsISupports* michael@0: SpeechGrammarList::GetParentObject() const michael@0: { michael@0: return mParent; michael@0: } michael@0: michael@0: uint32_t michael@0: SpeechGrammarList::Length() const michael@0: { michael@0: return 0; michael@0: } michael@0: michael@0: already_AddRefed michael@0: SpeechGrammarList::Item(uint32_t aIndex, ErrorResult& aRv) michael@0: { michael@0: aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); michael@0: return nullptr; michael@0: } michael@0: michael@0: void michael@0: SpeechGrammarList::AddFromURI(const nsAString& aSrc, michael@0: const Optional& aWeight, michael@0: ErrorResult& aRv) michael@0: { michael@0: aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); michael@0: return; michael@0: } michael@0: michael@0: void michael@0: SpeechGrammarList::AddFromString(const nsAString& aString, michael@0: const Optional& aWeight, michael@0: ErrorResult& aRv) michael@0: { michael@0: aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); michael@0: return; michael@0: } michael@0: michael@0: already_AddRefed michael@0: SpeechGrammarList::IndexedGetter(uint32_t aIndex, bool& aPresent, michael@0: ErrorResult& aRv) michael@0: { michael@0: aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); michael@0: return nullptr; michael@0: } michael@0: } // namespace dom michael@0: } // namespace mozilla