Back to index

lightning-sunbird  0.9+nobinonly
xpctest_inout.cpp
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 #include "nsISupports.h"
00042 #include "xpctest_inout.h"
00043 #include "xpctest_private.h"
00044 
00045 class xpcTestInOut : public nsIXPCTestInOut {
00046 public:
00047   NS_DECL_ISUPPORTS
00048   NS_DECL_NSIXPCTESTINOUT
00049 
00050   xpcTestInOut();
00051 };
00052 
00053 NS_IMPL_ISUPPORTS1(xpcTestInOut, nsIXPCTestInOut)
00054 
00055 xpcTestInOut :: xpcTestInOut() {
00056     NS_ADDREF_THIS();
00057 }
00058 
00059 NS_IMETHODIMP xpcTestInOut :: EchoLong(PRInt32 li, PRInt32 *lo){ 
00060     return NS_OK; 
00061 }
00062 NS_IMETHODIMP xpcTestInOut :: EchoShort(PRInt16 si, PRInt16 *so){ 
00063     return NS_OK; 
00064 }
00065 NS_IMETHODIMP xpcTestInOut :: EchoChar(char ci, char *co){ 
00066     return NS_OK; 
00067 }
00068 NS_IMETHODIMP xpcTestInOut :: EchoBoolean(PRBool bi, PRBool *bo){ 
00069     return NS_OK; 
00070 }
00071 NS_IMETHODIMP xpcTestInOut :: EchoOctet(PRUint8 oi, PRUint8 *oo){ 
00072     return NS_OK; 
00073 }
00074 NS_IMETHODIMP xpcTestInOut :: EchoLongLong(PRInt64 lli, PRInt64 *llo){ 
00075     return NS_OK; 
00076 }
00077 NS_IMETHODIMP xpcTestInOut :: EchoUnsignedShort(PRUint16 usi, PRUint16 *uso){ 
00078     return NS_OK; 
00079 }
00080 NS_IMETHODIMP xpcTestInOut :: EchoUnsignedLong(PRUint32 uli, PRUint32 *ulo){ 
00081     return NS_OK; 
00082 }
00083 NS_IMETHODIMP xpcTestInOut :: EchoFloat(float fi, float *fo){ 
00084     return NS_OK; 
00085 }
00086 NS_IMETHODIMP xpcTestInOut :: EchoDouble(double di, double *dout){ 
00087     return NS_OK; 
00088 }
00089 NS_IMETHODIMP xpcTestInOut :: EchoWchar(PRUnichar wci, PRUnichar *wco){ 
00090     return NS_OK; 
00091 }
00092 NS_IMETHODIMP xpcTestInOut :: EchoString(const PRUnichar *wsi, PRUnichar **wso){ 
00093     return NS_OK; 
00094 }
00095 NS_IMETHODIMP xpcTestInOut :: EchoPRBool(PRBool bi, PRBool *bo){ 
00096     return NS_OK; 
00097 }
00098 NS_IMETHODIMP xpcTestInOut :: EchoPRInt32(PRInt32 li, PRInt32 *lo){ 
00099     return NS_OK; 
00100 }
00101 NS_IMETHODIMP xpcTestInOut :: EchoPRInt16(PRInt16 li, PRInt16 *lo){ 
00102     return NS_OK; 
00103 }
00104 NS_IMETHODIMP xpcTestInOut :: EchoPRInt64(PRInt64 ii, PRInt64 *io){ 
00105     return NS_OK; 
00106 }
00107 NS_IMETHODIMP xpcTestInOut :: EchoPRUint8(PRUint8 ii, PRUint8 *io){ 
00108     return NS_OK; 
00109 }
00110 NS_IMETHODIMP xpcTestInOut :: EchoPRUint16(PRUint16 ii, PRUint16 *io){ 
00111     return NS_OK; 
00112 }
00113 NS_IMETHODIMP xpcTestInOut :: EchoPRUint32(PRUint32 ii, PRUint32 *io){ 
00114     return NS_OK; 
00115 }
00116 NS_IMETHODIMP xpcTestInOut :: EchoPRUint32_2(PRUint32 ii, PRUint32 *io){ 
00117     return NS_OK; 
00118 }
00119 NS_IMETHODIMP xpcTestInOut :: EchoPRUint64(PRUint64 ii, PRUint64 *io){ 
00120     return NS_OK; 
00121 }
00122 NS_IMETHODIMP xpcTestInOut :: EchoVoidPtr(void * vsi, void * *vso){ 
00123     return NS_OK; 
00124 }
00125 NS_IMETHODIMP xpcTestInOut :: EchoCharPtr(char * csi, char * *cso){ 
00126     return NS_OK; 
00127 }
00128 /*
00129 NS_IMETHODIMP xpcTestInOut :: EchoNsIDRef(const nsID & ri, nsID & *ro){ 
00130     return NS_OK; 
00131 }
00132 NS_IMETHODIMP xpcTestInOut :: EchoNsCIDRef(const nsCID & ri, nsCID & *ro){ 
00133     return NS_OK; 
00134 }
00135 */
00136 NS_IMETHODIMP xpcTestInOut :: EchoNsIDPtr(const nsID * pi, nsID * *po){ 
00137     return NS_OK; 
00138 }
00139 NS_IMETHODIMP xpcTestInOut :: EchoNsIIDPtr(const nsIID * pi, nsIID * *po){ 
00140     return NS_OK; 
00141 }
00142 NS_IMETHODIMP xpcTestInOut :: EchoNsCIDPtr(const nsCID * pi, nsCID * *po){ 
00143     return NS_OK; 
00144 }
00145 NS_IMETHODIMP xpcTestInOut :: EchoNsQIResult(void * ri, void * *ro){ 
00146     return NS_OK; 
00147 }
00148 NS_IMETHODIMP xpcTestInOut :: EchoVoid(void) {
00149     return NS_OK;
00150 }
00151 
00152 NS_IMETHODIMP
00153 xpctest::ConstructXPCTestInOut(nsISupports *aOuter, REFNSIID aIID, void **aResult)
00154 {
00155     nsresult rv;
00156     NS_ASSERTION(aOuter == nsnull, "no aggregation");
00157     xpcTestInOut *obj = new xpcTestInOut();
00158 
00159     if(obj)
00160     {
00161         rv = obj->QueryInterface(aIID, aResult);
00162         NS_ASSERTION(NS_SUCCEEDED(rv), "unable to find correct interface");
00163         NS_RELEASE(obj);
00164     }
00165     else
00166     {
00167         *aResult = nsnull;
00168         rv = NS_ERROR_OUT_OF_MEMORY;
00169     }
00170     return rv;
00171 }