home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Document.h
-
- Contains: Definition for XMPDocument
-
- Written by: Vincent Lo, Tantek I. Celik
-
- Copyright: ⌐ 1992 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <24> 2/4/94 VL Moved to PPC Header and began code cleanup.
- <23> 1/12/94 VL Init Changes.
- <22> 12/16/93 VL Added GetDocumentProperties,
- fDocumentProperties and ReleaseStorageUnit.
- <21> 11/23/93 VL Added fHeap and GetHeap().
- <20> 9/14/93 VL Added new calls to make Document reentrant.
- <19> 8/26/93 VL Removed AddToVersionList. Added
- ReleaseVersionList.
- SetBaseDraftFromForeignDraft should not
- return anything.
- <18> 8/13/93 VL Removed prototype related stuff. Also
- removed DocPriv.h include.
- <17> 8/9/93 NP Added class id string.
- <16> 8/6/93 PH Add forward declaration of XMPBentoCtr
- <15> 8/6/93 VL Get rid of fCMContainer. It should use
- fContainer::GetCMContainer. Also, make
- fContainer a XMPBentoContainer.
- fCMDraftList is renamed fCMVersionList.
- <14> 7/29/93 VL Removed GetDraft by name.
- <13> 7/6/93 PH Make XMPProtoContainer a friend.
- <12> 7/1/93 VL Added the prototype fields (to be removed
- when we get rid of the prototype).
- <11> 6/30/93 VL Removed RemoveDRaftChanges,
- CloseReleasedDRaft. Added GetVersionList,
- AddToVersionList.
- <10> 6/22/93 VL Removed fDocumentRefCount. Added
- RemoveDraftChanges().
- <9> 6/15/93 VL Added Reopen,
- Internalize/ExternalizeDraftList calls.
- <8> 6/2/93 VL Added fDocumentRefCount.
- <7> 4/29/93 VL RefCntObj.h should be RefCtObj.h.
- <6> 4/29/93 VL 8.3 Name Change
- <5> 4/27/93 VL Removed calls for version 2.
- <4> 4/9/93 VL XMPDocument should be subclassed from
- XMPRefCntObject.
- <3> 4/7/93 VL Moved parameters from Initialize to
- constructor.
- <2> 4/6/93 VL Added XMPPlatformDefs.h.
- <1> 4/6/93 VL first checked in
-
- To Do:
- 1) Should we have a private section?
- 2) Draft.h is included only for XMPDraftPermissions.
- */
-
- #ifndef _DOCUMENT_
- #define _DOCUMENT_
-
- #ifndef _XMPTYPES_
- #include "XMPTypes.h"
- #endif
-
- #ifndef _REFCTOBJ_
- #include "RefCtObj.h"
- #endif
-
- #ifndef _DRAFT_
- #include "Draft.h"
- #endif
-
- //==============================================================================
- // Constants
- //==============================================================================
- const XMPDraftID kXMPDefaultDraft = 1;
-
- //==============================================================================
- // Scalar Types
- //==============================================================================
- typedef XMPID XMPDocumentID;
- typedef XMPISOStr XMPDocumentName;
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
- class XMPDocument;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
- class XMPContainer;
- class XMPBentoContainer;
- class DraftList;
- class VersionList;
- class XMPDocStorageUnit;
-
- //==============================================================================
- // XMPDocument
- //==============================================================================
-
- #define kXMPDocumentID "appl:xmpdocument$class,1.0.0"
-
- class XMPDocument : public XMPRefCntObject {
-
- public:
-
- XMPMethod XMPContainer* GetContainer();
-
- XMPMethod XMPDocumentID GetID();
-
- XMPMethod XMPDocumentName GetName();
-
- XMPMethod void SetName(XMPDocumentName name);
-
- XMPMethod XMPStorageUnit* GetDocumentProperties();
-
- XMPMethod void IncrementRefCount();
-
- XMPMethod void Release();
-
- XMPMethod XMPDocument* CollapseDrafts(XMPDraft* from,XMPDraft* to);
-
- XMPMethod XMPDraft* GetDraft(XMPDraftPermissions perms,
- XMPDraftID id,
- XMPDraft* draft,
- XMPPositionCode posCode,
- XMPBoolean release);
-
- XMPMethod XMPDraft* GetBaseDraft(XMPDraftPermissions perms);
-
- XMPMethod XMPDraft* CreateDraft(XMPDraft* below,XMPBoolean releaseBelow);
-
- XMPMethod void SaveToAPrevDraft(XMPDraft* from,XMPDraft* to);
-
- XMPMethod void SetBaseDraftFromForeignDraft(XMPDraft* draft);
-
- private:
-
- XMPMethod CMValue GetCMVersionList();
-
- XMPMethod XMPDraft* GetDraftGut(VersionList* versionList,
- XMPDraftPermissions perms,
- XMPDraftID id,
- XMPDraft* draft,
- XMPPositionCode posCode,
- XMPBoolean release);
-
- XMPDocStorageUnit* fDocumentProperties;
- XMPBentoContainer* fContainer;
- XMPDocumentID fID;
- DraftList* fDrafts;
- DraftList* fReleasedDrafts;
- VersionList* fVersions;
- XMPULong fVersionListSemaphore;
- XMPHeap fHeap;
-
- public: // private by convention
-
- XMPDocument();
-
- XMPVMethod ~XMPDocument();
-
- XMPNVMethod void InitDocument(XMPContainer* container, XMPDocumentID id);
-
- XMPMethod XMPDocument* ReleaseDraft(XMPDraft* draft);
-
- XMPMethod XMPSize Purge(XMPSize size);
-
- XMPMethod void InternalizeVersionList();
-
- XMPMethod void ExternalizeVersionList();
-
- XMPMethod void Reopen();
- XMPMethod VersionList* GetVersionList();
- XMPMethod VersionList* TestAndGetVersionList();
- XMPMethod void ReleaseVersionList();
- XMPMethod XMPHeap GetHeap();
- XMPMethod void ReleaseStorageUnit(XMPStorageUnit* su);
- };
-
- #endif // _DOCUMENT_
-