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

#include <IEventWatcher.h>

Inheritance diagram for IEventWatcher:
IPMUnknownCIdleMouseWatcher

Public Types

enum  { kDefaultIID = IID_IEVENTWATCHER }
 

Public Member Functions

virtual
IEventDispatcher::EventTypeList 
WatchEvent (IEvent *e)=0
 
virtual void StartWatching ()=0
 
virtual void StopWatching ()=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

 This interface provides an easy way for snooping at events as they are dispatched

The event dispatcher maintains a list of event watchers. As events are dispatched to the event handlers, they are also passed to the EventWatchers. Some example uses of event watchers o drawing the mouse position in the rulers o drawing the mouse position in the transform panel o maintaining the shape of the mouse pointer o implementing tool tips Many of these used to be done in the IdleTaskMgr but caused some significant performance problems there.

Member Function Documentation

virtual void IEventWatcher::StartWatching ()
pure virtual

This is a hook for implementations of register interest in events they want to watch. Typically calls the AddEventWatcher method of the app's only EventDispatcher for each event of interest.

Implemented in CIdleMouseWatcher.

virtual void IEventWatcher::StopWatching ()
pure virtual

This method is a hook for implmentations to unregister interest in events. Typically calls the RemoveEventWatcher method of the app's only EventDispatcher for each event of interest.

Implemented in CIdleMouseWatcher.

virtual IEventDispatcher::EventTypeList IEventWatcher::WatchEvent (IEvente)
pure virtual

Called by the EventDispatcher before the event is dispatched. Returns the list of event kinds that are now of interest. If the EventList is empty, this IEventWatcher is removed from the EventDispatcher. (StopWatching would not be called)

Parameters
ethe event to watch
Returns
new list of events of interest

Implemented in CIdleMouseWatcher.