Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_EventHandler Class Reference

Base class for objects that will handle events from the various underlying OSs.

Inheritance diagram for CP_EventHandler:

CP_EventHandler_Imp CP_NoCopy List of all members.

Public Member Functions

Constructor / Destructor
 CP_EventHandler ()
 Constructor.
 CP_EventHandler (EventTargetRef inTarget)
virtual ~CP_EventHandler ()
 Destructor.
Events
void Add (UInt32 inClass, UInt32 inKind, CP_EventSignal *inEventSignal, OSWindow inWindow=NULL)
void Remove (UInt32 inEventClass, UInt32 inEventKind)
bool HasHandler (UInt32 inEventClass, UInt32 inEventKind)
CP_EventSignalFindHandler (UInt32 inEventClass, UInt32 inEventKind)
Getters
EventTargetRef GetEventTargetRef ()
Setters
void SetEventTargetRef (EventTargetRef inTarget)
Events
void Add (UInt32 inClass, UInt32 inKind, CP_EventSignal *inEventSignal, OSWindow inWindow=NULL)
void Remove (UInt32 inEventClass, UInt32 inEventKind)
bool HasHandler (UInt32 inEventClass, UInt32 inEventKind)
CP_EventSignalFindHandler (UInt32 inEventClass, UInt32 inEventKind)
Getters
EventTargetRef GetEventTargetRef ()
Setters
void SetEventTargetRef (EventTargetRef inTarget)

Protected Attributes

CP_EventHandler_Map fEventHandlers
EventTargetRef fTarget
EventHandlerRef fEventHandlerRef

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_EventHandler::CP_EventHandler  ) 
 

Constructor.

CP_EventHandler::CP_EventHandler EventTargetRef  inTarget  ) 
 

Constructor.

CP_EventHandler::~CP_EventHandler  )  [virtual]
 

Destructor.


Member Function Documentation

void CP_EventHandler_Imp::Add UInt32  inEventClass,
UInt32  inEventKind,
CP_EventSignal inEventSignal,
OSWindow  inWindow = NULL
[inherited]
 

Adds the passed in event and event signal handler to the list of events we maintain. This will also register with the Carbon Event handler the fact that we handle the passed in event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
inEventSignal The CP_EventSignal to be called for the the event. Note: This signal will be deleted when the event is removed from the list of events, and should be unique for each event, ie don't assign the same signal to the same event.
inWindow Not used on Mac.
Exceptions:
CP_OSErrorException Exception thrown in there was a problem adding the event to the Carbon Event handler.
Returns:
void

void CP_EventHandler_Imp::Remove UInt32  inEventClass,
UInt32  inEventKind
[inherited]
 

Removes the event hanndler associated with the passed in event class and event kind. This will also delete the event signal associated with the event class and kind, if the event is found.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
CP_OSErrorException Exception thrown in there was a problem removing the event from the Carbon Event handler.
Returns:
void

bool CP_EventHandler_Imp::HasHandler UInt32  inEventClass,
UInt32  inEventKind
[inherited]
 

Returns true if we have an installed handler for the passed in inEventClass and inEventKind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
none 
Returns:
bool True if the event class / kind handler exists.

CP_EventSignal * CP_EventHandler_Imp::FindHandler UInt32  inEventClass,
UInt32  inEventKind
[inherited]
 

Returns the CP_EventSignal that will handle the passed in Carbon Event, based on the event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
none 
Returns:
CP_EventSignal * The CP_EventSignal for the event.

EventTargetRef CP_EventHandler_Imp::GetEventTargetRef  )  [inherited]
 

void CP_EventHandler_Imp::SetEventTargetRef EventTargetRef  inTarget  )  [inherited]
 


Member Data Documentation

CP_EventHandler_Map CP_EventHandler_Imp::fEventHandlers [protected, inherited]
 

EventTargetRef CP_EventHandler_Imp::fTarget [protected, inherited]
 

Map that contains all of the registered handlers.

EventHandlerRef CP_EventHandler_Imp::fEventHandlerRef [protected, inherited]
 

Carbon Event target ref.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:45 2005 for CPLAT_MacOS by  doxygen 1.4.0