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