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

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

		Author:	Arnaud
		Date:	3/19/2004

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

#ifndef __IShPrefsComponent__
#define __IShPrefsComponent__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "ComTypes.h"



MCDEFINE_GUID_H(IID_IShPrefsComponent);

struct IShParameterComponent;
class  TMCCommandBindingContextList;

/// \addtogroup BasicCOM
/// \{

/// IShPrefsComponent is a component used to store the preferences of another component.
/// It can also store user defined key bindings
/// Those preferences are stored on a per user basis. 
/// So far there is no "explicit" UI in Carrara to change the component's preferences, 
/// but this mechanism can be used for example to save the position of a component's toolbar (eg motion path in Carrara).
///
/// To implement a prefs component:
/// - derive a class from TBasicPrefsComponent (and make a pmap for it)
/// - declare its 'COMP' resource (use kRID_PreferencesFamilyID for its family), and give it an ID (eg 'path').
/// - declare its 'GUID' resource (use R_IID_IExPrefsComponent for its parent interface)
/// - declare its 'PMap' resource.
///
/// Now for the component that wants to store its preferences, declare a 'CINF' resource 
/// and put the ID of the prefs component in its fPrefsCompID field. Example:
/// \verbatim
/// resource 'CINF' (R_PathAnimationMethod, "Motion Path")
/// {
///     'path',
///     kAnyPlatform,
///     kAnyAppKind,
///     kAnyAppMode, 
/// };
/// \endverbatim
///
/// Now in the code of component that wants to access its preferences, you can call GetMyPrefsComponent 
/// (implemented by TBasicDataExchanger). Example:
/// \code
/// IShParameterComponent* myPrefsComp= GetMyPrefsComponent();
///	if (MCVerify(myPrefsComp))
///	{
///		TMCPoint tbPos= kDefaultMPToolbarPos;
///		myPrefsComp->GetParameter(kToolBarParamID, &tbPos);
///		//...
///	}
/// \endcode
///
/// \see IShComponent::GetPrefComponent
///
struct IShPrefsComponent : public IMCUnknown
{
	/// IShPrefsComponent is always an IShParameterComponent
	///
	virtual IShParameterComponent*			MCCOMAPI GetThisParameterComponent() = 0;

	// ****************************************************************************
	//								GetCommandBindingContexts
	// 
	/// Returns the binding contexts of the external component
	/// 
	/// 
	virtual TMCCommandBindingContextList*	MCCOMAPI GetCommandBindingContexts() = 0;
};


/// \}
























#endif


