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

CP_AE_ObjectDispatcher Class Reference
[AppleEvents]

The AEDesc class is a MacOS only class to dispatch AppleEvents to the correct mix-in class CP_ScriptableObject_Imp for handling in the classes method DoAppleEvent. More...

List of all members.

Public Member Functions

Constructor / Destructor
 CP_AE_ObjectDispatcher ()
 Constructor.
virtual ~CP_AE_ObjectDispatcher ()
 Destructor.
Initialization
virtual void Init ()
Getters
SInt16 GetResolveFlags ()
CP_SDEFParsing::CP_SDEFParserGetSDEFParser ()
Event Handlers
virtual void HandleAppleEventSelf (const AppleEvent &inEvent, AppleEvent &inOutReply, SInt32 inRefCon)
virtual void HandleCreateElement (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void HandleCountElements (const AppleEvent &inEvent, AppleEvent &inOutReply)
Misc
OSErr ResolveSpecifier (const AEDesc &inSpec, AEDesc &outToken)
OSL Handlers
virtual void HandleAccessContainedObjects (DescType inDesiredClass, const AEDesc &inContainer, DescType inContainerClass, DescType inKeyForm, const AEDesc &inKeyData, AEDesc &outToken)
virtual SInt32 HandleCountObjects (const AEDesc &inContainerToken, const DescType inCountObjectsOfType)
virtual bool HandleCompareObjects (const DescType inOperation, const AEDesc &inObject1, const AEDesc &inObject2)
virtual void HandleDisposeToken (AEDesc &inToken)

Static Public Member Functions

Instance
static CP_AE_ObjectDispatcherInstance ()

Private Member Functions

Registration
void RegisterScriptingDefinitions ()
Events
void ProcessEvent (const AppleEvent &inAppleEvent, AEDesc &inDirectObjToken, AEDesc &outResult, AppleEvent &outReply, SInt32 inRefCon)
Registration
void RegisterCommands (CP_SDEFParsing::CP_SDEFParser *inSdefParser)

Static Private Member Functions

Event Handlers
static pascal OSErr AppleEventHandler (const AppleEvent *inMessage, AppleEvent *inOutReply, UInt32 inRefCon)
static pascal OSErr CreateElementHandler (const AppleEvent *inMessage, AppleEvent *inOutReply, UInt32 inRefCon)
static pascal OSErr CountObjectsHandler (const AppleEvent *inMessage, AppleEvent *inOutReply, UInt32 inRefCon)
OSL callbacks
static pascal OSErr OSLObjectAccessorHandler (const DescType inDesiredClass, const AEDesc *inContainer, const DescType inContainerClass, const DescType inForm, const AEDesc *inSelectionData, AEDesc *inValue, SInt32 inRefCon)
static pascal OSErr OSLCountObjectsHandler (const DescType inCountObjectsOfType, const DescType inContainerClass, const AEDesc *inContainerToken, SInt32 *inResult)
static pascal OSErr OSLCompareObjectsHandler (const DescType inOperation, const AEDesc *inObj1, const AEDesc *inObj2, Boolean *inOutResult)
static pascal OSErr OSLDisposeTokenHandler (AEDesc *inToken)

Private Attributes

CP_ScriptableObject_ImpfApplication
SInt16 fAEResolveFlags
CP_SDEFParsing::CP_SDEFParserfSDEFParser

Static Private Attributes

static CP_AE_ObjectDispatcherfsInstance = NULL
static bool gInited = false
static OSErr gErr = CP_noErr


Detailed Description


Constructor & Destructor Documentation

CP_AE_ObjectDispatcher::CP_AE_ObjectDispatcher  ) 
 

Constructor.

Exceptions:
none 

CP_AE_ObjectDispatcher::~CP_AE_ObjectDispatcher  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_AE_ObjectDispatcher * CP_AE_ObjectDispatcher::Instance  )  [static]
 

Returns the single instance of this object.

Exceptions:
none 
Returns:
CP_M_CommandHandler Returns the single instance of this class.

void CP_AE_ObjectDispatcher::Init  )  [virtual]
 

