1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webspeech/recognition/SpeechGrammar.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,81 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "SpeechGrammar.h" 1.11 + 1.12 +#include "mozilla/Preferences.h" 1.13 +#include "mozilla/dom/SpeechGrammarBinding.h" 1.14 + 1.15 +namespace mozilla { 1.16 +namespace dom { 1.17 + 1.18 +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(SpeechGrammar, mParent) 1.19 +NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGrammar) 1.20 +NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammar) 1.21 +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammar) 1.22 + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY 1.23 + NS_INTERFACE_MAP_ENTRY(nsISupports) 1.24 +NS_INTERFACE_MAP_END 1.25 + 1.26 +SpeechGrammar::SpeechGrammar(nsISupports* aParent) 1.27 + : mParent(aParent) 1.28 +{ 1.29 + SetIsDOMBinding(); 1.30 +} 1.31 + 1.32 +SpeechGrammar::~SpeechGrammar() 1.33 +{ 1.34 +} 1.35 + 1.36 +SpeechGrammar* 1.37 +SpeechGrammar::Constructor(const GlobalObject& aGlobal, 1.38 + ErrorResult& aRv) 1.39 +{ 1.40 + return new SpeechGrammar(aGlobal.GetAsSupports()); 1.41 +} 1.42 + 1.43 +nsISupports* 1.44 +SpeechGrammar::GetParentObject() const 1.45 +{ 1.46 + return mParent; 1.47 +} 1.48 + 1.49 +JSObject* 1.50 +SpeechGrammar::WrapObject(JSContext* aCx) 1.51 +{ 1.52 + return SpeechGrammarBinding::Wrap(aCx, this); 1.53 +} 1.54 + 1.55 +void 1.56 +SpeechGrammar::GetSrc(nsString& aRetVal, ErrorResult& aRv) const 1.57 +{ 1.58 + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 1.59 + return; 1.60 +} 1.61 + 1.62 +void 1.63 +SpeechGrammar::SetSrc(const nsAString& aArg, ErrorResult& aRv) 1.64 +{ 1.65 + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 1.66 + return; 1.67 +} 1.68 + 1.69 +float 1.70 +SpeechGrammar::GetWeight(ErrorResult& aRv) const 1.71 +{ 1.72 + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 1.73 + return 0; 1.74 +} 1.75 + 1.76 +void 1.77 +SpeechGrammar::SetWeight(float aArg, ErrorResult& aRv) 1.78 +{ 1.79 + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 1.80 + return; 1.81 +} 1.82 + 1.83 +} // namespace dom 1.84 +} // namespace mozilla