Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM SpeechRecognitionEvent.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_SpeechRecognitionEventBinding_h
4 : #define mozilla_dom_SpeechRecognitionEventBinding_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 : #include "mozilla/dom/SpeechRecognitionResultList.h"
13 : #include "nsIDocument.h"
14 :
15 : class nsIDocument;
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 : struct NativePropertyHooks;
21 : class ProtoAndIfaceCache;
22 : class SpeechRecognitionEvent;
23 : struct SpeechRecognitionEventAtoms;
24 : struct SpeechRecognitionEventInitAtoms;
25 : class SpeechRecognitionResultList;
26 :
27 : } // namespace dom
28 : } // namespace mozilla
29 :
30 : namespace mozilla {
31 : namespace dom {
32 :
33 0 : struct SpeechRecognitionEventInit : public EventInit
34 : {
35 : MOZ_INIT_OUTSIDE_CTOR RefPtr<nsIDocument> mEmma;
36 : MOZ_INIT_OUTSIDE_CTOR JS::Value mInterpretation;
37 : MOZ_INIT_OUTSIDE_CTOR uint32_t mResultIndex;
38 : MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::dom::SpeechRecognitionResultList> mResults;
39 :
40 : SpeechRecognitionEventInit();
41 :
42 0 : explicit inline SpeechRecognitionEventInit(const FastDictionaryInitializer& )
43 0 : : EventInit(FastDictionaryInitializer()),
44 0 : mInterpretation(JS::UndefinedValue())
45 : {
46 : // Do nothing here; this is used by our "Fast" subclass
47 0 : }
48 :
49 : private:
50 : SpeechRecognitionEventInit(const SpeechRecognitionEventInit&) = delete;
51 : SpeechRecognitionEventInit& operator=(const SpeechRecognitionEventInit&) = delete;
52 :
53 : static bool
54 : InitIds(JSContext* cx, SpeechRecognitionEventInitAtoms* atomsCache);
55 :
56 : public:
57 : bool
58 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
59 :
60 : bool
61 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
62 :
63 : void
64 : TraceDictionary(JSTracer* trc);
65 : };
66 :
67 : namespace binding_detail {
68 0 : struct FastSpeechRecognitionEventInit : public SpeechRecognitionEventInit
69 : {
70 0 : inline FastSpeechRecognitionEventInit()
71 0 : : SpeechRecognitionEventInit(FastDictionaryInitializer())
72 : {
73 : // Doesn't matter what int we pass to the parent constructor
74 0 : }
75 : };
76 : } // namespace binding_detail
77 :
78 :
79 : namespace SpeechRecognitionEventBinding {
80 :
81 : typedef mozilla::dom::SpeechRecognitionEvent NativeType;
82 :
83 : bool
84 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
85 :
86 : JSObject*
87 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
88 :
89 : const JSClass*
90 : GetJSClass();
91 :
92 : bool
93 : Wrap(JSContext* aCx, mozilla::dom::SpeechRecognitionEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
94 :
95 : template <class T>
96 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
97 : {
98 0 : JS::Rooted<JSObject*> reflector(aCx);
99 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
100 : }
101 :
102 : // We declare this as an array so that retrieving a pointer to this
103 : // binding's property hooks only requires compile/link-time resolvable
104 : // address arithmetic. Declaring it as a pointer instead would require
105 : // doing a run-time load to fetch a pointer to this binding's property
106 : // hooks. And then structures which embedded a pointer to this structure
107 : // would require a run-time load for proper initialization, which would
108 : // then induce static constructors. Lots of static constructors.
109 : extern const NativePropertyHooks sNativePropertyHooks[];
110 :
111 : void
112 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
113 :
114 : JS::Handle<JSObject*>
115 : GetProtoObjectHandle(JSContext* aCx);
116 :
117 : JS::Handle<JSObject*>
118 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
119 :
120 : JSObject*
121 : GetConstructorObject(JSContext* aCx);
122 :
123 : } // namespace SpeechRecognitionEventBinding
124 :
125 :
126 :
127 : } // namespace dom
128 : } // namespace mozilla
129 :
130 : #endif // mozilla_dom_SpeechRecognitionEventBinding_h
|