/* @(#)Z 1.5 com/src/bento/localidl/CMDoc.idl, odstorage, od96nt, odnt9712d 97/03/21 16:48:41 (96/10/29 09:14:17) */
//#====START_GENERATED_PROLOG======================================
//#
//#
//#   COMPONENT_NAME: odstorage
//#
//#   CLASSES: none
//#
//#   ORIGINS: 82,27
//#
//#
//#   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//#   All Rights Reserved
//#   Licensed Materials - Property of IBM
//#   US Government Users Restricted Rights - Use, duplication or
//#   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//#   	
//#   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//#   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//#   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//#   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//#   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//#   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//#   OR PERFORMANCE OF THIS SOFTWARE.
//#
//#====END_GENERATED_PROLOG========================================
//#

#ifdef __PRIVATE__
//#
//#	File:		CMDoc.idl
//#
//#	Contains:	IDL for CMDocument
//#
//#	Owned by:	Vincent Lo
//#
//#	Copyright:	(r) 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		<13>	 8/16/95	VL		1275241: Cleaned up IDL file.
//#		<12>	  8/3/95	RR		#1257260: Collapse B classes. Remove
//#									somInit methods. Don't call IsInitialized
//#									or SubclassResponsibility
//#		<11>	 5/25/95	VL		1251403: Multithreading naming support.
//#		<10>	 3/31/95	EL		1234685: ExternalizeVersionList has extra
//#									parameter so we can skip top draft.
//#		 <9>	 3/23/95	VL		1230357: Added Purge.
//#		 <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:	(r) 1993 - 1995 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;

#ifdef __PRIVATE__
//==============================================================================
// Implementation Types
//==============================================================================
typedef somToken CMValue;
typedef somToken VersionList;
typedef somToken DraftList;
typedef somToken ODMemoryHeapID;
#endif

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

interface CMDocument :  ODDocument 
{

#ifdef __PRIVATE__

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

	void	InternalizeVersionList();
	
	void 	ExternalizeVersionList(in ODBoolean ignoreTopDraft);

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

#ifdef __SOMIDL__
	implementation
	{
		majorversion = 1; minorversion = 0;
	  	functionprefix = CMDocument;
		
		override:
			somUninit,
			Purge,
			Acquire,
			Release,
			GetContainer,
			GetID,
			GetName,
			SetName,
			CollapseDrafts,
			AcquireDraft,
			Exists,
			AcquireBaseDraft,
			CreateDraft,
			SaveToAPrevDraft,
			SetBaseDraftFromForeignDraft,
			InitDocument,
			ReleaseDraft;
		releaseorder:
		#ifdef __PRIVATE__
			GetCMVersionList,
			AcquireDraftGut,
			InternalizeVersionList,
			ExternalizeVersionList,
			Reopen,
			GetVersionList,
			TestAndGetVersionList,
			ReleaseVersionList,
			GetHeap;
		#else
			reserved1,
			reserved2,
			reserved3,
			reserved4,
			reserved5,
			reserved6,
			reserved7,
			reserved8,
			reserved9;
		#endif
			
		#ifdef __PRIVATE__
			passthru C_xih =
				""
				"class DraftList;"
				"";
			passthru C_xh =
				""
				"class VersionList;"
				"#ifndef _CM_API_
				"#include <CMAPI.h>"
				"#endif"
				"#ifndef _ODMEMORY_"
				"#include <ODMemory.h>"
				"#endif"
				"";

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

#endif  // _CMDOC_
