|
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_SpeechRecognitionAlternative_h |
|
8 #define mozilla_dom_SpeechRecognitionAlternative_h |
|
9 |
|
10 #include "nsCycleCollectionParticipant.h" |
|
11 #include "nsString.h" |
|
12 #include "nsWrapperCache.h" |
|
13 #include "nsAutoPtr.h" |
|
14 #include "js/TypeDecls.h" |
|
15 |
|
16 #include "mozilla/Attributes.h" |
|
17 |
|
18 namespace mozilla { |
|
19 namespace dom { |
|
20 |
|
21 class SpeechRecognition; |
|
22 |
|
23 class SpeechRecognitionAlternative MOZ_FINAL : public nsISupports, |
|
24 public nsWrapperCache |
|
25 { |
|
26 public: |
|
27 SpeechRecognitionAlternative(SpeechRecognition* aParent); |
|
28 ~SpeechRecognitionAlternative(); |
|
29 |
|
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionAlternative) |
|
32 |
|
33 nsISupports* GetParentObject() const; |
|
34 |
|
35 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; |
|
36 |
|
37 void GetTranscript(nsString& aRetVal) const; |
|
38 |
|
39 float Confidence() const; |
|
40 |
|
41 nsString mTranscript; |
|
42 float mConfidence; |
|
43 private: |
|
44 nsRefPtr<SpeechRecognition> mParent; |
|
45 }; |
|
46 |
|
47 } // namespace dom |
|
48 } // namespace mozilla |
|
49 |
|
50 #endif |