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