home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / bento / headers / document.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  5.5 KB  |  182 lines

  1. /*
  2.     File:        Document.h
  3.  
  4.     Contains:    Definition for XMPDocument
  5.  
  6.     Written by:    Vincent Lo, Tantek I. Celik
  7.  
  8.     Copyright:    ⌐ 1992 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.     
  12.         <24>      2/4/94    VL        Moved to PPC Header and began code cleanup.
  13.         <23>     1/12/94    VL        Init Changes.
  14.         <22>    12/16/93    VL        Added GetDocumentProperties,
  15.                                     fDocumentProperties and ReleaseStorageUnit.
  16.         <21>    11/23/93    VL        Added fHeap and GetHeap().
  17.         <20>     9/14/93    VL        Added new calls to make Document reentrant.
  18.         <19>     8/26/93    VL        Removed AddToVersionList. Added
  19.                                     ReleaseVersionList.
  20.                                     SetBaseDraftFromForeignDraft should not
  21.                                     return anything.
  22.         <18>     8/13/93    VL        Removed prototype related stuff. Also
  23.                                     removed DocPriv.h include.
  24.         <17>      8/9/93    NP        Added class id string.
  25.         <16>      8/6/93    PH        Add forward declaration of XMPBentoCtr
  26.         <15>      8/6/93    VL        Get rid of fCMContainer. It should use
  27.                                     fContainer::GetCMContainer. Also, make
  28.                                     fContainer a XMPBentoContainer.
  29.                                     fCMDraftList is renamed fCMVersionList.
  30.         <14>     7/29/93    VL        Removed GetDraft by name.
  31.         <13>      7/6/93    PH        Make XMPProtoContainer a friend.
  32.         <12>      7/1/93    VL        Added the prototype fields (to be removed
  33.                                     when we get rid of the prototype).
  34.         <11>     6/30/93    VL        Removed RemoveDRaftChanges,
  35.                                     CloseReleasedDRaft. Added GetVersionList,
  36.                                     AddToVersionList.
  37.         <10>     6/22/93    VL        Removed fDocumentRefCount. Added
  38.                                     RemoveDraftChanges().
  39.          <9>     6/15/93    VL        Added Reopen,
  40.                                     Internalize/ExternalizeDraftList calls.
  41.          <8>      6/2/93    VL        Added fDocumentRefCount.
  42.          <7>     4/29/93    VL        RefCntObj.h should be RefCtObj.h.
  43.          <6>     4/29/93    VL        8.3 Name Change
  44.          <5>     4/27/93    VL        Removed calls for version 2.
  45.          <4>      4/9/93    VL        XMPDocument should be subclassed from
  46.                                     XMPRefCntObject.
  47.          <3>      4/7/93    VL        Moved parameters from Initialize to
  48.                                     constructor.
  49.          <2>      4/6/93    VL        Added XMPPlatformDefs.h.
  50.          <1>      4/6/93    VL        first checked in
  51.  
  52.     To Do:
  53.         1) Should we have a private section?
  54.         2) Draft.h is included only for XMPDraftPermissions.
  55. */
  56.  
  57. #ifndef _DOCUMENT_
  58. #define _DOCUMENT_
  59.  
  60. #ifndef _XMPTYPES_
  61. #include "XMPTypes.h"
  62. #endif
  63.  
  64. #ifndef _REFCTOBJ_
  65. #include "RefCtObj.h"
  66. #endif
  67.  
  68. #ifndef _DRAFT_
  69. #include "Draft.h"
  70. #endif
  71.  
  72. //==============================================================================
  73. // Constants
  74. //==============================================================================
  75. const    XMPDraftID    kXMPDefaultDraft =    1;
  76.  
  77. //==============================================================================
  78. // Scalar Types
  79. //==============================================================================
  80. typedef    XMPID        XMPDocumentID;
  81. typedef    XMPISOStr    XMPDocumentName;
  82.  
  83. //==============================================================================
  84. // Classes defined in this interface
  85. //==============================================================================
  86. class    XMPDocument;
  87.  
  88. //==============================================================================
  89. // Classes used by this interface
  90. //==============================================================================
  91. class    XMPContainer;
  92. class    XMPBentoContainer;
  93. class    DraftList;
  94. class    VersionList;
  95. class    XMPDocStorageUnit;
  96.  
  97. //==============================================================================
  98. // XMPDocument
  99. //==============================================================================
  100.  
  101. #define kXMPDocumentID "appl:xmpdocument$class,1.0.0"
  102.  
  103. class XMPDocument : public XMPRefCntObject {
  104.  
  105. public:
  106.  
  107.     XMPMethod    XMPContainer* GetContainer();
  108.  
  109.     XMPMethod    XMPDocumentID GetID();
  110.             
  111.     XMPMethod    XMPDocumentName GetName();
  112.             
  113.     XMPMethod    void SetName(XMPDocumentName name);
  114.     
  115.     XMPMethod    XMPStorageUnit*    GetDocumentProperties();
  116.  
  117.     XMPMethod    void IncrementRefCount();
  118.     
  119.     XMPMethod    void Release();
  120.  
  121.     XMPMethod    XMPDocument* CollapseDrafts(XMPDraft* from,XMPDraft* to);
  122.  
  123.     XMPMethod    XMPDraft* GetDraft(XMPDraftPermissions perms,
  124.                                 XMPDraftID id,
  125.                                 XMPDraft* draft,
  126.                                 XMPPositionCode posCode,
  127.                                 XMPBoolean release);
  128.             
  129.     XMPMethod    XMPDraft* GetBaseDraft(XMPDraftPermissions perms);    
  130.     
  131.     XMPMethod    XMPDraft* CreateDraft(XMPDraft* below,XMPBoolean releaseBelow);
  132.             
  133.     XMPMethod    void SaveToAPrevDraft(XMPDraft* from,XMPDraft* to);
  134.  
  135.     XMPMethod    void SetBaseDraftFromForeignDraft(XMPDraft* draft);
  136.  
  137. private:
  138.  
  139.     XMPMethod CMValue GetCMVersionList();
  140.     
  141.     XMPMethod XMPDraft*    GetDraftGut(VersionList* versionList,
  142.                                 XMPDraftPermissions perms,
  143.                                 XMPDraftID id,
  144.                                 XMPDraft* draft,
  145.                                 XMPPositionCode posCode,
  146.                                 XMPBoolean release);
  147.         
  148.     XMPDocStorageUnit*        fDocumentProperties;
  149.     XMPBentoContainer*        fContainer;
  150.     XMPDocumentID             fID;
  151.     DraftList*                fDrafts;
  152.     DraftList*                fReleasedDrafts;
  153.     VersionList*            fVersions;
  154.     XMPULong                fVersionListSemaphore;
  155.     XMPHeap                    fHeap;
  156.     
  157. public:    // private by convention
  158.  
  159.     XMPDocument();
  160.         
  161.     XMPVMethod    ~XMPDocument();
  162.             
  163.     XMPNVMethod void InitDocument(XMPContainer* container, XMPDocumentID id);
  164.  
  165.     XMPMethod XMPDocument* ReleaseDraft(XMPDraft* draft);
  166.  
  167.     XMPMethod XMPSize Purge(XMPSize size);
  168.     
  169.     XMPMethod void InternalizeVersionList();
  170.     
  171.     XMPMethod void ExternalizeVersionList();
  172.  
  173.     XMPMethod void            Reopen();
  174.     XMPMethod VersionList*    GetVersionList();
  175.     XMPMethod VersionList*    TestAndGetVersionList();
  176.     XMPMethod void            ReleaseVersionList();
  177.     XMPMethod XMPHeap        GetHeap();
  178.     XMPMethod void            ReleaseStorageUnit(XMPStorageUnit* su);
  179. };
  180.  
  181. #endif    // _DOCUMENT_
  182.