diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/events/nsIEventListenerService.idl | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/events/nsIEventListenerService.idl')
-rw-r--r-- | dom/events/nsIEventListenerService.idl | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/dom/events/nsIEventListenerService.idl b/dom/events/nsIEventListenerService.idl new file mode 100644 index 000000000..d59574449 --- /dev/null +++ b/dom/events/nsIEventListenerService.idl @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIDOMEventListener; +interface nsIDOMEventTarget; +interface nsIArray; + +/** + * Contains an event target along with an array of nsIAtom in form "oneventname" + * representing changed event listener names. + */ +[scriptable, uuid(07222b02-da12-4cf4-b2f7-761da007a8d8)] +interface nsIEventListenerChange : nsISupports +{ + readonly attribute nsIDOMEventTarget target; + readonly attribute nsIArray changedListenerNames; +}; + +[scriptable, function, uuid(aa7c95f6-d3b5-44b3-9597-1d9f19b9c5f2)] +interface nsIListenerChangeListener : nsISupports +{ + void listenersChanged(in nsIArray aEventListenerChanges); +}; + +/** + * An instance of this interface describes how an event listener + * was added to an event target. + */ +[scriptable, uuid(11ba5fd7-8db2-4b1a-9f67-342cfa11afad)] +interface nsIEventListenerInfo : nsISupports +{ + /** + * The type of the event for which the listener was added. + * Null if the listener is for all the events. + */ + readonly attribute AString type; + readonly attribute boolean capturing; + readonly attribute boolean allowsUntrusted; + readonly attribute boolean inSystemEventGroup; + + /** + * The underlying JS object of the event listener, if this listener + * has one. Null otherwise. + */ + [implicit_jscontext] + readonly attribute jsval listenerObject; + + /** + * Tries to serialize event listener to a string. + * Returns null if serialization isn't possible + * (for example with C++ listeners). + */ + AString toSource(); +}; + +[scriptable, uuid(77aab5f7-213d-4db4-9f22-e46dfb774f15)] +interface nsIEventListenerService : nsISupports +{ + /** + * Returns an array of nsIEventListenerInfo objects. + * If aEventTarget doesn't have any listeners, this returns null. + */ + void getListenerInfoFor(in nsIDOMEventTarget aEventTarget, + [optional] out unsigned long aCount, + [retval, array, size_is(aCount)] out + nsIEventListenerInfo aOutArray); + + /** + * Returns an array of event targets. + * aEventTarget will be at index 0. + * The objects are the ones that would be used as DOMEvent.currentTarget while + * dispatching an event to aEventTarget + * @note Some events, especially 'load', may actually have a shorter + * event target chain than what this methods returns. + */ + void getEventTargetChainFor(in nsIDOMEventTarget aEventTarget, + in boolean composed, + [optional] out unsigned long aCount, + [retval, array, size_is(aCount)] out + nsIDOMEventTarget aOutArray); + + /** + * Returns true if a event target has any listener for the given type. + */ + boolean hasListenersFor(in nsIDOMEventTarget aEventTarget, + in DOMString aType); + + /** + * Add a system-group eventlistener to a event target. + */ + void addSystemEventListener(in nsIDOMEventTarget target, + in DOMString type, + in nsIDOMEventListener listener, + in boolean useCapture); + + /** + * Remove a system-group eventlistener from a event target. + */ + void removeSystemEventListener(in nsIDOMEventTarget target, + in DOMString type, + in nsIDOMEventListener listener, + in boolean useCapture); + + void addListenerForAllEvents(in nsIDOMEventTarget target, + in nsIDOMEventListener listener, + [optional] in boolean aUseCapture, + [optional] in boolean aWantsUntrusted, + [optional] in boolean aSystemEventGroup); + + void removeListenerForAllEvents(in nsIDOMEventTarget target, + in nsIDOMEventListener listener, + [optional] in boolean aUseCapture, + [optional] in boolean aSystemEventGroup); + + void addListenerChangeListener(in nsIListenerChangeListener aListener); + void removeListenerChangeListener(in nsIListenerChangeListener aListener); +}; + |