// RiAnimPlugin.h : Declaration of the CRiAnimPlugin

#pragma once

/**
@interface IRiAnimPlugin

This interface declares script commands that are added into Rosetta after plugin is initialized. Use this script commands 
*/

[
	object,
	uuid("876D1DB3-9E09-4612-9E99-031F50D97F47"),
	dual, helpstring("IRiAnimPlugin Interface"),
	pointer_default(unique)
]
__interface IRiAnimPlugin : IDispatch
{
	/**
		Creates plugin's animation toolbar.
	*/
    [id(1), helpstring("method CreateAnimToolbar")] HRESULT CreateAnimToolbar(void);

	/**
		Creates procedural clip.
	*/
    [id(2), helpstring("method CreateProcClip")] HRESULT CreateProcClip([in] BSTR bszOwner);
};


// CRiAnimPlugin
[
	ATTRIBUTE_COCLASS,
	threading(both),
	vi_progid("AnimPlugin.RiAnimPlugin"),
	progid("AnimPlugin.RiAnimPlugin.1"),
	version(1.0),
	uuid("52B436D9-1054-4848-994C-013E06878123"),
	helpstring("RiAnimPlugin Class")
]

class ATL_NO_VTABLE CRiAnimPlugin : 
    IMPLEMENT_DISPATCH(IRiAnimPlugin),
    public IRsNamedItem,
	public IRsObject
{
	// system core
	CComPtr<IRsSysCore> m_spSysCore;
	// system factory
	CComPtr<IRsSysFactory> m_spFactory;

	HRESULT CreateCmdObj(const IID* piid, IRsNode** ppCmd);
	HRESULT ProcessCmd(IRsNode* pCmd);

public:
	CRiAnimPlugin()
	{
	}


	//DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

     // IRsObject
    RS_DECLARE_IRS_OBJECT(IRiAnimPlugin, L"AnimPluginNI")

	// IRsNamedItem
	STDMETHOD(get_Name)(BSTR* pVal);

public:

    STDMETHOD(CreateAnimToolbar)(void);
	STDMETHOD(CreateProcClip)(BSTR bszOwner);
};

