home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- * *
- * *
- * This code is copyright (c) 1992 *
- * Athena Design, Inc. *
- * and David Pollak *
- * *
- * ALL RIGHTS RESERVED *
- * *
- * *
- * *
- * *
- * *
- **************************************************************************/
-
- #import <objc/Object.h>
- #import <mach.h>
- #import <sys/message.h>
-
- enum {stringMAPIValue, numberMAPIValue, errorMAPIValue};
- enum {horizontalOrientation, verticalOrientation};
-
- typedef struct _MAPIValue {
- int type;
- short row,col;
- union {
- char *string;
- double number;
- int error;
- } values;
- } MAPIValue;
-
- typedef struct _MAPIMessage {
- msg_header_t head;
- msg_type_t handleType;
- int handle;
- msg_type_t lenType;
- int theLen;
- msg_type_t dataType;
- void *theData;
- } MAPIMessage;
-
- enum {MAPISuccess, MAPISendError, MAPIReceiveError, MAPILabelNotFoundError,
- MAPISheetClosedError, MAPINotImplError};
-
- enum {openSheetMesaDo, unlinkSheetMesaDo, recalcMesaDo, associateMesaDo,
- getLabelRangeMesaDo, getRangeMesaDo, putRangeMesaDo,
- getLabelsMesaDo, saveMesaDo, saveAsMesaDo, getRawInputMesaDo, setRawInputMesaDo,
- hideMesaDo, orderFrontMesaDo, newSheetMesaDo, displayMesaDo};
-
- void freeMAPIValue(int,MAPIValue *);
-
- @interface MesaAPI : Object
- {
- port_t myPort;
- port_t mesaPort;
- MAPIMessage theMessage;
- }
-
- - initToWorksheet:(const char *)ws;
- - initToNewWorksheet;
- - free;
- - (int)recalc;
- - (int)displaySheet;
- - (int)saveSheet;
- - (int)saveSheetAs:(const char *)name;
- - (int)hide;
- - (int)makeKeyAndOrderFront;
-
- - (int)getValues:(MAPIValue **)mv num:(int *)n
- upperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc;
- - (int)putValues:(MAPIValue *)mv num:(int)n
- upperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc;
- - (int)getLabels:(char ***)lp ranges:(short **)r num:(int *)num;
- - (int)associateLabel:(const char *)l withItems:(char **)it andValues:(MAPIValue *)mv
- offset:(int)off numItems:(int)ni orientation:(int)or;
- - (int)getValues:(MAPIValue **)mv forLabel:(const char *)l num:(int *)n
- upperRow:(int *)ur col:(int *)uc lowerRow:(int *)lr col:(int *)lc;
-
- // these methods are private. Do not use them
- - (int)sendMessage:(int)m :(void *)data :(int)len;
- - (int)receiveMessage;
- @end
-
- @interface MesaListen : Object
- {
- port_t myPort;
- char *portName;
- }
-
- - initToPort:(char *)s;
- - free;
- - gotMessage:(MAPIValue *)mv num:(int)num forUpperRow:(int)ur upperCol:(int)uc lowerRow:(int)lr
- lowerCol:(int)lc;
- @end