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


		ISceneDocument.h

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

		Author:	Greg
		Date:	5/21/98

		Revision History

		when		who			what & why
		==========	==========	======================================================
		11/29/99	Greg		Added JumpInStack support
		11/17/99	David		Added GetModuleByID().
		9/18/98		Greg		Added GetDocumentWindowByID() to ISceneDocument
		9/15/98		Greg		Added GetPropertiesWindow()
		
*****************************************************************************************/
#ifndef __ISCENEDOCUMENT__
#define __ISCENEDOCUMENT__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "COMTypes.h"

struct ISceneSelection;
struct IChangeChannel;
struct I3DShScene;
struct IMFPart;
struct I3DRenderingModule;
struct I3DShModule;
struct I3DShTreeElement;
struct I3DExExportFilter;
struct I3DShParamInfo;
struct IShAction;
struct I3DEditorHostPanePart;
class TMCSmartBloc;


//****** Globally Unique Ids *************************************************
MCDEFINE_GUID(IID_ISceneDocument, 0xd635b730, 0xf10a, 0x11d1, 0xa0, 0xd8, 0x0, 0xaa, 0x0, 0xd3, 0x7, 0xeb);


/// \addtogroup ShellInterface
/// \{

/// Interface used for the animation edition mode. This can be used for
/// non-linear clip edition, layer edition...
struct IExAnimationEditMode : public IMCUnknown
{
	// ****************************************************************************
	//								Begin
	// 
	/// Called when enterig edition mode
	/// 
	virtual void		MCCOMAPI Begin() = 0;

	// ****************************************************************************
	//								End
	// 
	/// Called when leaving edition mode
	/// 
	virtual void		MCCOMAPI End() = 0;

	// ****************************************************************************
	//								GetActiveTimeLine
	// 
	/// Returns the index of the active timeline for the given parameter.
	/// 
	/// \param paramInfo	The parameter.
	/// 
	virtual int32		MCCOMAPI GetActiveTimeLine(I3DShParamInfo* paramInfo) = 0;

	// ****************************************************************************
	//								CanBeSaved
	// 
	/// Returns true if a scene edited in this animation mode can be saved or false
	/// if not. This that last case, the function CreateLeaveAnimationEditModeAction()
	/// will be called.
	///
	/// \see IExAnimationEditMode::CreateLeaveAnimationEditModeAction
	/// 
	virtual boolean		MCCOMAPI CanBeSaved() const = 0;

	// ****************************************************************************
	//								CreateLeaveAnimationEditModeAction
	// 
	/// This function creates an action that will make the scene leave this
	/// animation edit mode. If the return value is not MC_S_OK, it means that
	/// the mode could not be created.
	///
	/// \param action		The action that need to be posted.
	/// \param actionNumber	The action number of the action to be posted.
	///
	/// \see IExAnimationEditMode::CanBeSaved
	/// 
	virtual MCCOMErr	MCCOMAPI CreateLeaveAnimationEditModeAction(IShAction** action, int32& actionNumber) = 0;
};

/// \}

#ifndef qDemoVersion //regular interface

/// \addtogroup ShellInterface
/// \{

/// Interface to a scene document.  Provides basic access to the scene's I3DShScene interface, and its associated change channels.
/// It also provides support for Jump In/Out.  This is when the user double-clicks on a group or object, and the document "jumps in" and allows 
/// editing of just that subtree.  
struct ISceneDocument : public IMCUnknown
{
	// ****************************************************************************
	//								GetScene
	// 
	/// Get a counted pointer to the scene
	/// 
	/// \param I3DShScene  Should be a pointer to a counted pointer.
	/// 
	virtual	void		MCCOMAPI GetScene(I3DShScene**) = 0;

	// ****************************************************************************
	//								GetScene
	// 
	/// Get a pointer to the scene without adding a reference.
	/// 
	/// \return A pointer to the scene.
	/// 
	virtual	I3DShScene*	MCCOMAPI GetScene() = 0;

	// ****************************************************************************
	//								GetSceneSelection
	// 
	/// Get a counted pointer to the scene selection.
	/// 
	/// \param ISceneSelection  Should be a pointer to a counted pointer.
	/// 
	virtual void 		MCCOMAPI GetSceneSelection(ISceneSelection**) = 0;

	// ****************************************************************************
	//								GetSceneSelectionChannel
	// 
	/// Get a counted pointer to the channel that is alerted when the scene selection change.
	/// 
	/// \param IChangeChannel  Should be a pointer to a counted pointer.
	/// 
	virtual void		MCCOMAPI GetSceneSelectionChannel(IChangeChannel**) = 0;

	// ****************************************************************************
	//								GetTreeHierarchyChannel
	// 
	/// Get a counted pointer to the channel that is alerted when there is a change in the tree hierarchy or transform.
	/// 
	/// \param IChangeChannel  Should be a pointer to a counted pointer.
	/// 
	virtual void 		MCCOMAPI GetTreeHierarchyChannel(IChangeChannel**) = 0;

