Back to index

lightning-sunbird  0.9+nobinonly
xpctest_private.h
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) 1998
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 /* local header for xpconnect tests components */
00042 
00043 #ifndef xpctest_private_h___
00044 #define xpctest_private_h___
00045 
00046 #include "nsISupports.h"
00047 #include "nsIFactory.h"
00048 #include "nsMemory.h"
00049 #include "nsIXPConnect.h"
00050 #include "nsIServiceManager.h"
00051 #include "nsIComponentManager.h"
00052 #include "nsIGenericFactory.h"
00053 #include "nscore.h"
00054 #include "nsCOMPtr.h"
00055 #include "nsAString.h"
00056 #include "nsVariant.h"
00057 #include <stdio.h>
00058 
00059 #include "xpctest.h"
00060 #include "jsapi.h"
00061 
00062 #if defined(WIN32) && !defined(XPCONNECT_STANDALONE)
00063 #define IMPLEMENT_TIMER_STUFF 1
00064 #endif
00065 
00066 #ifdef IMPLEMENT_TIMER_STUFF
00067 #include "nsITimer.h"
00068 #endif // IMPLEMENT_TIMER_STUFF
00069 
00070 // {ED132C20-EED1-11d2-BAA4-00805F8A5DD7}
00071 #define NS_ECHO_CID \
00072 { 0xed132c20, 0xeed1, 0x11d2, \
00073     { 0xba, 0xa4, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
00074 
00075 // {0ECB3420-0D6F-11d3-BAB8-00805F8A5DD7}
00076 #define NS_CHILD_CID \
00077 { 0xecb3420, 0xd6f, 0x11d3, \
00078     { 0xba, 0xb8, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
00079 
00080 // {FD774840-237B-11d3-9879-006008962422}
00081 #define NS_NOISY_CID \
00082 { 0xfd774840, 0x237b, 0x11d3, \
00083     { 0x98, 0x79, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
00084 
00085 // {4DD7EC80-30D9-11d3-9885-006008962422}
00086 #define NS_STRING_TEST_CID \
00087 { 0x4dd7ec80, 0x30d9, 0x11d3,\
00088     { 0x98, 0x85, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
00089 
00090 // {DC5FDE90-439D-11d3-988C-006008962422}
00091 #define NS_OVERLOADED_CID \
00092 { 0xdc5fde90, 0x439d, 0x11d3, \
00093     { 0x98, 0x8c, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
00094 
00095 #define NS_XPCTESTOBJECTREADONLY_CID \
00096   {0x1364941e, 0x4462, 0x11d3, \
00097     { 0x82, 0xee, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00098 
00099 #define NS_XPCTESTOBJECTREADWRITE_CID \
00100   {0x3b9b1d38, 0x491a, 0x11d3, \
00101     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00102 
00103 #define NS_XPCTESTIN_CID \
00104   {0x318d6f6a, 0x5411, 0x11d3, \
00105     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00106 
00107 #define NS_XPCTESTOUT_CID \
00108   {0x4105ae88, 0x5599, 0x11d3, \
00109     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00110 
00111 #define NS_XPCTESTINOUT_CID \
00112   { 0x70c54fa0, 0xc25e, 0x11d3, \
00113     { 0x98, 0xc9, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
00114 
00115 #define NS_XPCTESTCONST_CID \
00116   {0x83f57a56, 0x4f55, 0x11d3, \
00117     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00118 
00119 #define NS_XPCTESTCALLJS_CID \
00120   {0x38ba7d98, 0x5a54, 0x11d3, \
00121     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00122 
00123 #define NS_XPCTESTPARENTONE_CID \
00124   {0x5408fdcc, 0x60a3, 0x11d3, \
00125     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00126 
00127 #define NS_XPCTESTPARENTTWO_CID \
00128   {0x63137392, 0x60a3, 0x11d3, \
00129     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00130 
00131 #define NS_XPCTESTCHILD2_CID \
00132   {0x66bed216, 0x60a3, 0x11d3, \
00133     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00134 
00135 #define NS_XPCTESTCHILD3_CID \
00136   {0x62353978, 0x614e, 0x11d3, \
00137     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00138 
00139 #define NS_XPCTESTCHILD4_CID \
00140   {0xa6d22202, 0x622b, 0x11d3, \
00141     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00142 
00143 #define NS_XPCTESTCHILD5_CID \
00144   {0xba3eef4e, 0x6250, 0x11d3, \
00145     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
00146 
00147 // {5B9AF380-6569-11d3-989E-006008962422}
00148 #define NS_ARRAY_CID \
00149 { 0x5b9af380, 0x6569, 0x11d3, \
00150     { 0x98, 0x9e, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
00151 
00152 // {DB569F7E-16FB-4BCB-A86C-E08AA7F97666}
00153 #define NS_XPCTESTDOMSTRING_CID \
00154   {0xdb569f7e, 0x16fb, 0x1bcb, \
00155     { 0xa8, 0x6c, 0xe0, 0x8a, 0xa7, 0xf9, 0x76, 0x66 }}
00156 
00157 // {DC932D30-95B0-11d5-90FC-0010A4E73D9A}
00158 #define NS_XPCTESTVARIANT_CID \
00159   {0xdc932d30, 0x95b0, 0x11d5, \
00160     { 0x90, 0xfc, 0x0, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }}
00161 
00162 // 'namespace' class
00163 class xpctest
00164 {
00165 public:
00166   static NS_METHOD ConstructEcho(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00167   static NS_METHOD ConstructChild(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00168   static NS_METHOD ConstructNoisy(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00169   static NS_METHOD ConstructStringTest(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00170   static NS_METHOD ConstructOverloaded(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00171   static NS_METHOD ConstructXPCTestObjectReadOnly(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00172   static NS_METHOD ConstructXPCTestObjectReadWrite(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00173   static NS_METHOD ConstructXPCTestIn(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00174   static NS_METHOD ConstructXPCTestOut(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00175   static NS_METHOD ConstructXPCTestInOut(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00176   static NS_METHOD ConstructXPCTestConst(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00177   static NS_METHOD ConstructXPCTestCallJS(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00178   static NS_METHOD ConstructXPCTestParentOne(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00179   static NS_METHOD ConstructXPCTestParentTwo(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00180   static NS_METHOD ConstructXPCTestChild2(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00181   static NS_METHOD ConstructXPCTestChild3(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00182   static NS_METHOD ConstructXPCTestChild4(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00183   static NS_METHOD ConstructXPCTestChild5(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00184   static NS_METHOD ConstructArrayTest(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00185   static NS_METHOD ConstructXPCTestDOMString(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00186   static NS_METHOD ConstructXPCTestVariant(nsISupports *aOuter, REFNSIID aIID, void **aResult);
00187 
00188 private:
00189     xpctest();  // not implemented
00190 };
00191 
00192 #endif /* xpctest_private_h___ */