Line data Source code
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 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
31 : {
32 0 : return mozilla::dom::SpeechRecognitionErrorBinding::Wrap(aCx, this, aGivenProto);
33 : }
34 :
35 : void
36 0 : GetMessage(nsAString& aString)
37 : {
38 0 : aString = mMessage;
39 0 : }
40 :
41 : SpeechRecognitionErrorCode
42 0 : Error()
43 : {
44 0 : 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__
|