/* ***** 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
*
* 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 Python XPCOM language bindings.
*
* The Initial Developer of the Original Code is
* ActiveState Tool Corp.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Hammond <MarkH@ActiveState.com> (original author)
*
* 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 ***** */
// NOTE: This is a TEST interface, not a DEMO interface :-)
// We try to get as many data-types etc exposed, meaning this
// doesnt really make a good demo of a "simple component"
#include "nsISupports.idl"
#include "nsIVariant.idl"
interface nsIPythonTestInterface : nsISupports
{
// Some constants for us to test - one for every type supported by xpidl
const short One = 1;
const long Two = 2;
const long MinusOne = -1;
const long BigLong = 0x7FFFFFFF;
const long BiggerLong = 0xFFFFFFFF;
// Declare every type supported as an attribute.
unsigned short do_unsigned_short(in unsigned short p1, inout unsigned short p2, out unsigned short p3);
unsigned long long do_unsigned_long_long(in unsigned long long p1, inout unsigned long long p2, out unsigned long long p3);
nsIPythonTestInterface do_nsIPythonTestInterface(in nsIPythonTestInterface p1, inout nsIPythonTestInterface p2, out nsIPythonTestInterface p3);
// Do I really need these??
// void do_nsISupportsIs2(inout nsIIDRef iid, [iid_is(iid)] inout nsQIResult result);
// void do_nsISupportsIs3(out nsIIDRef iid, [iid_is(iid)] inout nsQIResult result);
// void do_nsISupportsIs4(out nsIIDRef iid, [iid_is(iid)] out nsQIResult result);
};
// Another interface - we use another interface purely for testing purposes -
// We ensure that the entire interface hierarcy is available correctly.
interface nsIPythonTestInterfaceExtra : nsIPythonTestInterface
{
// These were copied from the XPCOM test 'xpctest.idl'
// (and a few extras added)
// Note that this method shares a single "size_is" between 2 params!
// One count, one inout array.
// One in count and in array, plus out count and out array
// As per DoubleString2, but out string also marked retval
// One in array, one out array, one share inout count.
void DoubleString4([size_is(count)] in string in_str, inout PRUint32 count, [size_is(count)] out string out_str);
// UpString defines the count as only "in" - meaning the result must be the same size
// UpString2 defines count as only "in", and a string as only "out"
// Test we can get an "out" array with an "in" size (and the size is not used anywhere as a size for an in!)
void DoubleWideString4([size_is(count)] in wstring in_str, inout PRUint32 count, [size_is(count)] out wstring out_str);
// UpWideString defines the count as only "in" - meaning the result must be the same size
// UpWideString2 defines count as only "in", and a string as only "out"
// Test we can get an "out" array with an "in" size (and the size is not used anywhere as a size for an in!)
// Arrays of interfaces
// Arrays of IIDs
// More specific tests.
// Test our count param can be shared as an "in" param.
void SumArrays(in PRUint32 count, [array, size_is(count)]in PRInt32 array1, [array, size_is(count)]in PRInt32 array2, [retval]out PRInt32 result);
// Test our count param can be shared as an "out" param.
void GetArrays(out PRUint32 count, [array, size_is(count)]out PRInt32 array1, [array, size_is(count)]out PRInt32 array2);
// Test we can get an "out" array with an "in" size (and the size is not used anywhere as a size for an in!)
// Test our "in" count param can be shared as one "in", plus one "out" param.
void CopyArray(in PRUint32 count, [array, size_is(count)]in PRInt32 array1, [array, size_is(count)]out PRInt32 array2);
// Test our "in-out" count param can be shared as one "in", plus one "out" param.
void CopyAndDoubleArray(inout PRUint32 count, [array, size_is(count)]in PRInt32 array1, [array, size_is(count)]out PRInt32 array2);
// Test our "in-out" count param can be shared as one "in", plus one "in-out" param.
void AppendArray(inout PRUint32 count, [array, size_is(count)]in PRInt32 array1, [array, size_is(count)]inout PRInt32 array2);
};
// DOM String support is a "recent" (01/2001) addition to XPCOM. These test
// have their own interface for no real good reason ;-)
{
};