#ifdef __PRIVATE__
//#
//#	File:		Draft.idl
//#
//#	Contains:	Class definition for ODDraft
//#
//#	Written by:	Vincent Lo
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		<10>	 10/4/94	CC		1190858 - Added ReleaseLinkSource().
//#		 <9>	  9/6/94	VL		1184177: Removed GetName and SetName.
//#		 <8>	 8/26/94	VL		1183174: Added destDraft to BeginClone and
//#									added toID to Clone.
//#		 <7>	 8/16/94	VL		1143605: Fixed parameters to CloneInto.
//#		 <6>	 8/15/94	VL		#???: Added frameType parameter
//#									to CreateFrame.
//#		 <5>	 8/12/94	JBS		1179919: add biasCanvas param to
//#									Draft::CreateFrame()
//#		 <4>	 8/11/94	CC		Added CreateLinkIterator() and
//#									CreateLinkSourceIterator() methods.
//#		 <3>	  7/5/94	VL		Fixed parameters to CreateFrame.
//#		 <2>	 6/21/94	VL		Added functionprefix.
//#		 <1>	  6/8/94	VL		first checked in
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _DRAFT_
#define _DRAFT_

#ifndef _REFCTOBJ_
#include "RefCtObj.idl"
#endif

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

//==============================================================================
// Classes used by this interface
//==============================================================================
interface   ODCanvas;
interface   ODDocument;
interface   ODFrame;
interface   ODLink;
interface   ODLinkSource;
interface   ODLinkIterator;
interface   ODLinkSourceIterator;
interface   ODLinkSpec;
interface   ODPart;
interface   ODShape;
interface   ODStorageUnit;

//==============================================================================
// ODDraft
//==============================================================================

interface ODDraft :  ODRefCntObject
{

	ODDocument   GetDocument();
	
	ODDraftID    GetID();
	
	ODStorageUnit   GetDraftProperties();
	
	ODDraftPermissions  GetPermissions();
	
	ODStorageUnit   CreateStorageUnit();
	
	ODStorageUnit   GetStorageUnit(in ODStorageUnitID id);
	
	void      RemoveStorageUnit(in ODStorageUnit storageUnit);
	
	ODDraftKey    BeginClone(in ODDraft destDraft, in ODCloneKind kind);
	
	void      EndClone(in ODDraftKey key);
	
	void      AbortClone(in ODDraftKey key);

	ODID Clone(in ODDraftKey key, in ODID fromObjectID, in ODID toObjectID, in ODID scope);
	
	ODID WeakClone(in ODDraftKey key, in ODID objectID, in ODID toObjectID, in ODID scope);

	ODBoolean    ChangedFromPrev();
	
	void      SetChangedFromPrev();
	
	void      RemoveFromDocument();
	
	ODDraft     RemoveChanges();
	
	ODDraft     Externalize();
	
	ODDraft     SaveToAPrevious(in ODDraft to);
	
	ODFrame CreateFrame(
			in ODType		frameType,
			in ODFrame		containingFrame,
			in ODShape		frameShape,
			in ODCanvas		biasCanvas,
			in ODPart		part,
			in ODTypeToken	viewType,
			in ODTypeToken	presentation,
			in ODBoolean	isRoot,
			in ODBoolean	isOverlaid);
	   
	ODFrame GetFrame(in ODStorageUnitID id);
	
	void RemoveFrame(in ODFrame frame);
	
	ODPart CreatePart(in ODType partType,
						in ODEditor optionalEditor);
	
	ODPart GetPart(in ODStorageUnitID id);
	
	void RemovePart(in ODPart part);
	
	ODLinkSpec CreateLinkSpec (in ODPart part,
								in ODPtr data,
								in ODULong size);
	
	ODLinkSource CreateLinkSource(in ODPart part);
	
	ODLinkSource GetLinkSource(in ODStorageUnitID id);
	
	ODLink GetLink(in ODStorageUnitID id,
					in ODLinkSpec linkSpec);
	
	void        RemoveLink(in ODLink link);
	
	void        RemoveLinkSource(in ODLinkSource link);
	
// private by convention
	
	void InitDraft(in ODDocument document,
					in ODDraftID id,
					in ODDraftPermissions perms);
	
	void  ReleaseFrame(in ODFrame frame);
	
	void  ReleasePart(in ODPart part);
	
	void  ReleaseLink(in ODLink link);
	
	void  ReleaseLinkSource(in ODLinkSource link);

	ODDraft ReleaseStorageUnit(in ODStorageUnitID id);

	ODLinkIterator CreateLinkIterator();
	
	ODLinkSourceIterator CreateLinkSourceIterator();
	
#ifdef __SOMIDL__
  implementation
  {
  	functionprefix = ODDraft;

    override:
		somInit,
		somUninit,
        IncrementRefCount,
        Release;
    releaseorder:
        GetDocument,
        GetID,
        GetName,
        SetName,
        GetDraftProperties,
        GetPermissions,
        CreateStorageUnit,
        GetStorageUnit,
        RemoveStorageUnit,
        BeginClone,
        EndClone,
        AbortClone,
        Clone,
		WeakClone,
        ChangedFromPrev,
        SetChangedFromPrev,
        RemoveFromDocument,
        RemoveChanges,
        Externalize,
        SaveToAPrevious,
        CreateFrame,
        GetFrame,
        RemoveFrame,
        CreatePart,
        GetPart,
        RemovePart,
        CreateLinkSpec,
        CreateLinkSource,
        GetLinkSource,
        GetLink,
        RemoveLink,
        RemoveLinkSource,
        InitDraft,
        ReleaseFrame,
        ReleasePart,
        ReleaseLink,
        ReleaseLinkSource,
        ReleaseStorageUnit,
		CreateLinkIterator,
		CreateLinkSourceIterator;
  };
#endif
};

#endif  // _DRAFT_
