listenable.js
No description.

File Location

/goog/events/listenable.js

Classes

goog.events.Listenable
A listenable interface. A listenable is an object with the ability to dispatch/broadcast events to "event listeners" registered via listen/listenOnce. The interface allows for an event propagation mechanism similar to one offered by native browser event targets, such as capture/bubble mechanism, stopping propagation, and preventing default actions. Capture/bubble mechanism depends on the ancestor tree constructed via #getParentEventTarget; this tree must be directed acyclic graph. The meaning of default action(s) in preventDefault is specific to a particular use case. Implementations that do not support capture/bubble or can not have a parent listenable can simply not implement any ability to set the parent listenable (and have #getParentEventTarget return null). Implementation of this class can be used with or independently from goog.events. Implementation must call #addImplementation(implClass).
goog.events.ListenableKey
An interface that describes a single registered listener.

Public Protected Private

Global Functions

goog.events.Listenable.addImplementation(cls)
Marks a given class (constructor) as an implementation of Listenable, do that we can query that fact at runtime. The class must have already implemented the interface.
Arguments:
cls : !Function
The class constructor. The corresponding class must have already implemented the interface.
code »
goog.events.Listenable.isImplementedBy(obj) boolean
No description.
Arguments:
obj : Object
The object to check.
Returns: boolean  Whether a given instance implements Listenable. The class/superclass of the instance must call addImplementation.
code »
goog.events.ListenableKey.reserveKey() number
Reserves a key to be used for ListenableKey#key field.
Returns: number  A number to be used to fill ListenableKey#key field.
code »

Directory events

File Reference