Back to index

lightning-sunbird  0.9+nobinonly
nsJavaInterfaces.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Java XPCOM Bindings.
00015  *
00016  * The Initial Developer of the Original Code is IBM Corporation.
00017  * Portions created by the Initial Developer are Copyright (C) 2006
00018  * IBM Corporation. All Rights Reserved.
00019  *
00020  * Contributor(s):
00021  *   Javier Pedemonte (jhpedemonte@gmail.com)
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 #ifndef _nsJavaInterfaces_h_
00038 #define _nsJavaInterfaces_h_
00039 
00040 #include "jni.h"
00041 #include "nscore.h"
00042 
00043 #define MOZILLA_NATIVE(func) Java_org_mozilla_xpcom_internal_MozillaImpl_##func
00044 #define GRE_NATIVE(func) Java_org_mozilla_xpcom_internal_GREImpl_##func
00045 #define XPCOM_NATIVE(func) Java_org_mozilla_xpcom_internal_XPCOMImpl_##func
00046 #define JAVAPROXY_NATIVE(func) \
00047           Java_org_mozilla_xpcom_internal_XPCOMJavaProxy_##func
00048 #define LOCKPROXY_NATIVE(func) Java_org_mozilla_xpcom_ProfileLock_##func
00049 #define JXUTILS_NATIVE(func) \
00050           Java_org_mozilla_xpcom_internal_JavaXPCOMMethods_##func
00051 
00052 
00053 extern "C" NS_EXPORT void JNICALL
00054 MOZILLA_NATIVE(initialize) (JNIEnv* env, jobject);
00055 
00056 extern "C" NS_EXPORT void JNICALL
00057 GRE_NATIVE(initEmbedding) (JNIEnv* env, jobject, jobject aLibXULDirectory,
00058                            jobject aAppDirectory, jobject aAppDirProvider);
00059 
00060 extern "C" NS_EXPORT void JNICALL
00061 GRE_NATIVE(termEmbedding) (JNIEnv *env, jobject);
00062 
00063 extern "C" NS_EXPORT jobject JNICALL
00064 GRE_NATIVE(lockProfileDirectory) (JNIEnv *, jobject, jobject aDirectory);
00065 
00066 extern "C" NS_EXPORT void JNICALL
00067 GRE_NATIVE(notifyProfile) (JNIEnv *env, jobject);
00068 
00069 extern "C" NS_EXPORT jobject JNICALL
00070 XPCOM_NATIVE(initXPCOM) (JNIEnv* env, jobject, jobject aMozBinDirectory,
00071                          jobject aAppFileLocProvider);
00072 
00073 extern "C" NS_EXPORT void JNICALL
00074 XPCOM_NATIVE(shutdownXPCOM) (JNIEnv *env, jobject, jobject aServMgr);
00075 
00076 extern "C" NS_EXPORT jobject JNICALL
00077 XPCOM_NATIVE(newLocalFile) (JNIEnv *env, jobject, jstring aPath,
00078                             jboolean aFollowLinks);
00079 
00080 extern "C" NS_EXPORT jobject JNICALL
00081 XPCOM_NATIVE(getComponentManager) (JNIEnv *env, jobject);
00082 
00083 extern "C" NS_EXPORT jobject JNICALL
00084 XPCOM_NATIVE(getComponentRegistrar) (JNIEnv *env, jobject);
00085 
00086 extern "C" NS_EXPORT jobject JNICALL
00087 XPCOM_NATIVE(getServiceManager) (JNIEnv *env, jobject);
00088 
00089 extern "C" NS_EXPORT jobject JNICALL
00090 JAVAPROXY_NATIVE(callXPCOMMethod) (JNIEnv *env, jclass that, jobject aJavaProxy,
00091                                    jstring aMethodName, jobjectArray aParams);
00092 
00093 extern "C" NS_EXPORT void JNICALL
00094 JAVAPROXY_NATIVE(finalizeProxy) (JNIEnv *env, jclass that, jobject aJavaProxy);
00095 
00096 extern "C" NS_EXPORT jboolean JNICALL
00097 JAVAPROXY_NATIVE(isSameXPCOMObject) (JNIEnv *env, jclass that, jobject aProxy1,
00098                                      jobject aProxy2);
00099 
00100 extern "C" NS_EXPORT void JNICALL
00101 LOCKPROXY_NATIVE(release) (JNIEnv *env, jclass that, jlong aLockObject);
00102 
00103 extern "C" NS_EXPORT jlong JNICALL
00104 MOZILLA_NATIVE(getNativeHandleFromAWT) (JNIEnv* env, jobject, jobject widget);
00105 
00106 extern "C" NS_EXPORT jlong JNICALL
00107 JXUTILS_NATIVE(wrapJavaObject) (JNIEnv* env, jobject, jobject aJavaObject,
00108                                 jstring aIID);
00109 
00110 extern "C" NS_EXPORT jobject JNICALL
00111 JXUTILS_NATIVE(wrapXPCOMObject) (JNIEnv* env, jobject, jlong aXPCOMObject,
00112                                  jstring aIID);
00113 
00114 #endif // _nsJavaInterfaces_h_