/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the IDispatch implementation for XPConnect. * * The Initial Developer of the Original Code is * David Bradley. * Portions created by the Initial Developer are Copyright (C) 2002 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ // XPCIDispatchTest.idl : IDL source for XPCIDispatchTest.dll // // This file will be processed by the MIDL tool to // produce the type library (XPCIDispatchTest.tlb) and marshalling code. import "oaidl.idl"; import "ocidl.idl"; import "objsafe.idl"; [ uuid(83A51226-F49D-488A-8F78-75BB2F927F4C), version(1.0), helpstring("XPCIDispatchTest 1.0 Type Library") ] library IDispatchTestLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ object, uuid(0de5dbae-1d78-45cb-91a2-24516fef2837), dual, helpstring("nsIXPCDispSimple interface"), pointer_default(unique) ] interface nsIXPCDispSimple : IDispatch { [id(1), helpstring("Simple method returning the name of the class")] HRESULT ClassName([out]BSTR * name); [propget, id(2), helpstring("Simple number property")] HRESULT Number([out, retval]long * result); [propput, id(2), helpstring("Simple number property")] HRESULT Number([in]long result); } [ uuid(9F39237C-D179-4260-8EF3-4B6D4D7D5570), helpstring("nsXPCDispSimple Class") ] coclass nsXPCDispSimple { [default] interface nsIXPCDispSimple; }; [ object, uuid(47bf6c99-a30c-4105-8af6-de76dcfdd6dd), dual, helpstring("nsIXPCDispTestMethods interface"), pointer_default(unique) ] interface nsIXPCDispTestMethods : IDispatch { /* Return values test */ [id(1), helpstring("method with no parameters")] HRESULT NoParameters(); [id(2), helpstring("method that returns a string")] HRESULT ReturnBSTR([out, retval]BSTR * result); [id(3), helpstring("method that returns a 32 bit signed integer")] HRESULT ReturnI4([out, retval]int * result); [id(4), helpstring("method that returns an 8 bit unsigned integer")] HRESULT ReturnUI1([out, retval]unsigned char * result); [id(5), helpstring("method that returns a 16 bit signed integer")] HRESULT ReturnI2([out, retval]short * result); [id(6), helpstring("method that returns a 32 bit floating point number")] HRESULT ReturnR4([out, retval]float * result); [id(7), helpstring("method that returns a 64 bit floating point number")] HRESULT ReturnR8([out, retval]double * result); [id(8), helpstring("method that returns a boolean")] HRESULT ReturnBool([out, retval]VARIANT_BOOL * result); [id(9), helpstring("method that returns an IDispatch pointer")] HRESULT ReturnIDispatch([out, retval]IDispatch ** result); [id(10), helpstring("method that returns an error")] HRESULT ReturnError([out, retval]SCODE * result); [id(12), helpstring("method that returns a date")] HRESULT ReturnDate([out, retval]DATE * result); [id(13), helpstring("method that returns an IUnknown")] HRESULT ReturnIUnknown([out, retval]IUnknown ** result); [id(14), helpstring("method that returns a signed 8 bit integer")] HRESULT ReturnI1([out, retval]char * result); [id(15), helpstring("method that returns an unsigned 16 bit integer")] HRESULT ReturnUI2([out, retval]unsigned short * result); [id(16), helpstring("method that returns an unsigned 32 bit integer")] HRESULT ReturnUI4([out, retval]unsigned long * result); [id(17), helpstring("method that returns an integer")] HRESULT ReturnInt([out, retval]int * result); [id(18), helpstring("method that returns an unsigned integer")] HRESULT ReturnUInt([out, retval]unsigned int * result); /* Single input parameter tests */ [id(19), helpstring("method that takes a string")] HRESULT TakesBSTR([in]BSTR result); [id(20), helpstring("method that takes a 32 bit signed integer")] HRESULT TakesI4([in]int result); [id(21), helpstring("method that takes an 8 bit unsigned integer")] HRESULT TakesUI1([in]unsigned char result); [id(22), helpstring("method that takes a 16 bit signed integer")] HRESULT TakesI2([in]short result); [id(23), helpstring("method that takes a 32 bit floating point number")] HRESULT TakesR4([in]float result); [id(24), helpstring("method that takes a 64 bit floating point number")] HRESULT TakesR8([in]double result); [id(25), helpstring("method that takes a boolean")] HRESULT TakesBool([in]VARIANT_BOOL result); [id(26), helpstring("method that takes an IDispatch pointer")] HRESULT TakesIDispatch([in]IDispatch * result); [id(27), helpstring("method that takes an error")] HRESULT TakesError([in]SCODE result); [id(29), helpstring("method that takes a date")] HRESULT TakesDate([in]DATE result); [id(30), helpstring("method that takes an IUnknown")] HRESULT TakesIUnknown([in]IUnknown * result); [id(31), helpstring("method that takes a signed 8 bit integer")] HRESULT TakesI1([in]char result); [id(32), helpstring("method that takes an unsigned 16 bit integer")] HRESULT TakesUI2([in]unsigned short result); [id(33), helpstring("method that takes an unsigned 32 bit integer")] HRESULT TakesUI4([in]unsigned long result); [id(34), helpstring("method that takes an integer")] HRESULT TakesInt([in]int result); [id(35), helpstring("method that takes an unsigned integer")] HRESULT TakesUInt([in]unsigned int result); /* output parameter tests */ [id(36), helpstring("method that outputs a string")] HRESULT OutputsBSTR([out]BSTR * result); [id(37), helpstring("method that outputs a 32 bit signed integer")] HRESULT OutputsI4([out]long * result); [id(38), helpstring("method that outputs an 8 bit unsigned integer")] HRESULT OutputsUI1([out]unsigned char * result); [id(39), helpstring("method that outputs a 16 bit signed integer")] HRESULT OutputsI2([out]short * result); [id(40), helpstring("method that outputs a 32 bit floating point number")] HRESULT OutputsR4([out]float * result); [id(41), helpstring("method that outputs a 64 bit floating point number")] HRESULT OutputsR8([out]double * result); [id(42), helpstring("method that outputs a boolean")] HRESULT OutputsBool([out]VARIANT_BOOL * result); [id(43), helpstring("method that outputs an IDispatch pointer")] HRESULT OutputsIDispatch([out]IDispatch ** result); [id(44), helpstring("method that outputs an error")] HRESULT OutputsError([out]SCODE * result); [id(46), helpstring("method that outputs a date")] HRESULT OutputsDate([out]DATE * result); [id(47), helpstring("method that outputs an IUnknown")] HRESULT OutputsIUnknown([out]IUnknown ** result); [id(48), helpstring("method that outputs a signed 8 bit integer")] HRESULT OutputsI1([out]char * result); [id(49), helpstring("method that outputs an unsigned 16 bit integer")] HRESULT OutputsUI2([out]unsigned short * result); [id(50), helpstring("method that outputs an unsigned 32 bit integer")] HRESULT OutputsUI4([out]unsigned long * result); /* in/outparameter tests */ [id(53), helpstring("method that in/outs a string")] HRESULT InOutsBSTR([in, out]BSTR * result); [id(54), helpstring("method that in/outs a 32 bit signed integer")] HRESULT InOutsI4([in, out]long * result); [id(55), helpstring("method that in/outs an 8 bit unsigned integer")] HRESULT InOutsUI1([in, out]unsigned char * result); [id(56), helpstring("method that in/outs a 16 bit signed integer")] HRESULT InOutsI2([in, out]short * result); [id(57), helpstring("method that in/outs a 32 bit floating point number")] HRESULT InOutsR4([in, out]float * result); [id(58), helpstring("method that in/outs a 64 bit floating point number")] HRESULT InOutsR8([in, out]double * result); [id(59), helpstring("method that in/outs a boolean")] HRESULT InOutsBool([in, out]VARIANT_BOOL * result); [id(60), helpstring("method that in/outs an IDispatch pointer")] HRESULT InOutsIDispatch([in, out]IDispatch ** result); [id(61), helpstring("method that in/outs an error")] HRESULT InOutsError([in, out]SCODE * result); [id(63), helpstring("method that in/outs a date")] HRESULT InOutsDate([in, out]DATE * result); [id(64), helpstring("method that in/outs an IUnknown")] HRESULT InOutsIUnknown([in, out]IUnknown ** result); [id(65), helpstring("method that in/outs a signed 8 bit integer")] HRESULT InOutsI1([in, out]char * result); [id(66), helpstring("method that in/outs an unsigned 16 bit integer")] HRESULT InOutsUI2([in, out]unsigned short * result); [id(67), helpstring("method that in/outs an unsigned 32 bit integer")] HRESULT InOutsUI4([in, out]unsigned long * result); /* input and return tests*/ [id(70), helpstring("method that takes an long and returns it")] HRESULT OneParameterWithReturn([in]long input, [out,retval]long* result); [id(71), helpstring("method that takes a string and returns it")] HRESULT StringInputAndReturn([in]BSTR str, [out, retval]BSTR* result); [id(72), helpstring("method that takes an IDispatch and returns it")] HRESULT IDispatchInputAndReturn([in]IDispatch* input, [out,retval]IDispatch** result); /* Multiple parameters */ [id(73), helpstring("method that takes two parameters")] HRESULT TwoParameters([in]long one, [in]long two); [id(74), helpstring("method that takes 12 input parameters")] HRESULT TwelveInParameters([in]long one, [in]long two, [in]long three, [in]long four, [in]long five, [in]long six, [in]long seven, [in]long eight, [in]long nine, [in]long ten, [in]long eleven, [in]long twelve); [id(75), helpstring("method that takes 12 out parameters")] HRESULT TwelveOutParameters([out]long *one, [out]long *two, [out]long *three, [out]long *four, [out]long *five, [out]long *six, [out]long *seven, [out]long *eight, [out]long *nine, [out]long *ten, [out]long *eleven, [out]long *twelve); [id(76), helpstring("method that takes 12 input string parameters")] HRESULT TwelveStrings([in]BSTR one, [in]BSTR two, [in]BSTR three, [in]BSTR four, [in]BSTR five, [in]BSTR six, [in]BSTR seven, [in]BSTR eight, [in]BSTR nine, [in]BSTR ten, [in]BSTR eleven, [in]BSTR twelve); [id(77), helpstring("method that takes 12 input string parameters")] HRESULT TwelveOutStrings([out]BSTR* one, [out]BSTR* two, [out]BSTR* three, [out]BSTR* four, [out]BSTR* five, [out]BSTR* six, [out]BSTR* seven, [out]BSTR* eight, [out]BSTR* nine, [out]BSTR* ten, [out]BSTR* eleven, [out]BSTR* twelve); [id(78), helpstring("method that takes 12 input string parameters")] HRESULT TwelveIDispatch([in]IDispatch* one, [in]IDispatch* two, [in]IDispatch* three, [in]IDispatch* four, [in]IDispatch* five, [in]IDispatch* six, [in]IDispatch* seven, [in]IDispatch* eight, [in]IDispatch* nine, [in]IDispatch* ten, [in]IDispatch* eleven, [in]IDispatch* twelve); [id(79), helpstring("method that takes 12 input string parameters")] HRESULT TwelveOutIDispatch([out]IDispatch** one, [out]IDispatch** two, [out]IDispatch** three, [out]IDispatch** four, [out]IDispatch** five, [out]IDispatch** six, [out]IDispatch** seven, [out]IDispatch** eight, [out]IDispatch** nine, [out]IDispatch** ten, [out]IDispatch** eleven, [out]IDispatch** twelve); [id(80), helpstring("method that generates an error")] HRESULT CreateError(); } [ uuid(745D1149-9F46-418C-B176-71EAA98974BA), helpstring("nsXPCDispTestMethods Class") ] coclass nsXPCDispTestMethods { [default] interface nsIXPCDispTestMethods; }; [ object, uuid(f876c083-ae00-4b78-93b8-8305980f0864), dual, helpstring("nsIXPCDispTestArrays interface"), pointer_default(unique) ] interface nsIXPCDispTestArrays : IDispatch { [id(1), helpstring("returns a SAFEARRAY")] HRESULT ReturnSafeArray([out, retval]SAFEARRAY(VARIANT)* result); [id(2), helpstring("returns a SAFEARRAY")] HRESULT ReturnSafeArrayBSTR([out, retval]SAFEARRAY(VARIANT)* result); [id(3), helpstring("returns a SAFEARRAY")] HRESULT ReturnSafeArrayIDispatch([out, retval]SAFEARRAY(VARIANT)* result); [id(4), helpstring("method that takes a SAFEARRAY")] HRESULT TakesSafeArray([in]SAFEARRAY(VARIANT) array); [id(5), helpstring("method that takes a SAFEARRAY")] HRESULT TakesSafeArrayBSTR([in]SAFEARRAY(VARIANT) array); [id(6), helpstring("method that takes a SAFEARRAY")] HRESULT TakesSafeArrayIDispatch([in]SAFEARRAY(VARIANT) array); [id(7), helpstring("method that takes a SAFEARRAY")] HRESULT InOutSafeArray([in, out]SAFEARRAY(VARIANT) * array); [id(8), helpstring("method that takes a SAFEARRAY")] HRESULT InOutSafeArrayBSTR([in, out]SAFEARRAY(VARIANT) * array); [id(9), helpstring("method that takes a SAFEARRAY")] HRESULT InOutSafeArrayIDispatch([in, out]SAFEARRAY(VARIANT) * array); } [ uuid(AB085C43-C619-48C8-B68C-C495BDE12DFB), helpstring("nsXPCDispTestArrays Class") ] coclass nsXPCDispTestArrays { [default] interface nsIXPCDispTestArrays; }; [ object, uuid(9782107f-14cc-40b2-b0cd-988d81a46e9e), dual, helpstring("nsIXPCDispTestNoIDispatch interface"), pointer_default(unique) ] interface nsIXPCDispTestNoIDispatch : IUnknown { } [ uuid(7414404F-A4CC-4E3C-9B32-BB20CB22F541), helpstring("nsXPCDispTestNoIDispatch Class") ] coclass nsXPCDispTestNoIDispatch { [default] interface nsIXPCDispTestNoIDispatch; }; [ object, uuid(7830CACE-5019-489D-8B69-029E70CF39B7), dual, helpstring("nsIXPCDispTestProperties Interface"), pointer_default(unique) ] interface nsIXPCDispTestProperties : IDispatch { [propget, id(1), helpstring("property Short")] HRESULT Short([out, retval] short *pVal); [propput, id(1), helpstring("property Short")] HRESULT Short([in] short newVal); [propget, id(2), helpstring("property Long")] HRESULT Long([out, retval] long *pVal); [propput, id(2), helpstring("property Long")] HRESULT Long([in] long newVal); [propget, id(3), helpstring("property Float")] HRESULT Float([out, retval] float *pVal); [propput, id(3), helpstring("property Float")] HRESULT Float([in] float newVal); [propget, id(4), helpstring("property Double")] HRESULT Double([out, retval] double *pVal); [propput, id(4), helpstring("property Double")] HRESULT Double([in] double newVal); [propget, id(5), helpstring("property Currency")] HRESULT Currency([out, retval] CURRENCY *pVal); [propput, id(5), helpstring("property Currency")] HRESULT Currency([in] CURRENCY newVal); [propget, id(6), helpstring("property Date")] HRESULT Date([out, retval] DATE *pVal); [propput, id(6), helpstring("property Date")] HRESULT Date([in] DATE newVal); [propget, id(7), helpstring("property String")] HRESULT String([out, retval] BSTR *pVal); [propput, id(7), helpstring("property String")] HRESULT String([in] BSTR newVal); [propget, id(8), helpstring("property DispatchPtr")] HRESULT DispatchPtr([out, retval] IDispatch* *pVal); [propput, id(8), helpstring("property DispatchPtr")] HRESULT DispatchPtr([in] IDispatch* newVal); [propget, id(9), helpstring("property SCode")] HRESULT SCode([out, retval] SCODE *pVal); [propput, id(9), helpstring("property SCode")] HRESULT SCode([in] SCODE newVal); [propget, id(10), helpstring("property Boolean")] HRESULT Boolean([out, retval] BOOL *pVal); [propput, id(10), helpstring("property Boolean")] HRESULT Boolean([in] BOOL newVal); [propget, id(11), helpstring("property Variant")] HRESULT Variant([out, retval] VARIANT *pVal); [propput, id(11), helpstring("property Variant")] HRESULT Variant([in] VARIANT newVal); [propget, id(12), helpstring("property COMPtr")] HRESULT COMPtr([out, retval] IUnknown* *pVal); [propput, id(12), helpstring("property COMPtr")] HRESULT COMPtr([in] IUnknown* newVal); [propget, id(13), helpstring("property Char")] HRESULT Char([out, retval] unsigned char *pVal); [propput, id(13), helpstring("property Char")] HRESULT Char([in] unsigned char newVal); [propget, id(14), helpstring("property ParameterizedProperty")] HRESULT ParameterizedProperty([in]long aIndex, [out, retval] long *pVal); [propput, id(14), helpstring("property ParameterizedProperty")] HRESULT ParameterizedProperty([in]long aIndex, [in] long newVal); [propget, id(15), helpstring("property ParameterizedPropertyCount")] HRESULT ParameterizedPropertyCount([out, retval] long *pVal); }; [ object, uuid(0797788A-CB08-4995-BD45-7BF8C468DE21), dual, helpstring("nsIXPCDispTestScriptOn Interface"), pointer_default(unique) ] interface nsIXPCDispTestScriptOn : IDispatch { }; [ uuid(2A06373F-3E61-4882-A3D7-A104F70B09ED), helpstring("nsXPCDispTestScriptOn Class") ] coclass nsXPCDispTestScriptOn { [default] interface nsIXPCDispTestScriptOn; }; [ object, uuid(EE6F9DB5-890F-422D-B9DC-9C5AB5A1D654), dual, helpstring("nsIXPCDispTestScriptOff Interface"), pointer_default(unique) ] interface nsIXPCDispTestScriptOff : IDispatch { }; [ object, uuid(D84352CA-1A01-4E72-9072-77AFA669B3AD), dual, helpstring("nsIXPCDispTestWrappedJS Interface"), pointer_default(unique) ] interface nsIXPCDispTestWrappedJS : IDispatch { [id(1), helpstring("method TestParamTypes")] HRESULT TestParamTypes([in] IDispatch * obj, [out, retval]BSTR * errMsg); }; [ uuid(EAEE6BB2-C005-4B91-BCA7-6613236F6F69), helpstring("nsXPCDispTestWrappedJS Class") ] coclass nsXPCDispTestWrappedJS { [default] interface nsIXPCDispTestWrappedJS; }; [ uuid(959CD122-9826-4757-BA09-DE327D55F9E7), helpstring("nsXPCDispTestScriptOff Class") ] coclass nsXPCDispTestScriptOff { [default] interface nsIXPCDispTestScriptOff; }; [ uuid(D8B4265B-1768-4CA9-A285-7CCAEEB51C74), helpstring("nsXPCDispTestProperties Class") ] coclass nsXPCDispTestProperties { [default] interface nsIXPCDispTestProperties; }; };