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 #include
"nsISupports.idl"
13 * Contains an event target along with a count of event listener changes
14 * affecting accessibility.
16 [scriptable
, uuid(07222b02
-da12
-4cf4
-b2f7
-761da007a8d8
)]
17 interface nsIEventListenerChange
: nsISupports
19 readonly attribute EventTarget target
;
22 readonly attribute uint32_t countOfEventListenerChangesAffectingAccessibility
;
25 [scriptable
, function
, uuid(aa7c95f6
-d3b5
-44b3
-9597-1d9f19b9c5f2
)]
26 interface nsIListenerChangeListener
: nsISupports
28 void listenersChanged
(in nsIArray aEventListenerChanges
);
32 * An instance of this interface describes how an event listener
33 * was added to an event target.
35 [scriptable
, uuid(11ba5fd7
-8db2
-4b1a
-9f67
-342cfa11afad
)]
36 interface nsIEventListenerInfo
: nsISupports
39 * The type of the event for which the listener was added.
40 * Null if the listener is for all the events.
42 readonly attribute AString type
;
43 readonly attribute
boolean capturing
;
44 readonly attribute
boolean allowsUntrusted
;
45 readonly attribute
boolean inSystemEventGroup
;
48 * Changing the enabled state works only with listeners implemented in
49 * JS. An error is thrown for native listeners.
51 attribute
boolean enabled
;
54 * The underlying JS object of the event listener, if this listener
55 * has one. Null otherwise.
58 readonly attribute jsval listenerObject
;
61 * Tries to serialize event listener to a string.
62 * Returns null if serialization isn't possible
63 * (for example with C++ listeners).
68 [scriptable
, uuid(77aab5f7
-213d
-4db4
-9f22
-e46dfb774f15
)]
69 interface nsIEventListenerService
: nsISupports
72 * Returns an array of nsIEventListenerInfo objects.
73 * If aEventTarget doesn't have any listeners, this returns null.
75 Array
<nsIEventListenerInfo
> getListenerInfoFor
(in EventTarget aEventTarget
);
78 * Returns true if a event target has any listener for the given type.
80 boolean hasListenersFor
(in EventTarget aEventTarget
,
84 void addListenerForAllEvents
(in EventTarget target
,
86 [optional] in boolean aUseCapture
,
87 [optional] in boolean aWantsUntrusted
,
88 [optional] in boolean aSystemEventGroup
);
91 void removeListenerForAllEvents
(in EventTarget target
,
93 [optional] in boolean aUseCapture
,
94 [optional] in boolean aSystemEventGroup
);
96 void addListenerChangeListener
(in nsIListenerChangeListener aListener
);
97 void removeListenerChangeListener
(in nsIListenerChangeListener aListener
);