Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM NetworkInformation.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_NetworkInformationBinding_h
4 : #define mozilla_dom_NetworkInformationBinding_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 :
18 : namespace network {
19 :
20 : class Connection;
21 : struct ConnectionAtoms;
22 :
23 : } // namespace network
24 :
25 : } // namespace dom
26 : } // namespace mozilla
27 :
28 : namespace mozilla {
29 : namespace dom {
30 :
31 : enum class ConnectionType : uint8_t {
32 : Cellular,
33 : Bluetooth,
34 : Ethernet,
35 : Wifi,
36 : Other,
37 : None,
38 : Unknown,
39 : EndGuard_
40 : };
41 :
42 : namespace ConnectionTypeValues {
43 : extern const EnumEntry strings[8];
44 : } // namespace ConnectionTypeValues
45 :
46 : bool
47 : ToJSValue(JSContext* aCx, ConnectionType aArgument, JS::MutableHandle<JS::Value> aValue);
48 :
49 :
50 : namespace NetworkInformationBinding {
51 :
52 : typedef mozilla::dom::network::Connection NativeType;
53 :
54 : bool
55 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
56 :
57 : JSObject*
58 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
59 :
60 : const JSClass*
61 : GetJSClass();
62 :
63 : bool
64 : Wrap(JSContext* aCx, mozilla::dom::network::Connection* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
65 :
66 : template <class T>
67 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
68 : {
69 0 : JS::Rooted<JSObject*> reflector(aCx);
70 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
71 : }
72 :
73 : // We declare this as an array so that retrieving a pointer to this
74 : // binding's property hooks only requires compile/link-time resolvable
75 : // address arithmetic. Declaring it as a pointer instead would require
76 : // doing a run-time load to fetch a pointer to this binding's property
77 : // hooks. And then structures which embedded a pointer to this structure
78 : // would require a run-time load for proper initialization, which would
79 : // then induce static constructors. Lots of static constructors.
80 : extern const NativePropertyHooks sNativePropertyHooks[];
81 :
82 : void
83 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
84 :
85 : JS::Handle<JSObject*>
86 : GetProtoObjectHandle(JSContext* aCx);
87 :
88 : JS::Handle<JSObject*>
89 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
90 :
91 : JSObject*
92 : GetConstructorObject(JSContext* aCx);
93 :
94 : } // namespace NetworkInformationBinding
95 :
96 :
97 :
98 : } // namespace dom
99 : } // namespace mozilla
100 :
101 : #endif // mozilla_dom_NetworkInformationBinding_h
|