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

		IMFToolbarPart.h

		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Greg 
		Date:	1/21/98

		Revision History

		when		who			what & why
		==========	==========	======================================================
		12/2/99		Pierre		added EnableAllTools Call
		11/12/99	Ian			Added SetRespectWindowActive().
		4/5/99		Greg		Added kToolStyle_PlainFlat
		3/23/99		Greg		Added DragDrop tool support
		3/18/99		Joshua		Added API calls
		2/10/99		Greg		massive changes relating to draw styles, layouts, draw methods

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

#ifndef __IMFTOOLBARPART__
#define __IMFTOOLBARPART__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "MCCompObj.h"
#include "MCString.h"

struct IMFResponder;

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

// {3DA372B9-887D-46ee-928E-DFDAC9F3B511}
MCDEFINE_GUID(IID_IMFToolbarPart, 0x3da372b9, 0x887d, 0x46ee, 0x92, 0x8e, 0xdf, 0xda, 0xc9, 0xf3, 0xb5, 0x11);

//****************************************************************************
/// \addtogroup MCF
/// \{

enum EToolStyle
{
	kToolStyle_Normal 		= 0,
	kToolStyle_Flat 		= 1,
	kToolStyle_Inset 		= 2,
	kToolStyle_Overlay 		= 3,
	kToolStyle_PlainFlat	= 4,
	kToolStyle_OverlayBlit	= 5
};

/// enums for image array indices
enum EImageIndices
{
	
	kBackgroundImage 			= 0,	///< for use with kToolStyle_Overlay
	kOverlayImage 				= 1,	///< for use with kToolStyle_Overlay
	
	kImage						= 0,	///< for use with kToolStyle_Flat and kToolStyle_Inset
	
	kUnpressedEnabledImage 		= 0,	///< for use with kToolStyle_Normal
	kUnpressedMouseOverImage 	= 1,	///< for use with kToolStyle_Normal
	kUnpressedDisabledImage 	= 2,	///< for use with kToolStyle_Normal
	kPressedEnabledImage 		= 3,	///< for use with kToolStyle_Normal
	kPressedMouseOverImage 		= 4,	///< for use with kToolStyle_Normal
	kPressedDisabledImage		= 5,	///< for use with kToolStyle_Normal

	kTotalImages 				= 6
};


enum ELayoutOrientation 
{ 
	kLayoutOrientation_Horizontal 	= 0, 
	kLayoutOrientation_Vertical 	= 1 
};

enum ELayoutStyle
{ 
	kLayoutStyle_Straight 	= 0, 
	kLayoutStyle_Honeycomb 	= 1 
};


enum EToolbarResponderKind
{ 
	kToolSelectRecipient 			= 0, 
	kToolManipulationResponder 		= 1,

	kInvalidToolbarResponderKind	= 0xffffffff
};


namespace EMFPartMessage
{
	enum										//Receive() data parameter contents
	{
		kMsg_TrackingButtonInside	= 26,		///<Receive() data parameter contains TTopTool*
		kMsg_TrackingButtonOutside	= 27,		///<Receive() data parameter contains TTopTool*
		kMsg_ReleaseFlyout			= 28,
		kMsg_UnHookedResponder		= 29,		///<Receive() data parameter contains EToolbarResponderKind* (only sent to the former responder/recipient)

		//messages 26 to 30 already reserved for use here (in MFPartMessages.txt)		
	};
}


struct IMFPart;

/******************************************************************************\
*                                                                              *
*           IMFToolbarPart                                                     *
*                                                                              *
\******************************************************************************/

///Interface for objects implementing toolbars.  Toolbars are arrays of icons arranged either horizontally or vertically which can be clicked
///to cause actions or change states.  Note that multiple related tools can be stacked in groups, which expand when their expand arroy is clicked or when the 
///mouse is clicked and held on the tool.  
///
///Toolbars can be constructed manually using these functions, or from a TBAR resource.  See MFRTypes.r for the definition of a TBAR resource structure.
///Note that there are special tool types for defining groups of tools to stack, as follows.  The tools between these two keys in a TBAR resource will be stacked.
///\verbatim
///		tBeginToolGroup, "", noKey, noAction, normalEnabling, style_normal { noShadow, 0, 0, 0, 0, 0, 0 },
///		tEndToolGroup, "", noKey, noAction, normalEnabling, style_normal { noShadow, 0, 0, 0, 0, 0, 0 },
///\endverbatim
///To create a tool, you will assign the tool a numeric ID, an optional hotkey, an optional action, an enabling mode (see MFRTypes.r), an EToolStyle, and a set
///of UImg resource numbers which correspond to icons for the various states the tool can have.  See EImageIndices for the list of tool states.
///
struct IMFToolbarPart : public IMCUnknown
{
		
	virtual boolean 			MCCOMAPI	SetCurrentTool				(int32 inToolID, boolean inRedraw, boolean inNotify= true) = 0;
	virtual void 				MCCOMAPI	SetLayoutOrientation		(ELayoutOrientation inLayoutOrientation) = 0;
	virtual void 				MCCOMAPI	SetLayoutStyle				(ELayoutStyle inlayoutStyle) = 0;
	virtual void				MCCOMAPI	SetIsGlobal					(boolean inIsGlobal) = 0;
	virtual void				MCCOMAPI	SetToolSelectRecipient		(IMFResponder* recipient)=0;
	virtual void				MCCOMAPI	SetToolManipulationResponder(IMFResponder* inResponder)=0;
	virtual void 				MCCOMAPI	SetRespectWindowActive		(boolean inValue) = 0;
	
	virtual int32 				MCCOMAPI	GetCurrentTool				() = 0;
	virtual ELayoutOrientation	MCCOMAPI	GetLayoutOrientation		() const = 0;
	virtual ELayoutStyle		MCCOMAPI	GetLayoutStyle				() const = 0;
	
	virtual void				MCCOMAPI	AddToolsFromTBARResource	(ResourceID inTBARID) = 0;	
	
	virtual void 				MCCOMAPI	AddTool						(int32				inToolID,
																		 EToolStyle			inToolStyle,
																		 ResourceID			inImage[kTotalImages],
																		 int16 				inToolKey, 
																		 const TMCString& 	inName,
																		 ActionNumber 		inActionNumber,
																		 boolean			inIsAlwaysEnabled,
																		 boolean 			inIsShadowed, 
																		 int32 				inAfterIndex,
																		 boolean			inForceSticky=false) = 0;
		// Adds tool to toolbar.  inImage is an array of UImg resource IDs, which is interpreted
		// according to the inToolStyle field (see the EToolStyle and EImageIndices)

	virtual void				MCCOMAPI	ResetTools					() = 0;
	virtual	void				MCCOMAPI	EnableAllTools(boolean inEnabled) = 0;

	virtual IMFResponder*		MCCOMAPI	GetToolSelectRecipientNoAddRef() = 0;
	virtual IMFResponder*		MCCOMAPI	GetToolManipulationResponderNoAddRef()	= 0;

	// -Description:
	//		Select a tool by its ID in the toolbar.
	// -Parameters:
	//		ID of the tool to be selected.
	// -Returns:
	//		'true' if the tool is selected.
	virtual boolean				MCCOMAPI	SelectTool(int32 inToolID) = 0;


	virtual IMFPart*			MCCOMAPI	GetThisPart() = 0;

};
/// \}

#endif