Back to index

lightning-sunbird  0.9+nobinonly
jvmmgr.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef jvmmgr_h___
00039 #define jvmmgr_h___
00040 
00041 #include "prtypes.h"
00042 #include "jni.h"
00043 #include "jsdbgapi.h"
00044 #include "nsError.h"
00045 
00046 #include "nsISecurityContext.h"
00047 
00048 struct nsJVMManager;
00049 
00050 typedef enum nsJVMStatus {
00051     nsJVMStatus_Enabled,  /* but not Running */
00052     nsJVMStatus_Disabled, /* explicitly disabled */
00053     nsJVMStatus_Running,  /* enabled and started */
00054     nsJVMStatus_Failed    /* enabled but failed to start */
00055 } nsJVMStatus;
00056 
00057 
00058 /*******************************************************************************
00059  * Interface for C Clients
00060  ******************************************************************************/
00061 
00062 PR_BEGIN_EXTERN_C
00063 
00064 PR_EXTERN(void)
00065 JVM_ReleaseJVMMgr(struct nsJVMManager* mgr);
00066 
00067 PR_EXTERN(nsJVMStatus)
00068 JVM_StartupJVM(void);
00069 
00070 PR_EXTERN(nsJVMStatus)
00071 JVM_ShutdownJVM(void);
00072 
00073 PR_EXTERN(nsJVMStatus)
00074 JVM_GetJVMStatus(void);
00075 
00076 PR_EXTERN(PRBool)
00077 JVM_AddToClassPath(const char* dirPath);
00078 
00079 PR_EXTERN(void)
00080 JVM_ShowConsole(void);
00081 
00082 PR_EXTERN(void)
00083 JVM_HideConsole(void);
00084 
00085 PR_EXTERN(PRBool)
00086 JVM_IsConsoleVisible(void);
00087 
00088 PR_EXTERN(void)
00089 JVM_PrintToConsole(const char* msg);
00090 
00091 PR_EXTERN(void)
00092 JVM_ShowPrefsWindow(void);
00093 
00094 PR_EXTERN(void)
00095 JVM_HidePrefsWindow(void);
00096 
00097 PR_EXTERN(PRBool)
00098 JVM_IsPrefsWindowVisible(void);
00099 
00100 PR_EXTERN(void)
00101 JVM_StartDebugger(void);
00102 
00103 PR_EXTERN(JNIEnv*)
00104 JVM_GetJNIEnv(void);
00105 
00106 PR_IMPLEMENT(void)
00107 JVM_ReleaseJNIEnv(JNIEnv *pJNIEnv);
00108 
00109 PR_EXTERN(nsresult)
00110 JVM_SpendTime(PRUint32 timeMillis);
00111 
00112 PR_EXTERN(PRBool)
00113 JVM_MaybeStartupLiveConnect(void);
00114 
00115 PR_EXTERN(PRBool)
00116 JVM_MaybeShutdownLiveConnect(void);
00117 
00118 PR_EXTERN(PRBool)
00119 JVM_IsLiveConnectEnabled(void);
00120 
00121 PR_EXTERN(nsJVMStatus)
00122 JVM_ShutdownJVM(void);
00123 
00124 PR_EXTERN(PRBool)
00125 JVM_NSISecurityContextImplies(JSStackFrame  *pCurrentFrame, const char* target, const char* action);
00126 
00127 PR_EXTERN(JSPrincipals*)
00128 JVM_GetJavaPrincipalsFromStack(JSStackFrame  *pCurrentFrame);
00129 
00130 PR_EXTERN(void *)
00131 JVM_GetJavaPrincipalsFromStackAsNSVector(JSStackFrame  *pCurrentFrame);
00132 
00133 PR_EXTERN(JSStackFrame**)
00134 JVM_GetStartJSFrameFromParallelStack(void);
00135 
00136 PR_EXTERN(JSStackFrame*)
00137 JVM_GetEndJSFrameFromParallelStack(JSStackFrame  *pCurrentFrame);
00138 
00139 PR_EXTERN(nsISecurityContext*) 
00140 JVM_GetJSSecurityContext();
00141 
00142 PR_END_EXTERN_C
00143 
00144 #endif /* jvmmgr_h___ */