Bug 327977 ? Password manager overwrites page data for password-only forms. r=gavin
[wine-gecko.git] / modules / oji / public / nsIJVMPlugin.h
blobd3a24869da9c6372c3e15ed7ee7bbc7b90726d22
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 ////////////////////////////////////////////////////////////////////////////////
39 // NETSCAPE JAVA VM PLUGIN EXTENSIONS
40 //
41 // This interface allows a Java virtual machine to be plugged into
42 // Communicator to implement the APPLET tag and host applets.
43 //
44 // Note that this is the C++ interface that the plugin sees. The browser
45 // uses a specific implementation of this, nsJVMPlugin, found in jvmmgr.h.
46 ////////////////////////////////////////////////////////////////////////////////
48 #ifndef nsIJVMPlugin_h___
49 #define nsIJVMPlugin_h___
51 #include "nsISupports.h"
52 #include "nsIPrincipal.h"
53 #include "jni.h"
55 class nsISecureEnv;
57 /**
58 * This MIME type is what should be used to signify a Java VM plugin.
60 #define NS_JVM_MIME_TYPE "application/x-java-vm" // XXX "application/java" ?
63 #define NS_IJVMPLUGIN_IID \
64 { /* da6f3bc0-a1bc-11d1-85b1-00805f0e4dfe */ \
65 0xda6f3bc0, \
66 0xa1bc, \
67 0x11d1, \
68 {0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
71 ////////////////////////////////////////////////////////////////////////////////
72 // Java VM Plugin Interface
73 // This interface defines additional entry points that a plugin developer needs
74 // to implement in order to implement a Java virtual machine plugin.
76 class nsIJVMPlugin : public nsISupports {
77 public:
78 // Causes the JVM to append a new directory to its classpath.
79 // If the JVM doesn't support this operation, an error is returned.
80 NS_IMETHOD
81 AddToClassPath(const char* dirPath) = 0;
83 // Causes the JVM to remove a directory from its classpath.
84 // If the JVM doesn't support this operation, an error is returned.
85 NS_IMETHOD
86 RemoveFromClassPath(const char* dirPath) = 0;
88 // Returns the current classpath in use by the JVM.
89 NS_IMETHOD
90 GetClassPath(const char* *result) = 0;
92 NS_IMETHOD
93 #if PR_BYTES_PER_LONG == 8
94 GetJavaWrapper(JNIEnv* jenv, jlong obj, jobject *jobj) = 0;
95 #else
96 GetJavaWrapper(JNIEnv* jenv, jint obj, jobject *jobj) = 0;
97 #endif
99 /**
100 * This creates a new secure communication channel with Java. The second parameter,
101 * nativeEnv, if non-NULL, will be the actual thread for Java communication.
102 * Otherwise, a new thread should be created.
103 * @param proxyEnv the env to be used by all clients on the browser side
104 * @return outSecureEnv the secure environment used by the proxyEnv
106 NS_IMETHOD
107 CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv) = 0;
110 * Gives time to the JVM from the main event loop of the browser. This is
111 * necessary when there aren't any plugin instances around, but Java threads exist.
113 NS_IMETHOD
114 SpendTime(PRUint32 timeMillis) = 0;
116 NS_IMETHOD
117 #if PR_BYTES_PER_LONG == 8 || PR_BYTES_PER_WORD == 8
118 UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jlong* obj) = 0;
119 #else
120 UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj) = 0;
121 #endif
123 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJVMPLUGIN_IID)
126 NS_DEFINE_STATIC_IID_ACCESSOR(nsIJVMPlugin, NS_IJVMPLUGIN_IID)
128 ////////////////////////////////////////////////////////////////////////////////
130 #endif /* nsIJVMPlugin_h___ */