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 // Widget may be destroyed
37 NS_EVENT_MESSAGE(eWindowClose
)
39 NS_EVENT_MESSAGE(eKeyPress
)
40 NS_EVENT_MESSAGE(eKeyUp
)
41 NS_EVENT_MESSAGE(eKeyDown
)
43 // These messages are dispatched when PluginInstaceChild receives native
44 // keyboard events directly and it posts the information to the widget.
45 // These messages shouldn't be handled by content and non-reserved chrome
47 NS_EVENT_MESSAGE(eKeyDownOnPlugin
)
48 NS_EVENT_MESSAGE(eKeyUpOnPlugin
)
50 // This message is sent after a content process handles a key event or accesskey
51 // to indicate that an potential accesskey was not found. The parent process may
52 // then respond by, for example, opening menus and processing other shortcuts.
53 // It inherits its properties from a keypress event.
54 NS_EVENT_MESSAGE(eAccessKeyNotFound
)
56 NS_EVENT_MESSAGE(eResize
)
57 NS_EVENT_MESSAGE(eScroll
)
59 // Application installation
60 NS_EVENT_MESSAGE(eInstall
)
61 NS_EVENT_MESSAGE(eAppInstalled
)
63 // A plugin was clicked or otherwise focused. ePluginActivate should be
64 // used when the window is not active. ePluginFocus should be used when
65 // the window is active. In the latter case, the dispatcher of the event
66 // is expected to ensure that the plugin's widget is focused beforehand.
67 NS_EVENT_MESSAGE(ePluginActivate
)
68 NS_EVENT_MESSAGE(ePluginFocus
)
70 NS_EVENT_MESSAGE(eOffline
)
71 NS_EVENT_MESSAGE(eOnline
)
73 NS_EVENT_MESSAGE(eLanguageChange
)
75 NS_EVENT_MESSAGE(eMouseMove
)
76 NS_EVENT_MESSAGE(eMouseUp
)
77 NS_EVENT_MESSAGE(eMouseDown
)
78 NS_EVENT_MESSAGE(eMouseEnterIntoWidget
)
79 NS_EVENT_MESSAGE(eMouseExitFromWidget
)
80 NS_EVENT_MESSAGE(eMouseDoubleClick
)
81 NS_EVENT_MESSAGE(eMouseClick
)
82 NS_EVENT_MESSAGE(eMouseAuxClick
)
83 // eMouseActivate is fired when the widget is activated by a click.
84 NS_EVENT_MESSAGE(eMouseActivate
)
85 NS_EVENT_MESSAGE(eMouseOver
)
86 NS_EVENT_MESSAGE(eMouseOut
)
87 NS_EVENT_MESSAGE(eMouseHitTest
)
88 NS_EVENT_MESSAGE(eMouseEnter
)
89 NS_EVENT_MESSAGE(eMouseLeave
)
90 NS_EVENT_MESSAGE(eMouseTouchDrag
)
91 NS_EVENT_MESSAGE(eMouseLongTap
)
92 NS_EVENT_MESSAGE_FIRST_LAST(eMouseEvent
, eMouseMove
, eMouseLongTap
)
94 // Pointer spec events
95 NS_EVENT_MESSAGE(ePointerMove
)
96 NS_EVENT_MESSAGE(ePointerUp
)
97 NS_EVENT_MESSAGE(ePointerDown
)
98 NS_EVENT_MESSAGE(ePointerOver
)
99 NS_EVENT_MESSAGE(ePointerOut
)
100 NS_EVENT_MESSAGE(ePointerEnter
)
101 NS_EVENT_MESSAGE(ePointerLeave
)
102 NS_EVENT_MESSAGE(ePointerCancel
)
103 NS_EVENT_MESSAGE(ePointerGotCapture
)
104 NS_EVENT_MESSAGE(ePointerLostCapture
)
105 NS_EVENT_MESSAGE_FIRST_LAST(ePointerEvent
, ePointerMove
, ePointerLostCapture
)
107 NS_EVENT_MESSAGE(eContextMenu
)
109 NS_EVENT_MESSAGE(eLoad
)
110 NS_EVENT_MESSAGE(eUnload
)
111 NS_EVENT_MESSAGE(eHashChange
)
112 NS_EVENT_MESSAGE(eImageAbort
)
113 NS_EVENT_MESSAGE(eLoadError
)
114 NS_EVENT_MESSAGE(eLoadEnd
)
115 NS_EVENT_MESSAGE(ePopState
)
116 NS_EVENT_MESSAGE(eStorage
)
117 NS_EVENT_MESSAGE(eBeforeUnload
)
118 NS_EVENT_MESSAGE(eReadyStateChange
)
120 NS_EVENT_MESSAGE(eFormSubmit
)
121 NS_EVENT_MESSAGE(eFormReset
)
122 NS_EVENT_MESSAGE(eFormChange
)
123 NS_EVENT_MESSAGE(eFormSelect
)
124 NS_EVENT_MESSAGE(eFormInvalid
)
125 NS_EVENT_MESSAGE(eFormCheckboxStateChange
)
126 NS_EVENT_MESSAGE(eFormRadioStateChange
)
128 //Need separate focus/blur notifications for non-native widgets
129 NS_EVENT_MESSAGE(eFocus
)
130 NS_EVENT_MESSAGE(eBlur
)
131 NS_EVENT_MESSAGE(eFocusIn
)
132 NS_EVENT_MESSAGE(eFocusOut
)
134 NS_EVENT_MESSAGE(eDragEnter
)
135 NS_EVENT_MESSAGE(eDragOver
)
136 NS_EVENT_MESSAGE(eDragExit
)
137 NS_EVENT_MESSAGE(eDrag
)
138 NS_EVENT_MESSAGE(eDragEnd
)
139 NS_EVENT_MESSAGE(eDragStart
)
140 NS_EVENT_MESSAGE(eDrop
)
141 NS_EVENT_MESSAGE(eDragLeave
)
142 NS_EVENT_MESSAGE_FIRST_LAST(eDragDropEvent
, eDragEnter
, eDragLeave
)
144 // XUL specific events
145 NS_EVENT_MESSAGE(eXULPopupShowing
)
146 NS_EVENT_MESSAGE(eXULPopupShown
)
147 NS_EVENT_MESSAGE(eXULPopupPositioned
)
148 NS_EVENT_MESSAGE(eXULPopupHiding
)
149 NS_EVENT_MESSAGE(eXULPopupHidden
)
150 NS_EVENT_MESSAGE(eXULBroadcast
)
151 NS_EVENT_MESSAGE(eXULCommandUpdate
)
153 // Legacy mouse scroll (wheel) events
154 NS_EVENT_MESSAGE(eLegacyMouseLineOrPageScroll
)
155 NS_EVENT_MESSAGE(eLegacyMousePixelScroll
)
157 NS_EVENT_MESSAGE(eScrollPortUnderflow
)
158 NS_EVENT_MESSAGE(eScrollPortOverflow
)
160 NS_EVENT_MESSAGE(eLegacySubtreeModified
)
161 NS_EVENT_MESSAGE(eLegacyNodeInserted
)
162 NS_EVENT_MESSAGE(eLegacyNodeRemoved
)
163 NS_EVENT_MESSAGE(eLegacyNodeRemovedFromDocument
)
164 NS_EVENT_MESSAGE(eLegacyNodeInsertedIntoDocument
)
165 NS_EVENT_MESSAGE(eLegacyAttrModified
)
166 NS_EVENT_MESSAGE(eLegacyCharacterDataModified
)
167 NS_EVENT_MESSAGE_FIRST_LAST(eLegacyMutationEvent
,
168 eLegacySubtreeModified
, eLegacyCharacterDataModified
)
170 NS_EVENT_MESSAGE(eUnidentifiedEvent
)
172 // composition events
173 NS_EVENT_MESSAGE(eCompositionStart
)
174 // eCompositionEnd is the message for DOM compositionend event.
175 // This event should NOT be dispatched from widget if eCompositionCommit
177 NS_EVENT_MESSAGE(eCompositionEnd
)
178 // eCompositionUpdate is the message for DOM compositionupdate event.
179 // This event should NOT be dispatched from widget since it will be dispatched
180 // by mozilla::TextComposition automatically if eCompositionChange event
181 // will change composition string.
182 NS_EVENT_MESSAGE(eCompositionUpdate
)
183 // eCompositionChange is the message for representing a change of
184 // composition string. This should be dispatched from widget even if
185 // composition string isn't changed but the ranges are changed. This causes
186 // a DOM "text" event which is a non-standard DOM event.
187 NS_EVENT_MESSAGE(eCompositionChange
)
188 // eCompositionCommitAsIs is the message for representing a commit of
189 // composition string. TextComposition will commit composition with the
190 // last data. TextComposition will dispatch this event to the DOM tree as
191 // eCompositionChange without clause information. After that,
192 // eCompositionEnd will be dispatched automatically.
193 // Its mData and mRanges should be empty and nullptr.
194 NS_EVENT_MESSAGE(eCompositionCommitAsIs
)
195 // eCompositionCommit is the message for representing a commit of
196 // composition string with its mData value. TextComposition will dispatch this
197 // event to the DOM tree as eCompositionChange without clause information.
198 // After that, eCompositionEnd will be dispatched automatically.
199 // Its mRanges should be nullptr.
200 NS_EVENT_MESSAGE(eCompositionCommit
)
201 // eCompositionCommitRequestHandled is NOT used with any Widget*Event.
202 // This is used only by PBrowser.OnEventNeedingAckHandled(). If active IME
203 // commits composition synchronously, TabParent returns the commit string
204 // to the remote process synchronously. Then, TabChild dispatches
205 // eCompositionCommit in the remote process. Finally, this message is sent
206 // to TabParent. (If IME commits composition asynchronously, this message is
208 NS_EVENT_MESSAGE(eCompositionCommitRequestHandled
)
210 // Following events are defined for deprecated DOM events which are using
211 // InternalUIEvent class.
212 // DOMActivate (mapped with the DOM event and used internally)
213 NS_EVENT_MESSAGE(eLegacyDOMActivate
)
214 // DOMFocusIn (only mapped with the DOM event)
215 NS_EVENT_MESSAGE(eLegacyDOMFocusIn
)
216 // DOMFocusOut (only mapped with the DOM event)
217 NS_EVENT_MESSAGE(eLegacyDOMFocusOut
)
219 // pagetransition events
220 NS_EVENT_MESSAGE(ePageShow
)
221 NS_EVENT_MESSAGE(ePageHide
)
224 NS_EVENT_MESSAGE(eSVGLoad
)
225 NS_EVENT_MESSAGE(eSVGUnload
)
226 NS_EVENT_MESSAGE(eSVGResize
)
227 NS_EVENT_MESSAGE(eSVGScroll
)
230 NS_EVENT_MESSAGE(eSVGZoom
)
232 // XUL command events
233 NS_EVENT_MESSAGE(eXULCommand
)
235 // Cut, copy, paste events
236 NS_EVENT_MESSAGE(eCopy
)
237 NS_EVENT_MESSAGE(eCut
)
238 NS_EVENT_MESSAGE(ePaste
)
239 NS_EVENT_MESSAGE(ePasteNoFormatting
)
241 // Query for the selected text information, it return the selection offset,
242 // selection length and selected text.
243 NS_EVENT_MESSAGE(eQuerySelectedText
)
244 // Query for the text content of specified range, it returns actual lengh (if
245 // the specified range is too long) and the text of the specified range.
246 // Returns the entire text if requested length > actual length.
247 NS_EVENT_MESSAGE(eQueryTextContent
)
248 // Query for the caret rect of nth insertion point. The offset of the result is
249 // relative position from the top level widget.
250 NS_EVENT_MESSAGE(eQueryCaretRect
)
251 // Query for the bounding rect of a range of characters. This works on any
252 // valid character range given offset and length. Result is relative to top
253 // level widget coordinates
254 NS_EVENT_MESSAGE(eQueryTextRect
)
255 // Query for the bounding rect array of a range of characters.
256 // Thiis similar event of eQueryTextRect.
257 NS_EVENT_MESSAGE(eQueryTextRectArray
)
258 // Query for the bounding rect of the current focused frame. Result is relative
259 // to top level widget coordinates
260 NS_EVENT_MESSAGE(eQueryEditorRect
)
261 // Query for the current state of the content. The particular members of
262 // mReply that are set for each query content event will be valid on success.
263 NS_EVENT_MESSAGE(eQueryContentState
)
264 // Query for the selection in the form of a nsITransferable.
265 NS_EVENT_MESSAGE(eQuerySelectionAsTransferable
)
266 // Query for character at a point. This returns the character offset, its
267 // rect and also tentative caret point if the point is clicked. The point is
268 // specified by Event::mRefPoint.
269 NS_EVENT_MESSAGE(eQueryCharacterAtPoint
)
270 // Query if the DOM element under Event::mRefPoint belongs to our widget
272 NS_EVENT_MESSAGE(eQueryDOMWidgetHittest
)
275 NS_EVENT_MESSAGE(eLoadStart
)
276 NS_EVENT_MESSAGE(eProgress
)
277 NS_EVENT_MESSAGE(eSuspend
)
278 NS_EVENT_MESSAGE(eEmptied
)
279 NS_EVENT_MESSAGE(eStalled
)
280 NS_EVENT_MESSAGE(ePlay
)
281 NS_EVENT_MESSAGE(ePause
)
282 NS_EVENT_MESSAGE(eLoadedMetaData
)
283 NS_EVENT_MESSAGE(eLoadedData
)
284 NS_EVENT_MESSAGE(eWaiting
)
285 NS_EVENT_MESSAGE(ePlaying
)
286 NS_EVENT_MESSAGE(eCanPlay
)
287 NS_EVENT_MESSAGE(eCanPlayThrough
)
288 NS_EVENT_MESSAGE(eSeeking
)
289 NS_EVENT_MESSAGE(eSeeked
)
290 NS_EVENT_MESSAGE(eTimeUpdate
)
291 NS_EVENT_MESSAGE(eEnded
)
292 NS_EVENT_MESSAGE(eRateChange
)
293 NS_EVENT_MESSAGE(eDurationChange
)
294 NS_EVENT_MESSAGE(eVolumeChange
)
296 // paint notification events
297 NS_EVENT_MESSAGE(eAfterPaint
)
299 // Simple gesture events
300 NS_EVENT_MESSAGE(eSwipeGestureMayStart
)
301 NS_EVENT_MESSAGE(eSwipeGestureStart
)
302 NS_EVENT_MESSAGE(eSwipeGestureUpdate
)
303 NS_EVENT_MESSAGE(eSwipeGestureEnd
)
304 NS_EVENT_MESSAGE(eSwipeGesture
)
305 NS_EVENT_MESSAGE(eMagnifyGestureStart
)
306 NS_EVENT_MESSAGE(eMagnifyGestureUpdate
)
307 NS_EVENT_MESSAGE(eMagnifyGesture
)
308 NS_EVENT_MESSAGE(eRotateGestureStart
)
309 NS_EVENT_MESSAGE(eRotateGestureUpdate
)
310 NS_EVENT_MESSAGE(eRotateGesture
)
311 NS_EVENT_MESSAGE(eTapGesture
)
312 NS_EVENT_MESSAGE(ePressTapGesture
)
313 NS_EVENT_MESSAGE(eEdgeUIStarted
)
314 NS_EVENT_MESSAGE(eEdgeUICanceled
)
315 NS_EVENT_MESSAGE(eEdgeUICompleted
)
317 // These are used to send native events to plugins.
318 NS_EVENT_MESSAGE(ePluginInputEvent
)
320 // Events to manipulate selection (WidgetSelectionEvent)
321 // Clear any previous selection and set the given range as the selection
322 NS_EVENT_MESSAGE(eSetSelection
)
324 // Events of commands for the contents
325 NS_EVENT_MESSAGE(eContentCommandCut
)
326 NS_EVENT_MESSAGE(eContentCommandCopy
)
327 NS_EVENT_MESSAGE(eContentCommandPaste
)
328 NS_EVENT_MESSAGE(eContentCommandDelete
)
329 NS_EVENT_MESSAGE(eContentCommandUndo
)
330 NS_EVENT_MESSAGE(eContentCommandRedo
)
331 NS_EVENT_MESSAGE(eContentCommandPasteTransferable
)
332 NS_EVENT_MESSAGE(eContentCommandLookUpDictionary
)
333 // eContentCommandScroll scrolls the nearest scrollable element to the
334 // currently focused content or latest DOM selection. This would normally be
335 // the same element scrolled by keyboard scroll commands, except that this event
336 // will scroll an element scrollable in either direction. I.e., if the nearest
337 // scrollable ancestor element can only be scrolled vertically, and horizontal
338 // scrolling is requested using this event, no scrolling will occur.
339 NS_EVENT_MESSAGE(eContentCommandScroll
)
341 // Event to gesture notification
342 NS_EVENT_MESSAGE(eGestureNotify
)
344 NS_EVENT_MESSAGE(eScrolledAreaChanged
)
346 // CSS Transition & Animation events:
347 NS_EVENT_MESSAGE(eTransitionStart
)
348 NS_EVENT_MESSAGE(eTransitionRun
)
349 NS_EVENT_MESSAGE(eTransitionEnd
)
350 NS_EVENT_MESSAGE(eTransitionCancel
)
351 NS_EVENT_MESSAGE(eAnimationStart
)
352 NS_EVENT_MESSAGE(eAnimationEnd
)
353 NS_EVENT_MESSAGE(eAnimationIteration
)
354 NS_EVENT_MESSAGE(eAnimationCancel
)
356 // Webkit-prefixed versions of Transition & Animation events, for web compat:
357 NS_EVENT_MESSAGE(eWebkitTransitionEnd
)
358 NS_EVENT_MESSAGE(eWebkitAnimationStart
)
359 NS_EVENT_MESSAGE(eWebkitAnimationEnd
)
360 NS_EVENT_MESSAGE(eWebkitAnimationIteration
)
362 NS_EVENT_MESSAGE(eSMILBeginEvent
)
363 NS_EVENT_MESSAGE(eSMILEndEvent
)
364 NS_EVENT_MESSAGE(eSMILRepeatEvent
)
366 NS_EVENT_MESSAGE(eAudioProcess
)
367 NS_EVENT_MESSAGE(eAudioComplete
)
369 // script notification events
370 NS_EVENT_MESSAGE(eBeforeScriptExecute
)
371 NS_EVENT_MESSAGE(eAfterScriptExecute
)
373 NS_EVENT_MESSAGE(eBeforePrint
)
374 NS_EVENT_MESSAGE(eAfterPrint
)
376 NS_EVENT_MESSAGE(eMessage
)
377 NS_EVENT_MESSAGE(eMessageError
)
380 NS_EVENT_MESSAGE(eOpen
)
382 // Device motion and orientation
383 NS_EVENT_MESSAGE(eDeviceOrientation
)
384 NS_EVENT_MESSAGE(eAbsoluteDeviceOrientation
)
385 NS_EVENT_MESSAGE(eDeviceMotion
)
386 NS_EVENT_MESSAGE(eDeviceProximity
)
387 NS_EVENT_MESSAGE(eUserProximity
)
388 NS_EVENT_MESSAGE(eDeviceLight
)
389 #if defined(MOZ_WIDGET_ANDROID)
390 NS_EVENT_MESSAGE(eOrientationChange
)
394 NS_EVENT_MESSAGE(eVRDisplayActivate
)
395 NS_EVENT_MESSAGE(eVRDisplayDeactivate
)
396 NS_EVENT_MESSAGE(eVRDisplayConnect
)
397 NS_EVENT_MESSAGE(eVRDisplayDisconnect
)
398 NS_EVENT_MESSAGE(eVRDisplayPresentChange
)
400 NS_EVENT_MESSAGE(eShow
)
402 // Fullscreen DOM API
403 NS_EVENT_MESSAGE(eFullscreenChange
)
404 NS_EVENT_MESSAGE(eFullscreenError
)
405 NS_EVENT_MESSAGE(eMozFullscreenChange
)
406 NS_EVENT_MESSAGE(eMozFullscreenError
)
408 NS_EVENT_MESSAGE(eTouchStart
)
409 NS_EVENT_MESSAGE(eTouchMove
)
410 NS_EVENT_MESSAGE(eTouchEnd
)
411 NS_EVENT_MESSAGE(eTouchCancel
)
412 NS_EVENT_MESSAGE(eTouchPointerCancel
)
414 // Pointerlock DOM API
415 NS_EVENT_MESSAGE(ePointerLockChange
)
416 NS_EVENT_MESSAGE(ePointerLockError
)
417 NS_EVENT_MESSAGE(eMozPointerLockChange
)
418 NS_EVENT_MESSAGE(eMozPointerLockError
)
420 // eWheel is the event message of DOM wheel event.
421 NS_EVENT_MESSAGE(eWheel
)
422 // eWheelOperationStart may be dispatched when user starts to operate mouse
423 // wheel. This won't be fired on some platforms which don't have corresponding
425 NS_EVENT_MESSAGE(eWheelOperationStart
)
426 // eWheelOperationEnd may be dispatched when user ends or cancels operating
427 // mouse wheel. This won't be fired on some platforms which don't have
428 // corresponding native event.
429 NS_EVENT_MESSAGE(eWheelOperationEnd
)
431 //System time is changed
432 NS_EVENT_MESSAGE(eTimeChange
)
434 // Network packet events.
435 NS_EVENT_MESSAGE(eNetworkUpload
)
436 NS_EVENT_MESSAGE(eNetworkDownload
)
438 // MediaRecorder events.
439 NS_EVENT_MESSAGE(eMediaRecorderDataAvailable
)
440 NS_EVENT_MESSAGE(eMediaRecorderWarning
)
441 NS_EVENT_MESSAGE(eMediaRecorderStop
)
443 // Gamepad input events
444 NS_EVENT_MESSAGE(eGamepadButtonDown
)
445 NS_EVENT_MESSAGE(eGamepadButtonUp
)
446 NS_EVENT_MESSAGE(eGamepadAxisMove
)
447 NS_EVENT_MESSAGE(eGamepadConnected
)
448 NS_EVENT_MESSAGE(eGamepadDisconnected
)
449 NS_EVENT_MESSAGE_FIRST_LAST(eGamepadEvent
,
450 eGamepadButtonDown
, eGamepadDisconnected
)
452 // input and beforeinput events.
453 NS_EVENT_MESSAGE(eEditorInput
)
456 NS_EVENT_MESSAGE(eSelectStart
)
457 NS_EVENT_MESSAGE(eSelectionChange
)
460 NS_EVENT_MESSAGE(eVisibilityChange
)
462 // Details element events.
463 NS_EVENT_MESSAGE(eToggle
)
465 // Dialog element events.
466 NS_EVENT_MESSAGE(eClose
)
468 #ifdef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
469 #undef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
470 #undef NS_EVENT_MESSAGE_FIRST_LAST