Headers/AppleEvent.h

/*
    File:       AppleEvent.h
 
    Contains:   TAppleEvent is an Apple Event class that will send and receive Apple Events.
                AppleEvent.cp contains the TAppleEvent class definition.
 
    Written by: Kent Sandvik    
 
    Copyright:  Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
 
                You may incorporate this Apple sample source code into your program(s) without
                restriction. This Apple sample source code has been provided "AS IS" and the
                responsibility for its operation is yours. You are not permitted to redistribute
                this Apple sample source code as "Apple sample source code" after having made
                changes. If you're going to re-distribute the source, we require that you make
                it clear in the source that the code was descended from Apple sample source
                code, but that you've made changes.
 
    Change History (most recent first):
                8/18/1999   Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
 
*/
// Declare label for this header file
#ifndef _APPLEEVENT_
#define _APPLEEVENT_
 
#ifndef _DTSCPLUSLIBRARY_
#include "DTSCPlusLibrary.h"
#endif
 
//  Toolbox Include Files
#ifndef __PROCESSES__
#include <Processes.h>
#endif
 
#ifndef __APPLEEVENTS__
#include <AppleEvents.h>
#endif
 
 
// _________________________________________________________________________________________________________ //
//  TAppleEvent Class Interface
class TAppleEvent
// The TAppleEvent class will provide Apple Event services (send, receive, get and put
// descriptor information.
{
public:
    // CONSTRUCTORS AND DESTRUCTORS
    TAppleEvent();                              // create a kCurrentProcess AE
    TAppleEvent(OSType signature);              // create an AE based on the OSType address
    ~TAppleEvent();                             // default destructor
 
    void Initialize();                          // initialize fields to known values
 
    //  MAIN INTERFACES
    virtual OSErr Define(AEEventClass theClass,
                         AEEventID ID);         // create the actual AE
    virtual OSErr Send();                       // fire off the Apple Event
    virtual OSErr Send(AEEventClass theClass,
                       AEEventID ID);           // fire off with the specs
    virtual void SetAddress(const AEAddressDesc address);// set address for our AE
 
    //  GET/SET MEMBER FUNCTIONS
    virtual long GetTimeoutValue() const;       // get our timeout value
    virtual void SetTimeoutValue(const long val);// set out timeout value
    virtual AESendMode GetSendingMode() const;  // get our sending mode
    virtual void SetSendingMode(const AESendMode mode);// set our sending mode  
    virtual AESendPriority GetPriority() const; // get our priority setting
    virtual void SetPriority(const AESendPriority value);// set our priority setting        
 
    //  FIELDS
protected:
    OSErr fError;                               // current error 
    OSType fSignature;                          // keep track of the OSType used
    AEAddressDesc fTarget;                      // needed data structure for AEs
    AppleEvent fAE;                             // the final Apple Event itself
    AppleEvent fReply;                          // the reply AE
    AESendPriority fPriority;                   // priority mode
    AESendMode fSendMode;                       // our send mode field
    long fTimeout;                              // timeout (in ticks)
};
 
#endif
 
// _________________________________________________________________________________________________________ //
 
 
/*  Change History (most recent last):
  No        Init.   Date        Comment
  1         khs     11/22/92    New file
  2         khs     1/7/93      Cleanup
*/