1999-08-06 04:28:53 +04:00
|
|
|
/*
|
1999-11-06 05:47:15 +03:00
|
|
|
The contents of this file are subject to the Mozilla Public
|
|
|
|
License Version 1.1 (the "License"); you may not use this file
|
|
|
|
except in compliance with the License. You may obtain a copy of
|
|
|
|
the License at http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS
|
|
|
|
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
implied. See the License for the specific language governing
|
|
|
|
rights and limitations under the License.
|
|
|
|
|
|
|
|
The Original Code is mozilla.org code.
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is Sun Microsystems,
|
|
|
|
Inc. Portions created by Sun are
|
|
|
|
Copyright (C) 1999 Sun Microsystems, Inc. All
|
|
|
|
Rights Reserved.
|
|
|
|
|
|
|
|
Contributor(s):
|
1999-08-06 04:28:53 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __JavaDOMGlobals_h__
|
|
|
|
#define __JavaDOMGlobals_h__
|
|
|
|
|
|
|
|
#include "jni.h"
|
|
|
|
#include "prclist.h"
|
1999-09-25 06:35:56 +04:00
|
|
|
#include "nsError.h"
|
2000-06-14 01:22:35 +04:00
|
|
|
#include "nsString2.h"
|
1999-08-06 04:28:53 +04:00
|
|
|
|
2000-06-14 16:16:29 +04:00
|
|
|
// workaround for bug 30927
|
|
|
|
#ifdef ERROR
|
|
|
|
#undef ERROR
|
|
|
|
#endif
|
|
|
|
|
1999-08-06 04:28:53 +04:00
|
|
|
class nsISupports;
|
|
|
|
class nsIDOMNode;
|
1999-11-02 21:52:14 +03:00
|
|
|
struct PRLogModuleInfo;
|
|
|
|
struct PRLock;
|
1999-08-06 04:28:53 +04:00
|
|
|
|
|
|
|
class JavaDOMGlobals {
|
|
|
|
|
|
|
|
public:
|
|
|
|
static jclass attrClass;
|
|
|
|
static jclass cDataSectionClass;
|
|
|
|
static jclass commentClass;
|
|
|
|
static jclass documentClass;
|
|
|
|
static jclass documentFragmentClass;
|
|
|
|
static jclass documentTypeClass;
|
|
|
|
static jclass domImplementationClass;
|
|
|
|
static jclass elementClass;
|
|
|
|
static jclass entityClass;
|
|
|
|
static jclass entityReferenceClass;
|
|
|
|
static jclass namedNodeMapClass;
|
|
|
|
static jclass nodeClass;
|
|
|
|
static jclass nodeListClass;
|
|
|
|
static jclass notationClass;
|
|
|
|
static jclass processingInstructionClass;
|
|
|
|
static jclass textClass;
|
|
|
|
|
|
|
|
static jfieldID nodePtrFID;
|
|
|
|
static jfieldID nodeListPtrFID;
|
|
|
|
static jfieldID domImplementationPtrFID;
|
|
|
|
|
|
|
|
static jfieldID nodeTypeAttributeFID;
|
|
|
|
static jfieldID nodeTypeCDataSectionFID;
|
|
|
|
static jfieldID nodeTypeCommentFID;
|
|
|
|
static jfieldID nodeTypeDocumentFragmentFID;
|
|
|
|
static jfieldID nodeTypeDocumentFID;
|
|
|
|
static jfieldID nodeTypeDocumentTypeFID;
|
|
|
|
static jfieldID nodeTypeElementFID;
|
|
|
|
static jfieldID nodeTypeEntityFID;
|
|
|
|
static jfieldID nodeTypeEntityReferenceFID;
|
|
|
|
static jfieldID nodeTypeNotationFID;
|
|
|
|
static jfieldID nodeTypeProcessingInstructionFID;
|
|
|
|
static jfieldID nodeTypeTextFID;
|
|
|
|
|
1999-09-16 00:43:02 +04:00
|
|
|
static jclass domExceptionClass;
|
|
|
|
static jmethodID domExceptionInitMID;
|
|
|
|
static jclass runtimeExceptionClass;
|
|
|
|
static jmethodID runtimeExceptionInitMID;
|
1999-09-25 06:35:56 +04:00
|
|
|
|
|
|
|
static const char* const DOM_EXCEPTION_MESSAGE[];
|
|
|
|
|
|
|
|
typedef enum ExceptionType { EXCEPTION_RUNTIME,
|
|
|
|
EXCEPTION_DOM } ExceptionType;
|
1999-09-16 00:43:02 +04:00
|
|
|
|
1999-08-06 04:28:53 +04:00
|
|
|
static PRLogModuleInfo* log;
|
|
|
|
static PRCList garbage;
|
|
|
|
static PRLock* garbageLock;
|
|
|
|
|
1999-10-16 01:25:56 +04:00
|
|
|
static PRInt32 javaMaxInt;
|
|
|
|
|
1999-08-06 04:28:53 +04:00
|
|
|
static void Initialize(JNIEnv *env);
|
|
|
|
static void Destroy(JNIEnv *env);
|
|
|
|
static jobject CreateNodeSubtype(JNIEnv *env,
|
|
|
|
nsIDOMNode *node);
|
|
|
|
|
|
|
|
static void AddToGarbage(nsISupports* domObject);
|
|
|
|
static void TakeOutGarbage();
|
|
|
|
|
1999-09-16 00:43:02 +04:00
|
|
|
static void ThrowException(JNIEnv *env,
|
1999-09-25 06:35:56 +04:00
|
|
|
const char * message = NULL,
|
|
|
|
nsresult rv = NS_OK,
|
|
|
|
ExceptionType exceptionType = EXCEPTION_RUNTIME);
|
2000-06-14 01:22:35 +04:00
|
|
|
|
|
|
|
static nsString* GetUnicode(JNIEnv *env,
|
|
|
|
jstring str);
|
1999-09-16 00:43:02 +04:00
|
|
|
};
|
|
|
|
|
1999-08-06 04:28:53 +04:00
|
|
|
#endif /* __JavaDOMGlobals_h__ */
|