/*
 * $Id: asecom.idl,v 1.10 2007/10/10 13:22:12 bacon Exp $
 */

import "oaidl.idl";
import "ocidl.idl";
	
/* IAwk */
[
	object,
	uuid(05BC1C9F-7C4E-4F77-B186-2E0FD26C0641),
	dual,
	helpstring("ASE Awk Interface"),
	pointer_default(unique)
]
interface IAwk : IDispatch
{
	[id(1), helpstring("method Parse")] 
	HRESULT Parse([out,retval] VARIANT_BOOL* ret);

	[id(2), helpstring("method Run")] 
	HRESULT Run([in] VARIANT argarray, [out,retval] VARIANT_BOOL* ret);

	[id(3), helpstring("method AddGlobal")] 
	HRESULT AddGlobal([in] BSTR name, [out,retval] VARIANT_BOOL* ret);

	[id(4), helpstring("method DeleteGlobal")] 
	HRESULT DeleteGlobal([in] BSTR name, [out,retval] VARIANT_BOOL* ret);

	[id(5), helpstring("method AddFunction")] 
	HRESULT AddFunction([in] BSTR name, [in] int minArgs, [in] int maxArgs, [out,retval] VARIANT_BOOL* ret);

	[id(6), helpstring("method DeleteFunction")] 
	HRESULT DeleteFunction([in] BSTR name, [out,retval] VARIANT_BOOL* ret);


	[id(7), helpstring("method SetWord")]
	HRESULT SetWord([in] BSTR ow, [in] BSTR nw, [out,retval] VARIANT_BOOL* ret);

	[id(8), helpstring("method UnsetWord")]
	HRESULT UnsetWord([in] BSTR ow, [out,retval] VARIANT_BOOL* ret);

	[id(9), helpstring("method UnsetAllWords")]
	HRESULT UnsetAllWords([out,retval] VARIANT_BOOL* ret);

	[propget, id(10), helpstring("property ErrorCode")] 
	HRESULT ErrorCode([out,retval] int *pVal);

	[propget, id(11), helpstring("property ErrorLine")] 
	HRESULT ErrorLine([out,retval] int *pVal);

	[propget, id(12), helpstring("property ErrorMessage")] 
	HRESULT ErrorMessage([out,retval] BSTR *pVal);

	[propget, id(13), helpstring("property ImplicitVariable")] 
	HRESULT ImplicitVariable([out,retval] VARIANT_BOOL *pVal);
	[propput, id(13), helpstring("property ImplicitVariable")] 
	HRESULT ImplicitVariable([in] VARIANT_BOOL newVal);

	[propget, id(14), helpstring("property ExplicitVariable")]
	HRESULT ExplicitVariable([out,retval] VARIANT_BOOL *pVal);
	[propput, id(14), helpstring("property ExplicitVariable")] 
	HRESULT ExplicitVariable([in] VARIANT_BOOL newVal);

	[propget, id(17), helpstring("property ShiftOperators")]
	HRESULT ShiftOperators([out,retval] VARIANT_BOOL *pVal);
	[propput, id(17), helpstring("property ShiftOperators")] 
	HRESULT ShiftOperators([in] VARIANT_BOOL newVal);

	[propget, id(18), helpstring("property IdivOperator")]
	HRESULT IdivOperator([out,retval] VARIANT_BOOL *pVal);
	[propput, id(18), helpstring("property IdivOperator")]
	HRESULT IdivOperator([in] VARIANT_BOOL newVal);

	[propget, id(19), helpstring("property ConcatString")]
	HRESULT ConcatString([out,retval] VARIANT_BOOL *pVal);
	[propput, id(19), helpstring("property ConcatString")]
	HRESULT ConcatString([in] VARIANT_BOOL newVal);

	[propget, id(20), helpstring("property SupportExtio")]
	HRESULT SupportExtio([out,retval] VARIANT_BOOL *pVal);
	[propput, id(20), helpstring("property SupportExtio")]
	HRESULT SupportExtio([in] VARIANT_BOOL newVal);

	[propget, id(21), helpstring("property SupportBlockless")]
	HRESULT SupportBlockless([out,retval] VARIANT_BOOL *pVal);
	[propput, id(21), helpstring("property SupportBlockless")]
	HRESULT SupportBlockless([in] VARIANT_BOOL newVal);

	[propget, id(22), helpstring("property BaseOne")]
	HRESULT BaseOne([out,retval] VARIANT_BOOL *pVal);
	[propput, id(22), helpstring("property BaseOne")]
	HRESULT BaseOne([in] VARIANT_BOOL newVal);

	[propget, id(23), helpstring("property StripSpaces")]
	HRESULT StripSpaces([out,retval] VARIANT_BOOL *pVal);
	[propput, id(23), helpstring("property StripSpaces")]
	HRESULT StripSpaces([in] VARIANT_BOOL newVal);

