#ifdef __PRIVATE__
//#
//#	File:		LinkMgr.idl				** DO NOT REMERGE WITH APPLE CODE **
//#
//#	Contains:	Link Manager Interface
//#
//#	Written by:	Craig Carper
//#	Ported by:	Chris Andrew
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#	          	c 1995 by Novell, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#	          	c 1995 by Novell, Inc., all rights reserved.
#endif

#ifndef _LINKMGR_
#define _LINKMGR_

#ifndef _ODOBJECT_
#include "ODObject.idl"
#endif

#ifndef _STORAGEU_
#include "StorageU.idl"
#endif

//=====================================================================================
// Theory of Operation
//=====================================================================================

//=====================================================================================
// Classes defined in this interface
//=====================================================================================

interface  ODLinkManager;

//=====================================================================================
// Classes used by this interface
//=====================================================================================

interface  ODSession;
interface  ODDocument;
interface  ODDraft;
interface  ODLink;
interface  ODLinkSpec;

#ifdef __PRIVATE__
typedef somToken OrderedCollection;
typedef somToken OSErr;
#endif

//=====================================================================================
// Private struct DraftInfo
//=====================================================================================

//=====================================================================================
// ODLinkManager
//=====================================================================================

interface ODLinkManager : ODObject
{
	void InitLinkManager(in ODSession session);
	
	ODBoolean UnsavedExportedLinks(in ODDraft draft);
	
	ODBoolean AnyLinkImported(in ODDraft draft);
	
	void DraftOpened(in ODDraft draft);
	
	void DraftSaved(in ODDraft draft);
	
	void DraftClosing(in ODDraft draft);

#ifdef __PRIVATE__

	struct DraftInfo
	{
		ODDraft      		draft;
		OrderedCollection*  linksToExport;
		OrderedCollection*  newExportedLinks;
		ODBoolean			linksImported;
	};

	void ExportOnSave(in ODLink link, in ODBoolean doExport);
	
	ODLink CreateLink(in ODDraft draft,
						in ODLinkSpec linkSpec);

	void NewDraftInfo(in ODDraft draft);

	DraftInfo* GetDraftInfo(in ODDraft draft);

	void DeleteDraftInfos();

	ODLink FetchLink( in ODDraft draft, in char *pszItemName );

#endif

	#ifdef __SOMIDL__
	implementation
	{
		override:
			somInit,
			somUninit;
		releaseorder:
			InitLinkManager,
			UnsavedExportedLinks,
			AnyLinkImported,
			DraftOpened,
			DraftSaved,
			DraftClosing,
			#ifdef __PRIVATE__
				ExportOnSave,
				CreateLink,
				NewDraftInfo,
				GetDraftInfo,
				DeleteDraftInfos,
				FetchLink;
			#else
				reserved1,
				reserved2,
				reserved3,
				reserved4,
				reserved5,
				reserved6;
			#endif
		
		#ifdef __PRIVATE__
			passthru C_xh = ""
							"class OrderedCollection;"
							"";
	
			OrderedCollection*   fDraftInfos;
		#endif
	};
	#endif // __SOMIDL__
};
#endif	// _LINKMGR_

