Back to index

lightning-sunbird  0.9+nobinonly
nsLiveConnect.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 mozilla.org code.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1998
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either of the GNU General Public License Version 2 or later (the "GPL"),
00025  * or 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 /*
00038     nsLiveConnect.h
00039  */
00040 
00041 #pragma once
00042 
00043 #include "nsILiveconnect.h"
00044 #include "nsIPluginStreamListener.h"
00045 #include "SupportsMixin.h"
00046 
00047 class MRJMonitor;
00048 
00049 class nsLiveconnect : public nsILiveconnect,
00050                       public nsIPluginStreamListener,
00051                       private SupportsMixin {
00052 public:
00053     DECL_SUPPORTS_MIXIN
00054     
00055     nsLiveconnect();
00056     virtual ~nsLiveconnect();
00057     
00068     NS_IMETHOD
00069     GetMember(JNIEnv *env, jsobject jsobj, const jchar *name, jsize length, void* principalsArray[], 
00070               int numPrincipals, nsISupports *securitySupports, jobject *pjobj)
00071     {
00072         return NS_ERROR_NOT_IMPLEMENTED;
00073     }
00074 
00083     NS_IMETHOD
00084     GetSlot(JNIEnv *env, jsobject jsobj, jint slot, void* principalsArray[], 
00085             int numPrincipals, nsISupports *securitySupports, jobject *pjobj)
00086     {
00087         return NS_ERROR_NOT_IMPLEMENTED;
00088     }
00089 
00099     NS_IMETHOD
00100     SetMember(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, jobject jobj, void* principalsArray[], 
00101               int numPrincipals, nsISupports *securitySupports)
00102     {
00103         return NS_ERROR_NOT_IMPLEMENTED;
00104     }
00105 
00115     NS_IMETHOD
00116     SetSlot(JNIEnv *env, jsobject jsobj, jint slot, jobject jobj, void* principalsArray[], 
00117             int numPrincipals, nsISupports *securitySupports)
00118     {
00119         return NS_ERROR_NOT_IMPLEMENTED;
00120     }
00121 
00128     NS_IMETHOD
00129     RemoveMember(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length,  void* principalsArray[], 
00130                  int numPrincipals, nsISupports *securitySupports)
00131     {
00132         return NS_ERROR_NOT_IMPLEMENTED;
00133     }
00134 
00143     NS_IMETHOD
00144     Call(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, jobjectArray jobjArr,  void* principalsArray[], 
00145          int numPrincipals, nsISupports *securitySupports, jobject *pjobj)
00146     {
00147         return NS_ERROR_NOT_IMPLEMENTED;
00148     }
00149 
00159     NS_IMETHOD  
00160     Eval(JNIEnv *env, jsobject obj, const jchar *script, jsize length, void* principalsArray[], 
00161          int numPrincipals, nsISupports *securitySupports, jobject *outResult);
00162 
00172     NS_IMETHOD
00173     GetWindow(JNIEnv *env, void *pJavaObject, void* principalsArray[], 
00174               int numPrincipals, nsISupports *securitySupports, jsobject *pobj)
00175     {
00176         return NS_ERROR_NOT_IMPLEMENTED;
00177     }
00178 
00185     NS_IMETHOD
00186     FinalizeJSObject(JNIEnv *env, jsobject jsobj)
00187     {
00188         return NS_ERROR_NOT_IMPLEMENTED;
00189     }
00190 
00198     NS_IMETHOD
00199     ToString(JNIEnv *env, jsobject obj, jstring *pjstring)
00200     {
00201         return NS_ERROR_NOT_IMPLEMENTED;
00202     }
00203 
00204     // nsIPluginStreamListener implementation.
00205     
00213     NS_IMETHOD
00214     OnStartBinding(nsIPluginStreamInfo* pluginInfo)
00215     {
00216         return NS_OK;
00217     }
00218 
00229     NS_IMETHOD
00230     OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length);
00231 
00232     NS_IMETHOD
00233     OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName)
00234     {
00235         return NS_ERROR_NOT_IMPLEMENTED;
00236     }
00237     
00249     NS_IMETHOD
00250     OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status);
00251 
00255     NS_IMETHOD
00256     GetStreamType(nsPluginStreamType *result)
00257     {
00258         *result = nsPluginStreamType_Normal;
00259         return NS_OK;
00260     }
00261 
00262 private:
00263     MRJMonitor* mJavaScriptMonitor;
00264     char* mScript;
00265     char* mResult;
00266 
00267     // support for SupportsMixin.
00268     static const InterfaceInfo sInterfaces[];
00269     static const UInt32 kInterfaceCount;
00270 };