Back to index

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

#include <nsAEWordClass.h>

Inheritance diagram for AEWordClass:
Inheritance graph
[legend]
Collaboration diagram for AEWordClass:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AEWordClass ()
 ~AEWordClass ()
virtual void GetItemFromContainer (DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *resultToken)
virtual void CountObjects (DescType desiredType, DescType containerClass, const AEDesc *container, long *result)
virtual void CreateSelfSpecifier (const AEDesc *token, AEDesc *outSpecifier)
virtual void GetDataFromObject (const AEDesc *token, AEDesc *desiredTypes, AEDesc *data)
virtual void SetDataForObject (const AEDesc *token, AEDesc *data)
virtual Boolean CanSetProperty (DescType propertyCode)
virtual Boolean CanGetProperty (DescType propertyCode)
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 CompareObjects (DescType comparisonOperator, const AEDesc *object, const AEDesc *descriptorOrObject, Boolean *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)
void CreateSpecifier (const AEDesc *token, AEDesc *outSpecifier)
virtual void GetContainerSpecifier (const AEDesc *token, AEDesc *outContainerSpecifier)
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)
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

Private Types

typedef AEGenericClass Inherited

Friends

class AECoreClass

Detailed Description

Definition at line 45 of file nsAEWordClass.h.


Member Typedef Documentation

Definition at line 50 of file nsAEWordClass.h.


Member Enumeration Documentation

anonymous enum [protected, inherited]
Enumerator:
kAEExtract 
kExtractKeyDestFolder 
kAESendMessage 

Definition at line 78 of file nsAEGenericClass.h.

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

Constructor & Destructor Documentation

Definition at line 141 of file nsAEWordClass.cpp.

:      AEGenericClass(cWord, AETextClass::cTEText)
{
}

Definition at line 150 of file nsAEWordClass.cpp.

{

}

Member Function Documentation

Boolean AEWordClass::CanGetProperty ( DescType  propertyCode) [virtual]

Implements AEGenericClass.

Definition at line 321 of file nsAEWordClass.cpp.

{
       Boolean result = false;
       
       switch (propertyCode)
       {
              // Properties we can get:

              case pBestType:
              case pClass:
              case pDefaultType:
              case pObjectType:
              case pProperties:
                     result = true;
                     break;
                     
              default:
                     result = Inherited::CanGetProperty(propertyCode);
                     break;
       }
       
       return result;
}

Here is the call graph for this function:

Boolean AEWordClass::CanSetProperty ( DescType  propertyCode) [virtual]

Implements AEGenericClass.

Definition at line 290 of file nsAEWordClass.cpp.

{
       Boolean result = false;
       
       switch (propertyCode)
       {
              case pBestType:
              case pClass:
              case pDefaultType:
              case pObjectType:
                     result = false;
                     break;
              
              case typeNull:
                     result = true;              // contents
                     break;
                     
              case pProperties:
              default:
                     result = Inherited::CanSetProperty(propertyCode);
                     break;
       }
       
       return result;
}

Here is the call graph for this function:

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

Reimplemented in AEWindowClass.

Definition at line 604 of file nsAEGenericClass.cpp.

{
       ThrowOSErr(errAEEventNotHandled);
}

Here is the caller graph for this function:

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

Reimplemented from AEGenericClass.

Definition at line 178 of file nsAEWordClass.cpp.

{
       AEWordIterator              wordIterator;
       long          numItems = wordIterator.GetNumItems(container);
       *result = numItems;
}

Here is the call graph for this function:

void AEWordClass::CreateSelfSpecifier ( const AEDesc *  token,
AEDesc *  outSpecifier 
) [virtual]

Implements AEGenericClass.

Definition at line 352 of file nsAEWordClass.cpp.

{
       AETokenDesc                 tokenDesc(token);

       WEReference                 theWE = tokenDesc.GetWEReference();
       TAEListIndex                wordIndex = tokenDesc.GetElementNumber();
       
       AEDesc                      selfDesc = { typeNull, nil };
       AEDesc                      containerSpecifier = { typeNull, nil };
       OSErr                       err = noErr;
       
       GetContainerSpecifier(token, &containerSpecifier);
       
       err = ::AECreateDesc(typeLongInteger, &wordIndex, sizeof(TAEListIndex), &selfDesc);
       ThrowIfOSErr(err);
       
       err = ::CreateObjSpecifier(mClass, &containerSpecifier, formAbsolutePosition, &selfDesc, true, outSpecifier);
       ThrowIfOSErr(err);
}

