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

CP_ScriptableObject Class Reference

Inheritance diagram for CP_ScriptableObject:

CP_ScriptableObject_Imp CP_Application_Imp CP_Document_Base CP_Window_Imp CP_Application< DOC_POLICY, PRINT_POLICY, UNDO_POLICY > CP_Document< UNDO_POLICY, PRINT_POLICY > CP_Window CP_DocumentWindow CP_DrawerWindow CP_SheetWindow List of all members.

Containers

CP_ScriptableObject_ImpGetSuperScriptableObject () const
virtual void SetSuperScriptableObject (CP_ScriptableObject_Imp *inSuperScriptableObject)
CP_ScriptableObject_ImpGetDefaultSubScriptableObject () const
void SetDefaultSubScriptableObject (CP_ScriptableObject_Imp *inObject)
CP_ScriptableObject_ImpGetDefaultSuperScriptableObject () const
void SetDefaultSuperScriptableObject (CP_ScriptableObject_Imp *inObject)
static void SetDefaultObject (CP_ScriptableObject_Imp *inDefaultObject)
static CP_ScriptableObject_ImpGetDefaultObject ()
static CP_ScriptableObject_ImpGetScriptableObjectFromToken (const AEDesc &inToken)

Property

CP_ScriptableObject_ImpGetScriptableObjectProperty (DescType inProperty) const
virtual void DoAE_GetData (const DescType inPropertyType, const AEDesc &inValue, AppleEvent &inOutReply)
virtual void DoAE_SetData (const DescType inPropertyType, const AEDesc &inValue, AppleEvent &inOutReply)

AppleEventHandlers

virtual void DoAE_Activate (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Clone (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Close (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Delete (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_DoObjectsExist (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Move (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Open (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Print (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Save (const AppleEvent &inEvent, AppleEvent &inOutReply)
virtual void DoAE_Revert (const AppleEvent &inEvent, AppleEvent &inOutReply)

Public Member Functions

virtual ~CP_ScriptableObject () throw ()
Class
virtual DescType GetAppleClass () const =0
Class
virtual DescType GetAppleClass () const =0

Protected Member Functions

 CP_ScriptableObject ()
Specifier
virtual void MakeSelfSpecifier (AEDesc &inContainerSpec, AEDesc &inOutSelfSpec)
Specifier
virtual void MakeSelfSpecifier (AEDesc &inContainerSpec, AEDesc &inOutSelfSpec)

Protected Attributes

CP_AppleEventHandler_Map fEventHandlers
CP_ScriptableObject_ImpfSuperScriptableObject
CP_ScriptableObject_ImpfDefaultSubScriptableObject
CP_ScriptableObject_ImpfDefaultSuperScriptableObject

Static Protected Attributes

static CP_ScriptableObject_ImpgDefaultObject = NULL
static bool gInited = false

Constructor & Destructor Documentation

CP_ScriptableObject::~CP_ScriptableObject  )  throw () [virtual]
 

Destructor.

CPLAT_Begin_Namespace_CPLAT CP_ScriptableObject::CP_ScriptableObject  )  [protected]
 

Constructor.


Member Function Documentation

virtual DescType CP_ScriptableObject_Imp::GetAppleClass  )  const [pure virtual, inherited]
 

Implemented in CP_Document_Base, CP_Application_Imp, CP_ScriptableObject_Property, and CP_Window_Imp.

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

Handle the passed in Apple Event. You should not need to override this. Either call the one of the default handlers for the core events, or to override the default handlers, register an event handler for the event.

Registered event handlers will be handled first, then the built in functions will be called if there is no overriding event handler for the event.

Parameters:
inEvent The AppleEvent being handled.
inOutReply The AppleEvent to place any reply into.
inRefCon The eventID passed from the AppleEvent manager when the event handler was registered.
Exceptions:
OSErrorExceptions 
Returns:
void

Reimplemented in CP_ScriptableObject_Property.

void CP_ScriptableObject_Imp::HandleAppleEvent const AppleEvent &  inEvent,
AppleEvent &  outAEReply,
AEDesc &  outResult,
SInt32  inRefCon
[virtual, inherited]
 

Handles AppleEvents for this object and any sub scriptable objects that this object might contain.

Parameters:
inEvent The AppleEvent being handled.
inOutReply The AppleEvent to place any reply into.
outReply Location to put a reply into.
inRefCon The eventID passed from the AppleEvent manager when the event handler was registered.
Exceptions:
OSErrorExceptions 
Returns:
void

void CP_ScriptableObject_Imp::SetDefaultObject CP_ScriptableObject_Imp inDefaultObject  )  [static, inherited]
 

Set the default object. This is the object that subsequent events will use when they refer to the default object.

Parameters:
inDefaultObject The CP_ScriptableObject_Imp that is to become the default object.
Exceptions:
none 
Returns:
void

static CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::GetDefaultObject  )  [static, inherited]
 

CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::GetScriptableObjectFromToken const AEDesc &  inToken  )  [static, inherited]
 

Gets the scriptable object that an event corresponds to, by extracting our CP_ModelToken from the descriptor.

Parameters:
inToken The AEDesc that contains the token for the scriptable object we are trying to get.
Exceptions:
OSErrorExceptions 
Returns:
void

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::GetSuperScriptableObject  )  const [inherited]
 

virtual void CP_ScriptableObject_Imp::SetSuperScriptableObject CP_ScriptableObject_Imp inSuperScriptableObject  )  [virtual, inherited]
 

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::GetDefaultSubScriptableObject  )  const [inherited]
 

