#ifdef __PRIVATE__
//#
//#	File:		CMDoc.idl
//#
//#	Contains:	IDL for CMDocument
//#
//#	Written by:	Vincent Lo
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		 <8>	 9/23/94	VL		1184166: Added GetName and SetName to
//#									override.
//#		 <7>	 9/12/94	VL		1184154: Removed internal field for
//#									DocumentProperties.
//#		 <6>	  9/6/94	VL		1184154: Removed GetDocumentProperties.
//#		 <5>	 7/11/94	VL		Added Exists.
//#		 <4>	  7/5/94	VL		Fixed in/out.
//#		 <3>	 6/22/94	VL		Added functionprefix.
//#		 <2>	 6/15/94	RR		ODHeap -> ODMemoryHeap
//#		 <1>	  6/8/94	VL		first checked in
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _CMDOC_
#define _CMDOC_

#ifndef _DOCUMENT_
#include "Document.idl"
#endif

//==============================================================================
// Classes defined in this interface
//==============================================================================
interface   CMDocument;

//==============================================================================
// Classes used by this interface
//==============================================================================
interface	CMDraft;
interface	ODBentoContainer;

//==============================================================================
// Implementation Types
//==============================================================================

#ifdef __PRIVATE__
typedef somToken CMValue;
typedef somToken VersionList;
typedef somToken DraftList;
typedef somToken ODMemoryHeapID;
#endif

//==============================================================================
// CMDocument
//==============================================================================

interface CMDocument :  ODDocument 
{

#ifdef __PRIVATE__

	CMValue GetCMVersionList();
	
	CMDraft	GetDraftGut(in VersionList* versionList,
						in ODDraftPermissions perms,
						in ODDraftID id,
						in CMDraft draft,
						in ODPositionCode posCode,
						in ODBoolean release);

	void	InternalizeVersionList();
	
	void 	ExternalizeVersionList();

	void	Reopen();
	
	VersionList*	GetVersionList();
	
	VersionList*	TestAndGetVersionList();
	
	void			ReleaseVersionList();
	
	ODMemoryHeapID	GetHeap();
		
#endif

#ifdef __SOMIDL__
	implementation
	{
	  	functionprefix = CMDocument;
		
		override:
			somInit,
			somUninit,
			IncrementRefCount,
			Release,
			GetContainer,
			GetID,
			GetName,
			SetName,
			CollapseDrafts,
			GetDraft,
			Exists,
			GetBaseDraft,
			CreateDraft,
			SaveToAPrevDraft,
			SetBaseDraftFromForeignDraft,
			InitDocument,
			ReleaseDraft;
		releaseorder:
		#ifdef __PRIVATE__
			GetCMVersionList,
			GetDraftGut,
			InternalizeVersionList,
			ExternalizeVersionList,
			Reopen,
			GetVersionList,
			TestAndGetVersionList,
			ReleaseVersionList,
			GetHeap;
		#else
			reserved1,
			reserved2,
			reserved3,
			reserved4,
			reserved5,
			reserved6,
			reserved7,
			reserved8,
			reserved9;
		#endif
			
		#ifdef __PRIVATE__
			passthru C_xh =
				""
				"class DraftList;"
				"class VersionList;"
				"#include <CMAPI.h>"
				"#include <ODMemory.h>"
				"";

			ODBentoContainer		fContainer;
			ODDocumentID 			fID;
			DraftList*				fDrafts;
			DraftList*				fReleasedDrafts;
			VersionList*			fVersions;
			ODULong				fVersionListSemaphore;
			ODMemoryHeapID			fHeap;
			ODDocumentName			fName;
		#endif
  };
#endif
};

#endif  // _CMDOC_

