update dev300-m58
[ooovba.git] / sj2 / source / inc / java_lang_object.hxx
blobc756dc8c0bd1bcf69062ecb7bb8376f70a8b9045
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: java_lang_object.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #include <jni.h>
31 #ifdef OS2
32 #include <typedefs.h>
33 #endif
35 #ifndef _SJ_JAVA_LANG_OBJECT_HXX
36 #define _SJ_JAVA_LANG_OBJECT_HXX
38 #include <tools/string.hxx>
41 #ifdef HAVE_64BIT_POINTERS
42 #error "no 64 bit pointer"
43 #else
44 #ifdef OS2
45 #define INT64_TO_PVOID(x) (void *)x.lo
46 inline jlong Make_Os2_Int64( INT32 hi, INT32 lo ) {jlong x = CONST64( hi, lo ); return x; }
47 #define PVOID_TO_INT64(x) Make_Os2_Int64( 0, (INT32)x )
48 #else //OS2
49 #define PVOID_TO_INT64(x) (jlong)(INT32)x
50 #define INT64_TO_PVOID(x) (void *)x
51 #endif //Os2
52 #endif
54 //=====================================================================
55 class java_lang_Class;
56 class java_lang_Object
58 // Zuweisungsoperator und Copy Konstruktor sind verboten
59 java_lang_Object& operator = (java_lang_Object&) { return *this;};
60 java_lang_Object(java_lang_Object&) {};
62 static jclass getMyClass();
63 // nur zum Zerstoeren des C++ Pointers in vom JSbxObject
64 // abgeleiteten Java Objekten
65 //static jclass getJSbxObjectClass();
67 protected:
68 // der JAVA Handle zu dieser Klasse
69 jobject object;
70 // Klassendefinition
72 // neu in SJ2:
73 static jclass theClass; // die Klasse braucht nur einmal angefordert werden !
74 static jclass theJSbxObjectClass; // die Klasse braucht nur einmal angefordert werden !
75 static ULONG nObjCount; // Zaehler fuer die Anzahl der Instanzen
77 public:
78 // der Konstruktor, der fuer die abgeleiteten Klassen verwendet
79 // werden soll.
80 java_lang_Object( JNIEnv * pEnv, jobject myObj );
81 // der eigentliche Konstruktor
82 java_lang_Object();
84 virtual ~java_lang_Object();
86 void saveRef( JNIEnv * pEnv, jobject myObj );
87 jobject getJavaObject() const { return object; }
88 java_lang_Object * GetWrapper() { return this; }
90 java_lang_Class * getClass();
94 #endif