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

CP_EventHandler_Imp Class Reference

Implementation class for the CP_EventHandler when using MacOS Carbon Events. More...

Inheritance diagram for CP_EventHandler_Imp:

CP_NoCopy CP_EventHandler List of all members.

Public Member Functions

Constructor / Destructor
 CP_EventHandler_Imp ()
 Constructor.
 CP_EventHandler_Imp (EventTargetRef inTarget)
virtual ~CP_EventHandler_Imp ()
 Destructor.

Protected Attributes

CP_EventHandler_Map fEventHandlers
EventTargetRef fTarget
EventHandlerRef fEventHandlerRef

Static Private Member Functions

Callback
static pascal::OSStatus EventHandlerProc (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) throw ()

Detailed Description


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_EventHandler_Imp::CP_EventHandler_Imp  ) 
 

Constructor.

Exceptions:
none 

CP_EventHandler_Imp::CP_EventHandler_Imp EventTargetRef  inTarget  ) 
 

Constructor.

Parameters:
inTarget The event target ref that this event belongs to.
Exceptions:
none 

CP_EventHandler_Imp::~CP_EventHandler_Imp  )  [virtual]
 

Desstructor.

Exceptions:
none 


Member Function Documentation

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

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
 

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
 

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
 

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  ) 
 

void CP_EventHandler_Imp::SetEventTargetRef EventTargetRef  inTarget  ) 
 

pascal::OSStatus CP_EventHandler_Imp::EventHandlerProc EventHandlerCallRef  inHandlerCallRef,
EventRef  inEvent,
void *  inUserData
throw () [static, private]
 

Callback for the Carbon Event handler when it has a registered event to process. This will look up the CP_EventSignal and call it to handle the event.

Parameters:
inHandlerCallRef Carbon Event handler call ref for the event.
inEvent Carbon Event event ref for the event.
inUserData User supplied data passed to this callback, in this case it points to the instance of this class that will handle the event.
Exceptions:
none 
Returns:
void


Member Data Documentation

CP_EventHandler_Map CP_EventHandler_Imp::fEventHandlers [protected]
 

EventTargetRef CP_EventHandler_Imp::fTarget [protected]
 

Map that contains all of the registered handlers.

EventHandlerRef CP_EventHandler_Imp::fEventHandlerRef [protected]
 

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