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(eSVGLoad
)
214 NS_EVENT_MESSAGE(eSVGScroll
)
216 // XUL command events
217 NS_EVENT_MESSAGE(eXULCommand
)
219 // Cut, copy, paste events
220 NS_EVENT_MESSAGE(eCopy
)
221 NS_EVENT_MESSAGE(eCut
)
222 NS_EVENT_MESSAGE(ePaste
)
223 NS_EVENT_MESSAGE(ePasteNoFormatting
)
225 // Query for the selected text information, it return the selection offset,
226 // selection length and selected text.
227 NS_EVENT_MESSAGE(eQuerySelectedText
)
228 // Query for the text content of specified range, it returns actual lengh (if
229 // the specified range is too long) and the text of the specified range.
230 // Returns the entire text if requested length > actual length.
231 NS_EVENT_MESSAGE(eQueryTextContent
)
232 // Query for the caret rect of nth insertion point. The offset of the result is
233 // relative position from the top level widget.
234 NS_EVENT_MESSAGE(eQueryCaretRect
)
235 // Query for the bounding rect of a range of characters. This works on any
236 // valid character range given offset and length. Result is relative to top
237 // level widget coordinates
238 NS_EVENT_MESSAGE(eQueryTextRect
)
239 // Query for the bounding rect array of a range of characters.
240 // Thiis similar event of eQueryTextRect.
241 NS_EVENT_MESSAGE(eQueryTextRectArray
)
242 // Query for the bounding rect of the current focused frame. Result is relative
243 // to top level widget coordinates
244 NS_EVENT_MESSAGE(eQueryEditorRect
)
245 // Query for the current state of the content. The particular members of
246 // mReply that are set for each query content event will be valid on success.
247 NS_EVENT_MESSAGE(eQueryContentState
)
248 // Query for the selection in the form of a nsITransferable.
249 NS_EVENT_MESSAGE(eQuerySelectionAsTransferable
)
250 // Query for character at a point. This returns the character offset, its
251 // rect and also tentative caret point if the point is clicked. The point is
252 // specified by Event::mRefPoint.
253 NS_EVENT_MESSAGE(eQueryCharacterAtPoint
)
254 // Query if the DOM element under Event::mRefPoint belongs to our widget
256 NS_EVENT_MESSAGE(eQueryDOMWidgetHittest
)
259 NS_EVENT_MESSAGE(eLoadStart
)
260 NS_EVENT_MESSAGE(eProgress
)
261 NS_EVENT_MESSAGE(eSuspend
)
262 NS_EVENT_MESSAGE(eEmptied
)
263 NS_EVENT_MESSAGE(eStalled
)
264 NS_EVENT_MESSAGE(ePlay
)
265 NS_EVENT_MESSAGE(ePause
)
266 NS_EVENT_MESSAGE(eLoadedMetaData
)
267 NS_EVENT_MESSAGE(eLoadedData
)
268 NS_EVENT_MESSAGE(eWaiting
)
269 NS_EVENT_MESSAGE(ePlaying
)
270 NS_EVENT_MESSAGE(eCanPlay
)
271 NS_EVENT_MESSAGE(eCanPlayThrough
)
272 NS_EVENT_MESSAGE(eSeeking
)
273 NS_EVENT_MESSAGE(eSeeked
)
274 NS_EVENT_MESSAGE(eTimeUpdate
)
275 NS_EVENT_MESSAGE(eEnded
)
276 NS_EVENT_MESSAGE(eRateChange
)
277 NS_EVENT_MESSAGE(eDurationChange
)
278 NS_EVENT_MESSAGE(eVolumeChange
)
280 // paint notification events
281 NS_EVENT_MESSAGE(eAfterPaint
)
283 // Simple gesture events
284 NS_EVENT_MESSAGE(eSwipeGestureMayStart
)
285 NS_EVENT_MESSAGE(eSwipeGestureStart
)
286 NS_EVENT_MESSAGE(eSwipeGestureUpdate
)
287 NS_EVENT_MESSAGE(eSwipeGestureEnd
)
288 NS_EVENT_MESSAGE(eSwipeGesture
)
289 NS_EVENT_MESSAGE(eMagnifyGestureStart
)
290 NS_EVENT_MESSAGE(eMagnifyGestureUpdate
)
291 NS_EVENT_MESSAGE(eMagnifyGesture
)
292 NS_EVENT_MESSAGE(eRotateGestureStart
)
293 NS_EVENT_MESSAGE(eRotateGestureUpdate
)
294 NS_EVENT_MESSAGE(eRotateGesture
)
295 NS_EVENT_MESSAGE(eTapGesture
)
296 NS_EVENT_MESSAGE(ePressTapGesture
)
297 NS_EVENT_MESSAGE(eEdgeUIStarted
)
298 NS_EVENT_MESSAGE(eEdgeUICanceled
)
299 NS_EVENT_MESSAGE(eEdgeUICompleted
)
301 // Events to manipulate selection (WidgetSelectionEvent)
302 // Clear any previous selection and set the given range as the selection
303 NS_EVENT_MESSAGE(eSetSelection
)
305 // Events of commands for the contents
306 NS_EVENT_MESSAGE(eContentCommandCut
)
307 NS_EVENT_MESSAGE(eContentCommandCopy
)
308 NS_EVENT_MESSAGE(eContentCommandPaste
)
309 NS_EVENT_MESSAGE(eContentCommandDelete
)
310 NS_EVENT_MESSAGE(eContentCommandUndo
)
311 NS_EVENT_MESSAGE(eContentCommandRedo
)
312 // eContentCommandInsertText tries to insert text with replacing selection
313 // in focused editor.
314 NS_EVENT_MESSAGE(eContentCommandInsertText
)
315 NS_EVENT_MESSAGE(eContentCommandPasteTransferable
)
316 NS_EVENT_MESSAGE(eContentCommandLookUpDictionary
)
317 // eContentCommandScroll scrolls the nearest scrollable element to the
318 // currently focused content or latest DOM selection. This would normally be
319 // the same element scrolled by keyboard scroll commands, except that this event
320 // will scroll an element scrollable in either direction. I.e., if the nearest
321 // scrollable ancestor element can only be scrolled vertically, and horizontal
322 // scrolling is requested using this event, no scrolling will occur.
323 NS_EVENT_MESSAGE(eContentCommandScroll
)
325 // Event to gesture notification
326 NS_EVENT_MESSAGE(eGestureNotify
)
328 NS_EVENT_MESSAGE(eScrolledAreaChanged
)
330 // CSS Transition & Animation events:
331 NS_EVENT_MESSAGE(eTransitionStart
)
332 NS_EVENT_MESSAGE(eTransitionRun
)
333 NS_EVENT_MESSAGE(eTransitionEnd
)
334 NS_EVENT_MESSAGE(eTransitionCancel
)
335 NS_EVENT_MESSAGE(eAnimationStart
)
336 NS_EVENT_MESSAGE(eAnimationEnd
)
337 NS_EVENT_MESSAGE(eAnimationIteration
)
338 NS_EVENT_MESSAGE(eAnimationCancel
)
340 // Webkit-prefixed versions of Transition & Animation events, for web compat:
341 NS_EVENT_MESSAGE(eWebkitTransitionEnd
)
342 NS_EVENT_MESSAGE(eWebkitAnimationStart
)
343 NS_EVENT_MESSAGE(eWebkitAnimationEnd
)
344 NS_EVENT_MESSAGE(eWebkitAnimationIteration
)
346 NS_EVENT_MESSAGE(eSMILBeginEvent
)
347 NS_EVENT_MESSAGE(eSMILEndEvent
)
348 NS_EVENT_MESSAGE(eSMILRepeatEvent
)
350 NS_EVENT_MESSAGE(eAudioProcess
)
351 NS_EVENT_MESSAGE(eAudioComplete
)
353 // script notification events
354 NS_EVENT_MESSAGE(eBeforeScriptExecute
)
355 NS_EVENT_MESSAGE(eAfterScriptExecute
)
357 NS_EVENT_MESSAGE(eBeforePrint
)
358 NS_EVENT_MESSAGE(eAfterPrint
)
360 NS_EVENT_MESSAGE(eMessage
)
361 NS_EVENT_MESSAGE(eMessageError
)
364 NS_EVENT_MESSAGE(eOpen
)
366 // Device motion and orientation
367 NS_EVENT_MESSAGE(eDeviceOrientation
)
368 NS_EVENT_MESSAGE(eDeviceOrientationAbsolute
)
369 NS_EVENT_MESSAGE(eDeviceMotion
)
370 NS_EVENT_MESSAGE(eUserProximity
)
371 NS_EVENT_MESSAGE(eDeviceLight
)
372 #if defined(MOZ_WIDGET_ANDROID)
373 NS_EVENT_MESSAGE(eOrientationChange
)
377 NS_EVENT_MESSAGE(eVRDisplayActivate
)
378 NS_EVENT_MESSAGE(eVRDisplayDeactivate
)
379 NS_EVENT_MESSAGE(eVRDisplayConnect
)
380 NS_EVENT_MESSAGE(eVRDisplayDisconnect
)
381 NS_EVENT_MESSAGE(eVRDisplayPresentChange
)
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
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
)
431 NS_EVENT_MESSAGE(eSelectStart
)
432 NS_EVENT_MESSAGE(eSelectionChange
)
433 NS_EVENT_MESSAGE(eSlotChange
)
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 NS_EVENT_MESSAGE(eScrollend
)
454 #ifdef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
455 # undef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
456 # undef NS_EVENT_MESSAGE_FIRST_LAST