	// ****************************************************************************
	//								GetDocumentWindowByID
	// 
	/// 
	/// 
	/// \param IMFPar     
	/// \param inWindowI
	/// 
	virtual void		MCCOMAPI GetDocumentWindowByID(IMFPart**,IDType inWindowID) = 0;
	virtual void		MCCOMAPI GetModuleByID(I3DShModule**, IDType inModuleID) = 0;
	virtual void		MCCOMAPI GetSceneRenderingModule(I3DRenderingModule** renderingModule) = 0;
	virtual boolean		MCCOMAPI StopAnimPreview() = 0;
	virtual void		MCCOMAPI StartAnimPreview() = 0;

	// Jump In/Out support
	virtual void		MCCOMAPI GetJumpInOutChannel(IChangeChannel**) = 0;
	virtual uint32		MCCOMAPI GetJumpInStackCount() = 0;
	virtual void		MCCOMAPI GetJumpInStackTop(I3DShTreeElement** outTree) = 0;
	virtual void		MCCOMAPI JumpIn(I3DShTreeElement* inTree) = 0;
	virtual void		MCCOMAPI JumpOut() = 0;

	// Animation edition mode support (clips, layers...)
	virtual void					MCCOMAPI SetAnimationEditMode(IExAnimationEditMode* mode) = 0;
	virtual IExAnimationEditMode*	MCCOMAPI GetAnimationEditMode() const = 0;
	virtual void					MCCOMAPI ForceLeaveAnimationEditMode() = 0;

	// Exporter data
	virtual void		MCCOMAPI GetExporter(IDType type, I3DExExportFilter** exporter) = 0;
	virtual int32		MCCOMAPI GetUsedExporterCount() = 0;
	virtual void		MCCOMAPI GetUsedExporterByIndex(int32 index, I3DExExportFilter** exporter) = 0;
	virtual void		MCCOMAPI SetExporterData(I3DExExportFilter* exporter) = 0;
	virtual void		MCCOMAPI SetExporterData(IDType type, const TMCSmartBloc& pmapText) = 0;

	// Scene command
	virtual boolean		MCCOMAPI LaunchSceneCommand(IDType actionNumber) = 0;

	// Pane Part Render Lock
	virtual void		MCCOMAPI LockPanePartRender() = 0;
	virtual void		MCCOMAPI UnlockPanePartRender() = 0;
	virtual boolean		MCCOMAPI ShouldRenderPanePart(I3DEditorHostPanePart* panePart) = 0;
};
/// \}
#else 	//(qDemoVersion) begin scrambled interface

struct ISceneDocument : public IMCUnknown
{
	virtual	void	MCCOMAPI GetScene(I3DShScene**) = 0;
	virtual	I3DShScene*	MCCOMAPI GetScene() = 0;
	virtual void	MCCOMAPI GetJumpInStackTop(I3DShTreeElement** outTree) = 0;		
	virtual void    MCCOMAPI GetSceneSelectionChannel(IChangeChannel**) = 0;
	virtual uint32	MCCOMAPI GetJumpInStackCount() = 0;
	virtual void	MCCOMAPI GetDocumentWindowByID(IMFPart**,IDType inWindowID) = 0;
	virtual void	MCCOMAPI GetModuleByID(I3DShModule**, IDType inModuleID) = 0;
	virtual void	MCCOMAPI GetSceneRenderingModule(I3DRenderingModule** renderingModule) = 0;
	virtual void	MCCOMAPI StartAnimPreview() = 0;
	virtual boolean	MCCOMAPI StopAnimPreview() = 0;
	virtual void	MCCOMAPI GetJumpInOutChannel(IChangeChannel**) = 0;
	virtual void 	MCCOMAPI GetTreeHierarchyChannel(IChangeChannel**) = 0;	
	virtual void 	MCCOMAPI GetSceneSelection(ISceneSelection**) = 0;
	virtual void	MCCOMAPI JumpOut() = 0;	
	virtual void	MCCOMAPI JumpIn(I3DShTreeElement* inTree) = 0;
	virtual void	MCCOMAPI SetExporterData(IDType type, const TMCSmartBloc& pmapText) = 0;
	virtual int32	MCCOMAPI GetUsedExporterCount() = 0;
	virtual boolean	MCCOMAPI LaunchSceneCommand(IDType actionNumber) = 0;
	virtual void	MCCOMAPI GetExporter(IDType type, I3DExExportFilter** exporter) = 0;
	virtual void	MCCOMAPI SetExporterData(I3DExExportFilter* exporter) = 0;
	virtual void	MCCOMAPI GetUsedExporterByIndex(int32 index, I3DExExportFilter** exporter) = 0;
};

#endif	//(qDemoVersion) end scrambled

#endif