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