home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / DocShell / ODPrcs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  5.9 KB  |  178 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ODPrcs.h
  3.  
  4.     Contains:    OpenDoc Process runtime functions
  5.  
  6.     Owned by: Tantek Çelik
  7.  
  8.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>      3/1/96    JP        1314798: Added param to
  13.                                     VerifyAndLaunchDocumentStub
  14.          <2>     1/15/96    JA        1269485: Added GetPrefsFileSpec.
  15.         <19>    10/25/95    TÇ        1281409 GM: OpenDoc needs an AboutBox.
  16.         <18>    10/12/95    eeh        1287143: add keyODRefnumFromResource
  17.         <17>      6/2/95    TÇ        Need to copy resources into newly created
  18.                                     documents.  Completes fix to 4
  19.                                     BB:1233106,1242232, 1254312, 1242283
  20.         <16>     5/19/95    TÇ        1155852 BB: String constants need to be
  21.                                     moved to resource for Localization, 1249396
  22.                                     (was BB) OpenDoc shell should serialize
  23.                                     stationery creation.
  24.         <15>     4/29/95    TÇ        1216130 BB: Shell should open top draft
  25.                                     upon receipt of open document Apple event
  26.         <14>     4/24/95    eeh        1240662: define keyODActivateEventCause
  27.         <13>     4/15/95    TÇ        #1216915 DR/BB:Trying to open a document
  28.                                     that is already open causes an error.
  29.         <12>      4/7/95    eeh        1221297: eventID param to
  30.                                     VerifyAndLaunchDocumentStub
  31.         <11>     3/31/95    TÇ        1223465 BB: Opening and creating documents
  32.                                     under low disk space.  (Creating documents
  33.                                     under low disk space part fixed).
  34.                                     1211032 BB: Invalid Permissions error
  35.                                     opening locked document
  36.         <10>     2/20/95    TÇ        #1210979 BB: 5-$ Bugs need to be evaluated
  37.                                     and removed from Shell
  38.                                     #1221861 BB: Incomplete AOCE support needs
  39.                                     to be removed from OpenDoc
  40.          <9>      2/2/95    CG        #1205177:  "Editors" and "OpenDoc
  41.                                     Libraries" folders are being registered
  42.                                     with cfm (PPC only).
  43.          <8>      1/6/95    jpa        Added GetDescFSSpec [1198075]
  44.          <7>     12/5/94    jpa        Added GetLaunchFailedParams [1198075,
  45.                                     1158966]
  46.          <6>    11/30/94    RR        #1188078 include PlfmFile.h
  47.          <5>      9/8/94    eeh        #1185443: FileIsReadOnly() and contants for
  48.                                     mailer info.
  49.          <4>     8/29/94    TÇ        #1158280 OpenDoc™ should not overwrite old
  50.                                     stationery files when creating new ones
  51.          <3>     8/25/94    TÇ        #1183223 Enabled launching of documents in
  52.                                     folders other than that of the OpenDoc
  53.                                     libraries.  Added new call:
  54.                                     VerifyAndLaunchDocument
  55.          <2>     8/22/94    TÇ        #1182448 System Process quits when no
  56.                                     OpenDoc documents are running
  57.          <1>     8/22/94    TÇ        first checked in
  58.     
  59.     In Progress:
  60.         
  61. */
  62.  
  63. #ifndef _ODPRCS_
  64. #define _ODPRCS_
  65.  
  66. #define ppcinterfaces        /* keeps GX headers quiet */
  67.  
  68. #ifndef _ODTYPES_
  69. #include <ODTypes.h>
  70. #endif
  71.  
  72. #ifndef _PLFMFILE_
  73. #include "PlfmFile.h"
  74. #endif
  75.  
  76. #ifndef __DIALOGS__
  77. #include "Dialogs.h"
  78. #endif
  79.  
  80.  
  81. //==============================================================================
  82. // Constants
  83. //==============================================================================
  84.  
  85. const    ODSShort    kMaxFileNameSize            = 64;
  86. const     ODULong        kSpaceNeededForNewDocument    = 32767/1024;
  87.  
  88. const     DescType     kODActivateEvent            = 0x61637476;    // 'actv';
  89. const     DescType     keyODActivateEventCause        = 0x77687961;    // 'whya';
  90. const     DescType     keyODRefnumFromResource        = 0x72667273;    // 'rfrs';
  91.  
  92. //==============================================================================
  93. // Functions
  94. //==============================================================================
  95.  
  96. ODFileSpec    GetOpenDocLibsFldrSpec();
  97.  
  98. ODFileSpec    GetOpenDocBinaryFileSpec(char* binaryName);
  99.  
  100. OSErr        GetPrefsFileSpec(ODFileSpec* prefFileSpec);
  101.  
  102. #ifdef NEEDSYSTEMPROCESS
  103. ODBoolean    IsODSysProcessRunning();
  104. #endif
  105.  
  106. ODBoolean    AreODDocumentsRunning();
  107.  
  108. OSErr        FileIsReadOnly( ODFileSpec* fs, ODBoolean* result );
  109.  
  110. ODULong    GetVolumeWritableSpace(ODFileSpec* fs, ODULong* error);
  111.     // returns number of writeable K bytes avail on volume that the fs is on.
  112.  
  113. OSErr        GetDescFSSpec( AEDesc *, FSSpec & );
  114.  
  115. // Document Launching
  116.  
  117. OSErr    VerifyDocumentStub(FSSpecPtr documentStub, FSSpec* seedFSSPtr);
  118. OSErr    LaunchDocumentStub(AEDesc* theDocument, FSSpec* documentStub,
  119.         AEDesc* theAlias, AEDescList* otherParams, ProcessSerialNumber* psn,
  120.         DescType eventID);
  121.  
  122. OSErr    VerifyAndLaunchDocumentStub(AEDesc *theDocument,
  123.         AEDescList* otherParams, ProcessSerialNumber *launchedPSN,
  124.         DescType eventID, FSSpec* seedFSSPtr, ODBoolean unsavedDoc = kODFalse);
  125.  
  126. DialogPtr    ShowAboutScreen( );
  127.  
  128. const DescType kCFMLaunchFailedEventClass = 'dave';
  129. const DescType kCFMLaunchFailedEventID    = 'sean';
  130.  
  131. void    GetLaunchFailedParams( AppleEvent*, long &launchErr, ProcessSerialNumber *psn,
  132.                                             Str255 appName, Str255 libName );
  133. ODBoolean    WasLaunchedThenActivate(
  134.                         FSSpec* fileSpec, 
  135.                         DescType eventID,
  136.                         OSErr & err);
  137.  
  138.  
  139. /*****************************************************************************/
  140.  
  141. typedef short *RefNumPtr;
  142.  
  143. /* Constants to specify the file fork GetLocalPaths should match */
  144. enum
  145. {
  146.     kDataFork        = 0,
  147.     kResourceFork    = 1
  148. };
  149. typedef short ForkType;
  150.  
  151. /*****************************************************************************/
  152.  
  153. pascal    OSErr    GetLocalPaths(FSSpec *spec,
  154.                               ForkType fork,
  155.                               unsigned long *refNumCount,
  156.                               RefNumPtr *refNums);
  157. /*    Determine if local access paths to a file fork are open.
  158.     The GetLocalPaths function looks through the FCB list to see if
  159.     the fork of the file specified by spec and fork is open by the 
  160.     local File Manager (you should use PBGetCatInfo and check
  161.     ioFlAttrib if you need to see if *anyone* has the file fork open
  162.     *anywhere*). If the result is noErr, GetLocalPaths returns a
  163.     count and a pointer to an array of file refNums (if count is
  164.     not zero) of local access paths to the specified file fork.
  165.  
  166.     spec        input:    An FSSpec record specifying the file.
  167.     fork        input:    Specifies the file fork - either kDataFork
  168.                         or kResourceFork.
  169.     refNumCount    output:    The number of local access paths found.
  170.     refNums        output: If not NULL, a pointer to an array of
  171.                         file refNums - the number of which is
  172.                         specified by refNumCount.  The caller is
  173.                         responsible for disposing of this pointer.
  174. */
  175.  
  176.  
  177. #endif /* _ODPRCS_ */
  178.