/src/mozilla-central/dom/events/SpeechRecognitionError.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
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 SpeechRecognitionError_h__ |
8 | | #define SpeechRecognitionError_h__ |
9 | | |
10 | | #include "mozilla/dom/Event.h" |
11 | | #include "mozilla/dom/SpeechRecognitionErrorBinding.h" |
12 | | |
13 | | namespace mozilla { |
14 | | namespace dom { |
15 | | |
16 | | class SpeechRecognitionError : public Event |
17 | | { |
18 | | public: |
19 | | SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, |
20 | | nsPresContext* aPresContext, |
21 | | WidgetEvent* aEvent); |
22 | | virtual ~SpeechRecognitionError(); |
23 | | |
24 | | static already_AddRefed<SpeechRecognitionError> |
25 | | Constructor(const GlobalObject& aGlobal, |
26 | | const nsAString& aType, |
27 | | const SpeechRecognitionErrorInit& aParam, |
28 | | ErrorResult& aRv); |
29 | | |
30 | | virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override |
31 | 0 | { |
32 | 0 | return mozilla::dom::SpeechRecognitionError_Binding::Wrap(aCx, this, aGivenProto); |
33 | 0 | } |
34 | | |
35 | | void |
36 | | GetMessage(nsAString& aString) |
37 | | { |
38 | | aString = mMessage; |
39 | | } |
40 | | |
41 | | SpeechRecognitionErrorCode |
42 | | Error() |
43 | | { |
44 | | return mError; |
45 | | } |
46 | | |
47 | | void |
48 | | InitSpeechRecognitionError(const nsAString& aType, |
49 | | bool aCanBubble, |
50 | | bool aCancelable, |
51 | | SpeechRecognitionErrorCode aError, |
52 | | const nsAString& aMessage); |
53 | | |
54 | | protected: |
55 | | SpeechRecognitionErrorCode mError; |
56 | | nsString mMessage; |
57 | | }; |
58 | | |
59 | | } // namespace dom |
60 | | } // namespace mozilla |
61 | | |
62 | | #endif // SpeechRecognitionError_h__ |