Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 2 - Edition Manager


Summary of the Edition Manager

Pascal Summary

Constants

CONST 
   {resource types}
   rSectionType                  = 'sect';   {resource type for a }
                                             { section}
   {section types}
   stSubscriber                  = $01;      {subscriber section type}
   stPublisher                   = $0A;      {publisher section type} 
   {update modes}
   sumAutomatic                  = 0;        {subscriber receives new } 
                                             { editions automatically}
   sumManual                     = 1;        {subscriber receives new } 
                                             { editions manually}
   pumOnSave                     = 0;        {publisher sends new } 
                                             { editions on save}
   pumManual                     = 1;        {publisher does not send } 
                                             { new editions until user }
                                             { request}
   {edition container subpart number}
   kPartsNotUsed                 = 0;        {edition is the whole file}
   kPartNumberUnknown            = -1;       {not used in version 7.0} 

   {preview size}
   kPreviewWidth                 = 120;      {preview width} 
   kPreviewHeight                = 120;      {preview height}

   {special formats}
   kPublisherDocAliasFormat      = 'alis';   {alias record from the } 
                                             { edition to publisher} 
   kPreviewFormat                = 'prvw';   {'PICT' thumbnail sketch}
   kFormatListFormat             = 'fmts';   {list of all available }
                                             { formats and their sizes}

   {bits for formatMask}
   kPICTformatMask               = 1;        {graphics format}
   kTEXTformatMask               = 2;        {text format}
   ksndFormatMask                = 4;        {sound format}

   {Finder types for edition files}
   kPICTEditionFileType          = 'edtp';   {contains 'PICT', }
   kTEXTEditionFileType          = 'edtt';   { 'TEXT', and }
   ksndEditionFileType           = 'edts';   { 'snd ' file types}
   kUnknownEditionFileType       = 'edtu';   {unknown file type}
   {miscellaneous}
   kFormatLengthUnknown          = -1;       {length of format unknown}

   {message IDs for Apple events sent by the Edition Manager}
   sectionEventMsgClass          = 'sect';   {Apple events sent by the }
                                             { Edition Manager}
   sectionReadMsgID              = 'read';   {Section Read events}
   sectionWriteMsgID             = 'writ';   {Section Write events}
   sectionScrollMsgID            = 'scrl';   {Section Scroll events}
   sectionCancelMsgID            = 'cncl';   {Section Cancel events}

   {refCon field when displaying stacked dialog boxes}
   sfMainDialogRefCon            = 'stdf';   {new publisher and }
                                             { new subscriber}
   sfNewFolderDialogRefCon       = 'nfdr';   {new folder}
   sfReplaceDialogRefCon         = 'rplc';   {replace dialog}
   sfStatWarnDialogRefCon        = 'stat';   {warning dialog}
   sfErrorDialogRefCon           = 'err ';   {error dialog}
   emOptionsDialogRefCon         = 'optn';   {options dialog}
   emCancelSectionDialogRefCon   = 'cncl';   {cancel section}
   emGotoPubErrDialogRefCon      = 'gerr';   {locate publisher}

   {pseudo-item hits for dialogHooks}
   emHookRedrawPreview           = 150;      {for NewPublisher or }
                                             { NewSubscriber dialogs}
   emHookCancelSection           = 160;      {for SectionOptions dialog}
   emHookGoToPublisher           = 161;      {for SectionOptions dialog}
   emHookGetEditionNow           = 162;      {for SectionOptions dialog}
   emHookSendEditionNow          = 162;      {for SectionOptions dialog}
   emHookManualUpdateMode        = 163;      {for SectionOptions dialog}
   emHookAutoUpdateMode          = 164;      {for SectionOptions dialog}

Data Types