void CP_ScriptableObject_Imp::SetDefaultSubScriptableObject CP_ScriptableObject_Imp inObject  )  [inherited]
 

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::GetDefaultSuperScriptableObject  )  const [inherited]
 

void CP_ScriptableObject_Imp::SetDefaultSuperScriptableObject CP_ScriptableObject_Imp inObject  )  [inherited]
 

bool CP_ScriptableObject_Imp::CompareObjects const DescType  inOperation,
const CP_ScriptableObject_Imp toWhat
[virtual, inherited]
 

Compare Apple Event objects. This method returns false, and subclasses need to override it.

Parameters:
inOperation A DescType describing the type of comparison operation to be performed.
toWhat The CP_ScriptableObject_Imp we are comparing against.
Exceptions:
none 
Returns:
bool The result of the comparison.

SInt32 CP_ScriptableObject_Imp::CountContainedObjects const DescType  inType  )  [virtual, inherited]
 

Return a count of the objects of inType contained in ourselves. This needs to be overriden, this method just returns 0.

Parameters:
inType Not used
Exceptions:
none 
Returns:
SInt32 The number of contained objects.

Reimplemented in CP_Document_Base, and CP_Application_Imp.

void CP_ScriptableObject_Imp::GetContainedObject const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
none 
Returns:
void

CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::GetContainedObjectByName const DescType  inDesiredClass,
const CP_String inName
[virtual, inherited]
 

Return the object contained in ourselves based on the name passed in. Subclasses need to override this function. This routine just returns NULL.

Parameters:
inDesiredClass A DescType for the class we are looking for.
inName The name we are looking for.
Exceptions:
none 
Returns:
CP_ScriptableObject_Imp * The contained object.

Reimplemented in CP_Document_Base, and CP_Application_Imp.

CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::GetContainedObjectByPosition DescType  inDesiredClass,
SInt32  inPosition
[virtual, inherited]
 

Return the object contained in ourselves based on the position passed in. Subclasses need to override this function. This routine just returns NULL.

Parameters:
inDesiredClass A DescType for the class we are looking for.
inPosition The position of the object we are looking for.
Exceptions:
none 
Returns:
CP_ScriptableObject_Imp * The contained object.

Reimplemented in CP_Document_Base, and CP_Application_Imp.

CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::GetContainedObjectByUniqueID DescType  inDesiredClass,
SInt32  inID
[virtual, inherited]
 

Return the object contained in ourselves based on the unique ID passed in. Subclasses need to override this function. This routine just returns NULL.

Parameters:
inDesiredClass A DescType for the class we are looking for.
inUniqueID The unique id to identify the object.
Exceptions:
none 
Returns:
CP_ScriptableObject_Imp * The contained object.

CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::GetContainedObjectByRelativePosition DescType  inDesiredClass,
SInt32  inPosition
[virtual, inherited]
 

Return the object contained in ourselves based on the position passed in. Subclasses need to override this function. This routine just returns NULL.

Parameters:
inDesiredClass A DescType for the class we are looking for.
inRelativePosition The relative position of the object we are looking for.
Exceptions:
none 
Returns:
CP_ScriptableObject_Imp * The contained object.

CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::DoAE_CreateElement const DescType  inDesiredClass,
const DescType  inInsertLocation,
const AppleEvent &  inEvent,
AppleEvent &  inOutAEReply
[virtual, inherited]
 

Subclasses need to override this to handle the create element event.

Parameters:
inDesiredClass A DescType describing the class desired to create.
inInsertLocation A DescType describing the location to insert the object.
inEvent The incoming AppleEvent that we are creating the object for.
inOutAEReply The reply to the incoming Apple Event.
Exceptions:
none 
Returns:
CP_ScriptableObject_Imp * The newly created element.

Reimplemented in CP_Application< DOC_POLICY, PRINT_POLICY, UNDO_POLICY >.

void CP_ScriptableObject_Imp::AddEvent SInt32  inEventID,
CP_AppleEventSignal inEventSignal
[inherited]
 

Adds the passed in CP_AppleEventSignal to the list of AppleEvents we will handle through a signal / slot connection.

Parameters:
inEventID The identifier of the event to be handled.
inEventSignal The signal to call to handle the event.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::RemoveEvent SInt32  inEventID  )  [inherited]
 

Removes a previously added event handler from the list of the events handled by the object.

Parameters:
inEventID The identifier of the event to be removed.
Exceptions:
none 
Returns:
void

bool CP_ScriptableObject_Imp::HasHandlerForEvent SInt32  inEventID  )  [inherited]
 

Returns true if there is a registered signal handler for the passed in event.

Parameters:
inEventID The event id to check for a handler for.
Exceptions:
none 
Returns:
bool True if we have a handler for the event.

CP_AppleEventSignal * CP_ScriptableObject_Imp::FindHandlerForEvent SInt32  inEventID  )  [inherited]
 

Finds and returns the signal for the passed in event.

Parameters:
inEventID The identifier of the event to return the signal handler for.
Exceptions:
none 
Returns:
CP_AppleEventSignal * The AppleEventSignal handler for the event.

void CP_ScriptableObject_Imp::GetScriptableObjectToken DescType  inModelID,
DescType  inKeyForm,
const AEDesc &  inKeyData,
AEDesc &  outToken
[virtual, inherited]
 

Tries to get the CP_ModelToken from the passed in descriptor and return in outToken.

Parameters:
inModelID Identifier of the model to get.
inKeyForm Form to use.
inKeyData Descriptor that holds the data.
outToken Location to return the result in.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::PutInToken CP_ScriptableObject_Imp inScriptableObject,
AEDesc &  outToken
const [inherited]
 

Places the passed in scriptable object into a CP_ModelToken and then packages it up in a descriptor and returns in outToken.

Parameters:
inScriptableObject Object to package up.
outToken Location to return the result in.
Exceptions:
OSErrorExceptions 
Returns:
void

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::GetScriptableObjectProperty DescType  inProperty  )  const [inherited]
 

void CP_ScriptableObject_Imp::DoAE_GetData const DescType  inPropertyType,
const AEDesc &  inValue,
AppleEvent &  inOutReply
[virtual, inherited]
 

Subclasses should override this to handle the get data event.

Parameters:
inPropertyType The DescType of property we are getting.
inValue Any value of data to get.
inOutReply The AppleEvent where the reply will be placed.
Exceptions:
none 
Returns:
void

Reimplemented in CP_Document_Base, CP_Application_Imp, and CP_Window_Imp.

void CP_ScriptableObject_Imp::DoAE_SetData const DescType  inPropertyType,
const AEDesc &  inValue,
AppleEvent &  inOutReply
[virtual, inherited]
 

Subclasses should override this to handle the set data event.

Parameters:
inPropertyType The DescType of property we are setting.
inValue Any value of data to get.
inOutReply The AppleEvent where the reply will be placed.
Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp.

void CP_ScriptableObject_Imp::SendAppleEvent_Self const AEEventClass  inEventClass,
const AEEventID  inEventID,
const bool  inDoExecute
[inherited]
 

Send an Apple Event to ourselves. Used to record events.

