
#include "nsISupports.idl"

/* XXX should be built in */
native nsID(nsID *);

[scriptable, uuid(159E36D0-991E-11d2-AC3F-00C09300144B)]
interface nsITestXPCFoo : nsISupports {
    long Test(in long p1, in long p2);
    void Test2();

    attribute string Foo;

    const short one = 1;
    const short five = 5;
    const short six = 6;
};

[scriptable, uuid(5F9D20C0-9B6B-11d2-9FFE-000064657374)]
interface nsITestXPCFoo2 : nsITestXPCFoo {
};


[scriptable, uuid(CD2F2F40-C5D9-11d2-9838-006008962422)]
interface nsIEcho : nsISupports {

    void SetReceiver(in nsIEcho aReceiver);
    void SendOneString(in string str);
    long In2OutOneInt(in long input);

    long In2OutAddTwoInts(in  long input1,  in  long input2,
                          out long output1, out long output2);

    string In2OutOneString(in string input);
    void SimpleCallNoEcho();
    void SendManyTypes(in octet                 p1,
                       in short                 p2,
                       in long                  p3,
                       in long long             p4,
                       in octet                 p5,
                       in unsigned short        p6,
                       in unsigned long         p7,
                       in unsigned long long    p8,
                       in float                 p9,
                       in double                p10,
                       in boolean               p11,
                       in char                  p12,
                       in wchar                 p13,
                       in nsID                  p14,
                       in string                p15,
                       in wstring               p16);

    void SendInOutManyTypes(inout octet                 p1,
                            inout short                 p2,
                            inout long                  p3,
                            inout long long             p4,
                            inout octet                 p5,
                            inout unsigned short        p6,
                            inout unsigned long         p7,
                            inout unsigned long long    p8,
                            inout float                 p9,
                            inout double                p10,
                            inout boolean               p11,
                            inout char                  p12,
                            inout wchar                 p13,
                            inout nsID                  p14,
                            inout string                p15,
                            inout wstring               p16);
    
    void MethodWithNative(in long p1, in voidStar p2);
    void ReturnCode(in long code);
    void FailInJSTest(in long fail);
    void SharedString([retval, shared] out string str);

    void ReturnCode_NS_OK();
    void ReturnCode_NS_COMFALSE();
    void ReturnCode_NS_ERROR_NULL_POINTER();
    void ReturnCode_NS_ERROR_UNEXPECTED();
    void ReturnCode_NS_ERROR_OUT_OF_MEMORY();

    nsISupports ReturnInterface(in nsISupports obj);
};

/***************************************************************************/

[scriptable, uuid(83849a30-0d6e-11d3-bab8-00805f8a5dd7)]
interface nsIXPCTestParent : nsISupports {
    void method1(in short i);
    void method1a(in nsIXPCTestParent foo);
};

[scriptable, uuid(9ddf0f00-0d6e-11d3-bab8-00805f8a5dd7)]
interface nsIXPCTestChild : nsIXPCTestParent {
    void method2(in short i, in short j);
};

[scriptable, uuid(7bca65e0-0d73-11d3-bab8-00805f8a5dd7)]
interface nsIXPCTestOther : nsISupports {
    void method3(in short i, in short j, in short k);
};

[scriptable, uuid(1e4cf7b0-237a-11d3-9879-006008962422)]
interface nsIXPCTestNoisy : nsISupports {
    void squawk();
};

[scriptable, uuid(d970e910-30d8-11d3-9885-006008962422)]
interface nsIXPCTestString : nsISupports {
    string GetStringA();
    void GetStringB(out string s);
    void GetStringC([shared,retval] out string s);
};
