michael@0: /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef AndroidJNIWrapper_h__ michael@0: #define AndroidJNIWrapper_h__ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: extern "C" jclass jsjni_FindClass(const char *className); michael@0: michael@0: /** michael@0: * JNIEnv::FindClass alternative. michael@0: * Callable from any thread, including code michael@0: * invoked via the JNI that doesn't have MOZILLA_INTERNAL_API defined. michael@0: * The caller is responsible for ensuring that the class is not leaked by michael@0: * calling DeleteGlobalRef at an appropriate time. michael@0: */ michael@0: extern "C" jclass jsjni_GetGlobalClassRef(const char *className); michael@0: michael@0: extern "C" jmethodID jsjni_GetStaticMethodID(jclass methodClass, michael@0: const char *methodName, michael@0: const char *signature); michael@0: extern "C" bool jsjni_ExceptionCheck(); michael@0: extern "C" void jsjni_CallStaticVoidMethodA(jclass cls, jmethodID method, jvalue *values); michael@0: extern "C" int jsjni_CallStaticIntMethodA(jclass cls, jmethodID method, jvalue *values); michael@0: extern "C" jobject jsjni_GetGlobalContextRef(); michael@0: extern "C" JavaVM* jsjni_GetVM(); michael@0: extern "C" JNIEnv* jsjni_GetJNIForThread(); michael@0: michael@0: #endif /* AndroidJNIWrapper_h__ */