#ifdef __PRIVATE__
//#
//#	File:		WinStat.idl
//#
//#	Contains:	Class definition for ODWindowState
//#
//#	Written by:	Richard Rodseth, Eric House, Vincent Lo
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		 <9>	 9/23/94	RR		Added CreateFacet to override list
//#		 <8>	 8/25/94	RR		Added private GetBaseMenuBar
//#		 <7>	 8/16/94	JBS		1180387: add CreateCanvas()
//#		 <6>	 8/15/94	JBS		1181138: add frameType to CreateFrame();
//#									1181156: UI API Cleanup
//#		 <5>	 7/27/94	eeh		fix use of Point and Rect (honesty to SOM.)
//#		 <4>	 7/21/94	eeh		bounds param to FixUpMailerWindow -> Rect*
//#		 <3>	 6/20/94	jpa		Fixed syntax err in passthru.
//#		 <2>	 6/16/94	RR		Added function prefix
//#		 <1>	  6/8/94	RR		first checked in
//#		 <6>	 5/23/94	RR		Passthru to xh rather than xih
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _WINSTAT_
#define _WINSTAT_

#ifndef _WINSTATB_
#include "WinStatB.idl"
#endif

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

interface  ODWindowState;

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

interface  ODCanvas;
interface  ODDraft;
interface  ODFrame;
interface  ODMenuBar;
interface  ODPart;
interface  ODSession;
interface  ODWindow;
interface  ODWindowIterator;

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

typedef somToken LinkedList;
typedef somToken MailerTempInfo;
typedef somToken Str255;

#endif

//=====================================================================================
// ODWindowState
//=====================================================================================

#ifdef _PLATFORM_MACINTOSH_

interface ODWindowState :  ODBaseWindowState
{
	void DeactivateFrontWindows();
	
    void ActivateFrontWindows();
	
    ODWindow GetFrontWindow();
	
    ODWindow GetFrontFloatingWindow();
	
    ODWindow GetFrontRootWindow();

#ifdef __PRIVATE__

	void InitWindowState(in ODSession session);

	void SetCurrentMenuBar(in ODMenuBar theMenuBar);
	ODMenuBar  GetCurrentMenuBar();
	ODMenuBar  GetBaseMenuBar();
	
	
	ODWindow  AddWindow(in ODWindow window);
   void RemoveWindow(in ODWindow oldWindow);
#ifdef PLATFORM_MACINTOSH
	ODBoolean HandleAOCEMailerEvent(in ODEventData event);
   ODBoolean HandleAOCEMailerCommand(in ODCommandID command);
   void UpdateAOCEMailerMenus();
#endif
   ODWindow  FindODWindow(in POINT globalPoint);
   void ReleaseWindow(in ODWindow window);
   void SuspendResume(in ODEventData event);
   void SelectODWindow(in ODWindow window);
   void DragODWindow(in ODWindow window,
					  in POINT startPoint,
					  in RECT draggingBounds);
   void ShowODWindow(in ODWindow window);
   void HideODWindow(in ODWindow window);
   LinkedList* GetWindowList(); // for ODWindowIterator
#ifdef PLATFORM_MACINTOSH

  // AOCE Mailer

	void SetTempMailerWindow(in ODPlatformWindow platWin,
							 in MailerTempInfo replyInfo) ;
   void MakeWindowIntoReply(in ODWindow newWindow) ;
   ODPlatformWindow GetTempMailerWindow() ;
   void SetMailerWindow(in ODWindow window ) ;
   void ClearMailerWindow() ;
   ODWindow  GetMailerWindow() ;
   ODPlatformWindow FixUpMailerWindow(in RECT bounds,
   									  inout Str255 title,
									  in ODSShort procID,
									  in ODBoolean hasCloseBox,
									  in ODSLong refCon) ;
#endif

  void ActivateWindow(in ODPlatformWindow platformWindow);
  void DeactivateWindow(in ODPlatformWindow platformWindow);
  void HighlightAndActivateWindow(in ODPlatformWindow platformWindow,
  								  in ODBoolean activate);
  ODPlatformWindow GetLastFloatingPlatformWindow();
  ODPlatformWindow GetFrontNonFloatingPlatformWindow();

#endif

#ifdef __SOMIDL__
	implementation
  	{
  		functionprefix = ODWindowState;

		override:
			somInit,
			somUninit,
			Purge,
 
 			RegisterWindow,
			GetWindow,
			Internalize,
			Externalize,
			SetDefaultWindowTitles,
			OpenWindows,
			CloseWindows,
			GetWindowCount,
			GetRootWindowCount,
			GetTotalRootWindowCount,
			IsODWindow,
			GetODWindow,
			CreateWindowIterator,
			GetActiveWindow,
			SetBaseMenuBar,
			CopyBaseMenuBar,
			AdjustPartMenus,
			CreateCanvas,
			CreateFacet,
			CreatePlatformWindow;
			
	   releaseorder:
			DeactivateFrontWindows,
			ActivateFrontWindows,
			GetFrontWindow,
			GetFrontFloatingWindow,
			GetFrontRootWindow,
		#ifdef __PRIVATE__
			InitWindowState,
			SetCurrentMenuBar,
			GetCurrentMenuBar,
			GetBaseMenuBar,
			AddWindow,
			RemoveWindow,
#ifdef PLATFORM_MACINTOSH
			HandleAOCEMailerEvent,
			HandleAOCEMailerCommand,
			UpdateAOCEMailerMenus,
#endif
			FindODWindow,
			ReleaseWindow,
			SuspendResume,
			SelectODWindow,
			DragODWindow,
			ShowODWindow,
			HideODWindow,
			GetWindowList,
#ifdef PLATFORM_MACINTOSH
			SetTempMailerWindow,
			MakeWindowIntoReply,
			GetTempMailerWindow,
			SetMailerWindow,
			ClearMailerWindow,
			GetMailerWindow,
			FixUpMailerWindow,
			GetMailerWindowV2,
#endif
			ActivateWindow,
			DeactivateWindow,
			HighlightAndActivateWindow,
			GetLastFloatingPlatformWindow,
			GetFrontNonFloatingPlatformWindow;
		#else
			reserved1, reserved2, reserved3, reserved4, reserved5, reserved6,
			reserved7, reserved8, reserved9, reserved10, reserved11, reserved12,
			reserved13, reserved14, reserved15, reserved16, reserved17, reserved18,
			reserved19, reserved20, reserved21, reserved22, reserved23, reserved24,
			reserved25, reserved26, reserved27, reserved28, reserved29, reserved30;
		#endif

		majorversion = 1; minorversion = 0;
		
    #ifdef __PRIVATE__
		passthru C_xh =
			""
			"class LinkedList;"
			"enum MailerTempInfo { kNotForeign, kReplyToOne, kReplyToAll } ;"
			"#include <sys\Types.h>"
#ifdef PLATFORM_MACINTOSH
			"#include <Windows.h>"
#endif
			"";

		ODSession 		fSession;
		LinkedList* 		fWindowList;
		ODID 				fNextID;
		ODMenuBar 		fBaseMenuBar;
		ODMenuBar 		fCurrentMenuBar;
#ifdef PLATFORM_MACINTOSH
		ODPlatformWindow 	fTempMailerWindow ;
		MailerTempInfo    fMailerReplyInfo ;
		ODWindow       	fMailerWindow ;
#endif
    #endif

  };
#endif
};

#endif //# _PLATFORM_MACINTOSH_

#endif // _WINSTAT_
