Back to index

lightning-sunbird  0.9+nobinonly
xpctest.idl
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1999
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   John Bandhauer <jband@netscape.com>
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #include "nsISupports.idl"
00042 #include "xpcexception.idl"
00043 #include "nsIVariant.idl"
00044 #include "nsIPropertyBag.idl"
00045 
00046 // forward declaration (to test that such things work)
00047 interface nsITestXPCSomeUselessThing;
00048 
00049 // Note the use of [function] for this scriptable function callback declaration
00050 [scriptable, function, uuid(4407fc90-1e41-11d5-909d-0010a4e73d9a)]
00051 interface nsITestXPCFunctionCallback : nsISupports {
00052     void call(in string s);
00053     void callWithThis(in nsISupports self, in string s);
00054 };
00055 
00056 [scriptable, uuid(159E36D0-991E-11d2-AC3F-00C09300144B)]
00057 interface nsITestXPCFoo : nsISupports {
00058     long Test(in long p1, in long p2);
00059     void Test2();
00060 
00061     attribute string Foo;
00062 
00063     const short one = 1;
00064     const short five = 5;
00065     const short six = 6;
00066 };
00067 
00068 [scriptable, uuid(5F9D20C0-9B6B-11d2-9FFE-000064657374)]
00069 interface nsITestXPCFoo2 : nsITestXPCFoo {
00070 };
00071 
00072 [scriptable, uuid(CD2F2F40-C5D9-11d2-9838-006008962422)]
00073 interface nsIEcho : nsISupports {
00074     void SetReceiver(in nsIEcho aReceiver);
00075     void SendOneString(in string str);
00076     long In2OutOneInt(in long input);
00077 
00078     long In2OutAddTwoInts(in  long input1,  in  long input2,
00079                           out long output1, out long output2);
00080 
00081     string In2OutOneString(in string input);
00082 
00083     DOMString In2OutOneDOMString(in DOMString input);
00084     DOMString EchoIn2OutOneDOMString(in DOMString input);
00085 
00086     AString In2OutOneAString(in AString input);
00087     AString EchoIn2OutOneAString(in AString input);
00088 
00089     AUTF8String In2OutOneUTF8String(in AUTF8String input);
00090     AUTF8String EchoIn2OutOneUTF8String(in AUTF8String input);
00091 
00092     ACString In2OutOneCString(in ACString input);
00093     ACString EchoIn2OutOneCString(in ACString input);
00094 
00095     void SimpleCallNoEcho();
00096     void SendManyTypes(in octet                 p1,
00097                        in short                 p2,
00098                        in long                  p3,
00099                        in long long             p4,
00100                        in octet                 p5,
00101                        in unsigned short        p6,
00102                        in unsigned long         p7,
00103                        in unsigned long long    p8,
00104                        in float                 p9,
00105                        in double                p10,
00106                        in boolean               p11,
00107                        in char                  p12,
00108                        in wchar                 p13,
00109                        in nsIDPtr               p14,
00110                        in string                p15,
00111                        in wstring               p16);
00112 
00113     void SendInOutManyTypes(inout octet                 p1,
00114                             inout short                 p2,
00115                             inout long                  p3,
00116                             inout long long             p4,
00117                             inout octet                 p5,
00118                             inout unsigned short        p6,
00119                             inout unsigned long         p7,
00120                             inout unsigned long long    p8,
00121                             inout float                 p9,
00122                             inout double                p10,
00123                             inout boolean               p11,
00124                             inout char                  p12,
00125                             inout wchar                 p13,
00126                             inout nsIDPtr               p14,
00127                             inout string                p15,
00128                             inout wstring               p16);
00129 
00130     [noscript] void MethodWithNative(in long p1, in voidPtr p2);
00131     void ReturnCode(in long code);
00132     void FailInJSTest(in long fail);
00133     void SharedString([retval, shared] out string str);
00134 
00135     void ReturnCode_NS_OK();
00136     void ReturnCode_NS_ERROR_NULL_POINTER();
00137     void ReturnCode_NS_ERROR_UNEXPECTED();
00138     void ReturnCode_NS_ERROR_OUT_OF_MEMORY();
00139 
00140     nsISupports ReturnInterface(in nsISupports obj);
00141 
00142     nsIStackFrame GetStack();
00143     void SetReceiverReturnOldReceiver(inout nsIEcho aReceiver);
00144 
00145     void MethodWithForwardDeclaredParam(in nsITestXPCSomeUselessThing sut);
00146 
00147     void PseudoQueryInterface(in nsIIDRef uuid, 
00148                               [iid_is(uuid),retval] out nsQIResult result);
00149 
00150     void DebugDumpJSStack();
00151 
00152     void printArgTypes(/* optional params */);
00153     void throwArg(/* optional param */);
00154 
00155     void callReceiverSometimeLater();
00156 
00157     readonly attribute short throwInGetter;
00158 
00159     attribute string aString;
00160     attribute PRInt32 SomeValue;
00161 
00162     const short one = 1;
00163     const short five = 5;
00164     const short six = 6;
00165     const PRUint32 medium = 12345;
00166     const PRUint32 big = 0xFFFFFFFF;
00167 
00168     void callFunction(in nsITestXPCFunctionCallback callback, in string s);
00169     void callFunctionWithThis(in nsITestXPCFunctionCallback callback, 
00170                               in nsISupports self, in string s);
00171 };
00172 
00173 /***************************************************************************/
00174 
00175 [scriptable, uuid(83849a30-0d6e-11d3-bab8-00805f8a5dd7)]
00176 interface nsIXPCTestParent : nsISupports {
00177     void method1(in short i);
00178     void method1a(in nsIXPCTestParent foo);
00179 };
00180 
00181 [scriptable, uuid(9ddf0f00-0d6e-11d3-bab8-00805f8a5dd7)]
00182 interface nsIXPCTestChild : nsIXPCTestParent {
00183     void method2(in short i, in short j);
00184 };
00185 
00186 [scriptable, uuid(7bca65e0-0d73-11d3-bab8-00805f8a5dd7)]
00187 interface nsIXPCTestOther : nsISupports {
00188     void method3(in short i, in short j, in short k);
00189 };
00190 
00191 [scriptable, uuid(1e4cf7b0-237a-11d3-9879-006008962422)]
00192 interface nsIXPCTestNoisy : nsISupports {
00193     void squawk();
00194 };
00195 
00196 [scriptable, uuid(d970e910-30d8-11d3-9885-006008962422)]
00197 interface nsIXPCTestString : nsISupports {
00198     string GetStringA();
00199     void GetStringB(out string s);
00200     void GetStringC([shared,retval] out string s);
00201 
00202     void GetWStringCopied([retval] out wstring s);
00203     void GetWStringShared([shared,retval] out wstring s);
00204 };
00205 
00206 [scriptable, uuid(0ff4faf0-439a-11d3-988c-006008962422)]
00207 interface nsIXPCTestOverloaded : nsISupports {
00208     void Foo1(in PRInt32 p1);
00209     void Foo2(in PRInt32 p1, in PRInt32 p2);
00210 };
00211 
00212 [scriptable, uuid(3d2e64b0-6552-11d3-989e-006008962422)]
00213 interface nsIXPCTestArray : nsISupports {
00214 
00215     void SetReceiver(in nsIXPCTestArray aReceiver);
00216 
00217     void PrintIntegerArray(in PRUint32 count, 
00218                            [array, size_is(count)] in PRInt32 valueArray);
00219     void PrintStringArray(in PRUint32 count, 
00220                           [array, size_is(count)] in string valueArray);
00221     void MultiplyEachItemInIntegerArray(
00222                            in PRInt32 val, 
00223                            in PRUint32 count, 
00224                            [array, size_is(count)] inout PRInt32 valueArray);
00225     void MultiplyEachItemInIntegerArrayAndAppend(
00226                            in PRInt32 val, 
00227                            inout PRUint32 count, 
00228                            [array, size_is(count)] inout PRInt32 valueArray);
00229 
00230     void CallEchoMethodOnEachInArray(inout nsIIDPtr uuid, 
00231                                      inout PRUint32 count, 
00232        [array, size_is(count), iid_is(uuid)] inout nsQIResult result);
00233 
00234     void CallEchoMethodOnEachInArray2(inout PRUint32 count, 
00235        [array, size_is(count)] inout nsIEcho result);
00236 
00237     void DoubleStringArray(inout PRUint32 count, 
00238                            [array, size_is(count)] inout string valueArray);
00239     void ReverseStringArray(in PRUint32 count, 
00240                             [array, size_is(count)] inout string valueArray);
00241 
00242     void PrintStringWithSize(in PRUint32 count, 
00243                              [size_is(count)] in string str);
00244     void DoubleString(inout PRUint32 count, 
00245                       [size_is(count)] inout string str);
00246 
00247     void GetStrings(out PRUint32 count,
00248                     [retval, array, size_is(count)] out string str);
00249 
00250 };
00251 
00252 [scriptable, uuid(13082da0-643c-11d4-8fe0-0010a4e73d9a)]
00253 interface nsIWrappedJSObjectTest : nsISupports
00254 {
00255     void interfaceMember();        
00256 };
00257 
00258 [scriptable, uuid(41d923d0-5bc1-11d5-90db-0010a4e73d9a)]
00259 interface nsIBogus1 : nsISupports {};
00260 
00261 [scriptable, uuid(8d8f4210-5bc1-11d5-90db-0010a4e73d9a)]
00262 interface nsIBogus2 : nsISupports 
00263 {
00264     attribute nsIBogus1 bogus;
00265 };
00266 
00267 [scriptable, uuid(34bc9990-95af-11d5-90fc-0010a4e73d9a)]
00268 interface nsITestVariant : nsISupports
00269 {
00273     nsIVariant passThruVariant(in nsIVariant value);
00274     
00278     PRUint16   returnVariantType(in nsIVariant value);
00279     
00284     nsIVariant copyVariant(in nsIVariant value);
00285     
00291     nsIVariant copyVariantAsType(in nsIVariant value, in PRUint16 type);
00292     
00300     nsIVariant copyVariantAsTypeTwice(in nsIVariant value, 
00301                                       in PRUint16 type1, in PRUint16 type2);
00302 
00306     nsIVariant getNamedProperty(in nsISupports aBag, in AString aName);
00307 
00311     nsISimpleEnumerator getEnumerator(in nsISupports aBag);
00312 };