|
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 #include "SpeechGrammar.h" |
|
8 |
|
9 #include "mozilla/Preferences.h" |
|
10 #include "mozilla/dom/SpeechGrammarBinding.h" |
|
11 |
|
12 namespace mozilla { |
|
13 namespace dom { |
|
14 |
|
15 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(SpeechGrammar, mParent) |
|
16 NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGrammar) |
|
17 NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammar) |
|
18 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammar) |
|
19 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
|
20 NS_INTERFACE_MAP_ENTRY(nsISupports) |
|
21 NS_INTERFACE_MAP_END |
|
22 |
|
23 SpeechGrammar::SpeechGrammar(nsISupports* aParent) |
|
24 : mParent(aParent) |
|
25 { |
|
26 SetIsDOMBinding(); |
|
27 } |
|
28 |
|
29 SpeechGrammar::~SpeechGrammar() |
|
30 { |
|
31 } |
|
32 |
|
33 SpeechGrammar* |
|
34 SpeechGrammar::Constructor(const GlobalObject& aGlobal, |
|
35 ErrorResult& aRv) |
|
36 { |
|
37 return new SpeechGrammar(aGlobal.GetAsSupports()); |
|
38 } |
|
39 |
|
40 nsISupports* |
|
41 SpeechGrammar::GetParentObject() const |
|
42 { |
|
43 return mParent; |
|
44 } |
|
45 |
|
46 JSObject* |
|
47 SpeechGrammar::WrapObject(JSContext* aCx) |
|
48 { |
|
49 return SpeechGrammarBinding::Wrap(aCx, this); |
|
50 } |
|
51 |
|
52 void |
|
53 SpeechGrammar::GetSrc(nsString& aRetVal, ErrorResult& aRv) const |
|
54 { |
|
55 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
56 return; |
|
57 } |
|
58 |
|
59 void |
|
60 SpeechGrammar::SetSrc(const nsAString& aArg, ErrorResult& aRv) |
|
61 { |
|
62 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
63 return; |
|
64 } |
|
65 |
|
66 float |
|
67 SpeechGrammar::GetWeight(ErrorResult& aRv) const |
|
68 { |
|
69 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
70 return 0; |
|
71 } |
|
72 |
|
73 void |
|
74 SpeechGrammar::SetWeight(float aArg, ErrorResult& aRv) |
|
75 { |
|
76 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
77 return; |
|
78 } |
|
79 |
|
80 } // namespace dom |
|
81 } // namespace mozilla |