/****************************************************************************************

		IShPlatformUtilities.h

		Copyright: (c) 2001 Eovia Corp. All rights reserved.
		
		Author:	Emil
		Date:	3/25/99

		IShPlatformUtilities contains only low-level private calls,
		that are considered to be sensitive to publish:
		For now it contains calls that allow us to:

		-intercept events in the main event loop
		-initialize MAC exception handling globals

		Revision History

		when		who			what & why
		==========	==========	======================================================

*****************************************************************************************/

#ifndef __IShPlatformUtilities__
#define __IShPlatformUtilities__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "ComTypes.h"


class TMCString;
class TMCDynamicString;

/****** Globally Unique Ids **************************************************/

MCDEFINE_GUID_SAFELIB(IID_IShPlatformUtilities, 0xf27467e8, 0xe2f2, 0x11d2, 0xb5, 0x91, 0x0, 0x60, 0x97, 0xb, 0xc5, 0x21);
MCDEFINE_GUID_SAFELIB(IID_IInterceptEvent, 0xf27467e9, 0xe2f2, 0x11d2, 0xb5, 0x91, 0x0, 0x60, 0x97, 0xb, 0xc5, 0x21);

/*****************************************************************************\
*                                                                             *
*  IInterceptEvent                                                            *
*                                                                             *
*                                            *
*                                                                             *
\*****************************************************************************/

/// Main event loop callback Object 
///
struct IInterceptEvent : public IMCUnknown
{
	// ****************************************************************************
	//								OnEvent
	// 
	/// platformEvent is an EventRecord* on MacOS
	/// platformEvent is an MSG* on Windows
	/// Should return MC_S_OK if the event has been intercepted an requires no further processing.
	/// Should return MC_S_FALSE if the event needs to be processed by the main application
	/// 
	virtual MCCOMErr MCCOMAPI OnEvent(void* platformEvent) = 0;
};


/*****************************************************************************\
*                                                                             *
*  IShPlatformUtilities                                                       *
*                                                                             *
*    Platform Utilities Object                                                *

		IShPlatformUtilities contains only low-level private calls,
		that are considered to be sensitive to publish:
		For now it contains calls that allow us to:

		-intercept events in the main event loop
		-initialize MAC exception handling globals

*                                                                             *
\*****************************************************************************/

struct IShPlatformUtilities : public IMCUnknown
{
	virtual MCCOMErr MCCOMAPI AddInterceptEvent(IInterceptEvent* interceptEvent) = 0;
	virtual MCCOMErr MCCOMAPI RemoveInterceptEvent(IInterceptEvent* interceptEvent) = 0;
	
//following API function allow extensions to register themselves into the apps exception handling mechanism
//only for MacOS. It works by itself on Windows.
#if MAC
	virtual void*    MCCOMAPI GetExceptionHandlingData() = 0;	
#endif

};

#endif