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

		IMFTabPart.h

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

		Author:	Greg 
		Date:	8/10/98

		COM interface to internal TabPart objects.

		Revision History

		when		who			what & why
		==========	==========	======================================================
		1/18/99		Greg		icon tabs
		1/14/99		Greg		Added Set/GetIsIconTabs()
		10/22/98	Greg		changing pages sends a kMsg_TabPageChanged message

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

#ifndef __IMFTABPART__
#define __IMFTABPART__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "MCCompObj.h"

struct IMFPart;
class  TMCString;

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

MCDEFINE_GUID(IID_IMFTabPart, 0xde9fd1d1, 0xd892, 0x11d1, 0xa1, 0xd5, 0x0, 0xaa, 0x0, 0xd3, 0x7, 0xeb);

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



namespace EMFPartMessage
{
	enum
	{											//Receive() data parameter contents
		kMsg_TabPageChanged	= 36				//boolean

			// This message is sent when the user selects
			// a new tab page (or the page is set procedurally
			// via SetCurrentPage())
	};
}




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

enum ETabAlignment 
{ 
	kAlignTabsTop, 
	kAlignTabsBottom, 
	kAlignTabsLeft, 
	kAlignTabsRight
};

///IMFTabPart is the interface used for tabs in the UI. <P> In MCSketch, you will create a Node part of class
///TMFTabPart, with a child TMFTabArea to hold the tabs themselves and a Node Part to host the tab contents.
///Give the tab area an ID of <B>'TabA'</B> and the host NodePart an ID of <B> 'Host' </B>
///
/// <P>The pages for the tabs can be generated automatically from a TABS resource, or manually with AddPage()
/// <P>Tabs can have either text or icon labels.  If using icon labels, the textual names of the tabs will be
/// used as tooltips when the cursor hovers over the icon.
///
struct IMFTabPart : public IMCUnknown
{
		virtual void 	MCCOMAPI AddPagesFromTABSResource	(ResourceID			inResID) = 0;

	// ****************************************************************************
	//								AddPage
	// 
	/// Adds a new tab to the Tab Part.
	/// 
	/// \param inPart            Pointer to the Part to add
	/// \param inPageName        Name to appear in this page's tab
	/// \param inImageResID      If this has a value, the tab will have an icon rather than a title.
	/// \param inRecalcTabs      If true, recalculates tab sizes
	/// \param inRenumberPages   If true, renumbers the pages after inserting the page
	/// \param inFitPageToHost   If true, the new page is given the size of the host pane.  Otherwise, the new page is resized only if it is smaller.  Use false when the scroll part is outside the tabs.
	/// \param inDoNotResizePart If true, does not resize the part.
	/// 
		virtual IDType 	MCCOMAPI AddPage					(IMFPart* 			inPart, 
															 const TMCString&	inPageName,
															 ResourceID			inImageResID,
															 boolean 			inRecalcTabs,
															 boolean 			inRenumberPages,
															 boolean			inFitPageToHost,
															 boolean			inDoNotResizePart = false) = 0;
		
	// ****************************************************************************
	//								AddPage
	// 
	/// Adds a new tab to the Tab Part.
	/// 
	/// \param inPartResID       Resource ID for the part to add
	/// \param inPageName        Name to appear in this page's tab
	/// \param inImageResID      If this has a value, the tab will have an icon rather than a title.
	/// \param inRecalcTabs      If true, recalculates tab sizes
	/// \param inRenumberPages   If true, renumbers the pages after inserting the page
	/// \param inFitPageToHost   If true, the new page is given the size of the host pane.  Otherwise, the new page is resized only if it is smaller.  Use false when the scroll part is outside the tabs.
	/// \param inDoNotResizePart If true, does not resize the part. 
	/// 
		virtual IDType 	MCCOMAPI AddPage					(ResourceID			inPartResID,
															 const TMCString&	inPageName,
															 ResourceID			inImageResID,
															 boolean 			inRecalcTabs,
															 boolean			inRenumberPages,
															 boolean			inFitPageToHost,
															 boolean			inDoNotResizePart = false) = 0;

		virtual void	MCCOMAPI RemovePage					(IDType				inPageID,
															 boolean			inRecalcPages,
															 boolean			inRenumberPages) = 0;

		virtual void	MCCOMAPI RemoveAllPages				() = 0;
													 
		virtual void 	MCCOMAPI SetCurrentPage				(IDType inCurrentPageID, boolean notify=true) = 0;
		virtual IDType 	MCCOMAPI GetCurrentPage				() = 0;

		virtual IMFPart* MCCOMAPI GetCurrentTab				() = 0;

		virtual int32	MCCOMAPI GetPageCount				() = 0;

		virtual void	MCCOMAPI SetTabAlignment			(ETabAlignment inTabAlignment) = 0;

		virtual void	MCCOMAPI SetIsIconTabs				(boolean inIsIconTabs) = 0;
		virtual boolean	MCCOMAPI GetIsIconTabs				() = 0;

		virtual void	MCCOMAPI SetPageIsEnabled			(IDType			inPageID,
															 boolean		inIsEnabled) = 0;

		virtual void	MCCOMAPI SetPageName				(IDType				inPageID,
															 const TMCString&	inName) = 0;

		virtual boolean	MCCOMAPI GetPageIsEnabled			(IDType			inPageID) = 0;	
		virtual void	MCCOMAPI GetPageName				(IDType			inPageID,
															 TMCString&		ioName) = 0;

		virtual void	MCCOMAPI SetPageIsVisible			(IDType			inPageID,
															 boolean		inIsVisible) = 0;
		virtual boolean	MCCOMAPI GetPageIsVisible			(IDType			inPageID) = 0;

		virtual void	MCCOMAPI GetPageContainingPart		(IDType partID,IDType &pageID) = 0;


		//returns the IMFPart interface
		virtual IMFPart* MCCOMAPI GetThisPart				() = 0;

};

/// \}
#endif