1999-08-06 04:28:53 +04:00
|
|
|
#ifndef __nsJavaDOMImpl_h__
|
|
|
|
#define __nsJavaDOMImpl_h__
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
#include "nsIJavaDOM.h"
|
|
|
|
|
|
|
|
class nsIURI;
|
|
|
|
class nsIDOMDocument;
|
|
|
|
class nsIDocumentLoader;
|
|
|
|
|
|
|
|
class nsJavaDOMImpl : public nsIJavaDOM {
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsJavaDOMImpl();
|
|
|
|
virtual ~nsJavaDOMImpl();
|
|
|
|
|
|
|
|
/* nsIDocumentLoaderObserver methods */
|
|
|
|
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
|
|
|
nsIURI* aURL,
|
|
|
|
const char* aCommand);
|
|
|
|
|
|
|
|
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|
|
|
nsIChannel* channel,
|
1999-08-23 23:27:48 +04:00
|
|
|
nsresult aStatus,
|
1999-08-06 04:28:53 +04:00
|
|
|
nsIDocumentLoaderObserver* aObserver);
|
|
|
|
|
|
|
|
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
|
|
|
|
nsIChannel* channel,
|
|
|
|
nsIContentViewer* aViewer);
|
|
|
|
|
|
|
|
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
|
|
|
nsIChannel* channel,
|
|
|
|
PRUint32 aProgress,
|
|
|
|
PRUint32 aProgressMax);
|
|
|
|
|
|
|
|
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
|
|
|
|
nsIChannel* channel,
|
|
|
|
nsString& aMsg);
|
|
|
|
|
|
|
|
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
|
|
|
|
nsIChannel* channel,
|
1999-08-23 23:27:48 +04:00
|
|
|
nsresult aStatus);
|
1999-08-06 04:28:53 +04:00
|
|
|
|
|
|
|
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
|
|
|
|
nsIChannel* channel,
|
|
|
|
const char *aContentType,
|
|
|
|
const char *aCommand);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static JavaVM* jvm;
|
|
|
|
static JNIEnv* env;
|
|
|
|
|
1999-11-19 05:17:28 +03:00
|
|
|
static jclass domAccessorClass;
|
1999-08-06 04:28:53 +04:00
|
|
|
static jclass documentClass;
|
|
|
|
static jclass listenerClass;
|
|
|
|
static jclass gcClass;
|
|
|
|
|
|
|
|
static jobject docListener;
|
|
|
|
|
|
|
|
static jfieldID documentPtrFID;
|
|
|
|
|
1999-11-19 05:17:28 +03:00
|
|
|
static jmethodID getInstanceMID;
|
1999-08-06 04:28:53 +04:00
|
|
|
static jmethodID startURLLoadMID;
|
|
|
|
static jmethodID endURLLoadMID;
|
|
|
|
static jmethodID progressURLLoadMID;
|
|
|
|
static jmethodID statusURLLoadMID;
|
|
|
|
static jmethodID startDocumentLoadMID;
|
|
|
|
static jmethodID endDocumentLoadMID;
|
|
|
|
|
|
|
|
static jmethodID gcMID;
|
|
|
|
|
|
|
|
// cleanup after a JNI method invocation
|
|
|
|
static PRBool Cleanup();
|
|
|
|
|
|
|
|
nsIDOMDocument* GetDocument(nsIDocumentLoader* loader);
|
|
|
|
jobject CaffienateDOMDocument(nsIDOMDocument* domDoc);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __nsJavaDOMImpl_h__ */
|