![]() | InDesign SDK 20.5 |
#include <IScriptEventTarget.h>

Public Types | |
| enum | { kDefaultIID = IID_ISCRIPTEVENTTARGET } |
| enum | InitCallbackType { kPreDispatch, kPostDispatch } |
| typedef void(* | InitEventCallback )(IScriptEvent *e, InitCallbackType t, void *privateData) |
Public Member Functions | |
| virtual void | DispatchScriptEvent (ScriptElementID eventID, InitEventCallback initCallback=nil, void *privateData=nil)=0 |
| virtual bool16 | WillTriggerEventListeners (const PMString &eventType, bool16 bubbles) const =0 |
| virtual int32 | GetNumEventListeners () const =0 |
| virtual int32 | GetNumEventListeners (const PMString &eventType) const =0 |
| virtual IScriptEventListener * | QueryNthEventListener (int32 n) const =0 |
| virtual IScriptEventListener * | QueryNthEventListener (int32 n, const PMString &eventType) const =0 |
| virtual void | GetEventListeners (ScriptEventListenerList &eventListeners) const =0 |
| virtual void | GetEventListeners (ScriptEventListenerList &eventListeners, const PMString &eventType) const =0 |
| virtual bool16 | AddEventListener (IScriptEventListener *eventListener)=0 |
| virtual bool16 | RemoveEventListener (IScriptEventListener *eventListener)=0 |
| virtual IScriptEventListener * | QueryMatchingEventListener (const PMString &eventType, const ScriptData &handler) const =0 |
| virtual void | SetBusy (const PMString &eventType, bool16 bBusy)=0 |
| virtual bool16 | IsBusy () const =0 |
| virtual int32 | GetNumEvents (const ScriptID &type, const RequestContext &context) const =0 |
| virtual IScriptEvent * | QueryNthEvent (int32 n, const ScriptID &type, const RequestContext &context) const =0 |
| virtual void | PushEvent (IScriptEvent *e)=0 |
| virtual IScriptEvent * | PopEvent ()=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Any object that can be the target of attachable events in scripting should aggregate this interface to the same boss as its IID_ISCRIPT.
Some events have additional properties that must be initialized prior to dispatch, or used to update the object model after the event finishes propagation. In this case, pass an InitEventCallback function to DispatchScriptEvent. The IScriptEvent interface on the initialized event will be passed to this function before and after propagation.
A good example of this is a MutationEvent. See .h.
| pure virtual |
Register an event listener on this target, unless one already exists with the same parameters on this target.
| eventListener | is the listener to add IN |
| pure virtual |
Dispatch an attachable event
| eventID | - ID of the event |
| initCallback | - function to call before and after the event is dispatched |
| privateData | - private data to pass to the InitEventCallback function |
| pure virtual |
Return every event listener registered on this target. The order of event listeners is arbitrary.
| eventListeners | is the array of listeners OUT |
| pure virtual |
Return every event listener registered on this target for a particular event type. The order of event listeners is arbitrary.
| eventListeners | is the array of listeners OUT |
| eventType | is the event type IN |
| pure virtual |
Get the number of event listeners registered on this target
| pure virtual |
Get the number of event listeners registered on this target for a particular event type
| eventType | is the event type IN |
| pure virtual |
Get the number of active events on this target of a particular event type
| type | of events (to get all events, pass c_Event) IN |
| context | is the script request context IN |
| pure virtual |
Is this object the target of a propagating event
| pure virtual |
For INTERNAL USE ONLY by implementations of IScriptEventTarget::DispatchScriptEvent(). Remove an event from this target.
| pure virtual |
For INTERNAL USE ONLY by implementations of IScriptEventTarget::DispatchScriptEvent(). Add an event to this target.
| the | event IN |
| pure virtual |
Find a matching event listener, if one exists with the same parameters on this target.
| eventType | is the event type for which the listener is registered IN |
| handler | is the registered callback IN |
| pure virtual |
Return the nth active event on this target of a particular event type
| n | is the index of the desired event IN |
| type | of events (to get all events, pass c_Event) IN |
| context | is the script request context IN |
| pure virtual |
Return the nth event listener registered on this target. The order of event listeners is arbitrary.
| n | is the index of the desired listener IN |
| pure virtual |
Return the nth event listener registered on this target for a particular event type. The order of event listeners is arbitrary.
| n | is the index of the desired listener IN |
| eventType | is the event type IN |
| pure virtual |
Remove an event listener from this target, if one exists with the same parameters on this target.
| eventListener | is the listener to remove IN |
| pure virtual |
For INTERNAL USE ONLY by implementations of IScriptEventTarget::DispatchScriptEvent(). Increment/decrement the busy count for event listeners of a given type on this target.
| eventType | is the event type that is busy IN |
| bBusy | is kTrue to increment, kFalse to decrement IN |
| pure virtual |
Checks whether an event listener is registered with this event target object or any of its ancestors for the specified event type.
| eventType | is the event type IN |
| bubbles | pass kTrue if the event bubbles and you want to check for event listeners on this target's ancestors |