TYPE TimeStamp                   = LongInt;     {seconds since 1904}
   EditionRefNum                 = Handle;      {for use in Edition I/O}
   UpdateMode                    = Integer;     {sumAutomatic, }
                                                { sumManual, } 
                                                { pumOnSave, pumManual}
   SectionType                   = SignedByte;  {stSubscriber or }
                                                { stPublisher} 
   FormatType                    = PACKED ARRAY[1..4] OF CHAR; 
                                                {similar to ResType used } 
                                                { by the Scrap Manager}

   SectionHandle                 = ^SectionPtr;
   SectionPtr                    = ^SectionRecord;
   SectionRecord                 = 
   RECORD
      version:                   SignedByte;    {always 1 in version 7.0}
      kind:                      SectionType;   {publisher or subscriber}
      mode:                      UpdateMode;    {automatic or manual}
      mdDate:                    TimeStamp;     {last change to section}
      sectionID:                 LongInt;       {application-specific, }
                                                { unique per document}
      refCon:                    LongInt;       {application-specific}
      alias:                     AliasHandle;   {handle to alias record}

      {The following fields are private and are set up by the }
      { RegisterSection function.}

      subPart:                   LongInt;       {private}
      nextSection:               SectionHandle; {private}
      controlBlock:              Handle;        {private}
      refNum:                    EditionRefNum; {private}
   END;
   EditionContainerSpecPtr =^EditionContainerSpec;
   EditionContainerSpec =
   RECORD
      theFile:                   FSSpec;        {file containing edition } 
                                                { data}
      theFileScript:             ScriptCode;    {script code of filename}
      thePart:                   LongInt;       {which part of file, } 
                                                { always kPartsNotUsed}
      thePartName:               Str31;         {reserved}
      thePartScript:             ScriptCode;    {reserved}
   END;
   FormatsAvailable = ARRAY[0..0] OF
   RECORD
      theType:                   FormatType;    {format type for an }
                                                { edition}
      theLength:                 LongInt;       {length of edition format }
                                                { type}
   END;
   EditionInfoRecord = 
   RECORD
      crDate:                    TimeStamp;     {date edition container }
                                                { was created}
      mdDate:                    TimeStamp;     {date of last change}
      fdCreator:                 OSType;        {file creator}
      fdType:                    OSType;        {file type}
      container:                 EditionContainerSpec;
                                                {the edition}
   END;
   NewPublisherReply = 
   RECORD
      canceled:         Boolean;             {user canceled dialog box} 
      replacing:        Boolean;             {user chose existing } 
                                             { filename for an edition}
      usePart:          Boolean;             {always FALSE in version 7.0}
      preview:          Handle;              {handle to 'prvw', 'PICT',}
                                             { 'TEXT', or 'snd ' data}
      previewFormat:    FormatType;          {type of preview}
      container:        EditionContainerSpec;
                                             {edition chosen}
   END;
   NewSubscriberReply =
   RECORD
      canceled:         Boolean;             {user canceled dialog box}
      formatsMask:      SignedByte;          {formats required}
      container:        EditionContainerSpec;
                                             {edition selected}
   END;
   SectionOptionsReply =
   RECORD
      canceled:         Boolean;             {user canceled dialog box}
      changed:          Boolean;             {changed the section }
                                             { record}
      sectionH:         SectionHandle;       {handle to the specified }
                                             { section record}
      action:           ResType;             {action codes}
   END;
   EditionOpenerVerb= (eoOpen, eoClose, eoOpenNew, eoCloseNew,
                        eoCanSubscribe); 
   EditionOpenerParamBlock = 
   RECORD
      info:             EditionInfoRecord;   {edition container to }
                                             { be subscribed to}
      sectionH:         SectionHandle;       {publisher or subscriber }
                                             { requesting open}
      document:         FSSpecPtr;           {document passed}
      fdCreator:        OSType;              {Finder creator type}
      ioRefNum:         LongInt;             {reference number}
      ioProc:           FormatIOProcPtr;     {routine to read formats}
      success:          Boolean;             {reading or writing was }
                                             { successful}
      formatsMask:      SignedByte;          {formats required to }
                                             { subscribe}
   END;
   FormatIOVerb = (ioHasFormat, ioReadFormat, ioNewFormat, ioWriteFormat);
   FormatIOParamBlock = 
   RECORD
      ioRefNum:         LongInt;             {reference number}
      format:           FormatType;          {edition format type}
      formatIndex:      LongInt;             {opener-specific enumeration }
                                             { of formats}
      offset:           LongInt;             {offset into format}
      buffPtr:          Ptr;                 {data starts here}
      buffLen:          LongInt;             {length of data}
