Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsIEventListenerManager Class Reference

#include <nsIEventListenerManager.h>

Inheritance diagram for nsIEventListenerManager:
Inheritance graph
[legend]
Collaboration diagram for nsIEventListenerManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_IMETHOD AddEventListenerByIID (nsIDOMEventListener *aListener, const nsIID &aIID, PRInt32 flags)=0
 Sets events listeners of all types.
NS_IMETHOD RemoveEventListenerByIID (nsIDOMEventListener *aListener, const nsIID &aIID, PRInt32 flags)=0
 Removes events listeners of all types.
NS_IMETHOD AddEventListenerByType (nsIDOMEventListener *aListener, const nsAString &type, PRInt32 flags, nsIDOMEventGroup *aEvtGrp)=0
 Sets events listeners of all types.
NS_IMETHOD RemoveEventListenerByType (nsIDOMEventListener *aListener, const nsAString &type, PRInt32 flags, nsIDOMEventGroup *aEvtGrp)=0
 Removes events listeners of all types.
NS_IMETHOD AddScriptEventListener (nsISupports *aObject, nsIAtom *aName, const nsAString &aFunc, PRBool aDeferCompilation, PRBool aPermitUntrustedEvents)=0
 Creates a script event listener for the given script object with name aName and function body aFunc.
NS_IMETHOD RemoveScriptEventListener (nsIAtom *aName)=0
NS_IMETHOD RegisterScriptEventListener (nsIScriptContext *aContext, JSObject *aScopeObject, nsISupports *aObject, nsIAtom *aName)=0
 Registers an event listener that already exists on the given script object with the event listener manager.
NS_IMETHOD CompileScriptEventListener (nsIScriptContext *aContext, JSObject *aScopeObject, nsISupports *aObject, nsIAtom *aName, PRBool *aDidCompile)=0
 Compiles any event listeners that already exists on the given script object for a given event type.
NS_IMETHOD HandleEvent (nsPresContext *aPresContext, nsEvent *aEvent, nsIDOMEvent **aDOMEvent, nsIDOMEventTarget *aCurrentTarget, PRUint32 aFlags, nsEventStatus *aEventStatus)=0
 Causes a check for event listeners and processing by them if they exist.
NS_IMETHOD CreateEvent (nsPresContext *aPresContext, nsEvent *aEvent, const nsAString &aEventType, nsIDOMEvent **aDOMEvent)=0
 Creates a DOM event that can subsequently be passed into HandleEvent.
NS_IMETHOD CaptureEvent (PRInt32 aEventTypes)=0
 Changes script listener of specified event types from bubbling listeners to capturing listeners.
NS_IMETHOD ReleaseEvent (PRInt32 aEventTypes)=0
 Changes script listener of specified event types from capturing listeners to bubbling listeners.
NS_IMETHOD Disconnect (PRBool aUnusedParam=PR_FALSE)=0
 Tells the event listener manager that its target (which owns it) is no longer using it (and could go away).
NS_IMETHOD SetListenerTarget (nsISupports *aTarget)=0
 Tells the event listener manager what its target is.
NS_IMETHOD HasMutationListeners (PRBool *aListener)=0
 Allows us to quickly determine if we have mutation listeners registered.
NS_IMETHOD GetSystemEventGroupLM (nsIDOMEventGroup **aGroup)=0
 Gets the EventGroup registered for use by system event listeners.
virtual PRBool HasUnloadListeners ()=0
 Allows us to quickly determine whether we have unload or beforeunload listeners registered.

Detailed Description

Definition at line 60 of file nsIEventListenerManager.h.


Member Function Documentation

Sets events listeners of all types.

Parameters:
anevent listener

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::AddEventListenerByType ( nsIDOMEventListener aListener,
const nsAString &  type,
PRInt32  flags,
nsIDOMEventGroup aEvtGrp 
) [pure virtual]

Sets events listeners of all types.

Parameters:
anevent listener

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::AddScriptEventListener ( nsISupports *  aObject,
nsIAtom aName,
const nsAString &  aFunc,
PRBool  aDeferCompilation,
PRBool  aPermitUntrustedEvents 
) [pure virtual]

Creates a script event listener for the given script object with name aName and function body aFunc.

Parameters:
anevent listener

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::CaptureEvent ( PRInt32  aEventTypes) [pure virtual]

Changes script listener of specified event types from bubbling listeners to capturing listeners.

Parameters:
eventtypes

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::CompileScriptEventListener ( nsIScriptContext aContext,
JSObject aScopeObject,
nsISupports *  aObject,
nsIAtom aName,
PRBool aDidCompile 
) [pure virtual]

Compiles any event listeners that already exists on the given script object for a given event type.

Parameters:
anevent listener

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::CreateEvent ( nsPresContext aPresContext,
nsEvent aEvent,
const nsAString &  aEventType,
nsIDOMEvent **  aDOMEvent 
) [pure virtual]

Creates a DOM event that can subsequently be passed into HandleEvent.

(used rarely in the situation where methods on the event need to be invoked prior to the processing of the event).

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::Disconnect ( PRBool  aUnusedParam = PR_FALSE) [pure virtual]

Tells the event listener manager that its target (which owns it) is no longer using it (and could go away).

This causes the removal of all event listeners registered by this instance of the listener manager. This is important for Bug 323807, since nsDOMClassInfo::PreserveWrapper (and nsIDOMGCParticipant) require that we remove all event listeners to remove any weak references in the nsDOMClassInfo's preserved wrapper table to the target.

It also clears the weak pointer set by the call to |SetListenerTarget|.

Implemented in nsEventListenerManager.

Gets the EventGroup registered for use by system event listeners.

This is a special EventGroup which is used in the secondary DOM Event Loop pass for evaluation of system event listeners.

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::HandleEvent ( nsPresContext aPresContext,
nsEvent aEvent,
nsIDOMEvent **  aDOMEvent,
nsIDOMEventTarget aCurrentTarget,
PRUint32  aFlags,
nsEventStatus aEventStatus 
) [pure virtual]

Causes a check for event listeners and processing by them if they exist.

Event flags live in nsGUIEvent.h

Parameters:
anevent listener

Implemented in nsEventListenerManager.

Here is the caller graph for this function:

Allows us to quickly determine if we have mutation listeners registered.

Implemented in nsEventListenerManager.

Allows us to quickly determine whether we have unload or beforeunload listeners registered.

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::RegisterScriptEventListener ( nsIScriptContext aContext,
JSObject aScopeObject,
nsISupports *  aObject,
nsIAtom aName 
) [pure virtual]

Registers an event listener that already exists on the given script object with the event listener manager.

If the event listener is registerd from chrome code, the event listener will only ever receive trusted events.

Parameters:
thename of an event listener

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::ReleaseEvent ( PRInt32  aEventTypes) [pure virtual]

Changes script listener of specified event types from capturing listeners to bubbling listeners.

Parameters:
eventtypes

Implemented in nsEventListenerManager.

Removes events listeners of all types.

Parameters:
anevent listener

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::RemoveEventListenerByType ( nsIDOMEventListener aListener,
const nsAString &  type,
PRInt32  flags,
nsIDOMEventGroup aEvtGrp 
) [pure virtual]

Removes events listeners of all types.

Parameters:
anevent listener

Implemented in nsEventListenerManager.

Implemented in nsEventListenerManager.

NS_IMETHOD nsIEventListenerManager::SetListenerTarget ( nsISupports *  aTarget) [pure virtual]

Tells the event listener manager what its target is.

This must be followed by a call to |Disconnect| before the target is destroyed.

Implemented in nsEventListenerManager.


The documentation for this class was generated from the following file: