Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
AEGenericClass Class Reference

#include <nsAEGenericClass.h>

Inheritance diagram for AEGenericClass:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AEGenericClass (DescType classType, DescType containerClass)
virtual ~AEGenericClass ()
void DispatchEvent (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)

Static Public Member Functions

static pascal OSErr ItemFromContainerAccessor (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken, long refCon)

Protected Types

enum  { kAEExtract = 'Extr', kExtractKeyDestFolder = 'Fold', kAESendMessage = 'Post' }

Protected Member Functions

virtual void GetPropertyFromObject (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken)
virtual void GetProperty (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken)
virtual void GetItemFromContainer (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken)=0
virtual void CompareObjects (DescType comparisonOperator, const AEDesc *object, const AEDesc *descriptorOrObject, Boolean *result)
virtual void CountObjects (DescType desiredType, DescType containerClass, const AEDesc *container, long *result)
virtual void HandleClose (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleCount (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleSetData (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleGetData (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleDataSize (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleDelete (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleDuplicate (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleExists (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleMake (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleMove (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleOpen (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleReOpen (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleRun (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandlePrint (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleQuit (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleSave (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleExtract (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void HandleSendMessage (AEDesc *token, const AppleEvent *appleEvent, AppleEvent *reply)
virtual void GetDataFromObject (const AEDesc *token, AEDesc *desiredTypes, AEDesc *data)=0
virtual void SetDataForObject (const AEDesc *token, AEDesc *data)=0
void CreateSpecifier (const AEDesc *token, AEDesc *outSpecifier)
virtual void GetContainerSpecifier (const AEDesc *token, AEDesc *outContainerSpecifier)
virtual void CreateSelfSpecifier (const AEDesc *token, AEDesc *outSpecifier)=0
void GetDataFromListOrObject (const AEDesc *tokenOrTokenList, AEDesc *desiredTypes, AEDesc *data)
void SetDataForListOrObject (const AEDesc *tokenOrTokenList, const AppleEvent *appleEvent, AppleEvent *reply)
void GetDataFromList (const AEDesc *srcList, AEDesc *desiredTypes, AEDesc *dstList)
void SetDataForList (const AEDesc *token, AEDesc *data)
void GetPropertyFromListOrObject (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken)
void GetPropertyFromList (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken)
virtual DescType GetKeyEventDataAs (DescType propertyCode)
virtual Boolean CanSetProperty (DescType propertyCode)=0
virtual Boolean CanGetProperty (DescType propertyCode)=0
DescType GetClass ()
virtual void MakeNewObject (const DescType insertionPosition, const AEDesc *token, const AEDesc *ptrToWithData, const AEDesc *ptrToWithProperties, AppleEvent *reply)

Protected Attributes

DescType mClass
DescType mContainerClass
OSLAccessorUPP mItemFromContainerAccessor

Friends

class AEDispatchHandler

Detailed Description

Definition at line 48 of file nsAEGenericClass.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
kAEExtract 
kExtractKeyDestFolder 
kAESendMessage 

Definition at line 78 of file nsAEGenericClass.h.

            {
              kAEExtract                  = 'Extr',
              kExtractKeyDestFolder       = 'Fold',
              
              kAESendMessage              = 'Post'
       };

Constructor & Destructor Documentation

AEGenericClass::AEGenericClass ( DescType  classType,
DescType  containerClass 
)

Definition at line 51 of file nsAEGenericClass.cpp.

:      mClass(classType)
,      mContainerClass(containerClass)
,      mItemFromContainerAccessor(nil)
{

       // Window from null accessor used by the entire window hierarchy
       mItemFromContainerAccessor = NewOSLAccessorUPP(AEGenericClass::ItemFromContainerAccessor);
       ThrowIfNil(mItemFromContainerAccessor);
       
       OSErr  err;
       err = AEInstallObjectAccessor(mClass,            containerClass, 
                                                                      mItemFromContainerAccessor, 
                                                                      (long)this, 
                                                                      false);

       // although items of a given class can't contain other items of the same class, 
       // we need this accessor to support formRelativePostion,
       // which sends us one item as a "container" and asks us to find
       // either the item before or after that item
       err = AEInstallObjectAccessor(mClass,            mClass, 
                                                                      mItemFromContainerAccessor, 
                                                                      (long)this, 
                                                                      false);
       ThrowIfOSErr(err);

}

Here is the call graph for this function:

Definition at line 83 of file nsAEGenericClass.cpp.

{
       if (mItemFromContainerAccessor)
              DisposeOSLAccessorUPP(mItemFromContainerAccessor);
}

Member Function Documentation

Boolean AEGenericClass::CanGetProperty ( DescType  propertyCode) [protected, pure virtual]

Implemented in AEWindowClass, AEDocumentClass, AEApplicationClass, and AEWordClass.

Definition at line 810 of file nsAEGenericClass.cpp.

{
       Boolean       canGet = false;
       
       switch (propertyCode)
       {
              case pContents:
                     canGet = true;
                     break;
       }
       return canGet;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Boolean AEGenericClass::CanSetProperty ( DescType  propertyCode) [protected, pure virtual]

Implemented in AEWindowClass, AEDocumentClass, AEApplicationClass, and AEWordClass.

Definition at line 827 of file nsAEGenericClass.cpp.

{
       return false;
}

Here is the caller graph for this function:

void AEGenericClass::CompareObjects ( DescType  comparisonOperator,
const AEDesc *  object,
const AEDesc *  descriptorOrObject,
Boolean result 
) [protected, virtual]

Reimplemented in AEWindowClass.

Definition at line 604 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::CountObjects ( DescType  desiredType,
DescType  containerClass,
const AEDesc *  container,
long result 
) [protected, virtual]

Reimplemented in AEWindowClass, AEApplicationClass, and AEWordClass.

Definition at line 616 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

virtual void AEGenericClass::CreateSelfSpecifier ( const AEDesc *  token,
AEDesc *  outSpecifier 
) [protected, pure virtual]

Implemented in AEWindowClass, AEDocumentClass, AEApplicationClass, and AEWordClass.

Here is the caller graph for this function:

void AEGenericClass::CreateSpecifier ( const AEDesc *  token,
AEDesc *  outSpecifier 
) [protected]

Definition at line 840 of file nsAEGenericClass.cpp.

{
       CreateSelfSpecifier(token, outSpecifier);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::DispatchEvent ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
)

Definition at line 97 of file nsAEGenericClass.cpp.

{
       OSErr         err = noErr;
       
       AEEventID            eventID;
       OSType        typeCode;
       Size                 actualSize    = 0L;
       
       // Get the event ID
       err = AEGetAttributePtr(appleEvent,       keyEventIDAttr, 
                                                               typeType, 
                                                               &typeCode, 
                                                               (Ptr)&eventID, 
                                                               sizeof(eventID), 
                                                               &actualSize);
       ThrowIfOSErr(err);
       
       try
       {
              switch (eventID)
              {
                     case kAEClone:
                            HandleDuplicate(token, appleEvent, reply);
                            break;
                            
                     case kAEClose:
                            HandleClose(token, appleEvent, reply);
                            break;
                            
                     case kAECountElements:
                            HandleCount(token, appleEvent, reply);
                            break;
                            
                     case kAECreateElement:
                            HandleMake(token, appleEvent, reply);
                            break;
                            
                     case kAEDelete:
                            HandleDelete(token, appleEvent, reply);
                            break;
                            
                     case kAEDoObjectsExist:
                            HandleExists(token, appleEvent, reply);
                            break;
                            
                     case kAEGetData:
                            HandleGetData(token, appleEvent, reply);
                            break;
                            
                     case kAEGetDataSize:
                            HandleDataSize(token, appleEvent, reply);
                            break;
                            
                     case kAEMove:
                            HandleMove(token, appleEvent, reply);
                            break;
                            
                     case kAEOpen:        // == kAEOpenDocuments
                            HandleOpen(token, appleEvent, reply);
                            break;
                            
                     case kAEPrint:
                            HandlePrint(token, appleEvent, reply);
                            break;
                     
                     case kAEOpenApplication:
                            HandleRun(token, appleEvent, reply);
                            break;
                     
                     case kAEReopenApplication:
                       HandleReOpen(token, appleEvent, reply);
                       break; 
                                                 
                     case kAEQuitApplication:
                            HandleQuit(token, appleEvent, reply);
                            break;
                            
                     case kAESave:
                            HandleSave(token, appleEvent, reply);
                            break;
                            
                     case kAESetData:
                            HandleSetData(token, appleEvent, reply);
                            break;

                     // MT-NW suite
                     case kAEExtract:
                            HandleExtract(token, appleEvent, reply);
                            break;
                            
                     case kAESendMessage:
                            HandleSendMessage(token, appleEvent, reply);
                            break;
                            
                     default:
                            err = errAEEventNotHandled;
                            break;
              }
       }
       catch (OSErr catchErr)
       {
              PutReplyErrorNumber(reply, catchErr);
              throw;
       }
       catch ( ... )
       {
              PutReplyErrorNumber(reply, paramErr);
              throw;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

DescType AEGenericClass::GetClass ( ) [inline, protected]

Definition at line 193 of file nsAEGenericClass.h.

{ return mClass; }

Here is the caller graph for this function:

void AEGenericClass::GetContainerSpecifier ( const AEDesc *  token,
AEDesc *  outContainerSpecifier 
) [protected, virtual]

Definition at line 849 of file nsAEGenericClass.cpp.

{
       outContainerSpecifier->descriptorType = typeNull;
       outContainerSpecifier->dataHandle = nil;
       
       AEDispatchHandler*   handler = AECoreClass::GetDispatchHandlerForClass(mContainerClass);
       if (handler)
       {
              handler->CreateSelfSpecifier(token, outContainerSpecifier);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::GetDataFromList ( const AEDesc *  srcList,
AEDesc *  desiredTypes,
AEDesc *  dstList 
) [protected]

Definition at line 692 of file nsAEGenericClass.cpp.

{
       OSErr         err;
       long                 itemNum;
       long                 numItems;
       DescType             keyword;
       StAEDesc             srcItem;
       StAEDesc             dstItem;
              
       err = AECountItems((AEDescList*)srcList, &numItems);
       ThrowIfOSErr(err);
              
       for (itemNum = 1; itemNum <= numItems; itemNum++)
       {
              err = AEGetNthDesc(srcList, itemNum, typeWildCard, &keyword, &srcItem);
              ThrowIfOSErr(err);
              
              if (AEListUtils::TokenContainsTokenList(&srcItem) == false)
              {
                     GetDataFromObject(&srcItem, desiredTypes, &dstItem);  // Get data from single item
              }
              else
              {
                     ThrowIfOSErr(AECreateList(nil, 0, false, &dstItem));
                     GetDataFromList(&srcItem, desiredTypes, &dstItem);
              }
              err = AEPutDesc(dstList, itemNum, &dstItem);
              ThrowIfOSErr(err);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::GetDataFromListOrObject ( const AEDesc *  tokenOrTokenList,
AEDesc *  desiredTypes,
AEDesc *  data 
) [protected]

Definition at line 632 of file nsAEGenericClass.cpp.

{
       if (AEListUtils::TokenContainsTokenList(tokenOrTokenList) == false)
       {
              GetDataFromObject(tokenOrTokenList, desiredTypes, data);
       }
       else
       {
              ThrowIfOSErr(AECreateList(nil, 0, false, data));
              GetDataFromList(tokenOrTokenList, desiredTypes, data);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::GetDataFromObject ( const AEDesc *  token,
AEDesc *  desiredTypes,
AEDesc *  data 
) [protected, pure virtual]

Implemented in AEWindowClass, AEDocumentClass, AEApplicationClass, and AEWordClass.

Definition at line 729 of file nsAEGenericClass.cpp.

{
       ConstAETokenDesc            tokenDesc(token);
       DescType                    propertyCode         = tokenDesc.GetPropertyCode();
       OSErr                err                         = noErr;

       switch (propertyCode)
       {
              case pContents:
              case typeNull:
                     // must mean contents. Make a self specifier.
                     CreateSpecifier(token, data);
                     break;
                     
              default:
                     err = errAECantSupplyType;
                     break;
       }
       
       ThrowIfOSErr(err);
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void AEGenericClass::GetItemFromContainer ( DescType  desiredClass,
const AEDesc *  containerToken,
DescType  containerClass,
DescType  keyForm,
const AEDesc *  keyData,
AEDesc *  resultToken 
) [protected, pure virtual]

Implemented in AEWindowClass, AEApplicationClass, AEDocumentClass, and AEWordClass.

Here is the caller graph for this function:

DescType AEGenericClass::GetKeyEventDataAs ( DescType  propertyCode) [protected, virtual]

Reimplemented in AEApplicationClass.

Definition at line 799 of file nsAEGenericClass.cpp.

{
       return typeWildCard;
}

Here is the caller graph for this function:

void AEGenericClass::GetProperty ( DescType  desiredClass,
const AEDesc *  containerToken,
DescType  containerClass,
DescType  keyForm,
const AEDesc *  keyData,
AEDesc *  resultToken 
) [protected, virtual]

Reimplemented in AEApplicationClass.

Definition at line 213 of file nsAEGenericClass.cpp.

{
       
       // call the base class utility method, which calls back up to the object
       GetPropertyFromListOrObject(desiredClass, containerToken, containerClass, keyForm, keyData, resultToken);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::GetPropertyFromList ( DescType  desiredClass,
const AEDesc *  containerToken,
DescType  containerClass,
DescType  keyForm,
const AEDesc *  keyData,
AEDesc *  resultToken 
) [protected]

Definition at line 892 of file nsAEGenericClass.cpp.

{
       OSErr         err           = noErr;
       long                 itemNum;
       long                 numItems;
       DescType             keyword;
       
       err = AECountItems((AEDescList*)containerToken, &numItems);
       ThrowIfOSErr(err);
              
       for (itemNum = 1; itemNum <= numItems; itemNum++)
       {
              StAEDesc             srcItem;
              StAEDesc             dstItem;
              
              err = AEGetNthDesc(containerToken, itemNum, typeWildCard, &keyword, &srcItem);
              ThrowIfOSErr(err);
              
              if (AEListUtils::TokenContainsTokenList(&srcItem) == false)
              {
                     GetPropertyFromObject(desiredClass, &srcItem, containerClass, keyForm, keyData, &dstItem);
              }
              else
              {
                     err = AECreateList(nil, 0, false, &dstItem);
                     ThrowIfOSErr(err);
                     
                     GetPropertyFromList(desiredClass, &srcItem, containerClass, keyForm, keyData, &dstItem);
              }

              err = AEPutDesc(resultToken, itemNum, &dstItem);
              ThrowIfOSErr(err);
       }
       
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::GetPropertyFromListOrObject ( DescType  desiredClass,
const AEDesc *  containerToken,
DescType  containerClass,
DescType  keyForm,
const AEDesc *  keyData,
AEDesc *  resultToken 
) [protected]

Definition at line 867 of file nsAEGenericClass.cpp.

{
       if (AEListUtils::TokenContainsTokenList((AEDescList*)containerToken) == false)
       {
              GetPropertyFromObject(desiredClass, containerToken, containerClass, keyForm, keyData, resultToken);
       }
       else
       {
              OSErr  err = AECreateList(nil, 0, false, resultToken);
              ThrowIfOSErr(err);
              
              GetPropertyFromList(desiredClass, containerToken, containerClass, keyForm, keyData, resultToken);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::GetPropertyFromObject ( DescType  desiredClass,
const AEDesc *  containerToken,
DescType  containerClass,
DescType  keyForm,
const AEDesc *  keyData,
AEDesc *  resultToken 
) [protected, virtual]

Definition at line 938 of file nsAEGenericClass.cpp.

{
       OSErr                err;   
       DescType                    requestedProperty;

       err = AEDuplicateDesc(containerToken, resultToken);
       ThrowIfOSErr(err);
              
       requestedProperty = **(DescType**)(keyData->dataHandle);
       
       if (requestedProperty == kAEAll || requestedProperty == keyAEProperties)
              requestedProperty = pProperties;

       if (CanGetProperty(requestedProperty) || CanSetProperty(requestedProperty))
       {
              AETokenDesc          resultTokenDesc(resultToken);
              resultToken->descriptorType = desiredType;
              resultTokenDesc.SetPropertyCode(requestedProperty);
       }
       else
       {
              ThrowIfOSErr(errAEEventNotHandled);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::HandleClose ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 269 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleCount ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEApplicationClass.

Definition at line 278 of file nsAEGenericClass.cpp.

{
       ConstAETokenDesc     tokenDesc(token);
       long                 numberOfObjects = 0;
       DescType             objectClass;
       OSErr         err = noErr;  

       if (!reply->dataHandle)
              return;
       
       // Get the class of object that we will count
       err = GetObjectClassFromAppleEvent(appleEvent, &objectClass);
       ThrowIfOSErr(err);
       
       err = CheckForUnusedParameters(appleEvent);
       ThrowIfOSErr(err);

       if (AEListUtils::TokenContainsTokenList(token))
       {
              err = AECountItems(token, &numberOfObjects);
              ThrowIfOSErr(err);
              
       }
       else
       {
              CountObjects(objectClass, tokenDesc.GetDispatchClass(), token, &numberOfObjects);
       }

       err = AEPutParamPtr(reply, keyAEResult, 
                                                         typeLongInteger, 
                                                         (Ptr)&numberOfObjects, 
                                                         sizeof(long));
       ThrowIfOSErr(err);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::HandleDataSize ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 349 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleDelete ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 361 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleDuplicate ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 370 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleExists ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 384 of file nsAEGenericClass.cpp.

{
       OSErr  err;
       Boolean       foundIt       = true;

       err = AEPutParamPtr(reply, 
                                    keyAEResult, 
                                    typeBoolean, 
                                    (Ptr)&foundIt, 
                                    sizeof(Boolean));
              
       ThrowIfOSErr(err);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::HandleExtract ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Definition at line 581 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleGetData ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Definition at line 318 of file nsAEGenericClass.cpp.

{
       OSErr         err                  = noErr;      
       StAEDesc             data;
       StAEDesc             desiredTypes;
       
       (void)AEGetParamDesc(appleEvent, keyAERequestedType, typeAEList, &desiredTypes);
       
       GetDataFromListOrObject(tokenOrTokenList, &desiredTypes, &data);

       if (reply->descriptorType != typeNull)
       {
              err = AEPutKeyDesc(reply, keyDirectObject, &data);
              ThrowIfOSErr(err);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::HandleMake ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 403 of file nsAEGenericClass.cpp.

{
       DescType             insertionPos  = typeNull;
       OSErr         err                  = noErr;

       StAEDesc             insertionLoc;
       StAEDesc             objectSpec;

       // For Create Element, the object specifier is contained in  
       // a typeInsertionLoc record instead of in a direct parameter. 
       // We coerce the insertionLoc record into an AERecord so we can extract the fields.  
       // Notice that this is a REQUIRED parameter, but we give it a default behavior
       // by creating a new element at beginning of the first document
       
       err = ::AEGetParamDesc(appleEvent,                             // Extract as a AERecord
                                                          keyAEInsertHere, 
                                                          typeAERecord, 
                                                          &insertionLoc);
       if (err == errAEDescNotFound)
       {
              insertionPos  = kAEBeginning;
              err                  = noErr;
       }
       else if (err == noErr)
       {
              // Get the enumerated insertion location (at end, in front, before, after, replace.)
              
              OSType        typeCode;
              Size                 actualSize;
              err = ::AEGetKeyPtr(&insertionLoc, 
                                                               keyAEPosition,                     // insertion location
                                                               typeEnumeration, 
                                                               &typeCode, 
                                                               (Ptr)&insertionPos,
                                                               sizeof(insertionPos), 
                                                               &actualSize);

              // Extract and resolve the object specifier from the insertion location record.
              // In a case like "make new rectangle before rectangle 1 of document 1",
              // the ospec will resolve to "rectangle 1 of document 1"
                             
              err = ::AEGetKeyDesc(&insertionLoc, 
                                                               keyAEObject, 
                                                               typeWildCard, 
                                                               &objectSpec);
       }

       // if there was a object specifier in the insertion location (eg, "before rectangle 1 of document 1"),
       //   then we call AEResolve() to get a token for it,
       // Otherwise, is was something like "at end" or "at beginning", which is also OK, 
       //   then deal with it correctly later.
       if (objectSpec.descriptorType == typeNull) 
       {
              ::AEDisposeDesc(token);                   // destroy it's old representation, token will now be null descriptor
       }
       else
       {
              err = ::AEResolve(&objectSpec, 
                                                  kAEIDoMinimum, 
                                                  token);                    // token will contain info about the object to insert before, after, etc.
              ThrowIfOSErr(err);
       }
              
       // Extract the optional parameters from the AppleEvent
       
       // ----- [with data ....] -----
       
       StAEDesc             withData;
       const AEDesc* withDataPtr = nil;
       
       err = ::AEGetParamDesc(appleEvent, 
                                                          keyAEData,
                                                          typeWildCard,
                                                          &withData);
       if (err == errAEDescNotFound)
              err = noErr;
       else
       {
              ThrowIfOSErr(err);
              withDataPtr = &withData;
       }

       // ----- [with properties {property: value, ...}] -----
       StAEDesc             withProperties;
       const AEDesc* withPropertiesPtr = nil;
       err = AEGetParamDesc(appleEvent, 
                                                          keyAEPropData, 
                                                          typeWildCard, 
                                                          &withProperties);
                                                          
       if (err == errAEDescNotFound)
              err = noErr;
       else
       {
              ThrowIfOSErr(err);
              withPropertiesPtr = &withProperties;
       }
       
       // Finally, use the token and other parameters to create & initialize the object
       MakeNewObject(insertionPos, token, withDataPtr, withPropertiesPtr, reply);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::HandleMove ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 510 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleOpen ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 520 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandlePrint ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 550 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleQuit ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 560 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleReOpen ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEApplicationClass.

Definition at line 530 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleRun ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEApplicationClass.

Definition at line 540 of file nsAEGenericClass.cpp.

{
       ThrowIfOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleSave ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Reimplemented in AEWindowClass, and AEApplicationClass.

Definition at line 570 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleSendMessage ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Definition at line 592 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::HandleSetData ( AEDesc *  token,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected, virtual]

Definition at line 340 of file nsAEGenericClass.cpp.

{
       SetDataForListOrObject(token, appleEvent, reply);
}

Here is the call graph for this function:

Here is the caller graph for this function:

pascal OSErr AEGenericClass::ItemFromContainerAccessor ( DescType  desiredClass,
const AEDesc *  containerToken,
DescType  containerClass,
DescType  keyForm,
const AEDesc *  keyData,
AEDesc *  resultToken,
long  refCon 
) [static]

Definition at line 232 of file nsAEGenericClass.cpp.

{
       AEGenericClass*      itemClass = reinterpret_cast<AEGenericClass *>(refCon);
       if (!itemClass) return paramErr;
       
       OSErr         err = noErr;
       
       try
       {
              itemClass->GetItemFromContainer(desiredClass, containerToken, containerClass, keyForm, keyData, resultToken);
       }
       catch(OSErr catchErr)
       {
              err = catchErr;
       }
       catch(...)
       {
              err = paramErr;
       }
       
       return err;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::MakeNewObject ( const DescType  insertionPosition,
const AEDesc *  token,
const AEDesc *  ptrToWithData,
const AEDesc *  ptrToWithProperties,
AppleEvent *  reply 
) [protected, virtual]

Definition at line 976 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

void AEGenericClass::SetDataForList ( const AEDesc *  token,
AEDesc *  data 
) [protected]

Reimplemented in AEDocumentClass.

Definition at line 759 of file nsAEGenericClass.cpp.

{
       OSErr                err;
              
       if (AEListUtils::TokenContainsTokenList(token) == false)
       {
              SetDataForObject(token, data);
       }
       else
       {
              long                 numItems;
              long                 itemNum;
              err = AECountItems((AEDescList*)token, &numItems);
              ThrowIfOSErr(err);
              
              for (itemNum = 1; itemNum <= numItems; itemNum++)
              {
                     StAEDesc             tempToken;
                     AEKeyword     keyword;
                     
                     err = AEGetNthDesc((AEDescList*)token, itemNum, typeWildCard, &keyword, &tempToken);
                     ThrowIfOSErr(err);
                     
                     if (AEListUtils::TokenContainsTokenList(&tempToken) == false)
                     {
                            SetDataForObject(&tempToken, data);              // Set data from single item
                     }
                     else
                     {
                            SetDataForList(&tempToken, data);  // Recurse sublist
                     }
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AEGenericClass::SetDataForListOrObject ( const AEDesc *  tokenOrTokenList,
const AppleEvent *  appleEvent,
AppleEvent *  reply 
) [protected]

Definition at line 651 of file nsAEGenericClass.cpp.

{
       StAEDesc                    data;
       
       switch (tokenOrTokenList->descriptorType)
       {
              case typeAEList:
                     {
                            AECoreClass::GetAECoreHandler()->GetEventKeyDataParameter(appleEvent, typeWildCard, &data);
                            SetDataForList(tokenOrTokenList, &data);
                     }
                     break;
                            
              case cProperty:
                     {
                            ConstAETokenDesc     tokenDesc(tokenOrTokenList);
                            DescType             propertyCode = tokenDesc.GetPropertyCode();
                            //DescType           objectClass    = tokenDesc.GetObjectClass();
                            
                            if (CanSetProperty(propertyCode))
                            {
                                   AECoreClass::GetAECoreHandler()->GetEventKeyDataParameter(appleEvent, GetKeyEventDataAs(propertyCode), &data);
                                   SetDataForObject(tokenOrTokenList, &data);
                            }
                            else
                            {
                                   ThrowIfOSErr(errAENotModifiable);
                            }
                     }
                     break;
                     
              default:
                     ThrowIfOSErr(errAENotModifiable);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void AEGenericClass::SetDataForObject ( const AEDesc *  token,
AEDesc *  data 
) [protected, pure virtual]

Implemented in AEWindowClass, AEDocumentClass, AEApplicationClass, and AEWordClass.

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class AEDispatchHandler [friend]

Definition at line 50 of file nsAEGenericClass.h.


Member Data Documentation

DescType AEGenericClass::mClass [protected]

Definition at line 209 of file nsAEGenericClass.h.

DescType AEGenericClass::mContainerClass [protected]

Definition at line 210 of file nsAEGenericClass.h.

OSLAccessorUPP AEGenericClass::mItemFromContainerAccessor [protected]

Definition at line 212 of file nsAEGenericClass.h.


The documentation for this class was generated from the following files: