michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * Test pararameter passing and argument conversion. michael@0: * michael@0: * Each test method returns the value in 'b', and copies 'a' into 'b'. This lets michael@0: * us test return values, in params, and inout params (out params should be michael@0: * covered by the intersection of return values and inout). michael@0: */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIXPCTestInterfaceA; michael@0: interface nsIXPCTestInterfaceB; michael@0: michael@0: [scriptable, uuid(fe2b7433-ac3b-49ef-9344-b67228bfdd46)] michael@0: interface nsIXPCTestParams : nsISupports { michael@0: michael@0: // These types correspond to the ones in typelib.py michael@0: boolean testBoolean(in boolean a, inout boolean b); michael@0: octet testOctet(in octet a, inout octet b); michael@0: short testShort(in short a, inout short b); michael@0: long testLong(in long a, inout long b); michael@0: long long testLongLong(in long long a, inout long long b); michael@0: unsigned short testUnsignedShort(in unsigned short a, inout unsigned short b); michael@0: unsigned long testUnsignedLong(in unsigned long a, inout unsigned long b); michael@0: unsigned long long testUnsignedLongLong(in unsigned long long a, inout unsigned long long b); michael@0: float testFloat(in float a, inout float b); michael@0: double testDouble(in double a, inout float b); michael@0: char testChar(in char a, inout char b); michael@0: string testString(in string a, inout string b); michael@0: wchar testWchar(in wchar a, inout wchar b); michael@0: wstring testWstring(in wstring a, inout wstring b); michael@0: DOMString testDOMString(in DOMString a, inout DOMString b); michael@0: AString testAString(in AString a, inout AString b); michael@0: AUTF8String testAUTF8String(in AUTF8String a, inout AUTF8String b); michael@0: ACString testACString(in ACString a, inout ACString b); michael@0: jsval testJsval(in jsval a, inout jsval b); michael@0: michael@0: // michael@0: // Dependent parameters use the same types as above, but are handled much differently. michael@0: // michael@0: michael@0: // Test arrays. michael@0: void testShortArray(in unsigned long aLength, [array, size_is(aLength)] in short a, michael@0: inout unsigned long bLength, [array, size_is(bLength)] inout short b, michael@0: out unsigned long rvLength, [retval, array, size_is(rvLength)] out short rv); michael@0: void testDoubleArray(in unsigned long aLength, [array, size_is(aLength)] in double a, michael@0: inout unsigned long bLength, [array, size_is(bLength)] inout double b, michael@0: out unsigned long rvLength, [retval, array, size_is(rvLength)] out double rv); michael@0: void testStringArray(in unsigned long aLength, [array, size_is(aLength)] in string a, michael@0: inout unsigned long bLength, [array, size_is(bLength)] inout string b, michael@0: out unsigned long rvLength, [retval, array, size_is(rvLength)] out string rv); michael@0: void testWstringArray(in unsigned long aLength, [array, size_is(aLength)] in wstring a, michael@0: inout unsigned long bLength, [array, size_is(bLength)] inout wstring b, michael@0: out unsigned long rvLength, [retval, array, size_is(rvLength)] out wstring rv); michael@0: void testInterfaceArray(in unsigned long aLength, [array, size_is(aLength)] in nsIXPCTestInterfaceA a, michael@0: inout unsigned long bLength, [array, size_is(bLength)] inout nsIXPCTestInterfaceA b, michael@0: out unsigned long rvLength, [retval, array, size_is(rvLength)] out nsIXPCTestInterfaceA rv); michael@0: michael@0: // Test sized strings. michael@0: void testSizedString(in unsigned long aLength, [size_is(aLength)] in string a, michael@0: inout unsigned long bLength, [size_is(bLength)] inout string b, michael@0: out unsigned long rvLength, [retval, size_is(rvLength)] out string rv); michael@0: void testSizedWstring(in unsigned long aLength, [size_is(aLength)] in wstring a, michael@0: inout unsigned long bLength, [size_is(bLength)] inout wstring b, michael@0: out unsigned long rvLength, [retval, size_is(rvLength)] out wstring rv); michael@0: michael@0: // Test iid_is. michael@0: void testInterfaceIs(in nsIIDPtr aIID, [iid_is(aIID)] in nsQIResult a, michael@0: inout nsIIDPtr bIID, [iid_is(bIID)] inout nsQIResult b, michael@0: out nsIIDPtr rvIID, [retval, iid_is(rvIID)] out nsQIResult rv); michael@0: michael@0: // Test arrays of iid_is. According to khuey we don't use it for anything michael@0: // in mozilla-central, but calendar stuff depends on it. michael@0: void testInterfaceIsArray(in unsigned long aLength, in nsIIDPtr aIID, michael@0: [array, size_is(aLength), iid_is(aIID)] in nsQIResult a, michael@0: inout unsigned long bLength, inout nsIIDPtr bIID, michael@0: [array, size_is(bLength), iid_is(bIID)] inout nsQIResult b, michael@0: out unsigned long rvLength, out nsIIDPtr rvIID, michael@0: [retval, array, size_is(rvLength), iid_is(rvIID)] out nsQIResult rv); michael@0: };