/*===================================================================
Microsoft Denali

Microsoft Confidential.
Copyright 1997 Microsoft Corporation. All Rights Reserved.

Component: MetaUtil object

File: MetaUtil.idl

Owner: t-BrianM

This file contains the MIDL code for the MetaUtil object.
===================================================================*/

import "oaidl.idl";
import "ocidl.idl";

	[
		object,
		uuid(A4FA4E18-EF45-11D0-9E65-00C04FB94FEF),
		dual,
		helpstring("ICheckError Interface"),
		pointer_default(unique)
	]
	interface ICheckError : IDispatch
	{
		[propget, id(1), helpstring("Id of the type of error")] 
		HRESULT Id([out, retval] long *plId);

		[propget, id(2), helpstring("Severity of the error")] 
		HRESULT Severity([out, retval] long *plSeverity);

		[propget, id(3), helpstring("Description of the error")] 
		HRESULT Description([out, retval] BSTR *pbstrDescription);

		[propget, id(4), helpstring("Key where occured")] 
		HRESULT Key([out, retval] BSTR *pbstrKey);

		[propget, id(5), helpstring("Property where occured or 0")] 
		HRESULT Property([out, retval] long *plProperty);
		
	};

	[
		object,
		uuid(A4FA4E11-EF45-11D0-9E65-00C04FB94FEF),
		dual,
		helpstring("ICheckErrorCollection Interface"),
		pointer_default(unique)
	]
	interface ICheckErrorCollection : IDispatch
	{
		[propget, id(DISPID_VALUE), helpstring("Get an error by 1 based index")] 
		HRESULT Item([in] long lIndex, [out, retval] LPDISPATCH *ppIReturn);

		[propget, id(1), helpstring("Number of errors")] 
		HRESULT Count([out, retval] long *plReturn);

		[propget, id(DISPID_NEWENUM), restricted] 
		HRESULT _NewEnum([out, retval] LPUNKNOWN *ppIReturn);
	};

	[
		object,
		uuid(5C3CD722-E6C3-11D0-9E5D-00C04FB94FEF),
		dual,
		helpstring("IProperty Interface"),
		pointer_default(unique)
	]
	interface IProperty : IDispatch
	{
		[propget, id(1), helpstring("Id of property")] 
		HRESULT Id([out, retval] long *plId);

		[propget, id(2), helpstring("Name or property")] 
		HRESULT Name([out, retval] BSTR *pbstrName);

		[propget, id(3), helpstring("Metabase attributes of property")] 
		HRESULT Attributes([out, retval] long *plAttributes);
		[propput, id(3), helpstring("Metabase attributes of property")] 
		HRESULT Attributes([in] long lAttributes);

		[propget, id(4), helpstring("Metabase UserType of property")] 
		HRESULT UserType([out, retval] long *plUserType);
		[propput, id(4), helpstring("Metabase UserType of property")] 
		HRESULT UserType([in] long lUserType);

		[propget, id(5), helpstring("Metabase DataType of property")] 
		HRESULT DataType([out, retval] long *plDataType);
		[propput, id(5), helpstring("Metabase DataType of property")] 
		HRESULT DataType([in] long lDataType);

		[propget, id(6), helpstring("Property data")] 
		HRESULT Data([out, retval] VARIANT *pvarData);
		[propput, id(6), helpstring("Property data")] 
		HRESULT Data([in] VARIANT varData);

		[id(7), helpstring("Write property to metabase")] 
		HRESULT Write();
	};

	[
		object,
		uuid(802D7470-E767-11D0-9E5D-00C04FB94FEF),
		dual,
		helpstring("IPropertyCollection Interface"),
		pointer_default(unique)
	]
	interface IPropertyCollection : IDispatch
	{
		[propget, id(DISPID_VALUE), helpstring("Get a property by 1 based index")] 
		HRESULT Item([in] long lIndex, [out, retval] LPDISPATCH *ppIReturn);

		[propget, id(1), helpstring("Count the properties")] 
		HRESULT Count([out, retval] long *plReturn);

		[propget, id(DISPID_NEWENUM), restricted] 
		HRESULT _NewEnum([out, retval] LPUNKNOWN *ppIReturn);

		[id(2), helpstring("Get a property by Id or Name")] 
		HRESULT Get([in] VARIANT varId, [out, retval] IProperty **ppIReturn);

		[id(3), helpstring("Add a property to the collection's base key")] 
		HRESULT Add([in] VARIANT varId, [out, retval] IProperty **ppIReturn);

		[id(4), helpstring("Delete a property from the collection's base key")] 
		HRESULT Remove([in] VARIANT varId);
	};

	[
		object,
		uuid(1C733DD0-E1B5-11D0-9E58-00C04FB94FEF),
		dual,
		helpstring("IKeyCollection Interface"),
		pointer_default(unique)
	]
	interface IKeyCollection : IDispatch
	{

		[propget, id(DISPID_VALUE), helpstring("Get a key by 1 based index")] 
		HRESULT Item([in] long lIndex, [out, retval] BSTR *pbstrRetKey);

		[propget, id(1), helpstring("Count the keys")] 
		HRESULT Count([out, retval] long *plReturn);

		[propget, id(DISPID_NEWENUM), restricted] 
		HRESULT _NewEnum([out, retval] LPUNKNOWN *ppIReturn);

		[id(2), helpstring("Create a key relative to the collection's base key")] 
		HRESULT Add([in] BSTR bstrRelKey);

		[id(3), helpstring("Delete a key relative to the collection's base key")] 
		HRESULT Remove([in] BSTR bstrRelKey);
	};

	[
		object,
		uuid(B40F6F4D-E116-11D0-9E58-00C04FB94FEF),
		dual,
		helpstring("IMetaUtil Interface"),
		pointer_default(unique)
	]
	interface IMetaUtil : IDispatch
	{
		[id(1), helpstring("Flat, non-recursive enumeration of keys")] 
		HRESULT EnumKeys([in] BSTR bstrBaseKey, [out, retval] IKeyCollection **ppIReturn);

		[id(2), helpstring("Depth first, recursive enumeration of keys")] 
		HRESULT EnumAllKeys([in] BSTR bstrBaseKey, [out, retval] IKeyCollection **ppIReturn);

		[id(3), helpstring("Enumerate properties of a key")] 
		HRESULT EnumProperties([in] BSTR bstrKey, [out, retval] IPropertyCollection **ppIReturn);

		[id(4), helpstring("Create a key")] 
		HRESULT CreateKey([in] BSTR bstrKey);

		[id(5), helpstring("Delete a key")] 
		HRESULT DeleteKey([in] BSTR bstrKey);

		[id(6), helpstring("Rename a key")] 
		HRESULT RenameKey([in] BSTR bstrOldName, [in] BSTR bstrNewName);

		[id(7), helpstring("Copy a key")] 
		HRESULT CopyKey([in] BSTR bstrSrcKey, [in] BSTR bstrDestKey, [in] BOOL fOverwrite);

		[id(8), helpstring("Move a key")] 
		HRESULT MoveKey([in] BSTR bstrSrcKey, [in] BSTR bstrDestKey, [in] BOOL fOverwrite);

		[id(9), helpstring("Get a property")] 
		HRESULT GetProperty([in] BSTR bstrKey, [in] VARIANT varId, [out, retval] IProperty **ppIReturn);

		[id(10), helpstring("Create a property")] 
		HRESULT CreateProperty([in] BSTR bstrKey, [in] VARIANT varId, [out, retval] IProperty **ppIReturn);

		[id(11), helpstring("Delete a property")] 
		HRESULT DeleteProperty([in] BSTR Key, [in] VARIANT varId);

		[id(12), helpstring("Check a metabase schema for errors")] 
		HRESULT CheckSchema([in] BSTR bstrMachine, [out, retval] ICheckErrorCollection **ppIReturn);

		[id(13), helpstring("Check a metabase key for errors")] 
		HRESULT CheckKey([in] BSTR bstrKey, [out, retval] ICheckErrorCollection **ppIReturn);

		[id(14), helpstring("Expand an environment string")] 
		HRESULT ExpandString([in] BSTR bstrIn, [out, retval] BSTR *pbstrRet);

		[id(15), helpstring("Translate a property id to a name")] 
		HRESULT PropIdToName([in] BSTR bstrKey, [in] long lId, [out, retval] BSTR *pbstrName);

		[id(16), helpstring("Translate a property name to an id")] 
		HRESULT PropNameToId([in] BSTR bstrKey, [in] BSTR bstrName, [out, retval] long *plId);

		[propget, id(17), helpstring("Get a configuration setting")] 
		HRESULT Config([in] BSTR bstrSetting, [out, retval] VARIANT *pvarValue);
		[propput, id(17), helpstring("Set a configuration setting")] 
		HRESULT Config([in] BSTR bstrSetting, [in] VARIANT varValue);
	};

[
	uuid(B40F6F40-E116-11D0-9E58-00C04FB94FEF),
	version(1.0),
	helpstring("IISSample MetaUtil Object Library")
]
library MetaUtil
{
	importlib("stdole2.tlb");

	[
		uuid(8C4B7ADF-E10B-11D0-9E58-00C04FB94FEF),
		helpstring("MetaUtil Class")
	]
	coclass MetaUtil
	{
		[default] interface IMetaUtil;
	};

	[
		uuid(A4FA4E19-EF45-11D0-9E65-00C04FB94FEF),
		helpstring("CheckError Class")
	]
	coclass CheckError
	{
		[default] interface ICheckError;
	};
};
