home *** CD-ROM | disk | FTP | other *** search
- /* ====================
- * AEADescAppleEvent.cc
- * ====================
- */
-
- #include "AEADebugging.h"
-
- #include <Errors.h>
-
- #include "AEADescAppleEvent.hh"
-
- AEADescAppleEvent::AEADescAppleEvent()
- {
- }
-
- AEADescAppleEvent::AEADescAppleEvent(AEDesc inAEDesc)
- : AEADesc(inAEDesc)
- {
- switch (inAEDesc.descriptorType) {
- case typeAppleEvent:
- case typeNull:
- break;
- default:
- ThrowOSErr_(errAEWrongDataType);
- }
- }
-
- AEADescAppleEvent::AEADescAppleEvent(AEEventClass inEventClass, AEEventID inEventID,
- const AEAddressDesc &inTarget, short inReturnID, long inTransactionID)
- {
- Create(inEventClass, inEventID, inTarget, inReturnID, inTransactionID);
- }
-
- AEADescAppleEvent::~AEADescAppleEvent()
- {
- // AEADesc already calls Dispose().
- }
-
- void
- AEADescAppleEvent::Create(AEEventClass inEventClass, AEEventID inEventID,
- const AEAddressDesc &inTarget, short inReturnID, long inTransactionID)
- {
- OSErr err = ::AECreateAppleEvent(inEventClass, inEventID, &inTarget,
- inReturnID, inTransactionID, &Ref());
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::GetParameter(AEKeyword inKeyword, DescType inDesiredType,
- DescType &outTypeCode, void *outDataPtr, Size inMaximumSize, Size &outActualSize) const
- {
- OSErr err = ::AEGetParamPtr(&Ref(), inKeyword, inDesiredType,
- &outTypeCode, outDataPtr, inMaximumSize, &outActualSize);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::GetParameter(AEKeyword inKeyword, DescType inDesiredType,
- AEDesc &outAEDesc) const
- {
- OSErr err = ::AEGetParamDesc(&Ref(), inKeyword, inDesiredType, &outAEDesc);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::GetAttribute(AEKeyword inKeyword, DescType inDesiredType,
- DescType &outTypeCode, void *outDataPtr, Size inMaximumSize, Size &outActualSize) const
- {
- OSErr err = ::AEGetAttributePtr(&Ref(), inKeyword, inDesiredType,
- &outTypeCode, outDataPtr, inMaximumSize, &outActualSize);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::PutParameter(AEKeyword inKeyword, DescType inTypeCode,
- const void *inDataPtr, Size inDataSize)
- {
- OSErr err = ::AEPutParamPtr(&Ref(), inKeyword, inTypeCode, inDataPtr, inDataSize);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::PutParameter(AEKeyword inKeyword, const AEDesc &inAEDesc)
- {
- OSErr err = ::AEPutParamDesc(&Ref(), inKeyword, &inAEDesc);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::PutParameter(AEKeyword inKeyword, AEADesc inDesc)
- {
- PutParameter(inKeyword, inDesc.Ref());
- }
-
- void
- AEADescAppleEvent::PutAttribute(AEKeyword inKeyword, DescType inTypeCode,
- const void *inDataPtr, Size inDataSize)
- {
- OSErr err = ::AEPutAttributePtr(&Ref(), inKeyword, inTypeCode, inDataPtr, inDataSize);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::PutAttribute(AEKeyword inKeyword, const AEDesc &inAEDesc)
- {
- OSErr err = ::AEPutAttributeDesc(&Ref(), inKeyword, &inAEDesc);
- ThrowIfOSErr_(err);
- }
-
- void
- AEADescAppleEvent::PutAttribute(AEKeyword inKeyword, AEADesc inDesc)
- {
- PutAttribute(inKeyword, inDesc.Ref());
- }
-