#ifdef __PRIVATE__
//#
//#	File:		Disptch.idl
//#
//#	Contains:	Class definition for ODDispatcher
//#
//#	Written by:	Richard Rodseth
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		 <4>	 8/15/94	JBS		1181156: UI API Cleanup
//#		 <3>	  8/4/94	eeh		bug 1177981: add GetDispatchModule
//#		 <2>	 6/16/94	RR		Added function prefix
//#		 <1>	  6/8/94	RR		first checked in
//#		 <6>	  6/7/94	RR		Privatise change log
//#		 <1>	  5/9/94	VL		first checked in
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _DISPATCH_
#define _DISPATCH_

#ifndef _DISPATCHB_
#include "DisptchB.idl"
#endif

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

interface  ODDispatcher;

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

interface  ODDispatchModule;
interface  ODFacet;
interface  ODFrame;
interface  ODPart;
interface  ODSession;

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

typedef somToken IdleList;
typedef somToken DispatchTable;
typedef somToken TimerSet;
#endif

//=====================================================================================
// ODDispatcher
//=====================================================================================

#ifdef _PLATFORM_MACINTOSH_

interface ODDispatcher :  ODBaseDispatcher
{
   void RegisterIdle(in ODPart part,
   					 in ODFrame frame,
					 in ODIdleFrequency frequency);

   void UnregisterIdle(in ODPart part,
   					   in ODFrame frame);

   void SetIdleFrequency(in ODPart part,
   						 in ODFrame frame,
						 in ODIdleFrequency frequency);

   void ODYield(in ODFrame frame);

   void SetMouseRegion(in ODRgnHandle area);

   ODRgnHandle GetMouseRegion();

   void InvalidateFacetUnderMouse();

   ODSLong GetSleepTime();

#ifdef __PRIVATE__

	void InitDispatcher(in ODSession session);

   void InvalidateMouseRegion();

   ODFacet  GetFacetUnderMouse();

   void SetFacetUnderMouse(in ODFacet facet);

   ODBoolean HandleNullEvent(in ODEventData event,
   							 in  ODFrame skipFrame);

   ODBoolean MouseRegionIsInvalid();
   
   void ComputeMouseRegion();
   
   void CheckFacetUnderMouse();

	ODBoolean HandleTimerEvent (in ODEventData event);

#endif

#ifdef __SOMIDL__
  implementation
  {
  	functionprefix = ODDispatcher;
	
		override:
			somInit,
			somUninit,
			Purge,
			AddDispatchModule,
			GetDispatchModule,
			RemoveDispatchModule,
			AddMonitor,
			RemoveMonitor,
			Dispatch,
			Exit,
			ShouldExit;
		
		releaseorder:
			RegisterIdle,
			UnregisterIdle,
			SetIdleFrequency,
			ODYield,
			SetMouseRegion,
			GetMouseRegion,
			InvalidateFacetUnderMouse,
			GetSleepTime,
		#ifdef __PRIVATE__
			InitDispatcher,
			InvalidateMouseRegion,
			GetFacetUnderMouse,
			SetFacetUnderMouse,
			HandleNullEvent,
			MouseRegionIsInvalid,
			ComputeMouseRegion,
			CheckFacetUnderMouse,
			HandleTimerEvent;
		#else
			reserved1,
			reserved2,
			reserved3,
			reserved4,
			reserved5,
			reserved6,
			reserved7,
			reserved8,
			reserved9;
		#endif

		majorversion = 1; minorversion = 0;
		
		#ifdef __PRIVATE__
		passthru C_xih = "
		""
		"class DispatchTable;"
		"class IdleList;"
		"class TimerSet;"
		"";
		ODSession		fSession;
		ODBoolean		fExit;
		DispatchTable*	fDispatchTable;
		IdleList*		fIdleList;
		ODRgnHandle		fMouseRegion;
		ODRgnHandle		fPartMouseRegion;
		ODFacet			fFacetUnderMouse;
		TimerSet*		fTimerFrames;
		#endif
	
  };
#endif
};

#endif //# _PLATFORM_MACINTOSH_


#endif //# _DISPATCH_

