Source/SVAERecording.h

/*
    File:       SVAERecording.h
 
    Contains:   
 
    Written by: Original version by Jon Lansdell and Nigel Humphreys.
                3.1 updates by Greg Sutton.
 
    Copyright:  Copyright © 1995-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):
                7/20/1999   Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
 
*/
#ifndef __SVAERECORDING__
#define __SVAERECORDING__
 
#include "SVEditGlobals.h"
 
#include "SVToken.h"
 
OSErr           InstallRecordingHandlers(void);
 
pascal OSErr    HandleStartRecording(const AppleEvent   *theAppleEvent,
                                            AppleEvent  *reply,
                                            long        handlerRefCon); 
 
pascal OSErr    HandleStopRecording(const AppleEvent    *theAppleEvent,
                                            AppleEvent  *reply,
                                            long        handlerRefCon); 
 
OSErr       MakeWindowObj(WindowPtr theWindow, AEDesc *result);
OSErr       MakeDocumentObj(WindowPtr theWindow, AEDesc *result);
 
OSErr       MakeTextObjFromToken(TextToken* theToken, AEDesc* result);
OSErr       MakeSelectedTextObj(WindowPtr   theWindow,
                                TEHandle    theTextEditHandle,
                                AEDesc      *result);
OSErr       MakeTextObj(WindowPtr theWindow, short selStart, short selEnd, AEDesc *result);
 
 
enum editCommandType
{
    editCutCommand   = 1,
    editCopyCommand  = 2,
    editPasteCommand = 3,
    editClearCommand = 4
};
 
typedef enum editCommandType editCommandType;
 
OSErr   SendSelectionEvent(DPtr docPtr);
void    DoEditCommand(DPtr theDocument, editCommandType whatCommand);
OSErr   SendAESetObjProp(AEDesc *theObj, DescType theProp, AEDesc *theData, AEAddressDesc *toWhom);
 
    // Text Commands
    
void    IssueCutCommand(DPtr theDocument);
void    IssueCopyCommand(DPtr theDocument);
void    IssuePasteCommand(DPtr theDocument);
void    IssueClearCommand(DPtr theDocument);
void    IssueFontCommand(DPtr theDocument, short theItem);
void    IssueSizeCommand(DPtr theDocument, short theItem);
void    IssueStyleCommand(DPtr theDocument, short theItem);
 
    // Window Commands
 
void    IssueZoomCommand(WindowPtr whichWindow, short whichPart);
void    IssueCloseCommand(WindowPtr whichWindow);
void    IssueSizeWindow(WindowPtr whichWindow, short newHSize,short newVSize);
void    IssueMoveWindow(WindowPtr whichWindow, Rect sizeRect);
void    IssuePageSetupWindow(WindowPtr whichWindow, TPrint thePageSetup);
void    IssueGXPageSetupWindow(WindowPtr whichWindow, gxJob thGXJob);
 
#define kUsePrintDialog true
#define kNoPrintDialog false
void    IssuePrintWindow( WindowPtr whichWindow, Boolean useDialog);
 
    // Document Commands
 
OSErr   IssueAEOpenDoc(FSSpec myFSSpec);
void    IssueAENewWindow(void);
OSErr   IssueSaveCommand(WindowPtr theWindow, FSSpecPtr where);
                                                
OSErr   IssueRevertCommand(WindowPtr theWindow);
OSErr   IssueQuitCommand(void);
 
    // Recording of Keystrokes
 
void    AddKeyToTypingBuffer(DPtr theDocument, char theKey);
void    FlushAndRecordTypingBuffer(void);
 
 
void    StyleTokConst(short theStyleItem, DescType *thekConst);
OSErr   BuildTypeTextStylesDesc(Style onStyles, Style offStyles, AEDesc *resultDesc);
OSErr   BuildTextStylesDesc(Style theStyle, AEDesc *resultDesc);
OSErr   BuildStyledTextDesc(TEHandle theHTE, short start, short howLong, AEDesc *resultDesc);
 
 
Boolean PoseSizeDialog(long *whatSize);
OSErr   IssueSetDataObjToBufferContents(const AEDesc* theObj);
 
#endif