Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM WebExtensionContentScript.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_WebExtensionContentScriptBinding_h
4 : #define mozilla_dom_WebExtensionContentScriptBinding_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/extensions/MatchGlob.h"
12 : #include "mozilla/extensions/MatchPattern.h"
13 :
14 : namespace mozilla {
15 :
16 : namespace dom {
17 :
18 : struct NativePropertyHooks;
19 : class ProtoAndIfaceCache;
20 : struct WebExtensionContentScriptInitAtoms;
21 :
22 : } // namespace dom
23 :
24 : namespace extensions {
25 :
26 : class MatchGlob;
27 : class MatchPatternSet;
28 : class WebExtensionContentScript;
29 : struct WebExtensionContentScriptAtoms;
30 :
31 : } // namespace extensions
32 :
33 : } // namespace mozilla
34 :
35 : namespace mozilla {
36 : namespace dom {
37 :
38 : enum class ContentScriptRunAt : uint8_t {
39 : Document_start,
40 : Document_end,
41 : Document_idle,
42 : EndGuard_
43 : };
44 :
45 : namespace ContentScriptRunAtValues {
46 : extern const EnumEntry strings[4];
47 : } // namespace ContentScriptRunAtValues
48 :
49 : bool
50 : ToJSValue(JSContext* aCx, ContentScriptRunAt aArgument, JS::MutableHandle<JS::Value> aValue);
51 :
52 :
53 0 : struct WebExtensionContentScriptInit : public DictionaryBase
54 : {
55 : MOZ_INIT_OUTSIDE_CTOR bool mAllFrames;
56 : MOZ_INIT_OUTSIDE_CTOR Sequence<nsString> mCssPaths;
57 : MOZ_INIT_OUTSIDE_CTOR Nullable<Sequence<OwningNonNull<mozilla::extensions::MatchGlob>>> mExcludeGlobs;
58 : MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::extensions::MatchPatternSet> mExcludeMatches;
59 : MOZ_INIT_OUTSIDE_CTOR Nullable<uint64_t> mFrameID;
60 : MOZ_INIT_OUTSIDE_CTOR Nullable<Sequence<OwningNonNull<mozilla::extensions::MatchGlob>>> mIncludeGlobs;
61 : MOZ_INIT_OUTSIDE_CTOR Sequence<nsString> mJsPaths;
62 : MOZ_INIT_OUTSIDE_CTOR bool mMatchAboutBlank;
63 : MOZ_INIT_OUTSIDE_CTOR OwningNonNull<mozilla::extensions::MatchPatternSet> mMatches;
64 : MOZ_INIT_OUTSIDE_CTOR ContentScriptRunAt mRunAt;
65 :
66 : WebExtensionContentScriptInit();
67 :
68 0 : explicit inline WebExtensionContentScriptInit(const FastDictionaryInitializer& )
69 0 : {
70 : // Do nothing here; this is used by our "Fast" subclass
71 0 : }
72 :
73 : explicit inline WebExtensionContentScriptInit(const WebExtensionContentScriptInit& aOther)
74 : {
75 : *this = aOther;
76 : }
77 :
78 : bool
79 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
80 :
81 : bool
82 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
83 :
84 : void
85 : TraceDictionary(JSTracer* trc);
86 :
87 : WebExtensionContentScriptInit&
88 : operator=(const WebExtensionContentScriptInit& aOther);
89 :
90 : private:
91 : static bool
92 : InitIds(JSContext* cx, WebExtensionContentScriptInitAtoms* atomsCache);
93 : };
94 :
95 : namespace binding_detail {
96 0 : struct FastWebExtensionContentScriptInit : public WebExtensionContentScriptInit
97 : {
98 0 : inline FastWebExtensionContentScriptInit()
99 0 : : WebExtensionContentScriptInit(FastDictionaryInitializer())
100 : {
101 : // Doesn't matter what int we pass to the parent constructor
102 0 : }
103 : };
104 : } // namespace binding_detail
105 :
106 :
107 : namespace WebExtensionContentScriptBinding {
108 :
109 : typedef mozilla::extensions::WebExtensionContentScript NativeType;
110 :
111 : bool
112 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
113 :
114 : const JSClass*
115 : GetJSClass();
116 :
117 : bool
118 : Wrap(JSContext* aCx, mozilla::extensions::WebExtensionContentScript* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
119 :
120 : template <class T>
121 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
122 : {
123 0 : JS::Rooted<JSObject*> reflector(aCx);
124 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
125 : }
126 :
127 : void
128 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
129 :
130 : JS::Handle<JSObject*>
131 : GetProtoObjectHandle(JSContext* aCx);
132 :
133 : JS::Handle<JSObject*>
134 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
135 :
136 : JSObject*
137 : GetConstructorObject(JSContext* aCx);
138 :
139 : } // namespace WebExtensionContentScriptBinding
140 :
141 :
142 :
143 : } // namespace dom
144 : } // namespace mozilla
145 :
146 : #endif // mozilla_dom_WebExtensionContentScriptBinding_h
|