001package react4j.dom.proptypes.html;
002
003import javax.annotation.Nonnull;
004import javax.annotation.Nullable;
005import jsinterop.annotations.JsOverlay;
006import jsinterop.annotations.JsPackage;
007import jsinterop.annotations.JsType;
008import react4j.dom.events.DragEventHandler;
009import react4j.dom.events.FocusEventHandler;
010import react4j.dom.events.KeyboardEventHandler;
011import react4j.dom.events.MouseEventHandler;
012import react4j.dom.events.TouchEventHandler;
013import react4j.dom.proptypes.html.attributeTypes.AudioPreload;
014
015/**
016 * Props for audio elements. Refer to http://www.w3schools.com/tags/tag_audio.asp
017 */
018@JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" )
019public class AudioProps
020  extends HtmlGlobalFields<AudioProps>
021{
022  @JsOverlay
023  @Nonnull
024  public final AudioProps autoPlay()
025  {
026    return autoPlay( true );
027  }
028
029  @JsOverlay
030  @Nonnull
031  public final AudioProps autoPlay( boolean b )
032  {
033    setAutoPlay( b );
034    return self();
035  }
036
037  @JsOverlay
038  @Nonnull
039  public final AudioProps controls()
040  {
041    return controls( true );
042  }
043
044  @JsOverlay
045  @Nonnull
046  public final AudioProps controls( boolean b )
047  {
048    setControls( b );
049    return self();
050  }
051
052  @JsOverlay
053  @Nonnull
054  public final AudioProps loop()
055  {
056    return loop( true );
057  }
058
059  @JsOverlay
060  @Nonnull
061  public final AudioProps loop( boolean b )
062  {
063    setLoop( b );
064    return self();
065  }
066
067  @JsOverlay
068  @Nonnull
069  public final AudioProps muted()
070  {
071    return muted( true );
072  }
073
074  @JsOverlay
075  @Nonnull
076  public final AudioProps muted( boolean b )
077  {
078    setMuted( b );
079    return self();
080  }
081
082  @JsOverlay
083  @Nonnull
084  public final AudioProps preLoad( @Nonnull @AudioPreload final String value )
085  {
086    setPreload( value );
087    return self();
088  }
089
090  @JsOverlay
091  @Nonnull
092  public final AudioProps src( String s )
093  {
094    setSrc( s );
095    return self();
096  }
097
098  //Applicable Event Handlers
099
100  // Focus Events
101  @JsOverlay
102  @Nonnull
103  public final AudioProps onBlur( @Nullable final FocusEventHandler handler )
104  {
105    setOnBlur( handler );
106    return self();
107  }
108
109  @JsOverlay
110  @Nonnull
111  public final AudioProps onFocus( @Nullable final FocusEventHandler handler )
112  {
113    setOnFocus( handler );
114    return self();
115  }
116
117  // Keyboard Events
118  @JsOverlay
119  @Nonnull
120  public final AudioProps onKeyDown( @Nullable final KeyboardEventHandler handler )
121  {
122    setOnKeyDown( handler );
123    return self();
124  }
125
126  @JsOverlay
127  @Nonnull
128  public final AudioProps onKeyPress( @Nullable final KeyboardEventHandler handler )
129  {
130    setOnKeyPress( handler );
131    return self();
132  }
133
134  @JsOverlay
135  @Nonnull
136  public final AudioProps onKeyUp( @Nullable final KeyboardEventHandler handler )
137  {
138    setOnKeyUp( handler );
139    return self();
140  }
141
142  @JsOverlay
143  @Nonnull
144  public final AudioProps onClick( @Nullable final MouseEventHandler handler )
145  {
146    setOnClick( handler );
147    return self();
148  }
149
150  @JsOverlay
151  @Nonnull
152  public final AudioProps onContextMenu( @Nullable final MouseEventHandler handler )
153  {
154    setOnContextMenu( handler );
155    return self();
156  }
157
158  @JsOverlay
159  @Nonnull
160  public final AudioProps onDoubleClick( @Nullable final MouseEventHandler handler )
161  {
162    setOnDoubleClick( handler );
163    return self();
164  }
165
166  @JsOverlay
167  @Nonnull
168  public final AudioProps onDrag( @Nullable final DragEventHandler handler )
169  {
170    setOnDrag( handler );
171    return self();
172  }
173
174  @JsOverlay
175  @Nonnull
176  public final AudioProps onDragEnd( @Nullable final DragEventHandler handler )
177  {
178    setOnDragEnd( handler );
179    return self();
180  }
181
182  @JsOverlay
183  @Nonnull
184  public final AudioProps onDragEnter( @Nullable final DragEventHandler handler )
185  {
186    setOnDragEnter( handler );
187    return self();
188  }
189
190  @JsOverlay
191  @Nonnull
192  public final AudioProps onDragExit( @Nullable final DragEventHandler handler )
193  {
194    setOnDragExit( handler );
195    return self();
196  }
197
198  @JsOverlay
199  @Nonnull
200  public final AudioProps onDragLeave( @Nullable final DragEventHandler handler )
201  {
202    setOnDragLeave( handler );
203    return self();
204  }
205
206  @JsOverlay
207  @Nonnull
208  public final AudioProps onDragOver( @Nullable final DragEventHandler handler )
209  {
210    setOnDragOver( handler );
211    return self();
212  }
213
214  @JsOverlay
215  @Nonnull
216  public final AudioProps onDragStart( @Nullable final DragEventHandler handler )
217  {
218    setOnDragStart( handler );
219    return self();
220  }
221
222  @JsOverlay
223  @Nonnull
224  public final AudioProps onDrop( @Nullable final DragEventHandler handler )
225  {
226    setOnDrop( handler );
227    return self();
228  }
229
230  @JsOverlay
231  @Nonnull
232  public final AudioProps onMouseDown( @Nullable final MouseEventHandler handler )
233  {
234    setOnMouseDown( handler );
235    return self();
236  }
237
238  @JsOverlay
239  @Nonnull
240  public final AudioProps onMouseEnter( @Nullable final MouseEventHandler handler )
241  {
242    setOnMouseEnter( handler );
243    return self();
244  }
245
246  @JsOverlay
247  @Nonnull
248  public final AudioProps onMouseLeave( @Nullable final MouseEventHandler handler )
249  {
250    setOnMouseLeave( handler );
251    return self();
252  }
253
254  @JsOverlay
255  @Nonnull
256  public final AudioProps onMouseMove( @Nullable final MouseEventHandler handler )
257  {
258    setOnMouseMove( handler );
259    return self();
260  }
261
262  @JsOverlay
263  @Nonnull
264  public final AudioProps onMouseOut( @Nullable final MouseEventHandler handler )
265  {
266    setOnMouseOut( handler );
267    return self();
268  }
269
270  @JsOverlay
271  @Nonnull
272  public final AudioProps onMouseOver( @Nullable final MouseEventHandler handler )
273  {
274    setOnMouseOver( handler );
275    return self();
276  }
277
278  @JsOverlay
279  @Nonnull
280  public final AudioProps onMouseUp( @Nullable final MouseEventHandler handler )
281  {
282    setOnMouseUp( handler );
283    return self();
284  }
285
286  // Touch Events
287  @JsOverlay
288  @Nonnull
289  public final AudioProps onTouchCancel( @Nullable final TouchEventHandler handler )
290  {
291    setOnTouchCancel( handler );
292    return self();
293  }
294
295  @JsOverlay
296  @Nonnull
297  public final AudioProps onTouchEnd( @Nullable final TouchEventHandler handler )
298  {
299    setOnTouchEnd( handler );
300    return self();
301  }
302
303  @JsOverlay
304  @Nonnull
305  public final AudioProps onTouchMove( @Nullable final TouchEventHandler handler )
306  {
307    setOnTouchMove( handler );
308    return self();
309  }
310
311  @JsOverlay
312  @Nonnull
313  public final AudioProps onTouchStart( @Nullable final TouchEventHandler handler )
314  {
315    setOnTouchStart( handler );
316    return self();
317  }
318}