1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 * This file contains the list of event names that are exposed via IDL
8 * on various objects. It is designed to be used as inline input to
9 * various consumers through the magic of C preprocessing.
11 * Each entry consists of 4 pieces of information:
12 * 1) The name of the event
13 * 2) The event ID (see BasicEvents.h)
14 * 3) The event type (see the EventNameType enum in nsContentUtils.h)
15 * 4) The event struct type for this event.
16 * Items 2-4 might be empty strings for events for which they don't make sense.
18 * Event names that are exposed as content attributes on HTML elements
19 * and as IDL attributes on Elements, Documents and Windows and have
20 * no forwarding behavior should be enclosed in the EVENT macro.
22 * Event names that are exposed as content attributes on HTML elements
23 * and as IDL attributes on Elements, Documents and Windows and are
24 * forwarded from <body> and <frameset> to the Window should be
25 * enclosed in the FORWARDED_EVENT macro. If this macro is not
26 * defined, it will be defined to be equivalent to EVENT.
28 * Event names that are exposed as IDL attributes on Windows only
29 * should be enclosed in the WINDOW_ONLY_EVENT macro. If this macro
30 * is not defined, it will be defined to the empty string.
32 * Event names that are exposed as content and IDL attributes on
33 * <body> and <frameset>, which forward them to the Window, and are
34 * exposed as IDL attributes on the Window should be enclosed in the
35 * WINDOW_EVENT macro. If this macro is not defined, it will be
36 * defined to be equivalent to WINDOW_ONLY_EVENT.
38 * Touch-specific event names should be enclosed in TOUCH_EVENT. They
39 * are otherwise equivalent to those enclosed in EVENT. If
40 * TOUCH_EVENT is not defined, it will be defined to the empty string.
42 * Event names that are only exposed as IDL attributes on Documents
43 * should be enclosed in the DOCUMENT_ONLY_EVENT macro. If this macro is
44 * not defined, it will be defined to the empty string.
46 * Event names that are not exposed as IDL attributes at all should be
47 * enclosed in NON_IDL_EVENT. If NON_IDL_EVENT is not defined, it
48 * will be defined to the empty string.
50 * If you change which macros event names are enclosed in, please
51 * update the tests for bug 689564 and bug 659350 as needed.
56 #error "Don't define EVENT"
58 #ifdef WINDOW_ONLY_EVENT
59 #error "Don't define WINDOW_ONLY_EVENT"
60 #endif /* WINDOW_ONLY_EVENT */
62 #error "Don't define TOUCH_EVENT"
63 #endif /* TOUCH_EVENT */
64 #ifdef DOCUMENT_ONLY_EVENT
65 #error "Don't define DOCUMENT_ONLY_EVENT"
66 #endif /* DOCUMENT_ONLY_EVENT */
68 #error "Don't define NON_IDL_EVENT"
69 #endif /* NON_IDL_EVENT */
71 #define EVENT ID_TO_EVENT
72 #define WINDOW_ONLY_EVENT ID_TO_EVENT
73 #define TOUCH_EVENT ID_TO_EVENT
74 #define DOCUMENT_ONLY_EVENT ID_TO_EVENT
75 #define NON_IDL_EVENT ID_TO_EVENT
78 #ifdef DEFINED_FORWARDED_EVENT
79 #error "Don't define DEFINED_FORWARDED_EVENT"
80 #endif /* DEFINED_FORWARDED_EVENT */
82 #ifndef FORWARDED_EVENT
83 #define FORWARDED_EVENT EVENT
84 #define DEFINED_FORWARDED_EVENT
85 #endif /* FORWARDED_EVENT */
87 #ifdef DEFINED_WINDOW_ONLY_EVENT
88 #error "Don't define DEFINED_WINDOW_ONLY_EVENT"
89 #endif /* DEFINED_WINDOW_ONLY_EVENT */
91 #ifndef WINDOW_ONLY_EVENT
92 #define WINDOW_ONLY_EVENT(_name, _id, _type, _struct)
93 #define DEFINED_WINDOW_ONLY_EVENT
94 #endif /* WINDOW_ONLY_EVENT */
96 #ifdef DEFINED_WINDOW_EVENT
97 #error "Don't define DEFINED_WINDOW_EVENT"
98 #endif /* DEFINED_WINDOW_EVENT */
101 #define WINDOW_EVENT WINDOW_ONLY_EVENT
102 #define DEFINED_WINDOW_EVENT
103 #endif /* WINDOW_EVENT */
105 #ifdef DEFINED_TOUCH_EVENT
106 #error "Don't define DEFINED_TOUCH_EVENT"
107 #endif /* DEFINED_TOUCH_EVENT */
110 #define TOUCH_EVENT(_name, _id, _type, _struct)
111 #define DEFINED_TOUCH_EVENT
112 #endif /* TOUCH_EVENT */
114 #ifdef DEFINED_DOCUMENT_ONLY_EVENT
115 #error "Don't define DEFINED_DOCUMENT_ONLY_EVENT"
116 #endif /* DEFINED_DOCUMENT_ONLY_EVENT */
118 #ifndef DOCUMENT_ONLY_EVENT
119 #define DOCUMENT_ONLY_EVENT(_name, _id, _type, _struct)
120 #define DEFINED_DOCUMENT_ONLY_EVENT
121 #endif /* DOCUMENT_ONLY_EVENT */
123 #ifdef DEFINED_NON_IDL_EVENT
124 #error "Don't define DEFINED_NON_IDL_EVENT"
125 #endif /* DEFINED_NON_IDL_EVENT */
127 #ifndef NON_IDL_EVENT
128 #define NON_IDL_EVENT(_name, _id, _type, _struct)
129 #define DEFINED_NON_IDL_EVENT
130 #endif /* NON_IDL_EVENT */
132 #ifdef DEFINED_ERROR_EVENT
133 #error "Don't define DEFINED_ERROR_EVENT"
134 #endif /* DEFINED_ERROR_EVENT */
137 #define ERROR_EVENT FORWARDED_EVENT
138 #define DEFINED_ERROR_EVENT
139 #endif /* ERROR_EVENT */
141 #ifdef DEFINED_BEFOREUNLOAD_EVENT
142 #error "Don't define DEFINED_BEFOREUNLOAD_EVENT"
143 #endif /* DEFINED_BEFOREUNLOAD_EVENT */
145 #ifndef BEFOREUNLOAD_EVENT
146 #define BEFOREUNLOAD_EVENT WINDOW_EVENT
147 #define DEFINED_BEFOREUNLOAD_EVENT
148 #endif /* BEFOREUNLOAD_EVENT */
158 EVENT(canplaythrough
,
164 EventNameType_HTMLXUL
,
172 EventNameType_HTMLXUL
,
177 NS_MOUSE_DOUBLECLICK
,
178 EventNameType_HTMLXUL
,
182 EventNameType_HTMLXUL
,
186 EventNameType_HTMLXUL
,
190 EventNameType_HTMLXUL
,
193 NS_DRAGDROP_LEAVE_SYNTH
,
194 EventNameType_HTMLXUL
,
197 NS_DRAGDROP_OVER_SYNTH
,
198 EventNameType_HTMLXUL
,
202 EventNameType_HTMLXUL
,
206 EventNameType_HTMLXUL
,
208 EVENT(durationchange
,
222 EventNameType_HTMLXUL
,
223 eEditorInputEventClass
)
226 EventNameType_HTMLXUL
,
230 EventNameType_HTMLXUL
,
234 EventNameType_HTMLXUL
,
238 EventNameType_HTMLXUL
,
244 EVENT(loadedmetadata
,
253 NS_MOUSE_BUTTON_DOWN
,
273 NS_MOUSE_ENTER_SYNTH
,
280 EVENT(mozfullscreenchange
,
284 EVENT(mozfullscreenerror
,
288 EVENT(mozpointerlockchange
,
289 NS_POINTERLOCKCHANGE
,
292 EVENT(mozpointerlockerror
,
328 EVENT(gotpointercapture
,
329 NS_POINTER_GOT_CAPTURE
,
332 EVENT(lostpointercapture
,
333 NS_POINTER_LOST_CAPTURE
,
337 // Not supported yet; probably never because "wheel" is a better idea.
361 EventNameType_HTMLXUL
,
373 EventNameType_HTMLXUL
,
385 EventNameType_HTMLXUL
,
409 EventNameType_HTMLXUL
,
410 eClipboardEventClass
)
413 EventNameType_HTMLXUL
,
414 eClipboardEventClass
)
417 EventNameType_HTMLXUL
,
418 eClipboardEventClass
)
419 // Gecko-specific extensions that apply to elements
420 EVENT(beforescriptexecute
,
421 NS_BEFORE_SCRIPT_EXECUTE
,
422 EventNameType_HTMLXUL
,
424 EVENT(afterscriptexecute
,
425 NS_AFTER_SCRIPT_EXECUTE
,
426 EventNameType_HTMLXUL
,
429 FORWARDED_EVENT(blur
,
431 EventNameType_HTMLXUL
,
437 FORWARDED_EVENT(focus
,
439 EventNameType_HTMLXUL
,
441 FORWARDED_EVENT(load
,
445 FORWARDED_EVENT(scroll
,
447 (EventNameType_HTMLXUL
| EventNameType_SVGSVG
),
450 WINDOW_EVENT(afterprint
,
452 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
454 WINDOW_EVENT(beforeprint
,
456 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
458 BEFOREUNLOAD_EVENT(beforeunload
,
459 NS_BEFORE_PAGE_UNLOAD
,
460 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
462 WINDOW_EVENT(hashchange
,
464 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
466 WINDOW_EVENT(languagechange
,
468 EventNameType_HTMLBodyOrFramesetOnly
,
470 // XXXbz Should the onmessage attribute on <body> really not work? If so, do we
471 // need a different macro to flag things like that (IDL, but not content
472 // attributes on body/frameset), or is just using EventNameType_None enough?
473 WINDOW_EVENT(message
,
477 WINDOW_EVENT(offline
,
479 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
483 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
485 WINDOW_EVENT(pagehide
,
487 EventNameType_HTMLBodyOrFramesetOnly
,
489 WINDOW_EVENT(pageshow
,
491 EventNameType_HTMLBodyOrFramesetOnly
,
493 WINDOW_EVENT(popstate
,
495 EventNameType_XUL
| EventNameType_HTMLBodyOrFramesetOnly
,
498 // WINDOW_EVENT(redo)
501 (EventNameType_XUL
| EventNameType_SVGSVG
|
502 EventNameType_HTMLBodyOrFramesetOnly
),
505 // WINDOW_EVENT(storage)
507 // WINDOW_EVENT(undo)
510 (EventNameType_XUL
| EventNameType_SVGSVG
|
511 EventNameType_HTMLBodyOrFramesetOnly
),
514 WINDOW_ONLY_EVENT(devicemotion
,
518 WINDOW_ONLY_EVENT(deviceorientation
,
519 NS_DEVICE_ORIENTATION
,
522 WINDOW_ONLY_EVENT(deviceproximity
,
526 WINDOW_ONLY_EVENT(userproximity
,
530 WINDOW_ONLY_EVENT(devicelight
,
536 WINDOW_ONLY_EVENT(moztimechange
,
537 NS_MOZ_TIME_CHANGE_EVENT
,
540 WINDOW_ONLY_EVENT(moznetworkupload
,
541 NS_NETWORK_UPLOAD_EVENT
,
544 WINDOW_ONLY_EVENT(moznetworkdownload
,
545 NS_NETWORK_DOWNLOAD_EVENT
,
550 TOUCH_EVENT(touchstart
,
554 TOUCH_EVENT(touchend
,
558 TOUCH_EVENT(touchmove
,
562 TOUCH_EVENT(touchcancel
,
567 DOCUMENT_ONLY_EVENT(readystatechange
,
569 EventNameType_HTMLXUL
,
572 NON_IDL_EVENT(MozMouseHittest
,
577 NON_IDL_EVENT(DOMAttrModified
,
578 NS_MUTATION_ATTRMODIFIED
,
579 EventNameType_HTMLXUL
,
581 NON_IDL_EVENT(DOMCharacterDataModified
,
582 NS_MUTATION_CHARACTERDATAMODIFIED
,
583 EventNameType_HTMLXUL
,
585 NON_IDL_EVENT(DOMNodeInserted
,
586 NS_MUTATION_NODEINSERTED
,
587 EventNameType_HTMLXUL
,
589 NON_IDL_EVENT(DOMNodeRemoved
,
590 NS_MUTATION_NODEREMOVED
,
591 EventNameType_HTMLXUL
,
593 NON_IDL_EVENT(DOMNodeInsertedIntoDocument
,
594 NS_MUTATION_NODEINSERTEDINTODOCUMENT
,
595 EventNameType_HTMLXUL
,
597 NON_IDL_EVENT(DOMNodeRemovedFromDocument
,
598 NS_MUTATION_NODEREMOVEDFROMDOCUMENT
,
599 EventNameType_HTMLXUL
,
601 NON_IDL_EVENT(DOMSubtreeModified
,
602 NS_MUTATION_SUBTREEMODIFIED
,
603 EventNameType_HTMLXUL
,
606 NON_IDL_EVENT(DOMActivate
,
608 EventNameType_HTMLXUL
,
610 NON_IDL_EVENT(DOMFocusIn
,
612 EventNameType_HTMLXUL
,
614 NON_IDL_EVENT(DOMFocusOut
,
616 EventNameType_HTMLXUL
,
619 NON_IDL_EVENT(DOMMouseScroll
,
621 EventNameType_HTMLXUL
,
622 eMouseScrollEventClass
)
623 NON_IDL_EVENT(MozMousePixelScroll
,
624 NS_MOUSE_PIXEL_SCROLL
,
625 EventNameType_HTMLXUL
,
626 eMouseScrollEventClass
)
633 NON_IDL_EVENT(dataavailable
,
634 NS_MEDIARECORDER_DATAAVAILABLE
,
639 NS_MEDIARECORDER_STOP
,
643 NON_IDL_EVENT(warning
,
644 NS_MEDIARECORDER_WARNING
,
648 NON_IDL_EVENT(speakerforcedchange
,
649 NS_SPEAKERMANAGER_SPEAKERFORCEDCHANGE
,
653 // Events that only have on* attributes on XUL elements
658 NON_IDL_EVENT(compositionstart
,
659 NS_COMPOSITION_START
,
661 eCompositionEventClass
)
662 NON_IDL_EVENT(compositionupdate
,
663 NS_COMPOSITION_UPDATE
,
665 eCompositionEventClass
)
666 NON_IDL_EVENT(compositionend
,
669 eCompositionEventClass
)
670 NON_IDL_EVENT(command
,
678 NON_IDL_EVENT(popupshowing
,
679 NS_XUL_POPUP_SHOWING
,
682 NON_IDL_EVENT(popupshown
,
686 NON_IDL_EVENT(popuphiding
,
690 NON_IDL_EVENT(popuphidden
,
694 NON_IDL_EVENT(broadcast
,
698 NON_IDL_EVENT(commandupdate
,
699 NS_XUL_COMMAND_UPDATE
,
702 NON_IDL_EVENT(dragexit
,
703 NS_DRAGDROP_EXIT_SYNTH
,
706 NON_IDL_EVENT(dragdrop
,
707 NS_DRAGDROP_DRAGDROP
,
710 NON_IDL_EVENT(draggesture
,
714 NON_IDL_EVENT(overflow
,
715 NS_SCROLLPORT_OVERFLOW
,
718 NON_IDL_EVENT(underflow
,
719 NS_SCROLLPORT_UNDERFLOW
,
723 // Various SVG events
724 NON_IDL_EVENT(SVGLoad
,
728 NON_IDL_EVENT(SVGUnload
,
732 NON_IDL_EVENT(SVGResize
,
736 NON_IDL_EVENT(SVGScroll
,
741 NON_IDL_EVENT(SVGZoom
,
746 // Only map the ID to the real event name when ID_TO_EVENT is defined.
748 // This is a bit hackish, but SVG's event names are weird.
751 EventNameType_SVGSVG
,
754 // Only map the ID to the real event name when ID_TO_EVENT is defined.
761 NON_IDL_EVENT(beginEvent
,
765 // Only map the ID to the real event name when ID_TO_EVENT is defined.
772 NON_IDL_EVENT(endEvent
,
776 // Only map the ID to the real event name when ID_TO_EVENT is defined.
778 NON_IDL_EVENT(repeat
,
783 NON_IDL_EVENT(repeatEvent
,
788 NON_IDL_EVENT(MozAfterPaint
,
793 NON_IDL_EVENT(MozScrolledAreaChanged
,
794 NS_SCROLLEDAREACHANGED
,
796 eScrollAreaEventClass
)
799 NON_IDL_EVENT(gamepadbuttondown
,
800 NS_GAMEPAD_BUTTONDOWN
,
803 NON_IDL_EVENT(gamepadbuttonup
,
807 NON_IDL_EVENT(gamepadaxismove
,
811 NON_IDL_EVENT(gamepadconnected
,
812 NS_GAMEPAD_CONNECTED
,
815 NON_IDL_EVENT(gamepaddisconnected
,
816 NS_GAMEPAD_DISCONNECTED
,
821 // Simple gesture events
822 NON_IDL_EVENT(MozSwipeGestureStart
,
823 NS_SIMPLE_GESTURE_SWIPE_START
,
825 eSimpleGestureEventClass
)
826 NON_IDL_EVENT(MozSwipeGestureUpdate
,
827 NS_SIMPLE_GESTURE_SWIPE_UPDATE
,
829 eSimpleGestureEventClass
)
830 NON_IDL_EVENT(MozSwipeGestureEnd
,
831 NS_SIMPLE_GESTURE_SWIPE_END
,
833 eSimpleGestureEventClass
)
834 NON_IDL_EVENT(MozSwipeGesture
,
835 NS_SIMPLE_GESTURE_SWIPE
,
837 eSimpleGestureEventClass
)
838 NON_IDL_EVENT(MozMagnifyGestureStart
,
839 NS_SIMPLE_GESTURE_MAGNIFY_START
,
841 eSimpleGestureEventClass
)
842 NON_IDL_EVENT(MozMagnifyGestureUpdate
,
843 NS_SIMPLE_GESTURE_MAGNIFY_UPDATE
,
845 eSimpleGestureEventClass
)
846 NON_IDL_EVENT(MozMagnifyGesture
,
847 NS_SIMPLE_GESTURE_MAGNIFY
,
849 eSimpleGestureEventClass
)
850 NON_IDL_EVENT(MozRotateGestureStart
,
851 NS_SIMPLE_GESTURE_ROTATE_START
,
853 eSimpleGestureEventClass
)
854 NON_IDL_EVENT(MozRotateGestureUpdate
,
855 NS_SIMPLE_GESTURE_ROTATE_UPDATE
,
857 eSimpleGestureEventClass
)
858 NON_IDL_EVENT(MozRotateGesture
,
859 NS_SIMPLE_GESTURE_ROTATE
,
861 eSimpleGestureEventClass
)
862 NON_IDL_EVENT(MozTapGesture
,
863 NS_SIMPLE_GESTURE_TAP
,
865 eSimpleGestureEventClass
)
866 NON_IDL_EVENT(MozPressTapGesture
,
867 NS_SIMPLE_GESTURE_PRESSTAP
,
869 eSimpleGestureEventClass
)
870 NON_IDL_EVENT(MozEdgeUIStarted
,
871 NS_SIMPLE_GESTURE_EDGE_STARTED
,
873 eSimpleGestureEventClass
)
874 NON_IDL_EVENT(MozEdgeUICanceled
,
875 NS_SIMPLE_GESTURE_EDGE_CANCELED
,
877 eSimpleGestureEventClass
)
878 NON_IDL_EVENT(MozEdgeUICompleted
,
879 NS_SIMPLE_GESTURE_EDGE_COMPLETED
,
881 eSimpleGestureEventClass
)
883 NON_IDL_EVENT(transitionend
,
886 eTransitionEventClass
)
887 NON_IDL_EVENT(animationstart
,
890 eAnimationEventClass
)
891 NON_IDL_EVENT(animationend
,
894 eAnimationEventClass
)
895 NON_IDL_EVENT(animationiteration
,
896 NS_ANIMATION_ITERATION
,
898 eAnimationEventClass
)
900 NON_IDL_EVENT(audioprocess
,
905 NON_IDL_EVENT(complete
,
910 #ifdef DEFINED_FORWARDED_EVENT
911 #undef DEFINED_FORWARDED_EVENT
912 #undef FORWARDED_EVENT
913 #endif /* DEFINED_FORWARDED_EVENT */
915 #ifdef DEFINED_WINDOW_EVENT
916 #undef DEFINED_WINDOW_EVENT
918 #endif /* DEFINED_WINDOW_EVENT */
920 #ifdef DEFINED_WINDOW_ONLY_EVENT
921 #undef DEFINED_WINDOW_ONLY_EVENT
922 #undef WINDOW_ONLY_EVENT
923 #endif /* DEFINED_WINDOW_ONLY_EVENT */
925 #ifdef DEFINED_TOUCH_EVENT
926 #undef DEFINED_TOUCH_EVENT
928 #endif /* DEFINED_TOUCH_EVENT */
930 #ifdef DEFINED_DOCUMENT_ONLY_EVENT
931 #undef DEFINED_DOCUMENT_ONLY_EVENT
932 #undef DOCUMENT_ONLY_EVENT
933 #endif /* DEFINED_DOCUMENT_ONLY_EVENT */
935 #ifdef DEFINED_NON_IDL_EVENT
936 #undef DEFINED_NON_IDL_EVENT
938 #endif /* DEFINED_NON_IDL_EVENT */
940 #ifdef DEFINED_ERROR_EVENT
941 #undef DEFINED_ERROR_EVENT
943 #endif /* DEFINED_ERROR_EVENT */
945 #ifdef DEFINED_BEFOREUNLOAD_EVENT
946 #undef DEFINED_BEFOREUNLOAD_EVENT
947 #undef BEFOREUNLOAD_EVENT
948 #endif /* BEFOREUNLOAD_EVENT */
952 #undef WINDOW_ONLY_EVENT
954 #undef DOCUMENT_ONLY_EVENT
956 #endif /* ID_TO_EVENT */