#ifdef __PRIVATE__
//#
//#	File:		MssgIntf.idl
//#
//#	Contains:	Class definition for ODMessageInterface
//#
//#	Owned by:	Nick Pilch
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		<14>	 2/13/95	eeh		1214783: new param to
//#									DispatchToEventHandler and
//#									DispatchToEventHandlerAux
//#		<13>	 1/27/95	NP		1213948: Add forward decls to new classes.
//#		<12>	 1/27/95	NP		1213948: Fix parameter signatures to match
//#									old semantics.:
//#		<11>	 1/25/95	eeh		1214783: remove GiveShellATry; add
//#									GetDefaultSI
//#		<10>	  1/9/95	NP		1194880: SemtIntf name changes.
//#		 <9>	10/10/94	NP		1192023. Default accessors. Added private
//#									function and private field.
//#		 <8>	  9/9/94	NP		1185851: implement scripting.
//#		 <7>	  7/1/94	NP		Tweaks. Overwrote previous checkin.
//#		 <5>	 6/29/94	NP		Matching checkin for MssgIntf.cpp.
//#		 <4>	 6/28/94	NP		class prefix. Comment out ODPreDispatchUPP.
//#		 <3>	 6/24/94	NP		First public checkin.
//#		 <2>	 6/23/94	NP		Starting to fix.
//#		 <1>	  6/8/94	RR		first checked in
//#		 <3>	  6/7/94	RR		Privatise change log
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993 - 1995 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _MSSGINTF_
#define _MSSGINTF_

#ifndef _MSSGINTB_
#include "MssgIntB.idl"
#endif

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

interface  ODMessageInterface;

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

interface  ODPart;
interface  ODShape;
interface  ODSession;
interface  ODNameResolver;
interface  ODSemanticInterface;
interface  ODOSLToken;
interface  ODAppleEvent;
interface  ODAddressDesc;
interface  ODObjectSpec;

#ifdef __PRIVATE__
//=====================================================================================
// Implementation Types
//=====================================================================================

typedef somToken OSErr;
typedef somToken OrderedCollection;
typedef somToken SETransactionList;
typedef somToken AppleEvent;
typedef somToken AEDesc;
#endif

//==============================================================================
// ODMessageInterface
//==============================================================================

//ram#ifdef _PLATFORM_MACINTOSH_

interface ODMessageInterface : ODBaseMessageInterface
{
#ifdef __PRIVATE__ 

	void	InitMessageInterface(in	ODSession	session);

	OSErr	HandleAllSEventsAux(in		AppleEvent*	message,
								inout	AppleEvent	reply);

	OSErr	HandleRepliesAux(in			AppleEvent*	message,
								inout	AppleEvent	reply);

	OSErr	HandleAllCoercionsAux(	in		AEDesc*		theAEDesc,
									in		ODDescType	toType,
									inout	AEDesc		retDesc);

	OSErr	DispatchToCoercionHandler(in		AEDesc*		theAEDesc,
										in		ODDescType	toType,
										in		ODPart		sendee,
										inout	AEDesc		retDesc);

	OSErr	DispatchEventWithToken(in		ODOSLToken*		token,
									in		ODAppleEvent	message,
									inout	ODAppleEvent	reply,
									in		ODBoolean		usingSubjectAttr);

	ODBoolean	HandleSpecialEvents(in		AppleEvent*	message,
									out		AppleEvent	reply,
									out		OSErr		error);

	OSErr	DispatchToEventHandler(in		AppleEvent*	message,
									inout	AppleEvent	reply,
									in		ODPart			contextPart,
									in		ODBoolean		tokenIsDefault);

	OSErr	DispatchToEventHandlerAux(in		AppleEvent*		message,
										inout	AppleEvent		reply,
										in		ODPart			sendee,
										in		ODBoolean		tokenIsDefault);

	OrderedCollection*	GetPreHandlers();

	ODSemanticInterface	GetDefaultSI();

	void	PreHandlerAdded(in	ODSemanticInterface	face,
							in	ODSLong					refCon);

	void	PreHandlerRemoved(in	ODSemanticInterface	face,
								in	ODSLong					refCon);

	void	InstallDefaultHandlers();

#endif

#ifdef	__SOMIDL__
	implementation
	{
  		functionprefix = ODMessageInterface;

		override:
			somInit,
			somUninit,
			Purge,
			CreateEvent,
			CreatePartAddrDesc,
			CreatePartObjSpec,
			Send,
			ProcessSemanticEvent;
		releaseorder:
		#ifdef	__PRIVATE__
			InitMessageInterface,
			DispatchToEventHandler,
			GetPreHandlers,
			GetDefaultSI,
			PreHandlerAdded,
			PreHandlerRemoved,
			HandleAllSEvents,
			HandleAllSEventsAux,
			HandleReplies,
			HandleRepliesAux,
			HandlePreDispatch,
			HandleAllCoercions,
			HandleAllCoercionsAux,
			DispatchToCoercionHandler,
			DispatchEventWithToken,
			HandleSpecialEvents,
			DispatchToEventHandlerAux,
			InstallDefaultHandlers;
		#else
			reserved1,
			reserved2,
			reserved3,
			reserved4,
			reserved5,
			reserved6,
			reserved7,
			reserved8,
			reserved9,
			reserved10,
			reserved11,
			reserved12,
			reserved13,
			reserved14,
			reserved15,
			reserved16,
			reserved17,
			reserved18;
		#endif

		#ifdef	__PRIVATE__
		passthru	C_xih	=	"
		""
		"class	SETransactionList;"
		"#include <applevnt.h>"
		"";

		passthru	C_xh	=	"
		""
		"class	OrderedCollection;"
		"#include <applevnt.h>"
		"";

		OrderedCollection*		fPreHandlers;
		SETransactionList*		fTransactionList;
		ODSShort				fNextReturnID;
		ODSession				fSession;
		ODNameResolver			fNameResolver;
		ODSemanticInterface	fDefaultSI;
		#endif
	};
#endif
};

//ram#endif	//#	_PLATFORM_MACINTOSH_

#endif	//#	_MSSGINTF_