END;

Edition Manager Routines

Initializing the Edition Manager

FUNCTION InitEditionPack : OSErr;

Creating and Registering a Section

FUNCTION NewSection(container: EditionContainerSpec; 
sectionDocument: FSSpecPtr; kind: SectionType; 
sectionID: LongInt; initialMode: UpdateMode; 
VAR sectionH: SectionHandle): OSErr;
FUNCTION RegisterSection(sectionDocument: FSSpec; 
sectionH: SectionHandle; 
VAR aliasWasUpdated: Boolean)
: OSErr;
FUNCTION UnRegisterSection(sectionH: SectionHandle): OSErr;
FUNCTION IsRegisteredSection
(sectionH: SectionHandle): OSErr;
FUNCTION AssociateSection(sectionH: SectionHandle; 
newSectionDocument: FSSpecPtr): OSErr;

Creating and Deleting an Edition Container

FUNCTION CreateEditionContainerFile
(editionFile: FSSpec; fdCreator: OSType; editionFileNameScript: ScriptCode): OSErr;
FUNCTION DeleteEditionContainerFile
(editionFile: FSSpec): OSErr;

Setting and Getting a Format Mark

FUNCTION SetEditionFormatMark
(whichEdition: EditionRefNum; 
whichFormat: FormatType; 
setMarkTo: LongInt): OSErr;
FUNCTION GetEditionFormatMark
(whichEdition: EditionRefNum; 
whichFormat: FormatType; 
VAR currentMark: LongInt): OSErr; 

Reading in Edition Data

FUNCTION OpenEdition(subscriberSectionH: SectionHandle; 
VAR refNum: EditionRefNum): OSErr;
FUNCTION EditionHasFormat(whichEdition: EditionRefNum; 
whichFormat: FormatType; 
VAR formatSize: Size): OSErr; 
FUNCTION ReadEdition(whichEdition: EditionRefNum; 
whichFormat: FormatType; buffPtr: UNIV Ptr; 
VAR buffLen: Size): OSErr;

Writing out Edition Data

FUNCTION OpenNewEdition(publisherSectionH: SectionHandle; 
fdCreator: OSType; 
publisherSectionDocument: FSSpecPtr; 
VAR refNum: EditionRefNum): OSErr;
FUNCTION WriteEdition(whichEdition: EditionRefNum; 
whichFormat: FormatType; buffPtr: UNIV Ptr; 
buffLen: Size): OSErr;

Closing an Edition After Reading or Writing

FUNCTION CloseEdition(whichEdition: EditionRefNum; 
successful: Boolean): OSErr;

Displaying Dialog Boxes