Initialize our Apple Event handling dispatcher. This method installes the necessary Apple Event handling callbacks. This routine looks for all 'aedt' resources that contain information about the Apple Events.

Sets the instance to NULL if errors occurred in initializing this object.

Exceptions:
none 
Returns:
void

SInt16 CP_AE_ObjectDispatcher::GetResolveFlags  ) 
 

CP_SDEFParsing::CP_SDEFParser* CP_AE_ObjectDispatcher::GetSDEFParser  ) 
 

void CP_AE_ObjectDispatcher::HandleAppleEventSelf const AppleEvent &  inEvent,
AppleEvent &  inOutReply,
SInt32  inRefCon
[virtual]
 

Called from the generic AppleEvent handler to handle the actual AppleEvent.

Parameters:
inEvent AppleEvent containing the passed in Apple Event we are handling.
inOutReply The AppleEvent where the reply will be placed.
inRefCon Passed in user data.
Exceptions:
none 
Returns:
void

void CP_AE_ObjectDispatcher::HandleCreateElement const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[virtual]
 

Called from the create element AppleEvent callback to handle the create element event.

Parameters:
inEvent AppleEvent containing the passed in Apple Event we are handling.
inOutReply The AppleEvent where the reply will be placed.
Exceptions:
none 
Returns:
void

void CP_AE_ObjectDispatcher::HandleCountElements const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[virtual]
 

OSErr CP_AE_ObjectDispatcher::ResolveSpecifier const AEDesc &  inSpec,
AEDesc &  outToken
 

void CP_AE_ObjectDispatcher::HandleAccessContainedObjects DescType  inDesiredClass,
const AEDesc &  inContainerToken,
DescType  inContainerClass,
DescType  inKeyForm,
const AEDesc &  inKeyData,
AEDesc &  outToken
[virtual]
 

Get the desired object contained in inContainer.

Parameters:
inDesiredClass A DescType containing the desired class we are looking for.
inContainerToken Pointer to a AEDesc for the container.
inContainerClass Not used.
inKeyForm DescType describing the form the data is in.
inKeyData AEDesc containing the key data.
outToken AEDesc to return the result in.
Exceptions:
none 
Returns:
void

SInt32 CP_AE_ObjectDispatcher::HandleCountObjects const AEDesc &  inContainerToken,
const DescType  inCountObjectsOfType
[virtual]
 

Count the number of objects contained in inContainerToken.

Parameters:
inContainerToken AEDesc containing the container we are counting objects for.
inCountObjectsOfType The DescType describing the type of object we are counting.
Exceptions:
none 
Returns:
SInt32 The number of objects.

bool CP_AE_ObjectDispatcher::HandleCompareObjects const DescType  inOperation,
const AEDesc &  inObject1,
const AEDesc &  inObject2
[virtual]
 

Compare inObject1 to inObject2 using inOperator type comparison.

Parameters:
inOperation DescType describing the type of comparison to use.
inObject1 The AEDesc with one of our objects data.
inObject2 The AEDesc with the other objects data.
Exceptions:
none 
Returns:
SInt32 The number of objects.

void CP_AE_ObjectDispatcher::HandleDisposeToken AEDesc &  inToken  )  [virtual]
 

Get rid of the passed in inToken.

Parameters:
inToken The AEDesc object containing the token we are disposing.
Exceptions:
none 
Returns:
void

void CP_AE_ObjectDispatcher::RegisterScriptingDefinitions  )  [private]
 

Initialize our Apple Event handling from the information provided in a sdef scripting definition file.

Exceptions:
none 
Returns:
void

pascal OSErr CP_AE_ObjectDispatcher::AppleEventHandler const AppleEvent *  inEvent,
AppleEvent *  inOutReply,
UInt32  inRefCon
[static, private]
 

Generic Apple Event handling callback.

Parameters:
inEvent Contains the passed in AppleEvent from the Apple Event Manager.
inOutReply Pointer to the AppleEvent object that the reply to this event will be placed in.
inRefCon Passed in user data.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

pascal OSErr CP_AE_ObjectDispatcher::CreateElementHandler const AppleEvent *  inEvent,
AppleEvent *  inOutReply,
UInt32  inRefCon
[static, private]
 

