Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM SpeechRecognitionError.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_SpeechRecognitionErrorBinding_h
4 : #define mozilla_dom_SpeechRecognitionErrorBinding_h
5 :
6 : #include "EventBinding.h"
7 : #include "js/RootingAPI.h"
8 : #include "jspubtd.h"
9 : #include "mozilla/ErrorResult.h"
10 : #include "mozilla/dom/BindingDeclarations.h"
11 : #include "mozilla/dom/Nullable.h"
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : struct NativePropertyHooks;
17 : class ProtoAndIfaceCache;
18 : class SpeechRecognitionError;
19 : struct SpeechRecognitionErrorAtoms;
20 : struct SpeechRecognitionErrorInitAtoms;
21 :
22 : } // namespace dom
23 : } // namespace mozilla
24 :
25 : namespace mozilla {
26 : namespace dom {
27 :
28 : enum class SpeechRecognitionErrorCode : uint8_t {
29 : No_speech,
30 : Aborted,
31 : Audio_capture,
32 : Network,
33 : Not_allowed,
34 : Service_not_allowed,
35 : Bad_grammar,
36 : Language_not_supported,
37 : EndGuard_
38 : };
39 :
40 : namespace SpeechRecognitionErrorCodeValues {
41 : extern const EnumEntry strings[9];
42 : } // namespace SpeechRecognitionErrorCodeValues
43 :
44 : bool
45 : ToJSValue(JSContext* aCx, SpeechRecognitionErrorCode aArgument, JS::MutableHandle<JS::Value> aValue);
46 :
47 :
48 0 : struct SpeechRecognitionErrorInit : public EventInit
49 : {
50 : MOZ_INIT_OUTSIDE_CTOR SpeechRecognitionErrorCode mError;
51 : MOZ_INIT_OUTSIDE_CTOR nsString mMessage;
52 :
53 : SpeechRecognitionErrorInit();
54 :
55 0 : explicit inline SpeechRecognitionErrorInit(const FastDictionaryInitializer& )
56 0 : : EventInit(FastDictionaryInitializer())
57 : {
58 : // Do nothing here; this is used by our "Fast" subclass
59 0 : }
60 :
61 : explicit inline SpeechRecognitionErrorInit(const SpeechRecognitionErrorInit& aOther)
62 : {
63 : *this = aOther;
64 : }
65 :
66 : bool
67 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
68 :
69 : bool
70 : Init(const nsAString& aJSON);
71 :
72 : bool
73 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
74 :
75 : bool
76 : ToJSON(nsAString& aJSON) const;
77 :
78 : void
79 : TraceDictionary(JSTracer* trc);
80 :
81 : SpeechRecognitionErrorInit&
82 : operator=(const SpeechRecognitionErrorInit& aOther);
83 :
84 : private:
85 : static bool
86 : InitIds(JSContext* cx, SpeechRecognitionErrorInitAtoms* atomsCache);
87 : };
88 :
89 : namespace binding_detail {
90 0 : struct FastSpeechRecognitionErrorInit : public SpeechRecognitionErrorInit
91 : {
92 0 : inline FastSpeechRecognitionErrorInit()
93 0 : : SpeechRecognitionErrorInit(FastDictionaryInitializer())
94 : {
95 : // Doesn't matter what int we pass to the parent constructor
96 0 : }
97 : };
98 : } // namespace binding_detail
99 :
100 :
101 : namespace SpeechRecognitionErrorBinding {
102 :
103 : typedef mozilla::dom::SpeechRecognitionError NativeType;
104 :
105 : bool
106 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
107 :
108 : JSObject*
109 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
110 :
111 : const JSClass*
112 : GetJSClass();
113 :
114 : bool
115 : Wrap(JSContext* aCx, mozilla::dom::SpeechRecognitionError* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
116 :
117 : template <class T>
118 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
119 : {
120 0 : JS::Rooted<JSObject*> reflector(aCx);
121 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
122 : }
123 :
124 : // We declare this as an array so that retrieving a pointer to this
125 : // binding's property hooks only requires compile/link-time resolvable
126 : // address arithmetic. Declaring it as a pointer instead would require
127 : // doing a run-time load to fetch a pointer to this binding's property
128 : // hooks. And then structures which embedded a pointer to this structure
129 : // would require a run-time load for proper initialization, which would
130 : // then induce static constructors. Lots of static constructors.
131 : extern const NativePropertyHooks sNativePropertyHooks[];
132 :
133 : void
134 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
135 :
136 : JS::Handle<JSObject*>
137 : GetProtoObjectHandle(JSContext* aCx);
138 :
139 : JS::Handle<JSObject*>
140 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
141 :
142 : JSObject*
143 : GetConstructorObject(JSContext* aCx);
144 :
145 : } // namespace SpeechRecognitionErrorBinding
146 :
147 :
148 :
149 : } // namespace dom
150 : } // namespace mozilla
151 :
152 : #endif // mozilla_dom_SpeechRecognitionErrorBinding_h
|