1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
use super::*;
/// The SpeechSynthesisUtterance class.
/// [`SpeechSynthesisUtterance`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct SpeechSynthesisUtterance {
inner: EventTarget,
}
impl FromVal for SpeechSynthesisUtterance {
fn from_val(v: &Any) -> Self {
SpeechSynthesisUtterance {
inner: EventTarget::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for SpeechSynthesisUtterance {
type Target = EventTarget;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for SpeechSynthesisUtterance {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for SpeechSynthesisUtterance {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for SpeechSynthesisUtterance {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<SpeechSynthesisUtterance> for Any {
fn from(s: SpeechSynthesisUtterance) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&SpeechSynthesisUtterance> for Any {
fn from(s: &SpeechSynthesisUtterance) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(SpeechSynthesisUtterance);
impl SpeechSynthesisUtterance {
/// Getter of the `text` attribute.
/// [`SpeechSynthesisUtterance.text`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/text)
pub fn text(&self) -> JsString {
self.inner.get("text").as_::<JsString>()
}
/// Setter of the `text` attribute.
/// [`SpeechSynthesisUtterance.text`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/text)
pub fn set_text(&mut self, value: &JsString) {
self.inner.set("text", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `lang` attribute.
/// [`SpeechSynthesisUtterance.lang`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/lang)
pub fn lang(&self) -> JsString {
self.inner.get("lang").as_::<JsString>()
}
/// Setter of the `lang` attribute.
/// [`SpeechSynthesisUtterance.lang`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/lang)
pub fn set_lang(&mut self, value: &JsString) {
self.inner.set("lang", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `voice` attribute.
/// [`SpeechSynthesisUtterance.voice`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/voice)
pub fn voice(&self) -> SpeechSynthesisVoice {
self.inner.get("voice").as_::<SpeechSynthesisVoice>()
}
/// Setter of the `voice` attribute.
/// [`SpeechSynthesisUtterance.voice`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/voice)
pub fn set_voice(&mut self, value: &SpeechSynthesisVoice) {
self.inner.set("voice", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `volume` attribute.
/// [`SpeechSynthesisUtterance.volume`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/volume)
pub fn volume(&self) -> f32 {
self.inner.get("volume").as_::<f32>()
}
/// Setter of the `volume` attribute.
/// [`SpeechSynthesisUtterance.volume`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/volume)
pub fn set_volume(&mut self, value: f32) {
self.inner.set("volume", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `rate` attribute.
/// [`SpeechSynthesisUtterance.rate`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/rate)
pub fn rate(&self) -> f32 {
self.inner.get("rate").as_::<f32>()
}
/// Setter of the `rate` attribute.
/// [`SpeechSynthesisUtterance.rate`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/rate)
pub fn set_rate(&mut self, value: f32) {
self.inner.set("rate", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `pitch` attribute.
/// [`SpeechSynthesisUtterance.pitch`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/pitch)
pub fn pitch(&self) -> f32 {
self.inner.get("pitch").as_::<f32>()
}
/// Setter of the `pitch` attribute.
/// [`SpeechSynthesisUtterance.pitch`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/pitch)
pub fn set_pitch(&mut self, value: f32) {
self.inner.set("pitch", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onstart` attribute.
/// [`SpeechSynthesisUtterance.onstart`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onstart)
pub fn onstart(&self) -> Any {
self.inner.get("onstart").as_::<Any>()
}
/// Setter of the `onstart` attribute.
/// [`SpeechSynthesisUtterance.onstart`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onstart)
pub fn set_onstart(&mut self, value: &Any) {
self.inner.set("onstart", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onend` attribute.
/// [`SpeechSynthesisUtterance.onend`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onend)
pub fn onend(&self) -> Any {
self.inner.get("onend").as_::<Any>()
}
/// Setter of the `onend` attribute.
/// [`SpeechSynthesisUtterance.onend`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onend)
pub fn set_onend(&mut self, value: &Any) {
self.inner.set("onend", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onerror` attribute.
/// [`SpeechSynthesisUtterance.onerror`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onerror)
pub fn onerror(&self) -> Any {
self.inner.get("onerror").as_::<Any>()
}
/// Setter of the `onerror` attribute.
/// [`SpeechSynthesisUtterance.onerror`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onerror)
pub fn set_onerror(&mut self, value: &Any) {
self.inner.set("onerror", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onpause` attribute.
/// [`SpeechSynthesisUtterance.onpause`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onpause)
pub fn onpause(&self) -> Any {
self.inner.get("onpause").as_::<Any>()
}
/// Setter of the `onpause` attribute.
/// [`SpeechSynthesisUtterance.onpause`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onpause)
pub fn set_onpause(&mut self, value: &Any) {
self.inner.set("onpause", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onresume` attribute.
/// [`SpeechSynthesisUtterance.onresume`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onresume)
pub fn onresume(&self) -> Any {
self.inner.get("onresume").as_::<Any>()
}
/// Setter of the `onresume` attribute.
/// [`SpeechSynthesisUtterance.onresume`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onresume)
pub fn set_onresume(&mut self, value: &Any) {
self.inner.set("onresume", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onmark` attribute.
/// [`SpeechSynthesisUtterance.onmark`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onmark)
pub fn onmark(&self) -> Any {
self.inner.get("onmark").as_::<Any>()
}
/// Setter of the `onmark` attribute.
/// [`SpeechSynthesisUtterance.onmark`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onmark)
pub fn set_onmark(&mut self, value: &Any) {
self.inner.set("onmark", value);
}
}
impl SpeechSynthesisUtterance {
/// Getter of the `onboundary` attribute.
/// [`SpeechSynthesisUtterance.onboundary`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onboundary)
pub fn onboundary(&self) -> Any {
self.inner.get("onboundary").as_::<Any>()
}
/// Setter of the `onboundary` attribute.
/// [`SpeechSynthesisUtterance.onboundary`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/onboundary)
pub fn set_onboundary(&mut self, value: &Any) {
self.inner.set("onboundary", value);
}
}
impl SpeechSynthesisUtterance {
/// The `new SpeechSynthesisUtterance(..)` constructor, creating a new SpeechSynthesisUtterance instance
pub fn new() -> SpeechSynthesisUtterance {
Self {
inner: Any::global("SpeechSynthesisUtterance")
.new(&[])
.as_::<EventTarget>(),
}
}
}
impl SpeechSynthesisUtterance {
/// The `new SpeechSynthesisUtterance(..)` constructor, creating a new SpeechSynthesisUtterance instance
pub fn new_with_text(text: &JsString) -> SpeechSynthesisUtterance {
Self {
inner: Any::global("SpeechSynthesisUtterance")
.new(&[text.into()])
.as_::<EventTarget>(),
}
}
}