#ifdef __PRIVATE__
//#
//#     File:           Link.idl                                ** DO NOT REMERGE WITH APPLE CODE **
//#
//#     Contains:       Interface of ODLink class
//#
//#     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 _LINK_
#define _LINK_

#ifndef _LINKB_
#include "LinkB.idl"
#endif

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

/*
  This class is used to represent the destination side of OpenDoc links.
  ODDrafts create and own these links. The source ODPart will ask the draft
  to create an ODLinkSource and an ODLink pair, and return the ODLink
  object to the the destination part.  The destination part uses the ODLink
  object to extract the contents of the link.
*/

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

interface  ODLink;

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

interface       ODStorageUnit;
interface       ODLinkSource;
interface       ODLinkSource;
interface       ODStorageUnit;
interface       ODPart;
interface       ODPartList;
interface       ODDraft;
interface       ODFacet;

#ifdef __PRIVATE__

//==============================================================================
// Implementation types
//==============================================================================

typedef somToken ODPartList;
typedef somToken LPVOID;

#endif //# __PRIVATE__

//==============================================================================
// ODLink
//==============================================================================

interface ODLink : ODBaseLink
{
#ifdef __PRIVATE__

	void UpdateDependents( in ODChangeID id );

	void InitLink(in ODStorageUnit storageUnit,
					in ODLinkSource linkSource);
	
	void InitLinkFromStorage(in ODStorageUnit storageUnit);
	
	ODHandle GetTextValue(in ODLinkKey key);
	
	ODHandle CloneIntoMemoryContainer(in ODLinkKey key);

	void RefreshDataObject(in ODLinkKey key);
	
	void ThrowIfInvalidKey( in ODLinkKey key);

	void UseItemName( in char *pszItemName );

	LPVOID GetDataObject( in ODLinkKey key );

#endif


#ifdef __SOMIDL__
	implementation
	{
		override:
			somInit,
			somUninit,
			Release,
			Externalize,
			ReleaseAll,
			CloneInto,
			GetChangeID,
			GetChangeTime,
			GetContentStorageUnit,
			GetStatus,
			Lock,
			Unlock,
			RegisterDependent,
			ShowSourceContent,
			UnregisterDependent,
			ShowLinkDestinationInfo,
			GetLinkSource;
			
		releaseorder:
		#ifdef __PRIVATE__
			InitLink,
			InitLinkFromStorage,
			CreateLinkEdition,
			GetLinkEdition,
			UpdateLinkEdition,
			GetTextValue,
			CloneIntoMemoryContainer,
			RefreshDataObject,
			UpdateDependents,
		    ThrowIfInvalidKey,
			GetDataObject,
			UseItemName;
		#else
			reserved1,
			reserved2,
			reserved3,
			reserved4,
			reserved5,
			reserved6,
			reserved7,
			reserved8,
			reserved9,
			reserved10,
			reserved11,
			reserved12;
		#endif

		majorversion = 1; minorversion = 0;
	
		#ifdef __PRIVATE__
	
			ODPartList              *fPartList;             // the list of dependent parts
			ODLinkSource    fLinkSource;    // associated link source object
			char*                   fpszItemName;   // OLE item moniker name
			LPVOID                  fpDataObject;   // OLE data object

		#endif
	};
#endif
};

#endif // _LINK_
