Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM RTCDTMFSender.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_RTCDTMFSenderBinding_h
4 : #define mozilla_dom_RTCDTMFSenderBinding_h
5 :
6 : #include "js/RootingAPI.h"
7 : #include "jspubtd.h"
8 : #include "mozilla/DOMEventTargetHelper.h"
9 : #include "mozilla/ErrorResult.h"
10 : #include "mozilla/dom/BindingDeclarations.h"
11 : #include "mozilla/dom/CallbackInterface.h"
12 : #include "mozilla/dom/Nullable.h"
13 : #include "mozilla/dom/ToJSValue.h"
14 : #include "nsWeakReference.h"
15 :
16 : namespace mozilla {
17 : namespace dom {
18 :
19 : class EventHandlerNonNull;
20 : struct NativePropertyHooks;
21 : class ProtoAndIfaceCache;
22 : class RTCDTMFSender;
23 : struct RTCDTMFSenderAtoms;
24 :
25 : } // namespace dom
26 : } // namespace mozilla
27 :
28 : namespace mozilla {
29 : namespace dom {
30 :
31 : namespace RTCDTMFSenderBinding {
32 :
33 : typedef mozilla::dom::RTCDTMFSender 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::RTCDTMFSender* 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 RTCDTMFSenderBinding
73 :
74 :
75 :
76 0 : class RTCDTMFSenderJSImpl : public CallbackInterface
77 : {
78 : public:
79 0 : explicit inline RTCDTMFSenderJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
80 0 : : CallbackInterface(aCx, aCallback, aIncumbentGlobal)
81 : {
82 0 : }
83 :
84 : explicit inline RTCDTMFSenderJSImpl(JS::Handle<JSObject*> aCallback, const FastCallbackConstructor& )
85 : : CallbackInterface(aCallback, FastCallbackConstructor())
86 : {
87 : }
88 :
89 : explicit inline RTCDTMFSenderJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
90 : : CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
91 : {
92 : }
93 :
94 : void InsertDTMF(const nsAString& tones, uint32_t duration, uint32_t interToneGap, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
95 :
96 : inline bool
97 : operator==(const RTCDTMFSenderJSImpl& aOther) const
98 : {
99 : return CallbackInterface::operator==(aOther);
100 : }
101 :
102 : already_AddRefed<EventHandlerNonNull> GetOntonechange(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
103 :
104 : void GetToneBuffer(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
105 :
106 : void SetOntonechange(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
107 :
108 : private:
109 : static bool
110 : InitIds(JSContext* cx, RTCDTMFSenderAtoms* atomsCache);
111 : };
112 :
113 :
114 : class RTCDTMFSender final : public mozilla::DOMEventTargetHelper
115 : {
116 : public:
117 : NS_DECL_ISUPPORTS_INHERITED
118 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCDTMFSender, mozilla::DOMEventTargetHelper)
119 :
120 : private:
121 : RefPtr<RTCDTMFSenderJSImpl> mImpl;
122 : nsCOMPtr<nsISupports> mParent;
123 :
124 : public:
125 : RTCDTMFSender(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
126 :
127 : private:
128 : ~RTCDTMFSender();
129 :
130 : public:
131 : nsISupports* GetParentObject() const;
132 :
133 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
134 :
135 : void InsertDTMF(const nsAString& tones, uint32_t duration, uint32_t interToneGap, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
136 :
137 : already_AddRefed<EventHandlerNonNull> GetOntonechange(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
138 :
139 : void SetOntonechange(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
140 :
141 : void GetToneBuffer(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
142 :
143 : static bool
144 : _Create(JSContext* cx, unsigned argc, JS::Value* vp);
145 : };
146 :
147 :
148 : } // namespace dom
149 : } // namespace mozilla
150 :
151 : #endif // mozilla_dom_RTCDTMFSenderBinding_h
|