	[propget, id(24), helpstring("property EnableNextofile")]
	HRESULT EnableNextofile([out,retval] VARIANT_BOOL *pVal);
	[propput, id(24), helpstring("property EnableNextofile")]
	HRESULT EnableNextofile([in] VARIANT_BOOL newVal);

	[propget, id(25), helpstring("property UseCrlf")]
	HRESULT UseCrlf([out,retval] VARIANT_BOOL *pVal);
	[propput, id(25), helpstring("property UseCrlf")]
	HRESULT UseCrlf([in] VARIANT_BOOL newVal);

	[propget, id(26), helpstring("property ArgumentsToEntryPoint")]
	HRESULT ArgumentsToEntryPoint([out,retval] VARIANT_BOOL *pVal);
	[propput, id(26), helpstring("property ArgumentsToEntryPoint")]
	HRESULT ArgumentsToEntryPoint([in] VARIANT_BOOL newVal);

	[propget, id(27), helpstring("property EnableReset")]
	HRESULT EnableReset([out,retval] VARIANT_BOOL *pVal);
	[propput, id(27), helpstring("property EnableReset")]
	HRESULT EnableReset([in] VARIANT_BOOL newVal);

	[propget, id(28), helpstring("property AllowMapToVar")]
	HRESULT AllowMapToVar([out,retval] VARIANT_BOOL *pVal);
	[propput, id(28), helpstring("property AllowMapToVar")]
	HRESULT AllowMapToVar([in] VARIANT_BOOL newVal);

	[propget, id(29), helpstring("property SupportPatternActionBlock")]
	HRESULT SupportPatternActionBlock([out,retval] VARIANT_BOOL *pVal);
	[propput, id(29), helpstring("property SupportPatternActioinBlock")]
	HRESULT SupportPatternActionBlock([in] VARIANT_BOOL newVal);

	[propget, id(30), helpstring("property MaxDepthForBlockParse")]
	HRESULT MaxDepthForBlockParse([out,retval] int *pVal);
	[propput, id(30), helpstring("property MaxDepthForBlockParse")]
	HRESULT MaxDepthForBlockParse([in] int newVal);

	[propget, id(31), helpstring("property MaxDepthForBlockRun")]
	HRESULT MaxDepthForBlockRun([out,retval] int *pVal);
	[propput, id(31), helpstring("property MaxDepthForBlockRun")]
	HRESULT MaxDepthForBlockRun([in] int newVal);

	[propget, id(32), helpstring("property MaxDepthForExprParse")]
	HRESULT MaxDepthForExprParse([out,retval] int *pVal);
	[propput, id(32), helpstring("property MaxDepthForExprParse")]
	HRESULT MaxDepthForExprParse([in] int newVal);

	[propget, id(33), helpstring("property MaxDepthForExprRun")]
	HRESULT MaxDepthForExprRun([out,retval] int *pVal);
	[propput, id(33), helpstring("property MaxDepthForExprRun")]
	HRESULT MaxDepthForExprRun([in] int newVal);

	[propget, id(34), helpstring("property MaxDepthForRexBuild")]
	HRESULT MaxDepthForRexBuild([out,retval] int *pVal);
	[propput, id(34), helpstring("property MaxDepthForRexBuild")]
	HRESULT MaxDepthForRexBuild([in] int newVal);

	[propget, id(35), helpstring("property MaxDepthForRexMatch")]
	HRESULT MaxDepthForRexMatch([out,retval] int *pVal);
	[propput, id(35), helpstring("property MaxDepthForRexMatch")]
	HRESULT MaxDepthForRexMatch([in] int newVal);

	[propget, id(36), helpstring("property EntryPoint")]
	HRESULT EntryPoint([out,retval] BSTR *pVal);
	[propput, id(36), helpstring("property EntryPoint")]
	HRESULT EntryPoint([in] BSTR newVal);

	[propget, id(37), helpstring("property Debug")]
	HRESULT Debug([out,retval] VARIANT_BOOL *pVal);
	[propput, id(37), helpstring("property Debug")]
	HRESULT Debug([in] VARIANT_BOOL newVal);

	[propget, id(38), helpstring("property UseLongLong")]
	HRESULT UseLongLong([out,retval] VARIANT_BOOL *pVal);
	[propput, id(38), helpstring("property UseLongLong")]
	HRESULT UseLongLong([in] VARIANT_BOOL newVal);
};