Parameters:
inEventClass The AEEventClass for this event.
inEventID The AEEventID for this event.
inDoExecute If false, the event is sent for recording purposes, but not actually executed.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::MakeSpecifier AEDesc &  inOutSpecifier  )  [virtual, inherited]
 

Make the specifier for our object. This method will recruisvely travel the object heirachy to make the correct specifier.

Parameters:
inOutSpecifier The CP_AE_Object where we will place the results.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::GotRequiredParams const AppleEvent &  inAppleEvent  )  [virtual, inherited]
 

Check to make sure that the required params for the event are present, and throw an OSErr exception if they are missing.

Parameters:
inAppleEvent The AppleEvent that we are checking.
Exceptions:
OSErrorExceptions 
Returns:
void

void CP_ScriptableObject_Imp::Install CP_AE_ObjectDispatcher inDispatcher = NULL  )  [protected, virtual, inherited]
 

Initialize our Apple Event handling by installing the Apple Event dispatcher and its object handlers.

Parameters:
inDispatcher Ghe CP_AE_ObjectDispatcher you want to use. If you pass NULL in this parameter, then the default CPLAT dispatcher will be used.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::DoAE_Activate const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Clone const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Close const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

Reimplemented in CP_Window_Imp.

void CP_ScriptableObject_Imp::DoAE_Delete const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_DoObjectsExist const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Move const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Open const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Print const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Save const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::DoAE_Revert const AppleEvent &  inEvent,
AppleEvent &  inOutReply
[protected, virtual, inherited]
 

void CP_ScriptableObject_Imp::GetContainedObject_FormAbsolutePosition const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[protected, virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::GetContainedObject_FormName const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[protected, virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::GetContainedObject_FormUniqueID const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[protected, virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::GetContainedObject_FormRelativePosition const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[protected, virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::GetContainedObject_FormPropertyID const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[protected, virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
none 
Returns:
void

void CP_ScriptableObject_Imp::GetContainedObject_OtherForm const DescType  inDesiredClass,
const DescType  inForm,
const AEDesc &  inSelectionData,
AEDesc &  outToken
[protected, virtual, inherited]
 

Return the object contained in the passed in container based upon the inForm criteria.

Parameters:
inDesiredClass A DescType describing the class we are looking for.
inForm a DescType describing the form.
inSelectionData AEDesc with the selection data.
inNeedsDisposal Flag to indicate if we should dispose dispose of objects.
Exceptions:
CP_AE_EventNotHandledException 
Returns:
void

void CP_ScriptableObject_Imp::MakeSelfSpecifier AEDesc &  inContainerSpec,
AEDesc &  inOutSelfSpec
[protected, virtual, inherited]
 

Make an object specifier for our object. Each subclass needs to override this method to provide the proper container hierarchy.

Parameters:
inContainerSpec A AEDesc object containing the spec for our container.
inOutSelfSpec The AEDesc object where we place the specifier for ourselves.
Exceptions:
OSErrorExceptions 
Returns:
void

Reimplemented in CP_Document_Base, CP_Application_Imp, CP_ScriptableObject_Property, and CP_Window_Imp.

SInt32 CP_ScriptableObject_Imp::GetPositionOfSubObject const DescType  inObjectID,
const CP_ScriptableObject_Imp inObject
const [protected, virtual, inherited]
 

Subclasses need to override to return the position of their sub objects.

Parameters:
inDesiredClass A DescType for the class we are looking for.
inObject The object we are looking for.
Exceptions:
none 
Returns:
SInt32 The position of the subobject.


Member Data Documentation

CPLAT_Begin_Namespace_CPLAT CP_ScriptableObject_Imp * CP_ScriptableObject_Imp::gDefaultObject = NULL [static, protected, inherited]
 

bool CP_ScriptableObject_Imp::gInited = false [static, protected, inherited]
 

The default object that events will be dispatched to.

CP_AppleEventHandler_Map CP_ScriptableObject_Imp::fEventHandlers [protected, inherited]
 

Flag to indicate if this class has been initialized.

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::fSuperScriptableObject [protected, inherited]
 

Map that contains all of the registered handlers.

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::fDefaultSubScriptableObject [protected, inherited]
 

Scriptable object that is our container.

CP_ScriptableObject_Imp* CP_ScriptableObject_Imp::fDefaultSuperScriptableObject [protected, inherited]
 

Default scriptable object that is contained by this object.


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