INTEGRATION: CWS sb14 (1.2.98); FILE MERGED
2004/03/15 15:59:11 sb 1.2.98.5: #i21150# Added support for extended interface attributes. 2004/03/12 14:17:18 sb 1.2.98.4: #i21150# Adapted to modified registry type reader. 2004/03/09 15:02:38 sb 1.2.98.3: #i21150# Constructing Java and C++ code for services and singletons. 2004/03/05 12:31:22 sb 1.2.98.2: #i21150# Added support for service constructors to javamaker. 2004/02/19 14:04:19 sb 1.2.98.1: #i21150# Generate Java classes for single-interface--based services and interface-based singletons.
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: javatype.hxx,v $
|
* $RCSfile: javatype.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jsc $ $Date: 2001-03-13 12:04:26 $
|
* last change: $Author: rt $ $Date: 2004-03-30 16:53:39 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -70,27 +70,12 @@
|
|||||||
#include <codemaker/dependency.hxx>
|
#include <codemaker/dependency.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum BASETYPE
|
#include "codemaker/options.hxx"
|
||||||
{
|
|
||||||
BT_INVALID,
|
|
||||||
BT_VOID,
|
|
||||||
BT_ANY,
|
|
||||||
BT_TYPE,
|
|
||||||
BT_BOOLEAN,
|
|
||||||
BT_CHAR,
|
|
||||||
BT_STRING,
|
|
||||||
BT_FLOAT,
|
|
||||||
BT_DOUBLE,
|
|
||||||
BT_OCTET,
|
|
||||||
BT_BYTE,
|
|
||||||
BT_SHORT,
|
|
||||||
BT_LONG,
|
|
||||||
BT_HYPER,
|
|
||||||
BT_UNSIGNED_SHORT,
|
|
||||||
BT_UNSIGNED_LONG,
|
|
||||||
BT_UNSIGNED_HYPER
|
|
||||||
};
|
|
||||||
|
|
||||||
|
#include "registry/reader.hxx"
|
||||||
|
#include "registry/types.h"
|
||||||
|
|
||||||
|
namespace codemaker { struct ExceptionTreeNode; }
|
||||||
|
|
||||||
enum JavaTypeDecl
|
enum JavaTypeDecl
|
||||||
{
|
{
|
||||||
@@ -107,6 +92,7 @@ static const sal_Int32 UIT_ONEWAY = 0x00000010;
|
|||||||
static const sal_Int32 UIT_CONST = 0x00000020;
|
static const sal_Int32 UIT_CONST = 0x00000020;
|
||||||
static const sal_Int32 UIT_ANY = 0x00000040;
|
static const sal_Int32 UIT_ANY = 0x00000040;
|
||||||
static const sal_Int32 UIT_INTERFACE = 0x00000080;
|
static const sal_Int32 UIT_INTERFACE = 0x00000080;
|
||||||
|
static const sal_Int32 UIT_BOUND = 0x00000100;
|
||||||
|
|
||||||
enum UnoTypeInfo
|
enum UnoTypeInfo
|
||||||
{
|
{
|
||||||
@@ -162,7 +148,7 @@ class FileStream;
|
|||||||
class JavaType
|
class JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JavaType(TypeReader& typeReader,
|
JavaType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -170,25 +156,19 @@ public:
|
|||||||
virtual ~JavaType();
|
virtual ~JavaType();
|
||||||
|
|
||||||
virtual sal_Bool dump(JavaOptions* pOptions) throw( CannotDumpException );
|
virtual sal_Bool dump(JavaOptions* pOptions) throw( CannotDumpException );
|
||||||
virtual sal_Bool dumpDependedTypes(JavaOptions* pOptions) throw( CannotDumpException );
|
void dumpDependedTypes(JavaOptions * options);
|
||||||
virtual sal_Bool dumpFile(FileStream& o) throw( CannotDumpException ) { return sal_True; }
|
virtual sal_Bool dumpFile(FileStream& o) throw( CannotDumpException ) { return sal_True; }
|
||||||
|
|
||||||
void dumpPackage(FileStream& o, sal_Bool bFullScope = sal_False);
|
void dumpPackage(FileStream& o, sal_Bool bFullScope = sal_False);
|
||||||
|
|
||||||
virtual void dumpDepImports(FileStream& o, const ::rtl::OString& typeName);
|
|
||||||
|
|
||||||
virtual void dumpType(FileStream& o, const ::rtl::OString& type) throw( CannotDumpException );
|
virtual void dumpType(FileStream& o, const ::rtl::OString& type) throw( CannotDumpException );
|
||||||
::rtl::OString getBaseType(const ::rtl::OString& type);
|
|
||||||
void dumpTypeInit(FileStream& o, const ::rtl::OString& name, const ::rtl::OString& type);
|
void dumpTypeInit(FileStream& o, const ::rtl::OString& name, const ::rtl::OString& type);
|
||||||
BASETYPE isBaseType(const ::rtl::OString& type);
|
|
||||||
sal_Bool isUnsigned(const ::rtl::OString& type);
|
sal_Bool isUnsigned(const ::rtl::OString& type);
|
||||||
sal_Bool isAny(const ::rtl::OString& type);
|
sal_Bool isAny(const ::rtl::OString& type);
|
||||||
sal_Bool isInterface(const ::rtl::OString& type);
|
sal_Bool isInterface(const ::rtl::OString& type);
|
||||||
|
|
||||||
void dumpConstantValue(FileStream& o, sal_uInt16 index);
|
void dumpConstantValue(FileStream& o, sal_uInt16 index);
|
||||||
|
|
||||||
sal_uInt32 getMemberCount();
|
|
||||||
|
|
||||||
// only used for structs and exceptions
|
// only used for structs and exceptions
|
||||||
sal_Bool dumpMemberConstructor(FileStream& o);
|
sal_Bool dumpMemberConstructor(FileStream& o);
|
||||||
sal_Bool dumpInheritedMembers( FileStream& o, const ::rtl::OString& type,
|
sal_Bool dumpInheritedMembers( FileStream& o, const ::rtl::OString& type,
|
||||||
@@ -201,14 +181,19 @@ public:
|
|||||||
::rtl::OString indent();
|
::rtl::OString indent();
|
||||||
::rtl::OString indent(sal_uInt32 num);
|
::rtl::OString indent(sal_uInt32 num);
|
||||||
protected:
|
protected:
|
||||||
::rtl::OString checkSpecialJavaType(const ::rtl::OString& type);
|
rtl::OString resolveTypedefs(rtl::OString const & unoType);
|
||||||
|
|
||||||
|
rtl::OString unfoldType(rtl::OString const & unoType, sal_Int32 * rank = 0);
|
||||||
|
|
||||||
::rtl::OString checkRealBaseType(const ::rtl::OString& type);
|
::rtl::OString checkRealBaseType(const ::rtl::OString& type);
|
||||||
|
|
||||||
|
virtual rtl::OString translateTypeName() { return m_typeName; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sal_uInt32 m_indentLength;
|
sal_uInt32 m_indentLength;
|
||||||
::rtl::OString m_typeName;
|
::rtl::OString m_typeName;
|
||||||
::rtl::OString m_name;
|
::rtl::OString m_name;
|
||||||
TypeReader m_reader;
|
typereg::Reader m_reader;
|
||||||
TypeManager& m_typeMgr;
|
TypeManager& m_typeMgr;
|
||||||
TypeDependency m_dependencies;
|
TypeDependency m_dependencies;
|
||||||
};
|
};
|
||||||
@@ -216,7 +201,7 @@ protected:
|
|||||||
class InterfaceType : public JavaType
|
class InterfaceType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InterfaceType(TypeReader& typeReader,
|
InterfaceType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -229,12 +214,18 @@ public:
|
|||||||
void dumpMethods(FileStream& o, UnoInfoList* pUnoInfos);
|
void dumpMethods(FileStream& o, UnoInfoList* pUnoInfos);
|
||||||
|
|
||||||
void dumpUnoInfo(FileStream& o, const UnoInfo& unoInfo, sal_Int32 * index);
|
void dumpUnoInfo(FileStream& o, const UnoInfo& unoInfo, sal_Int32 * index);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void dumpExceptionSpecification(FileStream & out, sal_uInt16 methodIndex);
|
||||||
|
|
||||||
|
void dumpAttributeExceptionSpecification(
|
||||||
|
FileStream & out, rtl::OUString const & name, RTMethodMode sort);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModuleType : public JavaType
|
class ModuleType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModuleType(TypeReader& typeReader,
|
ModuleType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -248,7 +239,7 @@ public:
|
|||||||
class ConstantsType : public JavaType
|
class ConstantsType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConstantsType(TypeReader& typeReader,
|
ConstantsType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -261,7 +252,7 @@ public:
|
|||||||
class StructureType : public JavaType
|
class StructureType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StructureType(TypeReader& typeReader,
|
StructureType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -274,7 +265,7 @@ public:
|
|||||||
class ExceptionType : public JavaType
|
class ExceptionType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ExceptionType(TypeReader& typeReader,
|
ExceptionType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -288,7 +279,7 @@ public:
|
|||||||
class EnumType : public JavaType
|
class EnumType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EnumType(TypeReader& typeReader,
|
EnumType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -301,7 +292,7 @@ public:
|
|||||||
class TypeDefType : public JavaType
|
class TypeDefType : public JavaType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TypeDefType(TypeReader& typeReader,
|
TypeDefType(typereg::Reader& typeReader,
|
||||||
const ::rtl::OString& typeName,
|
const ::rtl::OString& typeName,
|
||||||
const TypeManager& typeMgr,
|
const TypeManager& typeMgr,
|
||||||
const TypeDependency& typeDependencies);
|
const TypeDependency& typeDependencies);
|
||||||
@@ -311,6 +302,42 @@ public:
|
|||||||
sal_Bool dump(JavaOptions* pOptions) throw( CannotDumpException );
|
sal_Bool dump(JavaOptions* pOptions) throw( CannotDumpException );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ServiceType: public JavaType {
|
||||||
|
public:
|
||||||
|
ServiceType(
|
||||||
|
typereg::Reader & reader, rtl::OString const & name,
|
||||||
|
TypeManager const & manager, TypeDependency const & dependencies):
|
||||||
|
JavaType(reader, name, manager, dependencies) {}
|
||||||
|
|
||||||
|
bool isSingleInterfaceBased();
|
||||||
|
|
||||||
|
virtual sal_Bool dumpFile(FileStream & out) throw (CannotDumpException);
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual rtl::OString translateTypeName();
|
||||||
|
|
||||||
|
void dumpCatchClauses(
|
||||||
|
FileStream & out, codemaker::ExceptionTreeNode const * node);
|
||||||
|
|
||||||
|
void dumpAny(
|
||||||
|
FileStream & out, rtl::OString const & javaExpression,
|
||||||
|
rtl::OString const & unoType);
|
||||||
|
};
|
||||||
|
|
||||||
|
class SingletonType: public JavaType {
|
||||||
|
public:
|
||||||
|
SingletonType(
|
||||||
|
typereg::Reader & reader, rtl::OString const & name,
|
||||||
|
TypeManager const & manager, TypeDependency const & dependencies):
|
||||||
|
JavaType(reader, name, manager, dependencies) {}
|
||||||
|
|
||||||
|
bool isInterfaceBased();
|
||||||
|
|
||||||
|
virtual sal_Bool dumpFile(FileStream & out) throw (CannotDumpException);
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual rtl::OString translateTypeName();
|
||||||
|
};
|
||||||
|
|
||||||
sal_Bool produceType(const ::rtl::OString& typeName,
|
sal_Bool produceType(const ::rtl::OString& typeName,
|
||||||
TypeManager& typeMgr,
|
TypeManager& typeMgr,
|
||||||
|
Reference in New Issue
Block a user