| 
									
										
										
										
											2021-02-03 22:13:12 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2024-10-04 13:19:50 +02:00
										 |  |  |  * Copyright (c) 2021, Andreas Kling <andreas@ladybird.org> | 
					
						
							| 
									
										
										
										
											2021-02-03 22:13:12 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2021-02-03 22:13:12 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-03 22:47:50 +01:00
										 |  |  | #include <AK/Forward.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Forward.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  | #define ENUMERATE_GLOBAL_EVENT_HANDLERS(E)                                    \
 | 
					
						
							|  |  |  |     E(onabort, HTML::EventNames::abort)                                       \ | 
					
						
							|  |  |  |     E(onauxclick, UIEvents::EventNames::auxclick)                             \ | 
					
						
							|  |  |  |     E(onblur, HTML::EventNames::blur)                                         \ | 
					
						
							|  |  |  |     E(oncancel, HTML::EventNames::cancel)                                     \ | 
					
						
							|  |  |  |     E(oncanplay, HTML::EventNames::canplay)                                   \ | 
					
						
							|  |  |  |     E(oncanplaythrough, HTML::EventNames::canplaythrough)                     \ | 
					
						
							|  |  |  |     E(onchange, HTML::EventNames::change)                                     \ | 
					
						
							|  |  |  |     E(onclick, UIEvents::EventNames::click)                                   \ | 
					
						
							|  |  |  |     E(onclose, HTML::EventNames::close)                                       \ | 
					
						
							|  |  |  |     E(oncontextmenu, HTML::EventNames::contextmenu)                           \ | 
					
						
							|  |  |  |     E(oncuechange, HTML::EventNames::cuechange)                               \ | 
					
						
							|  |  |  |     E(ondblclick, UIEvents::EventNames::dblclick)                             \ | 
					
						
							|  |  |  |     E(ondrag, HTML::EventNames::drag)                                         \ | 
					
						
							|  |  |  |     E(ondragend, HTML::EventNames::dragend)                                   \ | 
					
						
							|  |  |  |     E(ondragenter, HTML::EventNames::dragenter)                               \ | 
					
						
							|  |  |  |     E(ondragleave, HTML::EventNames::dragleave)                               \ | 
					
						
							|  |  |  |     E(ondragover, HTML::EventNames::dragover)                                 \ | 
					
						
							|  |  |  |     E(ondragstart, HTML::EventNames::dragstart)                               \ | 
					
						
							|  |  |  |     E(ondrop, HTML::EventNames::drop)                                         \ | 
					
						
							|  |  |  |     E(ondurationchange, HTML::EventNames::durationchange)                     \ | 
					
						
							|  |  |  |     E(onemptied, HTML::EventNames::emptied)                                   \ | 
					
						
							|  |  |  |     E(onended, HTML::EventNames::ended)                                       \ | 
					
						
							|  |  |  |     E(onerror, HTML::EventNames::error)                                       \ | 
					
						
							|  |  |  |     E(onfocus, HTML::EventNames::focus)                                       \ | 
					
						
							| 
									
										
										
										
											2024-02-25 06:51:28 +01:00
										 |  |  |     E(onfocusin, HTML::EventNames::focusin)                                   \ | 
					
						
							|  |  |  |     E(onfocusout, HTML::EventNames::focusout)                                 \ | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  |     E(onformdata, HTML::EventNames::formdata)                                 \ | 
					
						
							| 
									
										
										
										
											2024-11-22 23:58:16 +13:00
										 |  |  |     E(ongotpointercapture, UIEvents::EventNames::gotpointercapture)           \ | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  |     E(oninput, HTML::EventNames::input)                                       \ | 
					
						
							|  |  |  |     E(oninvalid, HTML::EventNames::invalid)                                   \ | 
					
						
							|  |  |  |     E(onkeydown, UIEvents::EventNames::keydown)                               \ | 
					
						
							|  |  |  |     E(onkeypress, UIEvents::EventNames::keypress)                             \ | 
					
						
							|  |  |  |     E(onkeyup, UIEvents::EventNames::keyup)                                   \ | 
					
						
							|  |  |  |     E(onload, HTML::EventNames::load)                                         \ | 
					
						
							|  |  |  |     E(onloadeddata, HTML::EventNames::loadeddata)                             \ | 
					
						
							|  |  |  |     E(onloadedmetadata, HTML::EventNames::loadedmetadata)                     \ | 
					
						
							|  |  |  |     E(onloadstart, HTML::EventNames::loadstart)                               \ | 
					
						
							| 
									
										
										
										
											2024-11-22 23:58:16 +13:00
										 |  |  |     E(onlostpointercapture, UIEvents::EventNames::lostpointercapture)         \ | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  |     E(onmousedown, UIEvents::EventNames::mousedown)                           \ | 
					
						
							|  |  |  |     E(onmouseenter, UIEvents::EventNames::mouseenter)                         \ | 
					
						
							|  |  |  |     E(onmouseleave, UIEvents::EventNames::mouseleave)                         \ | 
					
						
							|  |  |  |     E(onmousemove, UIEvents::EventNames::mousemove)                           \ | 
					
						
							|  |  |  |     E(onmouseout, UIEvents::EventNames::mouseout)                             \ | 
					
						
							|  |  |  |     E(onmouseover, UIEvents::EventNames::mouseover)                           \ | 
					
						
							|  |  |  |     E(onmouseup, UIEvents::EventNames::mouseup)                               \ | 
					
						
							|  |  |  |     E(onpause, HTML::EventNames::pause)                                       \ | 
					
						
							|  |  |  |     E(onplay, HTML::EventNames::play)                                         \ | 
					
						
							|  |  |  |     E(onplaying, HTML::EventNames::playing)                                   \ | 
					
						
							| 
									
										
										
										
											2024-11-22 23:58:16 +13:00
										 |  |  |     E(onpointercancel, UIEvents::EventNames::pointercancel)                   \ | 
					
						
							|  |  |  |     E(onpointerdown, UIEvents::EventNames::pointerdown)                       \ | 
					
						
							|  |  |  |     E(onpointerenter, UIEvents::EventNames::pointerenter)                     \ | 
					
						
							|  |  |  |     E(onpointerleave, UIEvents::EventNames::pointerleave)                     \ | 
					
						
							|  |  |  |     E(onpointermove, UIEvents::EventNames::pointermove)                       \ | 
					
						
							|  |  |  |     E(onpointerout, UIEvents::EventNames::pointerout)                         \ | 
					
						
							|  |  |  |     E(onpointerover, UIEvents::EventNames::pointerover)                       \ | 
					
						
							|  |  |  |     E(onpointerrawupdate, UIEvents::EventNames::pointerrawupdate)             \ | 
					
						
							|  |  |  |     E(onpointerup, UIEvents::EventNames::pointerup)                           \ | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  |     E(onprogress, HTML::EventNames::progress)                                 \ | 
					
						
							|  |  |  |     E(onratechange, HTML::EventNames::ratechange)                             \ | 
					
						
							|  |  |  |     E(onreset, HTML::EventNames::reset)                                       \ | 
					
						
							|  |  |  |     E(onresize, HTML::EventNames::resize)                                     \ | 
					
						
							|  |  |  |     E(onscroll, HTML::EventNames::scroll)                                     \ | 
					
						
							|  |  |  |     E(onsecuritypolicyviolation, HTML::EventNames::securitypolicyviolation)   \ | 
					
						
							|  |  |  |     E(onseeked, HTML::EventNames::seeked)                                     \ | 
					
						
							|  |  |  |     E(onseeking, HTML::EventNames::seeking)                                   \ | 
					
						
							|  |  |  |     E(onselect, HTML::EventNames::select)                                     \ | 
					
						
							| 
									
										
										
										
											2024-02-25 04:20:37 +01:00
										 |  |  |     E(onselectionchange, HTML::EventNames::selectionchange)                   \ | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  |     E(onslotchange, HTML::EventNames::slotchange)                             \ | 
					
						
							|  |  |  |     E(onstalled, HTML::EventNames::stalled)                                   \ | 
					
						
							|  |  |  |     E(onsubmit, HTML::EventNames::submit)                                     \ | 
					
						
							|  |  |  |     E(onsuspend, HTML::EventNames::suspend)                                   \ | 
					
						
							|  |  |  |     E(ontimeupdate, HTML::EventNames::timeupdate)                             \ | 
					
						
							|  |  |  |     E(ontoggle, HTML::EventNames::toggle)                                     \ | 
					
						
							|  |  |  |     E(onvolumechange, HTML::EventNames::volumechange)                         \ | 
					
						
							|  |  |  |     E(onwaiting, HTML::EventNames::waiting)                                   \ | 
					
						
							| 
									
										
										
										
											2023-04-07 11:30:56 +02:00
										 |  |  |     E(onwebkitanimationend, HTML::EventNames::webkitAnimationEnd)             \ | 
					
						
							|  |  |  |     E(onwebkitanimationiteration, HTML::EventNames::webkitAnimationIteration) \ | 
					
						
							|  |  |  |     E(onwebkitanimationstart, HTML::EventNames::webkitAnimationStart)         \ | 
					
						
							|  |  |  |     E(onwebkittransitionend, HTML::EventNames::webkitTransitionEnd)           \ | 
					
						
							| 
									
										
										
										
											2023-03-24 18:10:45 +01:00
										 |  |  |     E(onwheel, UIEvents::EventNames::wheel) | 
					
						
							| 
									
										
										
										
											2021-02-03 22:47:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class GlobalEventHandlers { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     virtual ~GlobalEventHandlers(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #undef __ENUMERATE
 | 
					
						
							| 
									
										
										
										
											2022-09-24 16:02:41 +01:00
										 |  |  | #define __ENUMERATE(attribute_name, event_name)       \
 | 
					
						
							|  |  |  |     void set_##attribute_name(WebIDL::CallbackType*); \ | 
					
						
							|  |  |  |     WebIDL::CallbackType* attribute_name(); | 
					
						
							| 
									
										
										
										
											2021-02-03 22:47:50 +01:00
										 |  |  |     ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE) | 
					
						
							|  |  |  | #undef __ENUMERATE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     virtual GC::Ptr<DOM::EventTarget> global_event_handlers_to_event_target(FlyString const& event_name) = 0; | 
					
						
							| 
									
										
										
										
											2021-02-03 22:47:50 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |