Bug 1769547 - Do not MOZ_CRASH() on missing process r=nika
[gecko.git] / widget / EventMessageList.h
blob62417a3f8af19fd15de544c4ae4a65eb5b667278
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/. */
6 /**
7 * This header file lists up all event messages.
8 * Before including this header file, you should define:
9 * NS_EVENT_MESSAGE(aMessage)
11 * Additionally, you can specify following macro for e*First and e*Last.
12 * NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast)
13 * This is optional, if you need only actual event messages, you don't need
14 * to define this macro.
16 * Naming rules of the event messages:
17 * 0. Starting with "e" prefix and use camelcase.
18 * 1. Basically, use same name as the DOM name which is fired at dispatching
19 * the event.
20 * 2. If the event message name becomes too generic, e.g., "eInvalid", that may
21 * conflict with another enum's item name, append something after the "e"
22 * prefix, e.g., "eFormInvalid".
25 #ifndef NS_EVENT_MESSAGE_FIRST_LAST
26 # define UNDEF_NS_EVENT_MESSAGE_FIRST_LAST 1
27 # define NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast)
28 #endif
30 NS_EVENT_MESSAGE(eVoidEvent)
32 // This is a dummy event message for all event listener implementation in
33 // EventListenerManager.
34 NS_EVENT_MESSAGE(eAllEvents)
36 NS_EVENT_MESSAGE(eKeyPress)
37 NS_EVENT_MESSAGE(eKeyUp)
38 NS_EVENT_MESSAGE(eKeyDown)
40 // This message is sent after a content process handles a key event or accesskey
41 // to indicate that an potential accesskey was not found. The parent process may
42 // then respond by, for example, opening menus and processing other shortcuts.
43 // It inherits its properties from a keypress event.
44 NS_EVENT_MESSAGE(eAccessKeyNotFound)
46 NS_EVENT_MESSAGE(eResize)
47 NS_EVENT_MESSAGE(eScroll)
48 NS_EVENT_MESSAGE(eMozVisualResize)
49 NS_EVENT_MESSAGE(eMozVisualScroll)
51 NS_EVENT_MESSAGE(eOffline)
52 NS_EVENT_MESSAGE(eOnline)
54 NS_EVENT_MESSAGE(eLanguageChange)
56 NS_EVENT_MESSAGE(eMouseMove)
57 NS_EVENT_MESSAGE(eMouseUp)
58 NS_EVENT_MESSAGE(eMouseDown)
59 NS_EVENT_MESSAGE(eMouseEnterIntoWidget)
60 NS_EVENT_MESSAGE(eMouseExitFromWidget)
61 NS_EVENT_MESSAGE(eMouseDoubleClick)
62 NS_EVENT_MESSAGE(eMouseClick)
63 NS_EVENT_MESSAGE(eMouseAuxClick)
64 // eMouseActivate is fired when the widget is activated by a click.
65 NS_EVENT_MESSAGE(eMouseActivate)
66 NS_EVENT_MESSAGE(eMouseOver)
67 NS_EVENT_MESSAGE(eMouseOut)
68 NS_EVENT_MESSAGE(eMouseHitTest)
69 NS_EVENT_MESSAGE(eMouseEnter)
70 NS_EVENT_MESSAGE(eMouseLeave)
71 NS_EVENT_MESSAGE(eMouseTouchDrag)
72 NS_EVENT_MESSAGE(eMouseLongTap)
73 NS_EVENT_MESSAGE(eMouseExploreByTouch)
74 NS_EVENT_MESSAGE_FIRST_LAST(eMouseEvent, eMouseMove, eMouseExploreByTouch)
76 // Pointer spec events
77 NS_EVENT_MESSAGE(ePointerMove)
78 NS_EVENT_MESSAGE(ePointerUp)
79 NS_EVENT_MESSAGE(ePointerDown)
80 NS_EVENT_MESSAGE(ePointerOver)
81 NS_EVENT_MESSAGE(ePointerOut)
82 NS_EVENT_MESSAGE(ePointerEnter)
83 NS_EVENT_MESSAGE(ePointerLeave)
84 NS_EVENT_MESSAGE(ePointerCancel)
85 NS_EVENT_MESSAGE(ePointerGotCapture)
86 NS_EVENT_MESSAGE(ePointerLostCapture)
87 NS_EVENT_MESSAGE_FIRST_LAST(ePointerEvent, ePointerMove, ePointerLostCapture)
89 NS_EVENT_MESSAGE(eContextMenu)
91 NS_EVENT_MESSAGE(eCueChange)
93 NS_EVENT_MESSAGE(eLoad)
94 NS_EVENT_MESSAGE(eUnload)
95 NS_EVENT_MESSAGE(eHashChange)
96 NS_EVENT_MESSAGE(eImageAbort)
97 NS_EVENT_MESSAGE(eLoadError)
98 NS_EVENT_MESSAGE(eLoadEnd)
99 NS_EVENT_MESSAGE(ePopState)
100 NS_EVENT_MESSAGE(eRejectionHandled)
101 NS_EVENT_MESSAGE(eStorage)
102 NS_EVENT_MESSAGE(eUnhandledRejection)
103 NS_EVENT_MESSAGE(eBeforeUnload)
104 NS_EVENT_MESSAGE(eReadyStateChange)
106 NS_EVENT_MESSAGE(eFormSubmit)
107 NS_EVENT_MESSAGE(eFormReset)
108 NS_EVENT_MESSAGE(eFormChange)
109 NS_EVENT_MESSAGE(eFormSelect)
110 NS_EVENT_MESSAGE(eFormInvalid)
111 NS_EVENT_MESSAGE(eFormCheckboxStateChange)
112 NS_EVENT_MESSAGE(eFormRadioStateChange)
113 NS_EVENT_MESSAGE(eFormData)
115 // Need separate focus/blur notifications for non-native widgets
116 NS_EVENT_MESSAGE(eFocus)
117 NS_EVENT_MESSAGE(eBlur)
118 NS_EVENT_MESSAGE(eFocusIn)
119 NS_EVENT_MESSAGE(eFocusOut)
121 NS_EVENT_MESSAGE(eDragEnter)
122 NS_EVENT_MESSAGE(eDragOver)
123 NS_EVENT_MESSAGE(eDragExit)
124 NS_EVENT_MESSAGE(eDrag)
125 NS_EVENT_MESSAGE(eDragEnd)
126 NS_EVENT_MESSAGE(eDragStart)
127 NS_EVENT_MESSAGE(eDrop)
128 NS_EVENT_MESSAGE(eDragLeave)
129 NS_EVENT_MESSAGE_FIRST_LAST(eDragDropEvent, eDragEnter, eDragLeave)
131 // XUL specific events
132 NS_EVENT_MESSAGE(eXULPopupShowing)
133 NS_EVENT_MESSAGE(eXULPopupShown)
134 NS_EVENT_MESSAGE(eXULPopupHiding)
135 NS_EVENT_MESSAGE(eXULPopupHidden)
136 NS_EVENT_MESSAGE(eXULBroadcast)
137 NS_EVENT_MESSAGE(eXULCommandUpdate)
138 NS_EVENT_MESSAGE(eXULSystemStatusBarClick)
140 // Legacy mouse scroll (wheel) events
141 NS_EVENT_MESSAGE(eLegacyMouseLineOrPageScroll)
142 NS_EVENT_MESSAGE(eLegacyMousePixelScroll)
144 NS_EVENT_MESSAGE(eScrollPortUnderflow)
145 NS_EVENT_MESSAGE(eScrollPortOverflow)
147 NS_EVENT_MESSAGE(eLegacySubtreeModified)
148 NS_EVENT_MESSAGE(eLegacyNodeInserted)
149 NS_EVENT_MESSAGE(eLegacyNodeRemoved)
150 NS_EVENT_MESSAGE(eLegacyNodeRemovedFromDocument)
151 NS_EVENT_MESSAGE(eLegacyNodeInsertedIntoDocument)
152 NS_EVENT_MESSAGE(eLegacyAttrModified)
153 NS_EVENT_MESSAGE(eLegacyCharacterDataModified)
154 NS_EVENT_MESSAGE_FIRST_LAST(eLegacyMutationEvent, eLegacySubtreeModified,
155 eLegacyCharacterDataModified)
157 NS_EVENT_MESSAGE(eUnidentifiedEvent)
159 // composition events
160 NS_EVENT_MESSAGE(eCompositionStart)
161 // eCompositionEnd is the message for DOM compositionend event.
162 // This event should NOT be dispatched from widget if eCompositionCommit
163 // is available.
164 NS_EVENT_MESSAGE(eCompositionEnd)
165 // eCompositionUpdate is the message for DOM compositionupdate event.
166 // This event should NOT be dispatched from widget since it will be dispatched
167 // by mozilla::TextComposition automatically if eCompositionChange event
168 // will change composition string.
169 NS_EVENT_MESSAGE(eCompositionUpdate)
170 // eCompositionChange is the message for representing a change of
171 // composition string. This should be dispatched from widget even if
172 // composition string isn't changed but the ranges are changed. This causes
173 // a DOM "text" event which is a non-standard DOM event.
174 NS_EVENT_MESSAGE(eCompositionChange)
175 // eCompositionCommitAsIs is the message for representing a commit of
176 // composition string. TextComposition will commit composition with the
177 // last data. TextComposition will dispatch this event to the DOM tree as
178 // eCompositionChange without clause information. After that,
179 // eCompositionEnd will be dispatched automatically.
180 // Its mData and mRanges should be empty and nullptr.
181 NS_EVENT_MESSAGE(eCompositionCommitAsIs)
182 // eCompositionCommit is the message for representing a commit of
183 // composition string with its mData value. TextComposition will dispatch this
184 // event to the DOM tree as eCompositionChange without clause information.
185 // After that, eCompositionEnd will be dispatched automatically.
186 // Its mRanges should be nullptr.
187 NS_EVENT_MESSAGE(eCompositionCommit)
188 // eCompositionCommitRequestHandled is NOT used with any Widget*Event.
189 // This is used only by PBrowser.OnEventNeedingAckHandled(). If active IME
190 // commits composition synchronously, BrowserParent returns the commit string
191 // to the remote process synchronously. Then, BrowserChild dispatches
192 // eCompositionCommit in the remote process. Finally, this message is sent
193 // to BrowserParent. (If IME commits composition asynchronously, this message
194 // is not used.)
195 NS_EVENT_MESSAGE(eCompositionCommitRequestHandled)
197 // Following events are defined for deprecated DOM events which are using
198 // InternalUIEvent class.
199 // DOMActivate (mapped with the DOM event and used internally)
200 NS_EVENT_MESSAGE(eLegacyDOMActivate)
201 // DOMFocusIn (only mapped with the DOM event)
202 NS_EVENT_MESSAGE(eLegacyDOMFocusIn)
203 // DOMFocusOut (only mapped with the DOM event)
204 NS_EVENT_MESSAGE(eLegacyDOMFocusOut)
206 // pagetransition events
207 NS_EVENT_MESSAGE(ePageShow)
208 NS_EVENT_MESSAGE(ePageHide)
210 // SVG events
211 NS_EVENT_MESSAGE(eSVGLoad)
212 NS_EVENT_MESSAGE(eSVGScroll)
214 // XUL command events
215 NS_EVENT_MESSAGE(eXULCommand)
217 // Cut, copy, paste events
218 NS_EVENT_MESSAGE(eCopy)
219 NS_EVENT_MESSAGE(eCut)
220 NS_EVENT_MESSAGE(ePaste)
221 NS_EVENT_MESSAGE(ePasteNoFormatting)
223 // Query for the selected text information, it return the selection offset,
224 // selection length and selected text.
225 NS_EVENT_MESSAGE(eQuerySelectedText)
226 // Query for the text content of specified range, it returns actual lengh (if
227 // the specified range is too long) and the text of the specified range.
228 // Returns the entire text if requested length > actual length.
229 NS_EVENT_MESSAGE(eQueryTextContent)
230 // Query for the caret rect of nth insertion point. The offset of the result is
231 // relative position from the top level widget.
232 NS_EVENT_MESSAGE(eQueryCaretRect)
233 // Query for the bounding rect of a range of characters. This works on any
234 // valid character range given offset and length. Result is relative to top
235 // level widget coordinates
236 NS_EVENT_MESSAGE(eQueryTextRect)
237 // Query for the bounding rect array of a range of characters.
238 // Thiis similar event of eQueryTextRect.
239 NS_EVENT_MESSAGE(eQueryTextRectArray)
240 // Query for the bounding rect of the current focused frame. Result is relative
241 // to top level widget coordinates
242 NS_EVENT_MESSAGE(eQueryEditorRect)
243 // Query for the current state of the content. The particular members of
244 // mReply that are set for each query content event will be valid on success.
245 NS_EVENT_MESSAGE(eQueryContentState)
246 // Query for the selection in the form of a nsITransferable.
247 NS_EVENT_MESSAGE(eQuerySelectionAsTransferable)
248 // Query for character at a point. This returns the character offset, its
249 // rect and also tentative caret point if the point is clicked. The point is
250 // specified by Event::mRefPoint.
251 NS_EVENT_MESSAGE(eQueryCharacterAtPoint)
252 // Query if the DOM element under Event::mRefPoint belongs to our widget
253 // or not.
254 NS_EVENT_MESSAGE(eQueryDOMWidgetHittest)
256 // Video events
257 NS_EVENT_MESSAGE(eLoadStart)
258 NS_EVENT_MESSAGE(eProgress)
259 NS_EVENT_MESSAGE(eSuspend)
260 NS_EVENT_MESSAGE(eEmptied)
261 NS_EVENT_MESSAGE(eStalled)
262 NS_EVENT_MESSAGE(ePlay)
263 NS_EVENT_MESSAGE(ePause)
264 NS_EVENT_MESSAGE(eLoadedMetaData)
265 NS_EVENT_MESSAGE(eLoadedData)
266 NS_EVENT_MESSAGE(eWaiting)
267 NS_EVENT_MESSAGE(ePlaying)
268 NS_EVENT_MESSAGE(eCanPlay)
269 NS_EVENT_MESSAGE(eCanPlayThrough)
270 NS_EVENT_MESSAGE(eSeeking)
271 NS_EVENT_MESSAGE(eSeeked)
272 NS_EVENT_MESSAGE(eTimeUpdate)
273 NS_EVENT_MESSAGE(eEnded)
274 NS_EVENT_MESSAGE(eRateChange)
275 NS_EVENT_MESSAGE(eDurationChange)
276 NS_EVENT_MESSAGE(eVolumeChange)
278 // paint notification events
279 NS_EVENT_MESSAGE(eAfterPaint)
281 // Simple gesture events
282 NS_EVENT_MESSAGE(eSwipeGestureMayStart)
283 NS_EVENT_MESSAGE(eSwipeGestureStart)
284 NS_EVENT_MESSAGE(eSwipeGestureUpdate)
285 NS_EVENT_MESSAGE(eSwipeGestureEnd)
286 NS_EVENT_MESSAGE(eSwipeGesture)
287 NS_EVENT_MESSAGE(eMagnifyGestureStart)
288 NS_EVENT_MESSAGE(eMagnifyGestureUpdate)
289 NS_EVENT_MESSAGE(eMagnifyGesture)
290 NS_EVENT_MESSAGE(eRotateGestureStart)
291 NS_EVENT_MESSAGE(eRotateGestureUpdate)
292 NS_EVENT_MESSAGE(eRotateGesture)
293 NS_EVENT_MESSAGE(eTapGesture)
294 NS_EVENT_MESSAGE(ePressTapGesture)
295 NS_EVENT_MESSAGE(eEdgeUIStarted)
296 NS_EVENT_MESSAGE(eEdgeUICanceled)
297 NS_EVENT_MESSAGE(eEdgeUICompleted)
299 // Events to manipulate selection (WidgetSelectionEvent)
300 // Clear any previous selection and set the given range as the selection
301 NS_EVENT_MESSAGE(eSetSelection)
303 // Events of commands for the contents
304 NS_EVENT_MESSAGE(eContentCommandCut)
305 NS_EVENT_MESSAGE(eContentCommandCopy)
306 NS_EVENT_MESSAGE(eContentCommandPaste)
307 NS_EVENT_MESSAGE(eContentCommandDelete)
308 NS_EVENT_MESSAGE(eContentCommandUndo)
309 NS_EVENT_MESSAGE(eContentCommandRedo)
310 // eContentCommandInsertText tries to insert text with replacing selection
311 // in focused editor.
312 NS_EVENT_MESSAGE(eContentCommandInsertText)
313 NS_EVENT_MESSAGE(eContentCommandPasteTransferable)
314 NS_EVENT_MESSAGE(eContentCommandLookUpDictionary)
315 // eContentCommandScroll scrolls the nearest scrollable element to the
316 // currently focused content or latest DOM selection. This would normally be
317 // the same element scrolled by keyboard scroll commands, except that this event
318 // will scroll an element scrollable in either direction. I.e., if the nearest
319 // scrollable ancestor element can only be scrolled vertically, and horizontal
320 // scrolling is requested using this event, no scrolling will occur.
321 NS_EVENT_MESSAGE(eContentCommandScroll)
323 // Event to gesture notification
324 NS_EVENT_MESSAGE(eGestureNotify)
326 NS_EVENT_MESSAGE(eScrolledAreaChanged)
328 // CSS Transition & Animation events:
329 NS_EVENT_MESSAGE(eTransitionStart)
330 NS_EVENT_MESSAGE(eTransitionRun)
331 NS_EVENT_MESSAGE(eTransitionEnd)
332 NS_EVENT_MESSAGE(eTransitionCancel)
333 NS_EVENT_MESSAGE(eAnimationStart)
334 NS_EVENT_MESSAGE(eAnimationEnd)
335 NS_EVENT_MESSAGE(eAnimationIteration)
336 NS_EVENT_MESSAGE(eAnimationCancel)
338 // Webkit-prefixed versions of Transition & Animation events, for web compat:
339 NS_EVENT_MESSAGE(eWebkitTransitionEnd)
340 NS_EVENT_MESSAGE(eWebkitAnimationStart)
341 NS_EVENT_MESSAGE(eWebkitAnimationEnd)
342 NS_EVENT_MESSAGE(eWebkitAnimationIteration)
344 NS_EVENT_MESSAGE(eSMILBeginEvent)
345 NS_EVENT_MESSAGE(eSMILEndEvent)
346 NS_EVENT_MESSAGE(eSMILRepeatEvent)
348 NS_EVENT_MESSAGE(eAudioProcess)
349 NS_EVENT_MESSAGE(eAudioComplete)
351 // script notification events
352 NS_EVENT_MESSAGE(eBeforeScriptExecute)
353 NS_EVENT_MESSAGE(eAfterScriptExecute)
355 NS_EVENT_MESSAGE(eBeforePrint)
356 NS_EVENT_MESSAGE(eAfterPrint)
358 NS_EVENT_MESSAGE(eMessage)
359 NS_EVENT_MESSAGE(eMessageError)
361 // Menu open event
362 NS_EVENT_MESSAGE(eOpen)
364 // Device motion and orientation
365 NS_EVENT_MESSAGE(eDeviceOrientation)
366 NS_EVENT_MESSAGE(eAbsoluteDeviceOrientation)
367 NS_EVENT_MESSAGE(eDeviceMotion)
368 NS_EVENT_MESSAGE(eUserProximity)
369 NS_EVENT_MESSAGE(eDeviceLight)
370 #if defined(MOZ_WIDGET_ANDROID)
371 NS_EVENT_MESSAGE(eOrientationChange)
372 #endif
374 // WebVR events
375 NS_EVENT_MESSAGE(eVRDisplayActivate)
376 NS_EVENT_MESSAGE(eVRDisplayDeactivate)
377 NS_EVENT_MESSAGE(eVRDisplayConnect)
378 NS_EVENT_MESSAGE(eVRDisplayDisconnect)
379 NS_EVENT_MESSAGE(eVRDisplayPresentChange)
381 NS_EVENT_MESSAGE(eShow)
383 // Fullscreen DOM API
384 NS_EVENT_MESSAGE(eFullscreenChange)
385 NS_EVENT_MESSAGE(eFullscreenError)
386 NS_EVENT_MESSAGE(eMozFullscreenChange)
387 NS_EVENT_MESSAGE(eMozFullscreenError)
389 NS_EVENT_MESSAGE(eTouchStart)
390 NS_EVENT_MESSAGE(eTouchMove)
391 NS_EVENT_MESSAGE(eTouchEnd)
392 NS_EVENT_MESSAGE(eTouchCancel)
393 NS_EVENT_MESSAGE(eTouchPointerCancel)
395 // Pointerlock DOM API
396 NS_EVENT_MESSAGE(ePointerLockChange)
397 NS_EVENT_MESSAGE(ePointerLockError)
398 NS_EVENT_MESSAGE(eMozPointerLockChange)
399 NS_EVENT_MESSAGE(eMozPointerLockError)
401 // eWheel is the event message of DOM wheel event.
402 NS_EVENT_MESSAGE(eWheel)
403 // eWheelOperationStart may be dispatched when user starts to operate mouse
404 // wheel. This won't be fired on some platforms which don't have corresponding
405 // native event.
406 NS_EVENT_MESSAGE(eWheelOperationStart)
407 // eWheelOperationEnd may be dispatched when user ends or cancels operating
408 // mouse wheel. This won't be fired on some platforms which don't have
409 // corresponding native event.
410 NS_EVENT_MESSAGE(eWheelOperationEnd)
412 // MediaRecorder events.
413 NS_EVENT_MESSAGE(eMediaRecorderDataAvailable)
414 NS_EVENT_MESSAGE(eMediaRecorderWarning)
415 NS_EVENT_MESSAGE(eMediaRecorderStop)
417 // Gamepad input events
418 NS_EVENT_MESSAGE(eGamepadButtonDown)
419 NS_EVENT_MESSAGE(eGamepadButtonUp)
420 NS_EVENT_MESSAGE(eGamepadAxisMove)
421 NS_EVENT_MESSAGE(eGamepadConnected)
422 NS_EVENT_MESSAGE(eGamepadDisconnected)
423 NS_EVENT_MESSAGE_FIRST_LAST(eGamepadEvent, eGamepadButtonDown,
424 eGamepadDisconnected)
426 // input and beforeinput events.
427 NS_EVENT_MESSAGE(eEditorInput)
428 NS_EVENT_MESSAGE(eEditorBeforeInput)
430 // selection events
431 NS_EVENT_MESSAGE(eSelectStart)
432 NS_EVENT_MESSAGE(eSelectionChange)
433 NS_EVENT_MESSAGE(eSlotChange)
435 // visibility change
436 NS_EVENT_MESSAGE(eVisibilityChange)
438 // security policy events
439 NS_EVENT_MESSAGE(eSecurityPolicyViolation)
441 // Details element events.
442 NS_EVENT_MESSAGE(eToggle)
444 // Dialog element events.
445 NS_EVENT_MESSAGE(eClose)
447 // Marquee element events.
448 NS_EVENT_MESSAGE(eMarqueeBounce)
449 NS_EVENT_MESSAGE(eMarqueeStart)
450 NS_EVENT_MESSAGE(eMarqueeFinish)
452 #ifdef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
453 # undef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
454 # undef NS_EVENT_MESSAGE_FIRST_LAST
455 #endif