#ifdef __PRIVATE__
//#     File:           ODTlSpc.h
//#
//#     Contains:       ODToolSpaceManager class definition
//#
//#     Written by:     Jeff Hanson
//#
//#     Copyright:      c 1994-95 by Novell, Inc., all rights reserved.
//#
//#     Change History (most recent first):
//#
//#              <1>     1/17/95        JH              Created
//#
//#     To Do:
//#
#else
//#     Copyright:      c 1993-1994 by Novell, Inc., all rights reserved.
#endif

#ifndef _ODTLSPC_
#define _ODTLSPC_

#ifndef _ODOBJECT_
#include "ODObject.idl"
#endif

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

/*
	This class manages space to be used for toolbars, statusbars, scrollbars, etc.
*/

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

interface ODToolSpaceManager;

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

interface ODSession;
interface ODShape;
interface ODToolWindow;
interface ODToolSpaceObj;
interface ODPart;

//=====================================================================================
// Implementation Types
//=====================================================================================

//#bln #ifdef __PRIVATE__
typedef somToken ToolDragFeedbackProc;
typedef somToken ODToolSpaceDomain;
typedef somToken ODToolSpacePos;
typedef somToken ODToolSpaceRect;
typedef somToken OrderedCollection;
//#bln #endif

//==============================================================================
// ODToolSpaceManager
//==============================================================================

interface ODToolSpaceManager : ODObject
{
	void InitToolSpaceManager();

	ODPlatformWindow GetParentWindow(in ODToolSpaceDomain tsDomain);

	ODSession GetSession();

	ODShape GetExistingToolSpace(in ODToolSpaceDomain tsDomain, in ODBoolean includeFloat);

	ODBoolean RequestToolSpace(in ODToolSpaceDomain tsDomain, in ODShape partFrameShape,
												in ODToolSpaceRect* requestedSpace);

	ODShape GetAvailableSpace(in ODToolSpaceDomain tsDomain);

	ODToolSpaceObj CreateToolSpace(in ODToolSpaceDomain tsDomain, in ODPart requestingPart,
												in ODToolSpaceRect* requestedSpace,
												in ODShape partFrameShape);

	void RemoveToolSpace(in ODToolSpaceObj aTSObj);

	void DocWindowResized(in ODPlatformWindow aDocumentWindow);

	void SetStatusText(in ODISOStr lpstrText);

	ODRgnHandle ToolSpaceRectToRgn(in ODToolSpaceDomain tsDomain, 
				in ODToolSpaceRect* aToolSpaceRect, in ODRect ownerRect,
				out ODRgnHandle leftRgn, out ODRgnHandle topRgn, out ODRgnHandle rightRgn, 
				out ODRgnHandle bottomRgn, out ODRgnHandle floatRgn);

	ODBoolean SetToolSpaceSizePos(in ODToolSpaceObj aTSObj, in ODCoordinate newLeft, in ODCoordinate newTop, 
										in ODCoordinate newWidth, in ODCoordinate newHeight, in ODToolSpacePos thePos);

	ODToolSpacePos TrackDrag(in ODToolSpaceObj aTSObj, in ODPoint downPnt, out ODRect finalSizePos, 
										in ToolDragFeedbackProc aFeedBackProc);

	ODRgnHandle GetHotZoneRgn(in ODToolSpaceObj aTSObj, in ODToolSpacePos thePos);

	ODRgnHandle PtInHotZone(in ODToolSpaceObj aTSObj, in ODPoint mousePnt, out ODToolSpacePos thePos);

	void SetHotZones(in ODToolSpaceRect* aToolSpaceRect);

	void GetHotZoneRect(in ODToolSpaceObj aTSObj, in ODToolSpaceDomain tsDomain, 
								in ODToolSpaceRect* aToolSpaceRect, in ODToolSpacePos thePos, out ODRect hotZoneRect);

	void MoveSizeRootWindow(in ODToolSpaceDomain tsDomain, in ODPlatformWindow theRootWnd);

#ifdef __SOMIDL__
	implementation
	{
	functionprefix = ODToolSpaceManager;

    override:
		somInit,
		somUninit;

    releaseorder:
		InitToolSpaceManager,
		GetParentWindow,
		GetSession,
		GetExistingToolSpace,
		RequestToolSpace,
		GetAvailableSpace,
		CreateToolSpace,
		RemoveToolSpace,
		DocWindowResized,
		SetStatusText,
		ToolSpaceRectToRgn,
		SetToolSpaceSizePos,
		TrackDrag,
		GetHotZoneRgn,
		PtInHotZone,
		SetHotZones,
		GetHotZoneRect,
		MoveSizeRootWindow;

    #ifdef __PRIVATE__
		passthru C_xh =
			""
			"#include <ODTypes.h>"
			"#define kODToolSpaceManagerID \"appl:ODToolSpaceManager$class,1.0.0\""
			"typedef void (WINAPI *ToolDragFeedbackProc)(ODPlatformCanvas aPltFrmCanvas, ODRgnHandle feedBackRgn, ODBoolean erase);"
			"#define kODTSNULL           			0x0000"
			"#define kODTSLeft           			0x0001"
			"#define kODTSTop           			0x0002"
			"#define kODTSRight           			0x0004"
			"#define kODTSBottom           			0x0008"
			"#define kODTSFloat           			0x0010"
			"enum ODToolSpaceDomain {"
			"	kODNoDomain,"
			"	kODDeskTop,"
			"	kODDocument,"
			"	kODRootPart,"
			"	kODPartFrame,"
			"	kODStatusTool,"
			"	kODStatusText"
			"};"
			"typedef ODUShort ODToolSpacePos;"
			""
			"struct ODExport ODToolSpaceRect {"
			"public:"
			"	ODCoordinate	left;"
			"	ODCoordinate	top;"
			"	ODCoordinate	right;"
			"	ODCoordinate	bottom;"
			"	ODRect			floatRect;"
			""      
			"	ODToolSpaceRect( )		{ }"
			"	ODToolSpaceRect( ODCoordinate l, ODCoordinate t,"
			"					ODCoordinate r, ODCoordinate b, ODRect* aFloatRect )"
			"			{left=l; top=t; right=r; bottom=b; floatRect = *aFloatRect;}"
			""
			"	ODBoolean IsEmpty() const;"
			""
			"	void Set(ODCoordinate l, ODCoordinate t," 
			"						ODCoordinate r, ODCoordinate b, ODRect* aFloatRect);"
			""
			"	void Clear(void);"
			"};"
			""
			"class OrderedCollection;"
			"";
		ODBoolean                       fInitialized;
		ODSession                       fSession;
		OrderedCollection*      fToolSpaces;
		ODCoordinate            fHotLeftSize;
		ODCoordinate            fHotTopSize;
		ODCoordinate            fHotRightSize;
		ODCoordinate            fHotBottomSize;
		ODRect                          fHotFloatRect;
	#endif
  };
#endif
};

#endif // _ODTLSPC_
