|
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 #ifndef mozilla_dom_SpeechRecognitionResultList_h |
|
8 #define mozilla_dom_SpeechRecognitionResultList_h |
|
9 |
|
10 #include "nsCycleCollectionParticipant.h" |
|
11 #include "nsWrapperCache.h" |
|
12 #include "nsAutoPtr.h" |
|
13 #include "nsTArray.h" |
|
14 #include "js/TypeDecls.h" |
|
15 |
|
16 #include "mozilla/Attributes.h" |
|
17 |
|
18 #include "SpeechRecognitionResult.h" |
|
19 |
|
20 namespace mozilla { |
|
21 namespace dom { |
|
22 |
|
23 class SpeechRecognition; |
|
24 |
|
25 class SpeechRecognitionResultList MOZ_FINAL : public nsISupports, |
|
26 public nsWrapperCache |
|
27 { |
|
28 public: |
|
29 SpeechRecognitionResultList(SpeechRecognition* aParent); |
|
30 ~SpeechRecognitionResultList(); |
|
31 |
|
32 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
33 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionResultList) |
|
34 |
|
35 nsISupports* GetParentObject() const; |
|
36 |
|
37 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; |
|
38 |
|
39 uint32_t Length() const; |
|
40 |
|
41 already_AddRefed<SpeechRecognitionResult> Item(uint32_t aIndex); |
|
42 |
|
43 already_AddRefed<SpeechRecognitionResult> IndexedGetter(uint32_t aIndex, bool& aPresent); |
|
44 |
|
45 nsTArray<nsRefPtr<SpeechRecognitionResult> > mItems; |
|
46 private: |
|
47 nsRefPtr<SpeechRecognition> mParent; |
|
48 }; |
|
49 |
|
50 } // namespace dom |
|
51 } // namespace mozilla |
|
52 |
|
53 #endif |