js/xpconnect/tests/idl/xpctest_params.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 /**
michael@0 6 * Test pararameter passing and argument conversion.
michael@0 7 *
michael@0 8 * Each test method returns the value in 'b', and copies 'a' into 'b'. This lets
michael@0 9 * us test return values, in params, and inout params (out params should be
michael@0 10 * covered by the intersection of return values and inout).
michael@0 11 */
michael@0 12
michael@0 13 #include "nsISupports.idl"
michael@0 14
michael@0 15 interface nsIXPCTestInterfaceA;
michael@0 16 interface nsIXPCTestInterfaceB;
michael@0 17
michael@0 18 [scriptable, uuid(fe2b7433-ac3b-49ef-9344-b67228bfdd46)]
michael@0 19 interface nsIXPCTestParams : nsISupports {
michael@0 20
michael@0 21 // These types correspond to the ones in typelib.py
michael@0 22 boolean testBoolean(in boolean a, inout boolean b);
michael@0 23 octet testOctet(in octet a, inout octet b);
michael@0 24 short testShort(in short a, inout short b);
michael@0 25 long testLong(in long a, inout long b);
michael@0 26 long long testLongLong(in long long a, inout long long b);
michael@0 27 unsigned short testUnsignedShort(in unsigned short a, inout unsigned short b);
michael@0 28 unsigned long testUnsignedLong(in unsigned long a, inout unsigned long b);
michael@0 29 unsigned long long testUnsignedLongLong(in unsigned long long a, inout unsigned long long b);
michael@0 30 float testFloat(in float a, inout float b);
michael@0 31 double testDouble(in double a, inout float b);
michael@0 32 char testChar(in char a, inout char b);
michael@0 33 string testString(in string a, inout string b);
michael@0 34 wchar testWchar(in wchar a, inout wchar b);
michael@0 35 wstring testWstring(in wstring a, inout wstring b);
michael@0 36 DOMString testDOMString(in DOMString a, inout DOMString b);
michael@0 37 AString testAString(in AString a, inout AString b);
michael@0 38 AUTF8String testAUTF8String(in AUTF8String a, inout AUTF8String b);
michael@0 39 ACString testACString(in ACString a, inout ACString b);
michael@0 40 jsval testJsval(in jsval a, inout jsval b);
michael@0 41
michael@0 42 //
michael@0 43 // Dependent parameters use the same types as above, but are handled much differently.
michael@0 44 //
michael@0 45
michael@0 46 // Test arrays.
michael@0 47 void testShortArray(in unsigned long aLength, [array, size_is(aLength)] in short a,
michael@0 48 inout unsigned long bLength, [array, size_is(bLength)] inout short b,
michael@0 49 out unsigned long rvLength, [retval, array, size_is(rvLength)] out short rv);
michael@0 50 void testDoubleArray(in unsigned long aLength, [array, size_is(aLength)] in double a,
michael@0 51 inout unsigned long bLength, [array, size_is(bLength)] inout double b,
michael@0 52 out unsigned long rvLength, [retval, array, size_is(rvLength)] out double rv);
michael@0 53 void testStringArray(in unsigned long aLength, [array, size_is(aLength)] in string a,
michael@0 54 inout unsigned long bLength, [array, size_is(bLength)] inout string b,
michael@0 55 out unsigned long rvLength, [retval, array, size_is(rvLength)] out string rv);
michael@0 56 void testWstringArray(in unsigned long aLength, [array, size_is(aLength)] in wstring a,
michael@0 57 inout unsigned long bLength, [array, size_is(bLength)] inout wstring b,
michael@0 58 out unsigned long rvLength, [retval, array, size_is(rvLength)] out wstring rv);
michael@0 59 void testInterfaceArray(in unsigned long aLength, [array, size_is(aLength)] in nsIXPCTestInterfaceA a,
michael@0 60 inout unsigned long bLength, [array, size_is(bLength)] inout nsIXPCTestInterfaceA b,
michael@0 61 out unsigned long rvLength, [retval, array, size_is(rvLength)] out nsIXPCTestInterfaceA rv);
michael@0 62
michael@0 63 // Test sized strings.
michael@0 64 void testSizedString(in unsigned long aLength, [size_is(aLength)] in string a,
michael@0 65 inout unsigned long bLength, [size_is(bLength)] inout string b,
michael@0 66 out unsigned long rvLength, [retval, size_is(rvLength)] out string rv);
michael@0 67 void testSizedWstring(in unsigned long aLength, [size_is(aLength)] in wstring a,
michael@0 68 inout unsigned long bLength, [size_is(bLength)] inout wstring b,
michael@0 69 out unsigned long rvLength, [retval, size_is(rvLength)] out wstring rv);
michael@0 70
michael@0 71 // Test iid_is.
michael@0 72 void testInterfaceIs(in nsIIDPtr aIID, [iid_is(aIID)] in nsQIResult a,
michael@0 73 inout nsIIDPtr bIID, [iid_is(bIID)] inout nsQIResult b,
michael@0 74 out nsIIDPtr rvIID, [retval, iid_is(rvIID)] out nsQIResult rv);
michael@0 75
michael@0 76 // Test arrays of iid_is. According to khuey we don't use it for anything
michael@0 77 // in mozilla-central, but calendar stuff depends on it.
michael@0 78 void testInterfaceIsArray(in unsigned long aLength, in nsIIDPtr aIID,
michael@0 79 [array, size_is(aLength), iid_is(aIID)] in nsQIResult a,
michael@0 80 inout unsigned long bLength, inout nsIIDPtr bIID,
michael@0 81 [array, size_is(bLength), iid_is(bIID)] inout nsQIResult b,
michael@0 82 out unsigned long rvLength, out nsIIDPtr rvIID,
michael@0 83 [retval, array, size_is(rvLength), iid_is(rvIID)] out nsQIResult rv);
michael@0 84 };

mercurial