Here is the call graph for this function:

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

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 
) [inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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 AEWordClass::GetDataFromObject ( const AEDesc *  token,
AEDesc *  desiredTypes,
AEDesc *  data 
) [virtual]

Implements AEGenericClass.

Definition at line 195 of file nsAEWordClass.cpp.

{
       AETokenDesc          tokenDesc(token);

       DescType                    aDescType            = cWord;
       DescType                    propertyCode         = tokenDesc.GetPropertyCode();
       WindowPtr            window                      = tokenDesc.GetWindowPtr();
       WEReference          theWE                = tokenDesc.GetWEReference();
       TAEListIndex         wordIndex                   = tokenDesc.GetElementNumber();
       OSErr                err                         = noErr;
       long                        wordStart, wordEnd;
       
       ThrowErrIfNil(theWE, errAENoSuchObject);
       
       switch (propertyCode)
       {
              case pProperties:
                     err = AECreateList(nil, 0, true, data);
                     ThrowIfOSErr(err);

                     err = AEPutKeyPtr(data, pObjectType, typeType, &aDescType, sizeof(DescType));
                     break;
                     
              case pBestType:
              case pClass:
              case pDefaultType:
              case pObjectType:
                     err = AECreateDesc(typeType, &aDescType, sizeof(DescType), data);
                     ThrowIfOSErr(err);
                     break;
       
              case pContents:
              case typeNull:
                     {
                            err = GetWEIndexedWordOffsets(theWE, wordIndex, &wordStart, &wordEnd);
                            ThrowIfOSErr(err);
                     
                            Handle               weHand = WEGetText(theWE);
                            StHandleLocker              lockHand(weHand);
                            
                            err = AECreateDesc(typeChar, *weHand + wordStart, wordEnd - wordStart,data);
                            ThrowIfOSErr(err);
                     }
                     break;
                     
              default:
                     Inherited::GetDataFromObject(token, desiredTypes, data);
                     break;
       }
       
       ThrowIfOSErr(err);
}

Here is the call graph for this function:

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

Implements AEGenericClass.

Definition at line 162 of file nsAEWordClass.cpp.

{
       AEWordIterator              wordIterator;
       wordIterator.GetItemFromContainer(desiredClass, containerToken, containerClass, keyForm, keyData, resultToken);
}

Here is the call graph for this function:

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

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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:

void AEWordClass::SetDataForObject ( const AEDesc *  token,
AEDesc *  data 
) [virtual]

Implements AEGenericClass.

Definition at line 253 of file nsAEWordClass.cpp.

{
       AETokenDesc          tokenDesc(token);

       DescType                    aDescType            = cWord;
       DescType                    propertyCode         = tokenDesc.GetPropertyCode();
       WindowPtr            window                      = tokenDesc.GetWindowPtr();
       WEReference          theWE                = tokenDesc.GetWEReference();
       TAEListIndex         wordIndex                   = tokenDesc.GetElementNumber();
       OSErr                err                         = noErr;
       long                        wordStart, wordEnd;
       
       ThrowErrIfNil(theWE, errAENoSuchObject);
       
       switch (propertyCode)
       {
       
              case pContents:
              case typeNull:
                     {
                            err = GetWEIndexedWordOffsets(theWE, wordIndex, &wordStart, &wordEnd);
                            ThrowIfOSErr(err);
                     
                     }
                     break;
       }
       
       ThrowIfOSErr(err);
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class AECoreClass [friend]

Definition at line 47 of file nsAEWordClass.h.


Member Data Documentation

DescType AEGenericClass::mClass [protected, inherited]

Definition at line 209 of file nsAEGenericClass.h.

DescType AEGenericClass::mContainerClass [protected, inherited]

Definition at line 210 of file nsAEGenericClass.h.

OSLAccessorUPP AEGenericClass::mItemFromContainerAccessor [protected, inherited]

Definition at line 212 of file nsAEGenericClass.h.


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