|
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 "SpeechGrammarList.h" |
|
8 |
|
9 #include "mozilla/dom/SpeechGrammarListBinding.h" |
|
10 #include "mozilla/ErrorResult.h" |
|
11 |
|
12 namespace mozilla { |
|
13 namespace dom { |
|
14 |
|
15 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(SpeechGrammarList, mParent) |
|
16 NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGrammarList) |
|
17 NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammarList) |
|
18 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammarList) |
|
19 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
|
20 NS_INTERFACE_MAP_ENTRY(nsISupports) |
|
21 NS_INTERFACE_MAP_END |
|
22 |
|
23 SpeechGrammarList::SpeechGrammarList(nsISupports* aParent) |
|
24 : mParent(aParent) |
|
25 { |
|
26 SetIsDOMBinding(); |
|
27 } |
|
28 |
|
29 SpeechGrammarList::~SpeechGrammarList() |
|
30 { |
|
31 } |
|
32 |
|
33 SpeechGrammarList* |
|
34 SpeechGrammarList::Constructor(const GlobalObject& aGlobal, |
|
35 ErrorResult& aRv) |
|
36 { |
|
37 return new SpeechGrammarList(aGlobal.GetAsSupports()); |
|
38 } |
|
39 |
|
40 JSObject* |
|
41 SpeechGrammarList::WrapObject(JSContext* aCx) |
|
42 { |
|
43 return SpeechGrammarListBinding::Wrap(aCx, this); |
|
44 } |
|
45 |
|
46 nsISupports* |
|
47 SpeechGrammarList::GetParentObject() const |
|
48 { |
|
49 return mParent; |
|
50 } |
|
51 |
|
52 uint32_t |
|
53 SpeechGrammarList::Length() const |
|
54 { |
|
55 return 0; |
|
56 } |
|
57 |
|
58 already_AddRefed<SpeechGrammar> |
|
59 SpeechGrammarList::Item(uint32_t aIndex, ErrorResult& aRv) |
|
60 { |
|
61 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
62 return nullptr; |
|
63 } |
|
64 |
|
65 void |
|
66 SpeechGrammarList::AddFromURI(const nsAString& aSrc, |
|
67 const Optional<float>& aWeight, |
|
68 ErrorResult& aRv) |
|
69 { |
|
70 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
71 return; |
|
72 } |
|
73 |
|
74 void |
|
75 SpeechGrammarList::AddFromString(const nsAString& aString, |
|
76 const Optional<float>& aWeight, |
|
77 ErrorResult& aRv) |
|
78 { |
|
79 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
80 return; |
|
81 } |
|
82 |
|
83 already_AddRefed<SpeechGrammar> |
|
84 SpeechGrammarList::IndexedGetter(uint32_t aIndex, bool& aPresent, |
|
85 ErrorResult& aRv) |
|
86 { |
|
87 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
|
88 return nullptr; |
|
89 } |
|
90 } // namespace dom |
|
91 } // namespace mozilla |