/* ASECOM */
[
	uuid(F9C69806-16A1-4162-998A-876B33C470BF),
	version(1.0),
	helpstring("ASECOM 1.0 Type Library")
]
library ASECOM
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[helpstring("Awk source mode")]
	typedef [v1_enum] enum AwkSourceMode
	{
		AWK_SOURCE_READ = 0,
		AWK_SOURCE_WRITE = 1
	} AwkSourceMode;

	[helpstring("AwkExtio type")]
	typedef [v1_enum] enum AwkExtioType
	{
		AWK_EXTIO_PIPE = 0,
		AWK_EXTIO_COPROC = 1,
		AWK_EXTIO_FILE = 2,
		AWK_EXTIO_CONSOLE = 3
	} AwkExtioType;

	[helpstring("AwkExtio mode")]
	typedef [v1_enum] enum AwkExtioMode
	{
		AWK_EXTIO_PIPE_READ = 0,
		AWK_EXTIO_PIPE_WRITE = 1,

		AWK_EXTIO_COPROC_READ = 0,
		AWK_EXTIO_COPROC_WRITE = 1,
		AWK_EXTIO_COPROC_RDWR = 2,

		AWK_EXTIO_FILE_READ = 0,
		AWK_EXTIO_FILE_WRITE = 1,
		AWK_EXTIO_FILE_APPEND = 2,

		AWK_EXTIO_CONSOLE_READ = 0,
		AWK_EXTIO_CONSOLE_WRITE = 1
	} AwkExtioMode;

	/* IBuffer */
	[
		object,
		uuid(AD5EA986-37E9-410E-A78E-21799104293A),
		dual,
		helpstring("IBuffer Interface"),
		pointer_default(unique)
	]
	interface IBuffer : IDispatch
	{
		[propget, id(1), helpstring("property Value")]
		HRESULT Value([out,retval] BSTR *pVal);

		[propput, id(1), helpstring("property Value")]
		HRESULT Value([in] BSTR newVal);
	};

	/* IAwkExtio */
	[
		object,
		uuid(BE0B91FF-9944-4DFC-A55B-1FE14E24AFEE),
		dual,
		helpstring("IAwkExtio Interface"),
		pointer_default(unique)
	]
	interface IAwkExtio : IDispatch
	{
		[propget, id(1), helpstring("property Name")]
		HRESULT Name([out,retval] BSTR *pVal);

		[propget, id(2), helpstring("property Type")]
		HRESULT Type([out,retval] AwkExtioType *pVal);

		[propget, id(3), helpstring("property Mode")]
		HRESULT Mode([out,retval] AwkExtioMode *pVal);

		[propget, id(4), helpstring("property Handle")]
		HRESULT Handle([out,retval] VARIANT *pVal);
		[propput, id(4), helpstring("property Handle")]
		HRESULT Handle([in] VARIANT newVal);
	};

	/* IAwkEvents */
	[ 
		uuid(1351DC8F-10AD-4C40-A2FA-9A2E89C27AC8),
		helpstring("ASE Awk Events Interface")
	]
	dispinterface IAwkEvents
	{
	properties:
	methods:
		[id(1), helpstring("open the source code")]
		HRESULT OpenSource([in] AwkSourceMode mode, [out,retval] int* ret);

		[id(2), helpstring("close the source code")]
		HRESULT CloseSource([in] AwkSourceMode mode, [out,retval] int* ret);

		[id(3), helpstring("read the source code")]
		HRESULT ReadSource([in] IBuffer* buf, [out,retval] int* ret);

		[id(4), helpstring("write the source code")]
		HRESULT WriteSource([in] IBuffer* buf, [out,retval] int* ret);

		[id(5), helpstring("method OpenExtio")]
		HRESULT OpenExtio([in] IAwkExtio* extio, [out,retval] int* ret);

		[id(6), helpstring("method CloseExtio")]
		HRESULT CloseExtio([in] IAwkExtio* extio, [out,retval] int* ret);

		[id(7), helpstring("method ReadExtio")]
		HRESULT ReadExtio([in] IAwkExtio* extio, [in] IBuffer* buf, [out,retval] int* ret);

		[id(8), helpstring("method WriteExtio")]
		HRESULT WriteExtio([in] IAwkExtio* extio, [in] IBuffer* buf, [out,retval] int* ret);

		[id(9), helpstring("method FlushExtio")]
		HRESULT FlushExtio([in] IAwkExtio* extio, [out,retval] int* ret);

		[id(10), helpstring("method NextExtio")]
		HRESULT NextExtio([in] IAwkExtio* extio, [out,retval] int* ret);

		[id(11), helpstring("method HandleFunction")]
		HRESULT HandleFunction([in] BSTR name, [in] VARIANT argarray, [out,retval] VARIANT* ret);

		/*[id(12), helpstring("method OnClose")] 
		HRESULT OnClose([out,retval] int* ret);*/
	};

	/* Awk */
	[
		uuid(AD863B53-F5EC-45C3-8B1C-6AC678227DC8),
		helpstring("ASE Awk Class")
	]
	coclass Awk
	{
		[default] interface IAwk;
		[default,source] dispinterface IAwkEvents;
	};

	/* AwkExtio */
	[
		uuid(F52F065A-5FD4-4F4D-AFEA-F5E446B16383),
		helpstring("ASE AwkExtio Class")
	]
	coclass AwkExtio
	{
		[default] interface IAwkExtio;
	};

	/* Buffer */
	[
		uuid(866B79A7-7628-4808-8AE7-784BE2491C80),
		helpstring("ASE Buffer Class")
	]
	coclass Buffer
	{
		[default] interface IBuffer;
	};
};