Apple Event callback for the create element event.

Parameters:
inEvent Contains the passed in AppleEvent from the Apple Event Manager.
inOutReply Pointer to the AppleEvent object that the reply to this event will be placed in.
inRefCon Passed in user data.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

pascal OSErr CP_AE_ObjectDispatcher::CountObjectsHandler const AppleEvent *  inEvent,
AppleEvent *  inOutReply,
UInt32  inRefCon
[static, private]
 

Apple Event callback for the count event.

Parameters:
inEvent Contains the passed in AppleEvent from the Apple Event Manager.
inOutReply Pointer to the AppleEvent object that the reply to this event will be placed in.
inRefCon Passed in user data.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

void CP_AE_ObjectDispatcher::ProcessEvent const AppleEvent &  inAppleEvent,
AEDesc &  inDirectObjToken,
AEDesc &  outResult,
AppleEvent &  outReply,
SInt32  inRefCon
[private]
 

pascal OSErr CP_AE_ObjectDispatcher::OSLObjectAccessorHandler const DescType  inDesiredClass,
const AEDesc *  inContainer,
const DescType  inContainerClass,
const DescType  inForm,
const AEDesc *  inKeyData,
AEDesc *  outToken,
SInt32  inRefCon
[static, private]
 

Object accessor OSL callback.

Parameters:
inDesiredClass A DescType containing the desired class we are looking for.
inContainer Pointer to a AEDesc for the container.
inContainerClass DescType describing the type of class the container belongs to.
inForm DescType describing the form the data is in.
inSelectionData AEDesc containing the selection data.
inValue AEDesc containing the value descriptor.
inRefCon Passed in user data.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

pascal OSErr CP_AE_ObjectDispatcher::OSLCountObjectsHandler const DescType  inCountObjectsOfType,
const DescType  inContainerClass,
const AEDesc *  inContainerToken,
SInt32 inResult
[static, private]
 

Count objects OSL callback.

Parameters:
inCountObjectsOfType A DescType containing the desired class of objects we are looking for.
inContainerClass DescType describing the type of class the container belongs to.
inContainerToken DescType describing the containers token.
inResult Location to return the result in.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

pascal OSErr CP_AE_ObjectDispatcher::OSLCompareObjectsHandler const DescType  inOperation,
const AEDesc *  inObj1,
const AEDesc *  inObj2,
Boolean *  inOutResult
[static, private]
 

Compare objects OSL callback.

NOTE:Apple TechNote 1095 (Update 2/11/98): The objects being passed in are located in relocatable blocks that are not locked and may move after the compare function is called. There is a further chance for a memory leak when resolving "whose" clauses in object specifiers.

Parameters:
inOperation DescType describing the type of comparison we looking for.
inObj1 DescType describing one of the objects to be compared to.
inObj2 DescType describing the other object to be compared to inObj1.
inOutResult The location were the result will be placed.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

pascal OSErr CP_AE_ObjectDispatcher::OSLDisposeTokenHandler AEDesc *  inToken  )  [static, private]
 

Dispose token OSL callback.

Parameters:
inToken AEDesc for the token we are disposing.
Exceptions:
none 
Returns:
OSErr Returns any error that occurred.

void CP_AE_ObjectDispatcher::RegisterCommands CP_SDEFParsing::CP_SDEFParser inSdefParser  )  [private]
 


Member Data Documentation

CPLAT_Begin_Namespace_CPLAT CP_AE_ObjectDispatcher * CP_AE_ObjectDispatcher::fsInstance = NULL [static, private]
 

bool CP_AE_ObjectDispatcher::gInited = false [static, private]
 

OSErr CP_AE_ObjectDispatcher::gErr = CP_noErr [static, private]
 

CP_ScriptableObject_Imp* CP_AE_ObjectDispatcher::fApplication [private]
 

SInt16 CP_AE_ObjectDispatcher::fAEResolveFlags [private]
 

CP_SDEFParsing::CP_SDEFParser* CP_AE_ObjectDispatcher::fSDEFParser [private]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:20 2005 for CPLAT by  doxygen 1.4.0