FUNCTION GetLastEditionContainerUsed
(VAR container: EditionContainerSpec): OSErr;
FUNCTION NewSubscriberDialog
(VAR reply: NewSubscriberReply): OSErr;
FUNCTION NewPublisherDialog(VAR reply: NewPublisherReply): OSErr;
FUNCTION SectionOptionsDialog
(VAR reply: SectionOptionsReply): OSErr;
FUNCTION NewSubscriberExpDialog
(VAR reply: NewSubscriberReply; where: Point; expansionDITLresID: Integer; 
dlgHook: ExpDlgHookProcPtr; 
filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
FUNCTION NewPublisherExpDialog
(VAR reply: NewPublisherReply; where: Point; expansionDITLresID: Integer; 
dlgHook: ExpDlgHookProcPtr; 
filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
FUNCTION SectionOptionsExpDialog
(VAR reply: SectionOptionsReply; where: Point; expansionDITLresID: Integer; 
dlgHook: ExpDlgHookProcPtr; 
filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;

Locating a Publisher and Edition From a Subscriber

FUNCTION GetEditionInfo(sectionH: SectionHandle; 
VAR editionInfo: EditionInfoRecord): OSErr;
FUNCTION GoToPublisherSection
(container: EditionContainerSpec): OSErr;

Edition Container Formats

FUNCTION GetStandardFormats(container: EditionContainerSpec; 
VAR previewFormat: FormatType; 
preview, publisherAlias, 
formats: Handle): OSErr;

Reading and Writing Non-Edition files

FUNCTION GetEditionOpenerProc
(VAR opener: EditionOpenerProcPtr): OSErr;
FUNCTION SetEditionOpenerProc
(opener: EditionOpenerProcPtr): OSErr;
FUNCTION CallEditionOpenerProc
(selector: EditionOpenerVerb; 
VAR PB: EditionOpenerParamBlock; 
routine: EditionOpenerProcPtr): OSErr;
FUNCTION CallFormatIOProc(selector: FormatIOVerb; 
VAR PB: FormatIOParamBlock; 
routine: FormatIOProcPtr): OSErr;

Application-Defined Routines

FUNCTION MyExpDlgHook(itemOffset: Integer; itemHit: Integer; 
theDialog: DialogPtr; 
yourDataPtr: Ptr): Integer;
FUNCTION MyExpModalFilter(theDialog: DialogPtr; 
VAR theEvent: EventRecord; 
itemOffset: Integer; VAR itemHit: Integer; 
yourDataPtr: Ptr): Boolean;
FUNCTION MyOpener(selector: EditionOpenerVerb; 
VAR PB: EditionOpenerParamBlock): OSErr;
FUNCTION MyIO(selector: FormatIOVerb; 
VAR PB: FormatIOParamBlock): OSErr;

C Summary

Constants

CONST 
enum {
   /*resource types*/
   #define rSectionType           'sect'     /*resource type for a */
                                             /* section*/

   /*section types*/
   stSubscriber                  = 0x01,     /*subscriber section type*/
   stPublisher                   = 0x0A,     /*publisher section type*/ 

   /*update modes*/
   sumAutomatic                  = 0,        /*subscriber receives new */ 
                                             /* editions automatically*/
   sumManual                     = 1,        /*subscriber receives new */ 
                                             /* editions manually*/
   pumOnSave                     = 0,        /*publisher sends new */ 
                                             /* editions on save*/
   pumManual                     = 1,        /*publisher does not send */ 
                                             /* new editions until user */
                                             /* request*/
   /*edition container subpart number*/
   kPartsNotUsed                 = 0,        /*edition is the whole file*/
   kPartNumberUnknown            = -1,       /*not used in version 7.0*/ 

   /*preview size*/
   kPreviewWidth                 = 120,      /*preview width*/ 
   kPreviewHeight                = 120,      /*preview height*/
   /*special formats*/
   #define kPublisherDocAliasFormat 'alis'   /*alias record from the */ 
                                             /* edition to publisher*/ 
   #define kPreviewFormat           'prvw'   /*'PICT' thumbnail sketch*/
   #define kFormatListFormat        'fmts'   /*list of all available */
                                             /* formats and their sizes*/

   /*bits for formatMask*/
   kPICTformatMask               = 1,        /*graphics format*/
   kTEXTformatMask               = 2,        /*text format*/
   ksndFormatMask                = 4,        /*sound format*/

   /*Finder types for edition files*/
   #define kPICTEditionFileType     'edtp'   /*contains 'PICT', */
   #define kTEXTEditionFileType     'edtt'   /* 'TEXT', and */
   #define ksndEditionFileType      'edts'   /* 'snd ' file types*/
   #define kUnknownEditionFileType  'edtu'   /*unknown file type*/

   /*pseudo-item hits for dialogHooks*/
   emHookRedrawPreview           = 150,      /*for NewPublisher or */
                                             /* NewSubscriber dialogs*/
   emHookCancelSection           = 160,      /*for SectionOptions dialog*/
   emHookGoToPublisher           = 161,      /*for SectionOptions dialog*/
   emHookGetEditionNow           = 162,      /*for SectionOptions dialog*/
   emHookSendEditionNow          = 162,      /*for SectionOptions dialog*/
   emHookManualUpdateMode        = 163,      /*for SectionOptions dialog*/
   emHookAutoUpdateMode          = 164       /*for SectionOptions dialog*/
};
   /*edition opener verbs*/
enum {eoOpen, eoClose, eoOpenNew, eoCloseNew, eoCanSubscribe};

enum {
   /*refCon field when displaying stacked dialog boxes*/
   #define emOptionsDialogRefCon        'optn'     /*options dialog*/
   #define emCancelSectionDialogRefCon  'cncl'     /*cancel section*/
   #define emGotoPubErrDialogRefCon     'gerr'     /*locate publisher*/

   kFormatLengthUnknown          = -1        /*length of format unknown*/
};
   /*refCon field when displaying stacked dialog boxes*/
   #define sfMainDialogRefCon     'stdf'     {new publisher and }
                                             { new subscriber}
   #define sfNewFolderDialogRefCon'nfdr'     {new folder}
   #define sfReplaceDialogRefCon  'rplc'     {replace dialog}
   #define sfStatWarnDialogRefCon 'stat'     {warning dialog}
   #define sfErrorDialogRefCon    'err '     {error dialog}

   /*message IDs for Apple events sent by the Edition Manager*/
   #define sectionEventMsgClass   'sect'     /*Apple events sent by the */
                                             /* Edition Manager*/
   #define sectionReadMsgID       'read'     /*Section Read events*/
   #define sectionWriteMsgID      'writ'     /*Section Write events*/
   #define sectionScrollMsgID     'scrl'     /*Section Scroll events*/
   #define sectionCancelMsgID     'cncl'     /*Section Cancel events*/

Data Types

typedef unsigned long TimeStamp;             /*seconds since 1904*/
typedef Handle EditionRefNum;`               /*used in Edition I/O*/
typedef short UpdateMode;                    /*update mode: sumAutomatic, */
                                             /* sumManual, */ 
                                             /* pumOnSave, pumManual*/
typedef char SectionType;                    /*one byte, stSubscriber */
                                             /* or stPublisher*/ 
typedef unsigned long FormatType;            /*similar to ResType*/

struct SectionRecord {
   SignedByte version;                       /*always 1x01 in version 7.0*/
   SectionType kind;                         /*stPublisher or */
                                             /* stSubscriber*/
   UpdateMode mode;                          /*automatic or manual*/
   TimeStamp mdDate;                         /*last change to section*/
   long sectionID;                           /*application-specific, */
                                             /* unique per document*/
   long refCon;                              /*application-specific*/
   AliasHandle alias;                        /*handle to alias record*/
   long subPart;                             /*private*/
   struct SectionRecord **nextSection;       /*private*/
   Handle controlBlock;                      /*private*/
   EditionRefNum refNum;                     /*private*/
};

typedef struct SectionRecord SectionRecord;
typedef SectionRecord *SectionPtr, **SectionHandle;


struct EditionContainerSpec {
   FSSpec theFile;                           /*file containing */ 
                                             /* edition data*/
   ScriptCode theFileScript;                 /*script code of filename*/
   long thePart;                             /*which part of file, */ 
                                             /* always kPartsNotUsed*/
   Str31 thePartName;                        /*reserved*/
   ScriptCode thePartScript;                 /*reserved*/
};

typedef struct EditionContainerSpec EditionContainerSpec;
typedef EditionContainerSpec *EditionContainerSpecPtr;

struct EditionInfoRecord {
   TimeStamp crDate;                      /*date edition container */
                                          /* was created*/
   TimeStamp mdDate;                      /*date of last change*/
   OSType fdCreator;                      /*file creator*/
   OSType fdType;                         /*file type*/
   EditionContainerSpec container;        /*the edition*/
};

typedef struct EditionInfoRecord EditionInfoRecord;

struct NewPublisherReply {
   Boolean canceled;                      /*user canceled dialog box*/ 
   Boolean replacing;                     /*user chose existing */ 
                                          /* filename for an edition*/
   Boolean usePart;                       /*always FALSE in version */ 
                                          /* 7.0*/
   Handle preview;                        /*handle to 'prvw', 'PICT',*/
                                          /* 'TEXT', or 'snd ' data*/
   FormatType previewFormat;              /*type of preview*/
   EditionContainerSpec container;        /*edition chosen*/
};
typedef struct NewPublisherReply NewPublisherReply;

struct NewSubscriberReply {
   Boolean canceled;                      /*user canceled dialog box*/
   unsigned char formatsMask;             /*formats required*/
   EditionContainerSpec container;        /*edition selected*/
};
typedef struct NewSubscriberReply NewSubscriberReply;
struct SectionOptionsReply {
   Boolean canceled;                      /*user canceled dialog box*/
   Boolean changed;                       /*changed the section */
                                          /* record*/
   SectionHandle sectionH;                /*handle to the specified */
                                          /* section record*/
   ResType action;                        /*action codes*/
};

typedef struct SectionOptionsReply SectionOptionsReply;

typedef pascal Boolean (*ExpModalFilterProcPtr) (DialogPtr theDialog, 
                                    EventRecord *theEvent, short itemOffset, 
                                    short *itemHit, Ptr yourDataPtr);

typedef pascal short (*ExpDlgHookProcPtr) (short itemOffset, short itemHit,
                                       DialogPtr theDialog, Ptr yourDataPtr);

typedef unsigned char EditionOpenerVerb;
   
struct EditionOpenerParamBlock {
   EditionInfoRecord info;                /*edition container to */
                                          /* be subscribed to*/
   SectionHandle sectionH;                /*publisher or subscriber */
                                          /* requesting open*/
   FSSpecPtr document;                    /*document passed*/
   OSType fdCreator;                      /*Finder creator type*/
   long ioRefNum;                         /*reference number*/
   FormatIOProcPtr ioProc;                /*routine to read formats*/
   Boolean success;                       /*reading or writing was */
                                          /* successful*/
   unsigned char formatsMask;             /*formats required to */
                                          /* subscribe*/
};
typedef struct EditionOpenerParamBlock EditionOpenerParamBlock;

typedef pascal short (*EditionOpenerProcPtr) (EditionOpenerVerb selector,
                                             FormatIOParamBlock *PB);

enum {ioHasFormat, ioReadFormat, ioNewFormat, ioWriteFormat};
typedef unsigned char FormatIOVerb;


struct FormatIOParamBlock {
   long ioRefNum;                         /*reference number*/
   FormatType format;                     /*edition format type*/
   long formatIndex;                      /* opener-specific */ 
                                          /* enumeration */
                                          /* of formats*/
   unsigned long offset;                  /*offset into format*/
   Ptr buffPtr;                           /*data starts here*/
   unsigned long buffLen;                 /*length of data*/
};

typedef struct FormatIOParamBlock FormatIOParamBlock;

typedef pascal short (*FormatIOProcPtr) (FormatIOVerb selector,
                                       FormatIOParamBlock *PB);

Edition Manager Routines

Initializing the Edition Manager

pascal OSErr InitEditionPack(void)

Creating and Registering a Section

pascal OSErr NewSection(const EditionContainerSpec *container,
const FSSpec *sectionDocument,
SectionType kind, long sectionID,
UpdateMode initialMode,
SectionHandle *sectionH);
pascal OSErr RegisterSection
(const FSSpec *sectionDocument,
SectionHandle sectionH,
Boolean *aliasWasUpdated);
pascal OSErr UnRegisterSection
(SectionHandle sectionH);
pascal OSErr IsRegisteredSection
(SectionHandle sectionH);
pascal OSErr AssociateSection
(SectionHandle sectionH,
const FSSpec *newSectionDocument);

Creating and Deleting an Edition Container

pascal OSErr CreateEditionContainerFile
(const FSSpec *editionFile, OSType fdCreator, ScriptCode editionFileNameScript);
pascal OSErr DeleteEditionContainerFile
(const FSSpec *editionFile);

Setting and Getting a Format Mark

pascal OSErr SetEditionFormatMark
(EditionRefNum whichEdition,
FormatType whichFormat,
unsigned long setMarkTo);
pascal OSErr GetEditionFormatMark
(EditionRefNum whichEdition,
FormatType whichFormat,
unsigned long *currentMark);

Reading in Edition Data

pascal OSErr OpenEdition(SectionHandle subscriberSectionH, 
EditionRefNum *refNum);
pascal OSErr EditionHasFormat
(EditionRefNum whichEdition,
FormatType whichFormat,
Size *formatSize);
pascal OSErr ReadEdition(EditionRefNum whichEdition,
FormatType whichFormat, void *buffPtr,
Size *buffLen);

Writing out Edition Data

pascal OSErr OpenNewEdition(SectionHandle publisherSectionH,
OSType fdCreator,
const FSSpec *publisherSectionDocument,
EditionRefNum *refNum);
pascal OSErr WriteEdition(EditionRefNum whichEdition,
FormatType whichFormat, const void *buffPtr, 
Size *buffLen);

Closing an Edition After Reading or Writing

pascal OSErr CloseEdition(EditionRefNum whichEdition,
Boolean successful);

Displaying Dialog Boxes

pascal OSErr GetLastEditionContainerUsed
(EditionContainerSpec *container);
pascal OSErr NewSubscriberDialog
(NewSubscriberReply *reply);
pascal OSErr NewPublisherDialog
(NewPublisherReply *reply);
pascal OSErr SectionOptionsDialog
(SectionOptionsReply *reply);
pascal OSErr NewSubscriberExpDialog
(NewSubscriberReply *reply, Point where,
short expansionDITLresID,
ExpDlgHookProcPtr dlgHook,
ExpModalFilterProcPtr filterProc,
void *yourDataPtr);
pascal OSErr NewPublisherExpDialog
(NewPublisherReply *reply, Point where,
short expansionDITLresID,
ExpDlgHookProcPtr dlgHook,
ExpModalFilterProcPtr filterProc,
void *yourDataPtr);
pascal OSErr SectionOptionsExpDialog
(SectionOptionsReply *reply, Point where, 
short expansionDITLresID,
ExpDlgHookProcPtr dlgHook,
ExpModalFilterProcPtr filterProc,
void *yourDataPtr);

Locating a Publisher and Edition From a Subscriber

pascal OSErr GetEditionInfo(const SectionHandle sectionH,
EditionInfoRecord *editionInfo);
pascal OSErr GoToPublisherSection
(const EditionContainerSpec *container);

Edition Container Formats

pascal OSErr GetStandardFormats
(const EditionContainerSpec *container,
FormatType *previewFormat,
Handle preview, Handle publisherAlias,
Handle formats);

Reading and Writing Non-Edition files

pascal OSErr GetEditionOpenerProc
(EditionOpenerProcPtr *opener);
pascal OSErr SetEditionOpenerProc
(EditionOpenerProcPtr opener);
pascal OSErr CallEditionOpenerProc
(EditionOpenerVerb selector,
EditionOpenerParamBlock *PB,
EditionOpenerProcPtr routine);
pascal OSErr CallFormatIOProc
(FormatIOVerb selector,
FormatIOParamBlock *PB,
FormatIOProcPtr routine);

Application-Defined Routines

pascal OSErr MyExpDlgHook(short itemOffset, short itemHit,
DialogPtr theDialog,
Ptr yourDataPtr);
pascal OSErr MyExpModalFilter
(DialogPtr theDialog,
EventRecord *theEvent,
short itemOffset, short *itemHit, 
Ptr yourDataPtr);
pascal OSErr MyOpener(EditionOpenerVerb selector,
EditionOpenerParamBlock *PB);
pascal OSErr MyIO(FormatIOVerb selector,
FormatIOParamBlock *PB);

Result Codes
noErr0No error
abortErr-27Publisher has written a new edition
dskFulErr-34Disk is full
nsvErr-35No such volume
ioErr-36I/O error
bdNamErr-37Bad filename
fnOpnErr-38File not open
eofErr-39No additional data in the format
fnfErr-43Edition container not found
flLckedErr-45Publisher writing to an edition
fBsyErr-47Section doing I/O
paramErr-50Invalid parameter
rfNumErr-51Bad edition reference number
permErr-54Not a subscriber
wrPermErr-61Not a publisher
noTypeErr-102Format not available
memFullErr-108Memory full
dirNFErr-120Directory not found
userCanceledErr-128User clicked Cancel in dialog box
editionMgrInitErr-450Manager not initialized or could not load package
badSectionErr-451Not a valid section type
notRegisteredSectionErr-452Not registered
badSubPartErr-454Bad edition container spec or invalid edition container
multiplePublisherWrn-460Already is a publisher
containerNotFoundWrn-461Alias was not resolved
notThePublisherWrn-463Not the publisher


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996