InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IEventDispatcher Class Referenceabstract

#include <IEventDispatcher.h>

Inheritance diagram for IEventDispatcher:
IPMUnknown

Classes

class  EventTypeList
 

Public Types

enum  { kDefaultIID = IID_IEVENTDISPATCHER }
 
enum  PushWhere { kPushOnTop, kPushOnBottom }
 

Public Member Functions

virtual void Push (IEventHandler *newHandler, PushWhere pushWhere=kPushOnTop)=0
 
virtual void Remove (IEventHandler *ehToRemove)=0
 
virtual IEventHandlerPeek (int32 ehIndex=0) const =0
 
virtual int32 Depth () const =0
 
virtual void Init ()=0
 
virtual void CleanUp ()=0
 
virtual bool16 DispatchEvent (IEvent *theEvent, IEvent::SystemHandledState initialState=IEvent::kShouldCall)=0
 
virtual void AddEventWatcher (IEventWatcher *newWatcher, EventTypeList interest)=0
 
virtual void AddEventWatcher (IEventWatcher *newWatcher, IEvent::EventType interest)=0
 
virtual void RemoveEventWatcher (IEventWatcher *newWatcher, EventTypeList interest)=0
 
virtual void RemoveEventWatcher (IEventWatcher *newWatcher, IEvent::EventType interest)=0
 
virtual void StopAllEventWatchers ()=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

The event dispatcher maintains a stack of event handlers. Events are dispatched to the event handlers, starting with the topmost event event handler on the stack. The event will be passed on to the next handler in the stack, until a handler returns that it has handled the event.

Member Enumeration Documentation

anonymous enum

DefaultIID so that UseDefaultIID() can work for this interface

enum for where on the stack to add

Member Function Documentation

virtual void IEventDispatcher::CleanUp ()
pure virtual

Terminates the dispatcher

virtual int32 IEventDispatcher::Depth () const
pure virtual

Return the number of event handlers on the stack.

virtual bool16 IEventDispatcher::DispatchEvent (IEventtheEvent,
IEvent::SystemHandledState initialState = IEvent::kShouldCall 
)
pure virtual

Dispatch the event. The event is passed to the topmost event handler. If it is not handled, it is passed on to the next handler, and so on, until either the event has been handled, or it has been passed to all the event handlers on the stack. Returns true if the event was handled, false otherwise.

virtual void IEventDispatcher::Init ()
pure virtual

Initializes the dispatcher

virtual IEventHandler* IEventDispatcher::Peek (int32 ehIndex = 0) const
pure virtual

Return a pointer to the indicated event handler on the stack. By default, return the top event handler. ehIndex can range from 0 (top EH) to Depth() - 1 (bottom EH).

virtual void IEventDispatcher::Push (IEventHandlernewHandler,
PushWhere pushWhere = kPushOnTop 
)
pure virtual

Add a new handler to the top or bottom of the stack. Stack may be enlarged to fit the new handler. An event handler may only be added once or else an assertion violation will occur and Push will do nothing.

virtual void IEventDispatcher::Remove (IEventHandlerehToRemove)
pure virtual

Remove the ehToRemove from the stack. If ehToRemove is not on the stack, does nothing.