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 #ifndef _nsEventShell_H_
7 #define _nsEventShell_H_
17 * Used for everything about events.
22 * Fire the accessible event.
24 static void FireEvent(mozilla::a11y::AccEvent
* aEvent
);
27 * Fire accessible event of the given type for the given accessible.
29 * @param aEventType [in] the event type
30 * @param aAccessible [in] the event target
32 static void FireEvent(uint32_t aEventType
,
33 mozilla::a11y::LocalAccessible
* aAccessible
,
34 mozilla::a11y::EIsFromUserInput aIsFromUserInput
=
35 mozilla::a11y::eAutoDetect
);
38 * Fire state change event.
40 static void FireEvent(mozilla::a11y::LocalAccessible
* aTarget
,
41 uint64_t aState
, bool aIsEnabled
,
42 bool aIsFromUserInput
) {
43 RefPtr
<mozilla::a11y::AccStateChangeEvent
> stateChangeEvent
=
44 new mozilla::a11y::AccStateChangeEvent(
45 aTarget
, aState
, aIsEnabled
,
46 (aIsFromUserInput
? mozilla::a11y::eFromUserInput
47 : mozilla::a11y::eNoUserInput
));
48 FireEvent(stateChangeEvent
);
52 * Append 'event-from-input' object attribute if the accessible event has
53 * been fired just now for the given node.
55 * @param aNode [in] the DOM node
56 * @param aAttributes [in, out] the attributes
58 static void GetEventAttributes(nsINode
* aNode
,
59 mozilla::a11y::AccAttributes
* aAttributes
);
62 static mozilla::StaticRefPtr
<nsINode
> sEventTargetNode
;
63 static bool sEventFromUserInput
;