Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM BatteryManager.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_BatteryManagerBinding_h
4 : #define mozilla_dom_BatteryManagerBinding_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 battery {
19 :
20 : class BatteryManager;
21 : struct BatteryManagerAtoms;
22 :
23 : } // namespace battery
24 :
25 : } // namespace dom
26 : } // namespace mozilla
27 :
28 : namespace mozilla {
29 : namespace dom {
30 :
31 : namespace BatteryManagerBinding {
32 :
33 : typedef mozilla::dom::battery::BatteryManager NativeType;
34 :
35 : JSObject*
36 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
37 :
38 : const JSClass*
39 : GetJSClass();
40 :
41 : bool
42 : Wrap(JSContext* aCx, mozilla::dom::battery::BatteryManager* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
43 :
44 : template <class T>
45 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
46 : {
47 0 : JS::Rooted<JSObject*> reflector(aCx);
48 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
49 : }
50 :
51 : // We declare this as an array so that retrieving a pointer to this
52 : // binding's property hooks only requires compile/link-time resolvable
53 : // address arithmetic. Declaring it as a pointer instead would require
54 : // doing a run-time load to fetch a pointer to this binding's property
55 : // hooks. And then structures which embedded a pointer to this structure
56 : // would require a run-time load for proper initialization, which would
57 : // then induce static constructors. Lots of static constructors.
58 : extern const NativePropertyHooks sNativePropertyHooks[];
59 :
60 : void
61 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
62 :
63 : JS::Handle<JSObject*>
64 : GetProtoObjectHandle(JSContext* aCx);
65 :
66 : JS::Handle<JSObject*>
67 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
68 :
69 : JSObject*
70 : GetConstructorObject(JSContext* aCx);
71 :
72 : } // namespace BatteryManagerBinding
73 :
74 :
75 :
76 : } // namespace dom
77 : } // namespace mozilla
78 :
79 : #endif // mozilla_dom_BatteryManagerBinding_h
|