Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM IntlUtils.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_IntlUtilsBinding_h
4 : #define mozilla_dom_IntlUtilsBinding_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 : #include "mozilla/dom/Record.h"
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : struct DisplayNameOptionsAtoms;
17 : struct DisplayNameResultAtoms;
18 : class IntlUtils;
19 : struct IntlUtilsAtoms;
20 : struct LocaleInfoAtoms;
21 : struct NativePropertyHooks;
22 : class ProtoAndIfaceCache;
23 :
24 : } // namespace dom
25 : } // namespace mozilla
26 :
27 : namespace mozilla {
28 : namespace dom {
29 :
30 0 : struct DisplayNameOptions : public DictionaryBase
31 : {
32 : MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mKeys;
33 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mStyle;
34 :
35 : DisplayNameOptions();
36 :
37 0 : explicit inline DisplayNameOptions(const FastDictionaryInitializer& )
38 0 : {
39 : // Do nothing here; this is used by our "Fast" subclass
40 0 : }
41 :
42 : explicit inline DisplayNameOptions(const DisplayNameOptions& aOther)
43 : {
44 : *this = aOther;
45 : }
46 :
47 : bool
48 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
49 :
50 : bool
51 : Init(const nsAString& aJSON);
52 :
53 : bool
54 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
55 :
56 : bool
57 : ToJSON(nsAString& aJSON) const;
58 :
59 : void
60 : TraceDictionary(JSTracer* trc);
61 :
62 : DisplayNameOptions&
63 : operator=(const DisplayNameOptions& aOther);
64 :
65 : private:
66 : static bool
67 : InitIds(JSContext* cx, DisplayNameOptionsAtoms* atomsCache);
68 : };
69 :
70 : namespace binding_detail {
71 0 : struct FastDisplayNameOptions : public DisplayNameOptions
72 : {
73 0 : inline FastDisplayNameOptions()
74 0 : : DisplayNameOptions(FastDictionaryInitializer())
75 : {
76 : // Doesn't matter what int we pass to the parent constructor
77 0 : }
78 : };
79 : } // namespace binding_detail
80 :
81 :
82 0 : struct DisplayNameResult : public DictionaryBase
83 : {
84 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mLocale;
85 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mStyle;
86 : MOZ_INIT_OUTSIDE_CTOR Optional<Record<nsString, nsString>> mValues;
87 :
88 : DisplayNameResult();
89 :
90 : explicit inline DisplayNameResult(const FastDictionaryInitializer& )
91 : {
92 : // Do nothing here; this is used by our "Fast" subclass
93 : }
94 :
95 : private:
96 : DisplayNameResult(const DisplayNameResult&) = delete;
97 : DisplayNameResult& operator=(const DisplayNameResult&) = delete;
98 :
99 : static bool
100 : InitIds(JSContext* cx, DisplayNameResultAtoms* atomsCache);
101 :
102 : public:
103 : bool
104 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
105 :
106 : bool
107 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
108 :
109 : void
110 : TraceDictionary(JSTracer* trc);
111 : };
112 :
113 : namespace binding_detail {
114 : struct FastDisplayNameResult : public DisplayNameResult
115 : {
116 : inline FastDisplayNameResult()
117 : : DisplayNameResult(FastDictionaryInitializer())
118 : {
119 : // Doesn't matter what int we pass to the parent constructor
120 : }
121 : };
122 : } // namespace binding_detail
123 :
124 :
125 0 : struct LocaleInfo : public DictionaryBase
126 : {
127 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mDirection;
128 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mLocale;
129 :
130 : LocaleInfo();
131 :
132 : explicit inline LocaleInfo(const FastDictionaryInitializer& )
133 : {
134 : // Do nothing here; this is used by our "Fast" subclass
135 : }
136 :
137 : explicit inline LocaleInfo(const LocaleInfo& aOther)
138 : {
139 : *this = aOther;
140 : }
141 :
142 : bool
143 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
144 :
145 : bool
146 : Init(const nsAString& aJSON);
147 :
148 : bool
149 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
150 :
151 : bool
152 : ToJSON(nsAString& aJSON) const;
153 :
154 : void
155 : TraceDictionary(JSTracer* trc);
156 :
157 : LocaleInfo&
158 : operator=(const LocaleInfo& aOther);
159 :
160 : private:
161 : static bool
162 : InitIds(JSContext* cx, LocaleInfoAtoms* atomsCache);
163 : };
164 :
165 : namespace binding_detail {
166 : struct FastLocaleInfo : public LocaleInfo
167 : {
168 : inline FastLocaleInfo()
169 : : LocaleInfo(FastDictionaryInitializer())
170 : {
171 : // Doesn't matter what int we pass to the parent constructor
172 : }
173 : };
174 : } // namespace binding_detail
175 :
176 :
177 : namespace IntlUtilsBinding {
178 :
179 : typedef mozilla::dom::IntlUtils NativeType;
180 :
181 : const JSClass*
182 : GetJSClass();
183 :
184 : bool
185 : Wrap(JSContext* aCx, mozilla::dom::IntlUtils* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
186 :
187 : template <class T>
188 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
189 : {
190 0 : JS::Rooted<JSObject*> reflector(aCx);
191 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
192 : }
193 :
194 : // We declare this as an array so that retrieving a pointer to this
195 : // binding's property hooks only requires compile/link-time resolvable
196 : // address arithmetic. Declaring it as a pointer instead would require
197 : // doing a run-time load to fetch a pointer to this binding's property
198 : // hooks. And then structures which embedded a pointer to this structure
199 : // would require a run-time load for proper initialization, which would
200 : // then induce static constructors. Lots of static constructors.
201 : extern const NativePropertyHooks sNativePropertyHooks[];
202 :
203 : void
204 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
205 :
206 : JS::Handle<JSObject*>
207 : GetProtoObjectHandle(JSContext* aCx);
208 :
209 : } // namespace IntlUtilsBinding
210 :
211 :
212 :
213 : } // namespace dom
214 : } // namespace mozilla
215 :
216 : #endif // mozilla_dom_IntlUtilsBinding_h
|