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 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
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)
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(eBeforeToggle
)
95 NS_EVENT_MESSAGE(eLoad
)
96 NS_EVENT_MESSAGE(eUnload
)
97 NS_EVENT_MESSAGE(eHashChange
)
98 NS_EVENT_MESSAGE(eImageAbort
)
99 NS_EVENT_MESSAGE(eLoadError
)
100 NS_EVENT_MESSAGE(eLoadEnd
)
101 NS_EVENT_MESSAGE(ePopState
)
102 NS_EVENT_MESSAGE(eRejectionHandled
)
103 NS_EVENT_MESSAGE(eStorage
)
104 NS_EVENT_MESSAGE(eUnhandledRejection
)
105 NS_EVENT_MESSAGE(eBeforeUnload
)
106 NS_EVENT_MESSAGE(eReadyStateChange
)
108 NS_EVENT_MESSAGE(eFormSubmit
)
109 NS_EVENT_MESSAGE(eFormReset
)
110 NS_EVENT_MESSAGE(eFormChange
)
111 NS_EVENT_MESSAGE(eFormSelect
)
112 NS_EVENT_MESSAGE(eFormInvalid
)
113 NS_EVENT_MESSAGE(eFormCheckboxStateChange
)
114 NS_EVENT_MESSAGE(eFormRadioStateChange
)
115 NS_EVENT_MESSAGE(eFormData
)
117 // Need separate focus/blur notifications for non-native widgets
118 NS_EVENT_MESSAGE(eFocus
)
119 NS_EVENT_MESSAGE(eBlur
)
120 NS_EVENT_MESSAGE(eFocusIn
)
121 NS_EVENT_MESSAGE(eFocusOut
)
123 NS_EVENT_MESSAGE(eDragEnter
)
124 NS_EVENT_MESSAGE(eDragOver
)
125 NS_EVENT_MESSAGE(eDragExit
)
126 NS_EVENT_MESSAGE(eDrag
)
127 NS_EVENT_MESSAGE(eDragEnd
)
128 NS_EVENT_MESSAGE(eDragStart
)
129 NS_EVENT_MESSAGE(eDrop
)
130 NS_EVENT_MESSAGE(eDragLeave
)
131 NS_EVENT_MESSAGE_FIRST_LAST(eDragDropEvent
, eDragEnter
, eDragLeave
)
133 // XUL specific events
134 NS_EVENT_MESSAGE(eXULPopupShowing
)
135 NS_EVENT_MESSAGE(eXULPopupShown
)
136 NS_EVENT_MESSAGE(eXULPopupHiding
)
137 NS_EVENT_MESSAGE(eXULPopupHidden
)
138 NS_EVENT_MESSAGE(eXULBroadcast
)
139 NS_EVENT_MESSAGE(eXULCommandUpdate
)
140 NS_EVENT_MESSAGE(eXULSystemStatusBarClick
)
142 // Legacy mouse scroll (wheel) events
143 NS_EVENT_MESSAGE(eLegacyMouseLineOrPageScroll
)
144 NS_EVENT_MESSAGE(eLegacyMousePixelScroll
)
146 NS_EVENT_MESSAGE(eScrollPortUnderflow
)
147 NS_EVENT_MESSAGE(eScrollPortOverflow
)
149 NS_EVENT_MESSAGE(eLegacySubtreeModified
)
150 NS_EVENT_MESSAGE(eLegacyNodeInserted
)
151 NS_EVENT_MESSAGE(eLegacyNodeRemoved
)
152 NS_EVENT_MESSAGE(eLegacyNodeRemovedFromDocument
)
153 NS_EVENT_MESSAGE(eLegacyNodeInsertedIntoDocument
)
154 NS_EVENT_MESSAGE(eLegacyAttrModified
)
155 NS_EVENT_MESSAGE(eLegacyCharacterDataModified
)
156 NS_EVENT_MESSAGE_FIRST_LAST(eLegacyMutationEvent
, eLegacySubtreeModified
,
157 eLegacyCharacterDataModified
)
159 NS_EVENT_MESSAGE(eUnidentifiedEvent
)
161 // composition events
162 NS_EVENT_MESSAGE(eCompositionStart
)
163 // eCompositionEnd is the message for DOM compositionend event.
164 // This event should NOT be dispatched from widget if eCompositionCommit
166 NS_EVENT_MESSAGE(eCompositionEnd
)
167 // eCompositionUpdate is the message for DOM compositionupdate event.
168 // This event should NOT be dispatched from widget since it will be dispatched
169 // by mozilla::TextComposition automatically if eCompositionChange event
170 // will change composition string.
171 NS_EVENT_MESSAGE(eCompositionUpdate
)
172 // eCompositionChange is the message for representing a change of
173 // composition string. This should be dispatched from widget even if
174 // composition string isn't changed but the ranges are changed. This causes
175 // a DOM "text" event which is a non-standard DOM event.
176 NS_EVENT_MESSAGE(eCompositionChange
)
177 // eCompositionCommitAsIs is the message for representing a commit of
178 // composition string. TextComposition will commit composition with the
179 // last data. TextComposition will dispatch this event to the DOM tree as
180 // eCompositionChange without clause information. After that,
181 // eCompositionEnd will be dispatched automatically.
182 // Its mData and mRanges should be empty and nullptr.
183 NS_EVENT_MESSAGE(eCompositionCommitAsIs
)
184 // eCompositionCommit is the message for representing a commit of
185 // composition string with its mData value. TextComposition will dispatch this
186 // event to the DOM tree as eCompositionChange without clause information.
187 // After that, eCompositionEnd will be dispatched automatically.
188 // Its mRanges should be nullptr.
189 NS_EVENT_MESSAGE(eCompositionCommit
)
190 // eCompositionCommitRequestHandled is NOT used with any Widget*Event.
191 // This is used only by PBrowser.OnEventNeedingAckHandled(). If active IME
192 // commits composition synchronously, BrowserParent returns the commit string
193 // to the remote process synchronously. Then, BrowserChild dispatches
194 // eCompositionCommit in the remote process. Finally, this message is sent
195 // to BrowserParent. (If IME commits composition asynchronously, this message
197 NS_EVENT_MESSAGE(eCompositionCommitRequestHandled
)
199 // Following events are defined for deprecated DOM events which are using
200 // InternalUIEvent class.
201 // DOMActivate (mapped with the DOM event and used internally)
202 NS_EVENT_MESSAGE(eLegacyDOMActivate
)
203 // DOMFocusIn (only mapped with the DOM event)
204 NS_EVENT_MESSAGE(eLegacyDOMFocusIn
)
205 // DOMFocusOut (only mapped with the DOM event)
206 NS_EVENT_MESSAGE(eLegacyDOMFocusOut
)
208 // pagetransition events
209 NS_EVENT_MESSAGE(ePageShow
)
210 NS_EVENT_MESSAGE(ePageHide
)
213 NS_EVENT_MESSAGE(eContextLost
)
214 NS_EVENT_MESSAGE(eContextRestored
)
217 NS_EVENT_MESSAGE(eSVGLoad
)
218 NS_EVENT_MESSAGE(eSVGScroll
)
220 // XUL command events
221 NS_EVENT_MESSAGE(eXULCommand
)
223 // Cut, copy, paste events
224 NS_EVENT_MESSAGE(eCopy
)
225 NS_EVENT_MESSAGE(eCut
)
226 NS_EVENT_MESSAGE(ePaste
)
227 NS_EVENT_MESSAGE(ePasteNoFormatting
)
229 // Query for the selected text information, it return the selection offset,
230 // selection length and selected text.
231 NS_EVENT_MESSAGE(eQuerySelectedText
)
232 // Query for the text content of specified range, it returns actual lengh (if
233 // the specified range is too long) and the text of the specified range.
234 // Returns the entire text if requested length > actual length.
235 NS_EVENT_MESSAGE(eQueryTextContent
)
236 // Query for the caret rect of nth insertion point. The offset of the result is
237 // relative position from the top level widget.
238 NS_EVENT_MESSAGE(eQueryCaretRect
)
239 // Query for the bounding rect of a range of characters. This works on any
240 // valid character range given offset and length. Result is relative to top
241 // level widget coordinates
242 NS_EVENT_MESSAGE(eQueryTextRect
)
243 // Query for the bounding rect array of a range of characters.
244 // Thiis similar event of eQueryTextRect.
245 NS_EVENT_MESSAGE(eQueryTextRectArray
)
246 // Query for the bounding rect of the current focused frame. Result is relative
247 // to top level widget coordinates
248 NS_EVENT_MESSAGE(eQueryEditorRect
)
249 // Query for the current state of the content. The particular members of
250 // mReply that are set for each query content event will be valid on success.
251 NS_EVENT_MESSAGE(eQueryContentState
)
252 // Query for the selection in the form of a nsITransferable.
253 NS_EVENT_MESSAGE(eQuerySelectionAsTransferable
)
254 // Query for character at a point. This returns the character offset, its
255 // rect and also tentative caret point if the point is clicked. The point is
256 // specified by Event::mRefPoint.
257 NS_EVENT_MESSAGE(eQueryCharacterAtPoint
)
258 // Query if the DOM element under Event::mRefPoint belongs to our widget
260 NS_EVENT_MESSAGE(eQueryDOMWidgetHittest
)
263 NS_EVENT_MESSAGE(eLoadStart
)
264 NS_EVENT_MESSAGE(eProgress
)
265 NS_EVENT_MESSAGE(eSuspend
)
266 NS_EVENT_MESSAGE(eEmptied
)
267 NS_EVENT_MESSAGE(eStalled
)
268 NS_EVENT_MESSAGE(ePlay
)
269 NS_EVENT_MESSAGE(ePause
)
270 NS_EVENT_MESSAGE(eLoadedMetaData
)
271 NS_EVENT_MESSAGE(eLoadedData
)
272 NS_EVENT_MESSAGE(eWaiting
)
273 NS_EVENT_MESSAGE(ePlaying
)
274 NS_EVENT_MESSAGE(eCanPlay
)
275 NS_EVENT_MESSAGE(eCanPlayThrough
)
276 NS_EVENT_MESSAGE(eSeeking
)
277 NS_EVENT_MESSAGE(eSeeked
)
278 NS_EVENT_MESSAGE(eTimeUpdate
)
279 NS_EVENT_MESSAGE(eEnded
)
280 NS_EVENT_MESSAGE(eRateChange
)
281 NS_EVENT_MESSAGE(eDurationChange
)
282 NS_EVENT_MESSAGE(eVolumeChange
)
284 // paint notification events
285 NS_EVENT_MESSAGE(eAfterPaint
)
287 // Simple gesture events
288 NS_EVENT_MESSAGE(eSwipeGestureMayStart
)
289 NS_EVENT_MESSAGE(eSwipeGestureStart
)
290 NS_EVENT_MESSAGE(eSwipeGestureUpdate
)
291 NS_EVENT_MESSAGE(eSwipeGestureEnd
)
292 NS_EVENT_MESSAGE(eSwipeGesture
)
293 NS_EVENT_MESSAGE(eMagnifyGestureStart
)
294 NS_EVENT_MESSAGE(eMagnifyGestureUpdate
)
295 NS_EVENT_MESSAGE(eMagnifyGesture
)
296 NS_EVENT_MESSAGE(eRotateGestureStart
)
297 NS_EVENT_MESSAGE(eRotateGestureUpdate
)
298 NS_EVENT_MESSAGE(eRotateGesture
)
299 NS_EVENT_MESSAGE(eTapGesture
)
300 NS_EVENT_MESSAGE(ePressTapGesture
)
301 NS_EVENT_MESSAGE(eEdgeUIStarted
)
302 NS_EVENT_MESSAGE(eEdgeUICanceled
)
303 NS_EVENT_MESSAGE(eEdgeUICompleted
)
305 // Events to manipulate selection (WidgetSelectionEvent)
306 // Clear any previous selection and set the given range as the selection
307 NS_EVENT_MESSAGE(eSetSelection
)
309 // Events of commands for the contents
310 NS_EVENT_MESSAGE(eContentCommandCut
)
311 NS_EVENT_MESSAGE(eContentCommandCopy
)
312 NS_EVENT_MESSAGE(eContentCommandPaste
)
313 NS_EVENT_MESSAGE(eContentCommandDelete
)
314 NS_EVENT_MESSAGE(eContentCommandUndo
)
315 NS_EVENT_MESSAGE(eContentCommandRedo
)
316 // eContentCommandInsertText tries to insert text with replacing selection
317 // in focused editor.
318 NS_EVENT_MESSAGE(eContentCommandInsertText
)
319 NS_EVENT_MESSAGE(eContentCommandPasteTransferable
)
320 NS_EVENT_MESSAGE(eContentCommandLookUpDictionary
)
321 // eContentCommandScroll scrolls the nearest scrollable element to the
322 // currently focused content or latest DOM selection. This would normally be
323 // the same element scrolled by keyboard scroll commands, except that this event
324 // will scroll an element scrollable in either direction. I.e., if the nearest
325 // scrollable ancestor element can only be scrolled vertically, and horizontal
326 // scrolling is requested using this event, no scrolling will occur.
327 NS_EVENT_MESSAGE(eContentCommandScroll
)
329 // Event to gesture notification
330 NS_EVENT_MESSAGE(eGestureNotify
)
332 NS_EVENT_MESSAGE(eScrolledAreaChanged
)
334 // CSS Transition & Animation events:
335 NS_EVENT_MESSAGE(eTransitionStart
)
336 NS_EVENT_MESSAGE(eTransitionRun
)
337 NS_EVENT_MESSAGE(eTransitionEnd
)
338 NS_EVENT_MESSAGE(eTransitionCancel
)
339 NS_EVENT_MESSAGE(eAnimationStart
)
340 NS_EVENT_MESSAGE(eAnimationEnd
)
341 NS_EVENT_MESSAGE(eAnimationIteration
)
342 NS_EVENT_MESSAGE(eAnimationCancel
)
344 // Webkit-prefixed versions of Transition & Animation events, for web compat:
345 NS_EVENT_MESSAGE(eWebkitTransitionEnd
)
346 NS_EVENT_MESSAGE(eWebkitAnimationStart
)
347 NS_EVENT_MESSAGE(eWebkitAnimationEnd
)
348 NS_EVENT_MESSAGE(eWebkitAnimationIteration
)
350 NS_EVENT_MESSAGE(eSMILBeginEvent
)
351 NS_EVENT_MESSAGE(eSMILEndEvent
)
352 NS_EVENT_MESSAGE(eSMILRepeatEvent
)
354 NS_EVENT_MESSAGE(eAudioProcess
)
355 NS_EVENT_MESSAGE(eAudioComplete
)
357 // script notification events
358 NS_EVENT_MESSAGE(eBeforeScriptExecute
)
359 NS_EVENT_MESSAGE(eAfterScriptExecute
)
361 NS_EVENT_MESSAGE(eBeforePrint
)
362 NS_EVENT_MESSAGE(eAfterPrint
)
364 NS_EVENT_MESSAGE(eMessage
)
365 NS_EVENT_MESSAGE(eMessageError
)
366 NS_EVENT_MESSAGE(eRTCTransform
)
369 NS_EVENT_MESSAGE(eOpen
)
371 // Device motion and orientation
372 NS_EVENT_MESSAGE(eDeviceOrientation
)
373 NS_EVENT_MESSAGE(eDeviceOrientationAbsolute
)
374 NS_EVENT_MESSAGE(eDeviceMotion
)
375 NS_EVENT_MESSAGE(eUserProximity
)
376 NS_EVENT_MESSAGE(eDeviceLight
)
377 #if defined(MOZ_WIDGET_ANDROID)
378 NS_EVENT_MESSAGE(eOrientationChange
)
382 NS_EVENT_MESSAGE(eVRDisplayActivate
)
383 NS_EVENT_MESSAGE(eVRDisplayDeactivate
)
384 NS_EVENT_MESSAGE(eVRDisplayConnect
)
385 NS_EVENT_MESSAGE(eVRDisplayDisconnect
)
386 NS_EVENT_MESSAGE(eVRDisplayPresentChange
)
388 // Fullscreen DOM API
389 NS_EVENT_MESSAGE(eFullscreenChange
)
390 NS_EVENT_MESSAGE(eFullscreenError
)
391 NS_EVENT_MESSAGE(eMozFullscreenChange
)
392 NS_EVENT_MESSAGE(eMozFullscreenError
)
394 NS_EVENT_MESSAGE(eTouchStart
)
395 NS_EVENT_MESSAGE(eTouchMove
)
396 NS_EVENT_MESSAGE(eTouchEnd
)
397 NS_EVENT_MESSAGE(eTouchCancel
)
398 NS_EVENT_MESSAGE(eTouchPointerCancel
)
400 // Pointerlock DOM API
401 NS_EVENT_MESSAGE(ePointerLockChange
)
402 NS_EVENT_MESSAGE(ePointerLockError
)
403 NS_EVENT_MESSAGE(eMozPointerLockChange
)
404 NS_EVENT_MESSAGE(eMozPointerLockError
)
406 // eWheel is the event message of DOM wheel event.
407 NS_EVENT_MESSAGE(eWheel
)
408 // eWheelOperationStart may be dispatched when user starts to operate mouse
409 // wheel. This won't be fired on some platforms which don't have corresponding
411 NS_EVENT_MESSAGE(eWheelOperationStart
)
412 // eWheelOperationEnd may be dispatched when user ends or cancels operating
413 // mouse wheel. This won't be fired on some platforms which don't have
414 // corresponding native event.
415 NS_EVENT_MESSAGE(eWheelOperationEnd
)
417 // MediaRecorder events.
418 NS_EVENT_MESSAGE(eMediaRecorderDataAvailable
)
419 NS_EVENT_MESSAGE(eMediaRecorderWarning
)
420 NS_EVENT_MESSAGE(eMediaRecorderStop
)
422 // Gamepad input events
423 NS_EVENT_MESSAGE(eGamepadButtonDown
)
424 NS_EVENT_MESSAGE(eGamepadButtonUp
)
425 NS_EVENT_MESSAGE(eGamepadAxisMove
)
426 NS_EVENT_MESSAGE(eGamepadConnected
)
427 NS_EVENT_MESSAGE(eGamepadDisconnected
)
428 NS_EVENT_MESSAGE_FIRST_LAST(eGamepadEvent
, eGamepadButtonDown
,
429 eGamepadDisconnected
)
431 // input and beforeinput events.
432 NS_EVENT_MESSAGE(eEditorInput
)
433 NS_EVENT_MESSAGE(eEditorBeforeInput
)
436 NS_EVENT_MESSAGE(eSelectStart
)
437 NS_EVENT_MESSAGE(eSelectionChange
)
438 NS_EVENT_MESSAGE(eSlotChange
)
441 NS_EVENT_MESSAGE(eVisibilityChange
)
443 // security policy events
444 NS_EVENT_MESSAGE(eSecurityPolicyViolation
)
446 // Details element events.
447 NS_EVENT_MESSAGE(eToggle
)
449 // Dialog element events.
450 NS_EVENT_MESSAGE(eClose
)
451 NS_EVENT_MESSAGE(eCancel
)
453 // Marquee element events.
454 NS_EVENT_MESSAGE(eMarqueeBounce
)
455 NS_EVENT_MESSAGE(eMarqueeStart
)
456 NS_EVENT_MESSAGE(eMarqueeFinish
)
458 NS_EVENT_MESSAGE(eScrollend
)
460 #ifdef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
461 # undef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
462 # undef NS_EVENT_MESSAGE_FIRST_LAST