Source code

Revision control

Copy as Markdown

Other Tools

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This file contains the list of event names that are exposed via IDL
* on various objects. It is designed to be used as inline input to
* various consumers through the magic of C preprocessing.
*
* Each entry consists of 4 pieces of information:
* 1) The name of the event
* 2) The event message
* 3) The event type (see the EventNameType enum in nsContentUtils.h)
* 4) The event struct type for this event.
* Items 2-4 might be empty strings for events for which they don't make sense.
*
* Event names that are exposed as content attributes on HTML elements
* and as IDL attributes on Elements, Documents and Windows and have
* no forwarding behavior should be enclosed in the EVENT macro.
*
* Event names that are exposed as content attributes on HTML elements
* and as IDL attributes on Elements, Documents and Windows and are
* forwarded from <body> and <frameset> to the Window should be
* enclosed in the FORWARDED_EVENT macro. If this macro is not
* defined, it will be defined to be equivalent to EVENT.
*
* Event names that are exposed as IDL attributes on Windows only
* should be enclosed in the WINDOW_ONLY_EVENT macro. If this macro
* is not defined, it will be defined to the empty string.
*
* Event names that are exposed as content and IDL attributes on
* <body> and <frameset>, which forward them to the Window, and are
* exposed as IDL attributes on the Window should be enclosed in the
* WINDOW_EVENT macro. If this macro is not defined, it will be
* defined to be equivalent to WINDOW_ONLY_EVENT.
*
* Touch-specific event names should be enclosed in TOUCH_EVENT. They
* are otherwise equivalent to those enclosed in EVENT. If
* TOUCH_EVENT is not defined, it will be defined to the empty string.
*
* Event names that are only exposed as IDL attributes on Documents
* should be enclosed in the DOCUMENT_ONLY_EVENT macro. If this macro is
* not defined, it will be defined to the empty string.
*
* Event names that are not exposed as IDL attributes at all should be
* enclosed in NON_IDL_EVENT. If NON_IDL_EVENT is not defined, it
* will be defined to the empty string.
*
* If you change which macros event names are enclosed in, please
* update the tests for bug 689564 and bug 659350 as needed.
*/
#ifdef MESSAGE_TO_EVENT
# ifdef EVENT
# error "Don't define EVENT"
# endif /* EVENT */
# ifdef WINDOW_ONLY_EVENT
# error "Don't define WINDOW_ONLY_EVENT"
# endif /* WINDOW_ONLY_EVENT */
# ifdef TOUCH_EVENT
# error "Don't define TOUCH_EVENT"
# endif /* TOUCH_EVENT */
# ifdef DOCUMENT_ONLY_EVENT
# error "Don't define DOCUMENT_ONLY_EVENT"
# endif /* DOCUMENT_ONLY_EVENT */
# ifdef NON_IDL_EVENT
# error "Don't define NON_IDL_EVENT"
# endif /* NON_IDL_EVENT */
# define EVENT MESSAGE_TO_EVENT
# define WINDOW_ONLY_EVENT MESSAGE_TO_EVENT
# define TOUCH_EVENT MESSAGE_TO_EVENT
# define DOCUMENT_ONLY_EVENT MESSAGE_TO_EVENT
# define NON_IDL_EVENT MESSAGE_TO_EVENT
#endif /* MESSAGE_TO_EVENT */
#ifdef DEFINED_FORWARDED_EVENT
# error "Don't define DEFINED_FORWARDED_EVENT"
#endif /* DEFINED_FORWARDED_EVENT */
#ifndef FORWARDED_EVENT
# define FORWARDED_EVENT EVENT
# define DEFINED_FORWARDED_EVENT
#endif /* FORWARDED_EVENT */
#ifdef DEFINED_WINDOW_ONLY_EVENT
# error "Don't define DEFINED_WINDOW_ONLY_EVENT"
#endif /* DEFINED_WINDOW_ONLY_EVENT */
#ifndef WINDOW_ONLY_EVENT
# define WINDOW_ONLY_EVENT(_name, _message, _type, _struct)
# define DEFINED_WINDOW_ONLY_EVENT
#endif /* WINDOW_ONLY_EVENT */
#ifdef DEFINED_WINDOW_EVENT
# error "Don't define DEFINED_WINDOW_EVENT"
#endif /* DEFINED_WINDOW_EVENT */
#ifndef WINDOW_EVENT
# define WINDOW_EVENT WINDOW_ONLY_EVENT
# define DEFINED_WINDOW_EVENT
#endif /* WINDOW_EVENT */
#ifdef DEFINED_TOUCH_EVENT
# error "Don't define DEFINED_TOUCH_EVENT"
#endif /* DEFINED_TOUCH_EVENT */
#ifndef TOUCH_EVENT
# define TOUCH_EVENT(_name, _message, _type, _struct)
# define DEFINED_TOUCH_EVENT
#endif /* TOUCH_EVENT */
#ifdef DEFINED_DOCUMENT_ONLY_EVENT
# error "Don't define DEFINED_DOCUMENT_ONLY_EVENT"
#endif /* DEFINED_DOCUMENT_ONLY_EVENT */
#ifndef DOCUMENT_ONLY_EVENT
# define DOCUMENT_ONLY_EVENT(_name, _message, _type, _struct)
# define DEFINED_DOCUMENT_ONLY_EVENT
#endif /* DOCUMENT_ONLY_EVENT */
#ifdef DEFINED_NON_IDL_EVENT
# error "Don't define DEFINED_NON_IDL_EVENT"
#endif /* DEFINED_NON_IDL_EVENT */
#ifndef NON_IDL_EVENT
# define NON_IDL_EVENT(_name, _message, _type, _struct)
# define DEFINED_NON_IDL_EVENT
#endif /* NON_IDL_EVENT */
#ifdef DEFINED_ERROR_EVENT
# error "Don't define DEFINED_ERROR_EVENT"
#endif /* DEFINED_ERROR_EVENT */
#ifndef ERROR_EVENT
# define ERROR_EVENT FORWARDED_EVENT
# define DEFINED_ERROR_EVENT
#endif /* ERROR_EVENT */
#ifdef DEFINED_BEFOREUNLOAD_EVENT
# error "Don't define DEFINED_BEFOREUNLOAD_EVENT"
#endif /* DEFINED_BEFOREUNLOAD_EVENT */
#ifndef BEFOREUNLOAD_EVENT
# define BEFOREUNLOAD_EVENT WINDOW_EVENT
# define DEFINED_BEFOREUNLOAD_EVENT
#endif /* BEFOREUNLOAD_EVENT */
EVENT(abort, eImageAbort, EventNameType_All, eBasicEventClass)
EVENT(beforetoggle, eBeforeToggle, EventNameType_HTMLXUL, eBasicEventClass)
EVENT(cancel, eCancel, EventNameType_HTMLXUL, eBasicEventClass)
EVENT(canplay, eCanPlay, EventNameType_HTML, eBasicEventClass)
EVENT(canplaythrough, eCanPlayThrough, EventNameType_HTML, eBasicEventClass)
EVENT(change, eFormChange, EventNameType_HTMLXUL, eBasicEventClass)
EVENT(CheckboxStateChange, eFormCheckboxStateChange, EventNameType_None,
eBasicEventClass)
EVENT(RadioStateChange, eFormRadioStateChange, EventNameType_None,
eBasicEventClass)
EVENT(auxclick, ePointerAuxClick, EventNameType_All, ePointerEventClass)
EVENT(click, ePointerClick, EventNameType_All, ePointerEventClass)
EVENT(close, eClose, EventNameType_HTMLXUL, eBasicEventClass)
EVENT(contentvisibilityautostatechange, eContentVisibilityAutoStateChange,
EventNameType_All, eBasicEventClass)
EVENT(contextmenu, eContextMenu,
EventNameType_HTMLXUL | EventNameType_SVGGraphic, ePointerEventClass)
NON_IDL_EVENT(mouselongtap, eMouseLongTap, EventNameType_HTMLXUL,
eMouseEventClass)
EVENT(cuechange, eCueChange, EventNameType_All, eBasicEventClass)
EVENT(dblclick, eMouseDoubleClick, EventNameType_HTMLXUL, eMouseEventClass)
EVENT(drag, eDrag, EventNameType_HTMLXUL, eDragEventClass)
EVENT(dragend, eDragEnd, EventNameType_HTMLXUL, eDragEventClass)
EVENT(dragenter, eDragEnter, EventNameType_HTMLXUL, eDragEventClass)
EVENT(dragexit, eDragExit, EventNameType_HTMLXUL, eDragEventClass)
EVENT(dragleave, eDragLeave, EventNameType_HTMLXUL, eDragEventClass)
EVENT(dragover, eDragOver, EventNameType_HTMLXUL, eDragEventClass)
EVENT(dragstart, eDragStart, EventNameType_HTMLXUL, eDragEventClass)
EVENT(drop, eDrop, EventNameType_HTMLXUL, eDragEventClass)
EVENT(durationchange, eDurationChange, EventNameType_HTML, eBasicEventClass)
EVENT(emptied, eEmptied, EventNameType_HTML, eBasicEventClass)
EVENT(encrypted, eEncrypted, EventNameType_HTMLMedia, eBasicEventClass)
EVENT(ended, eEnded, EventNameType_HTML, eBasicEventClass)
EVENT(formdata, eFormData, EventNameType_HTML, eBasicEventClass)
EVENT(fullscreenchange, eFullscreenChange, EventNameType_HTML, eBasicEventClass)
EVENT(fullscreenerror, eFullscreenError, EventNameType_HTML, eBasicEventClass)
EVENT(beforeinput, eEditorBeforeInput, EventNameType_HTMLXUL,
eEditorInputEventClass)
EVENT(input, eEditorInput, EventNameType_HTMLXUL, eEditorInputEventClass)
EVENT(invalid, eFormInvalid, EventNameType_HTMLXUL, eBasicEventClass)
EVENT(keydown, eKeyDown, EventNameType_HTMLXUL, eKeyboardEventClass)
EVENT(keypress, eKeyPress, EventNameType_HTMLXUL, eKeyboardEventClass)
EVENT(keyup, eKeyUp, EventNameType_HTMLXUL, eKeyboardEventClass)
NON_IDL_EVENT(mozaccesskeynotfound, eAccessKeyNotFound, EventNameType_None,
eKeyboardEventClass)
EVENT(loadeddata, eLoadedData, EventNameType_HTML, eBasicEventClass)
EVENT(loadedmetadata, eLoadedMetaData, EventNameType_HTML, eBasicEventClass)
EVENT(loadend, eLoadEnd, EventNameType_HTML, eBasicEventClass)
EVENT(loadstart, eLoadStart, EventNameType_HTML, eBasicEventClass)
EVENT(mousedown, eMouseDown, EventNameType_All, eMouseEventClass)
EVENT(mouseenter, eMouseEnter, EventNameType_All, eMouseEventClass)
EVENT(mouseleave, eMouseLeave, EventNameType_All, eMouseEventClass)
EVENT(mousemove, eMouseMove, EventNameType_All, eMouseEventClass)
EVENT(mouseout, eMouseOut, EventNameType_All, eMouseEventClass)
EVENT(mouseover, eMouseOver, EventNameType_All, eMouseEventClass)
EVENT(mouseup, eMouseUp, EventNameType_All, eMouseEventClass)
EVENT(mozfullscreenchange, eMozFullscreenChange, EventNameType_HTML,
eBasicEventClass)
EVENT(mozfullscreenerror, eMozFullscreenError, EventNameType_HTML,
eBasicEventClass)
EVENT(mozpointerlockchange, eMozPointerLockChange, EventNameType_HTML,
eBasicEventClass)
EVENT(mozpointerlockerror, eMozPointerLockError, EventNameType_HTML,
eBasicEventClass)
EVENT(pointerlockchange, ePointerLockChange, EventNameType_HTML,
eBasicEventClass)
EVENT(pointerlockerror, ePointerLockError, EventNameType_HTML, eBasicEventClass)
EVENT(pointerdown, ePointerDown, EventNameType_All, ePointerEventClass)
EVENT(pointermove, ePointerMove, EventNameType_All, ePointerEventClass)
EVENT(pointerup, ePointerUp, EventNameType_All, ePointerEventClass)
EVENT(pointercancel, ePointerCancel, EventNameType_All, ePointerEventClass)
EVENT(pointerover, ePointerOver, EventNameType_All, ePointerEventClass)
EVENT(pointerout, ePointerOut, EventNameType_All, ePointerEventClass)