From f1e22f1a051c44a55759b7d44b0f0ef1b6f3c9de Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 9 Apr 2015 09:09:19 +0200 Subject: fix android build since after my converting stuff in include/registry/types.h to use 'enum class', it can obviously no longer be "extern C", so drop the "extern C" and rename the file to reflect that. Change-Id: Ia30f5731316525e48531c4785ab7471a428bcf6f --- idlc/inc/idlc/astattribute.hxx | 2 +- include/registry/reader.h | 2 +- include/registry/reader.hxx | 2 +- include/registry/refltype.hxx | 2 +- include/registry/types.h | 340 ----------------------------------------- include/registry/types.hxx | 332 ++++++++++++++++++++++++++++++++++++++++ include/registry/writer.h | 2 +- include/registry/writer.hxx | 2 +- registry/source/regimpl.cxx | 2 +- 9 files changed, 339 insertions(+), 347 deletions(-) delete mode 100644 include/registry/types.h create mode 100644 include/registry/types.hxx diff --git a/idlc/inc/idlc/astattribute.hxx b/idlc/inc/idlc/astattribute.hxx index 6765d3c79638..173c393d912c 100644 --- a/idlc/inc/idlc/astattribute.hxx +++ b/idlc/inc/idlc/astattribute.hxx @@ -22,7 +22,7 @@ #include #include "idlc/astscope.hxx" -#include +#include #include namespace typereg { class Writer; } diff --git a/include/registry/reader.h b/include/registry/reader.h index 48dfef9161a6..a0e8eca502a9 100644 --- a/include/registry/reader.h +++ b/include/registry/reader.h @@ -21,7 +21,7 @@ #define INCLUDED_REGISTRY_READER_H #include -#include +#include #include #include diff --git a/include/registry/reader.hxx b/include/registry/reader.hxx index a03b6ef99fbf..d8980985700c 100644 --- a/include/registry/reader.hxx +++ b/include/registry/reader.hxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/include/registry/refltype.hxx b/include/registry/refltype.hxx index a7e3fcf25385..3e3bedad8796 100644 --- a/include/registry/refltype.hxx +++ b/include/registry/refltype.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_REGISTRY_REFLTYPE_HXX #define INCLUDED_REGISTRY_REFLTYPE_HXX -#include +#include #include /** specifies the type source of a binary type blob. diff --git a/include/registry/types.h b/include/registry/types.h deleted file mode 100644 index 27eacb899967..000000000000 --- a/include/registry/types.h +++ /dev/null @@ -1,340 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_REGISTRY_TYPES_H -#define INCLUDED_REGISTRY_TYPES_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** specifies the typeclass of a binary type blob. - - The general structure of a binary type blob is always the same. It depends - on the typeclass which parts of the blob are filled with data or not. - */ -enum RTTypeClass { - /** specifies that the structure of the given blob is unknown and can't be - read. - */ - RT_TYPE_INVALID, - - /** specifies that the blob represents an interface type. An interface blob - can contain a base interface, attributes and methods. - */ - RT_TYPE_INTERFACE, - - /** specifies that the blob represents a module type. A module blob can - contain a base module and constant members (fields). - */ - RT_TYPE_MODULE, - - /** specifies that the blob represents a struct type. A struct blob can - contain a base struct and members (fields). - */ - RT_TYPE_STRUCT, - - /** specifies that the blob represents an enum type. An enum blob can - contain enum values which are accessible as fields. - */ - RT_TYPE_ENUM, - - /** specifies that the blob represents an exception type. An exception blob - can contain a base exception and members (fields). - */ - RT_TYPE_EXCEPTION, - - /** specifies that the blob represents a typedef type. A typedef blob can - contain a base type. - */ - RT_TYPE_TYPEDEF, - - /** specifies that the blob represents a service type. A service blob can - contain a base service, properties (fields), references to services or - interfaces. - */ - RT_TYPE_SERVICE, - - /** specifies that the blob represents a singleton type (a named object) - which refers exactly one existing service. - */ - RT_TYPE_SINGLETON, - - /// deprecated, not used. - RT_TYPE_OBJECT, - - /** specifies that the blob represents a constants type. A constants blob - can contain constant types as fields. - */ - RT_TYPE_CONSTANTS, - - /** @deprecated - a union type was evaluated but currently not supported. - */ - RT_TYPE_UNION, - - /// @cond INTERNAL - /** - Flag for published entities. - - Used in combination with RT_TYPE_INTERFACE, RT_TYPE_STRUCT, RT_TYPE_ENUM, - RT_TYPE_EXCEPTION, RT_TYPE_TYPEDEF, RT_TYPE_SERVICE, RT_TYPE_SINGLETON, - or RT_TYPE_CONSTANTS to mark an entity as published. - - (The value of this enumerator is chosen so that it is unlikely that its - addition changes the underlying type of this enumeration for any C/C++ - compiler.) - - @since UDK 3.2.0 - */ - RT_TYPE_PUBLISHED = 0x4000 - /// @endcond -}; - -/** specifies the type for the field access. - - Fields in a type blob are used for different types. Among others they were - used for properties of services and these properties can have several flags. - - @see RTFieldAccess::INVALID - @see RTFieldAccess::READONLY - @see RTFieldAccess::OPTIONAL - @see RTFieldAccess::MAYBEVOID - @see RTFieldAccess::BOUND - @see RTFieldAccess::CONSTRAINED - @see RTFieldAccess::TRANSIENT - @see RTFieldAccess::MAYBEAMBIGUOUS - @see RTFieldAccess::MAYBEDEFAULT - @see RTFieldAccess::REMOVABLE - @see RTFieldAccess::ATTRIBUTE - @see RTFieldAccess::PROPERTY - @see RTFieldAccess::CONST - @see RTFieldAccess::READWRITE - @see RTFieldAccess::DEFAULT - @see RTFieldAccess::PARAMETERIZED_TYPE - @see RTFieldAccess::PUBLISHED - */ -enum class RTFieldAccess -{ - NONE = 0x0000, - /// specifies a unknown flag - INVALID = 0x0000, - /// specifies a readonly property/attribute - READONLY = 0x0001, - /// specifies a property as optional that means that it must not be implemented. - OPTIONAL = 0x0002, - /// @see com::sun::star::beans::PropertyAttribute - MAYBEVOID = 0x0004, - /// @see com::sun::star::beans::PropertyAttribute - BOUND = 0x0008, - /// @see com::sun::star::beans::PropertyAttribute - CONSTRAINED = 0x0010, - /// @see com::sun::star::beans::PropertyAttribute - TRANSIENT = 0x0020, - /// @see com::sun::star::beans::PropertyAttribute - MAYBEAMBIGUOUS = 0x0040, - /// @see com::sun::star::beans::PropertyAttribute - MAYBEDEFAULT = 0x0080, - /// @see com::sun::star::beans::PropertyAttribute - REMOVABLE = 0x0100, - /// @see com::sun::star::beans::PropertyAttribute - ATTRIBUTE = 0x0200, - /// specifies that the field is a property - PROPERTY = 0x0400, - /// specifies that the field is a constant or enum value - CONST = 0x0800, - /// specifies that the property/attribute has read/write access - READWRITE = 0x1000, - /// only to describe a union default label - DEFAULT = 0x2000, - /** - Indicates that a member of a polymorphic struct type template is of a - parameterized type. - - Only valid for fields that represent members of polymorphic struct type - templates. - - @since UDK 3.2.0 - */ - PARAMETERIZED_TYPE = 0x4000, - /** - Flag for published individual constants. - - Used in combination with RTFieldAccess::CONST for individual constants (which are - not members of constant groups). - - @since UDK 3.2.0 - */ - PUBLISHED = 0x8000, - -}; -namespace o3tl -{ - template<> struct typed_flags : is_typed_flags {}; -} - -/** specifies the type of a field value. - - A field can have a value if it repsresents a constant or an enum value. - */ -enum RTValueType { - RT_TYPE_NONE, - RT_TYPE_BOOL, - RT_TYPE_BYTE, - RT_TYPE_INT16, - RT_TYPE_UINT16, - RT_TYPE_INT32, - RT_TYPE_UINT32, - RT_TYPE_INT64, - RT_TYPE_UINT64, - RT_TYPE_FLOAT, - RT_TYPE_DOUBLE, - RT_TYPE_STRING -}; - -/** specifies a variable container for field values. - */ -union RTConstValueUnion { - sal_Bool aBool; - sal_Int8 aByte; - sal_Int16 aShort; - sal_uInt16 aUShort; - sal_Int32 aLong; - sal_uInt32 aULong; - sal_Int64 aHyper; - sal_uInt64 aUHyper; - float aFloat; - double aDouble; - sal_Unicode const * aString; -}; - -/** specifies the mode of a method. - - A method can be synchron or asynchron (oneway). The const attribute for - methods was removed so that the const values are deprecated. - */ -enum class RTMethodMode { - /// indicates an invalid mode - INVALID, - - /// indicates the asynchronous mode of a method - ONEWAY, - - /// @deprecated - ONEWAY_CONST, - - /// indicated the synchronous mode of a method - TWOWAY, - - /// @deprecated - TWOWAY_CONST, - - /** - Indicates an extended attribute getter (that has a 'raises' clause) of an - interface type. - - @since UDK 3.2.0 - */ - ATTRIBUTE_GET, - - /** - Indicates an extended attribute setter (that has a 'raises' clause) of an - interface type. - - @since UDK 3.2.0 - */ - ATTRIBUTE_SET -}; - -/** specifies the mode of a parameter. - - There are three parameter modes which have impact of the handling of the - parameter in the UNO bridges and the UNO code generation. - */ -enum RTParamMode { - /// indicates an invalid parameter mode - RT_PARAM_INVALID = 0, - - /// indicates a pure in parameter which is used by value - RT_PARAM_IN = 1, - - /// indicates a pure out parameter which is used by reference - RT_PARAM_OUT = 2, - - /// indicates a in and out parameter which is used also by reference - RT_PARAM_INOUT = 3, - - /** - Indicates a rest parameter (currently only valid for service - constructors). - - This value can be combined with any of RT_PARAM_IN, RT_PARAM_OUT, and - RT_PARAM_INOUT (however, service constructors currently only allow - RT_PARAM_IN, anyway). - - @since UDK 3.2.0 - */ - RT_PARAM_REST = 4 -}; - -/** specifies the type of a reference used in a service description. - */ -enum class RTReferenceType { - /// the reference type is unknown - INVALID, - - /** the service support the interface that means a implementation of this - service must implement this interface. - */ - SUPPORTS, - - /** @deprecated - the service observes the interface. - */ - OBSERVES, - - /** the service exports the specified service that means this service - provides also the specified service. - */ - EXPORTS, - - /** @deprecated - the service needs the specified service that means in the context of - this service the specified service will be used or must be available. - */ - NEEDS, - - /** - Indicates a type parameter of a polymorphic struct type template. - - @since UDK 3.2.0 - */ - TYPE_PARAMETER -}; - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/registry/types.hxx b/include/registry/types.hxx new file mode 100644 index 000000000000..dc28e9d5d47b --- /dev/null +++ b/include/registry/types.hxx @@ -0,0 +1,332 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_REGISTRY_TYPES_H +#define INCLUDED_REGISTRY_TYPES_H + +#include +#include + +/** specifies the typeclass of a binary type blob. + + The general structure of a binary type blob is always the same. It depends + on the typeclass which parts of the blob are filled with data or not. + */ +enum RTTypeClass { + /** specifies that the structure of the given blob is unknown and can't be + read. + */ + RT_TYPE_INVALID, + + /** specifies that the blob represents an interface type. An interface blob + can contain a base interface, attributes and methods. + */ + RT_TYPE_INTERFACE, + + /** specifies that the blob represents a module type. A module blob can + contain a base module and constant members (fields). + */ + RT_TYPE_MODULE, + + /** specifies that the blob represents a struct type. A struct blob can + contain a base struct and members (fields). + */ + RT_TYPE_STRUCT, + + /** specifies that the blob represents an enum type. An enum blob can + contain enum values which are accessible as fields. + */ + RT_TYPE_ENUM, + + /** specifies that the blob represents an exception type. An exception blob + can contain a base exception and members (fields). + */ + RT_TYPE_EXCEPTION, + + /** specifies that the blob represents a typedef type. A typedef blob can + contain a base type. + */ + RT_TYPE_TYPEDEF, + + /** specifies that the blob represents a service type. A service blob can + contain a base service, properties (fields), references to services or + interfaces. + */ + RT_TYPE_SERVICE, + + /** specifies that the blob represents a singleton type (a named object) + which refers exactly one existing service. + */ + RT_TYPE_SINGLETON, + + /// deprecated, not used. + RT_TYPE_OBJECT, + + /** specifies that the blob represents a constants type. A constants blob + can contain constant types as fields. + */ + RT_TYPE_CONSTANTS, + + /** @deprecated + a union type was evaluated but currently not supported. + */ + RT_TYPE_UNION, + + /// @cond INTERNAL + /** + Flag for published entities. + + Used in combination with RT_TYPE_INTERFACE, RT_TYPE_STRUCT, RT_TYPE_ENUM, + RT_TYPE_EXCEPTION, RT_TYPE_TYPEDEF, RT_TYPE_SERVICE, RT_TYPE_SINGLETON, + or RT_TYPE_CONSTANTS to mark an entity as published. + + (The value of this enumerator is chosen so that it is unlikely that its + addition changes the underlying type of this enumeration for any C/C++ + compiler.) + + @since UDK 3.2.0 + */ + RT_TYPE_PUBLISHED = 0x4000 + /// @endcond +}; + +/** specifies the type for the field access. + + Fields in a type blob are used for different types. Among others they were + used for properties of services and these properties can have several flags. + + @see RTFieldAccess::INVALID + @see RTFieldAccess::READONLY + @see RTFieldAccess::OPTIONAL + @see RTFieldAccess::MAYBEVOID + @see RTFieldAccess::BOUND + @see RTFieldAccess::CONSTRAINED + @see RTFieldAccess::TRANSIENT + @see RTFieldAccess::MAYBEAMBIGUOUS + @see RTFieldAccess::MAYBEDEFAULT + @see RTFieldAccess::REMOVABLE + @see RTFieldAccess::ATTRIBUTE + @see RTFieldAccess::PROPERTY + @see RTFieldAccess::CONST + @see RTFieldAccess::READWRITE + @see RTFieldAccess::DEFAULT + @see RTFieldAccess::PARAMETERIZED_TYPE + @see RTFieldAccess::PUBLISHED + */ +enum class RTFieldAccess +{ + NONE = 0x0000, + /// specifies a unknown flag + INVALID = 0x0000, + /// specifies a readonly property/attribute + READONLY = 0x0001, + /// specifies a property as optional that means that it must not be implemented. + OPTIONAL = 0x0002, + /// @see com::sun::star::beans::PropertyAttribute + MAYBEVOID = 0x0004, + /// @see com::sun::star::beans::PropertyAttribute + BOUND = 0x0008, + /// @see com::sun::star::beans::PropertyAttribute + CONSTRAINED = 0x0010, + /// @see com::sun::star::beans::PropertyAttribute + TRANSIENT = 0x0020, + /// @see com::sun::star::beans::PropertyAttribute + MAYBEAMBIGUOUS = 0x0040, + /// @see com::sun::star::beans::PropertyAttribute + MAYBEDEFAULT = 0x0080, + /// @see com::sun::star::beans::PropertyAttribute + REMOVABLE = 0x0100, + /// @see com::sun::star::beans::PropertyAttribute + ATTRIBUTE = 0x0200, + /// specifies that the field is a property + PROPERTY = 0x0400, + /// specifies that the field is a constant or enum value + CONST = 0x0800, + /// specifies that the property/attribute has read/write access + READWRITE = 0x1000, + /// only to describe a union default label + DEFAULT = 0x2000, + /** + Indicates that a member of a polymorphic struct type template is of a + parameterized type. + + Only valid for fields that represent members of polymorphic struct type + templates. + + @since UDK 3.2.0 + */ + PARAMETERIZED_TYPE = 0x4000, + /** + Flag for published individual constants. + + Used in combination with RTFieldAccess::CONST for individual constants (which are + not members of constant groups). + + @since UDK 3.2.0 + */ + PUBLISHED = 0x8000, + +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +/** specifies the type of a field value. + + A field can have a value if it repsresents a constant or an enum value. + */ +enum RTValueType { + RT_TYPE_NONE, + RT_TYPE_BOOL, + RT_TYPE_BYTE, + RT_TYPE_INT16, + RT_TYPE_UINT16, + RT_TYPE_INT32, + RT_TYPE_UINT32, + RT_TYPE_INT64, + RT_TYPE_UINT64, + RT_TYPE_FLOAT, + RT_TYPE_DOUBLE, + RT_TYPE_STRING +}; + +/** specifies a variable container for field values. + */ +union RTConstValueUnion { + sal_Bool aBool; + sal_Int8 aByte; + sal_Int16 aShort; + sal_uInt16 aUShort; + sal_Int32 aLong; + sal_uInt32 aULong; + sal_Int64 aHyper; + sal_uInt64 aUHyper; + float aFloat; + double aDouble; + sal_Unicode const * aString; +}; + +/** specifies the mode of a method. + + A method can be synchron or asynchron (oneway). The const attribute for + methods was removed so that the const values are deprecated. + */ +enum class RTMethodMode { + /// indicates an invalid mode + INVALID, + + /// indicates the asynchronous mode of a method + ONEWAY, + + /// @deprecated + ONEWAY_CONST, + + /// indicated the synchronous mode of a method + TWOWAY, + + /// @deprecated + TWOWAY_CONST, + + /** + Indicates an extended attribute getter (that has a 'raises' clause) of an + interface type. + + @since UDK 3.2.0 + */ + ATTRIBUTE_GET, + + /** + Indicates an extended attribute setter (that has a 'raises' clause) of an + interface type. + + @since UDK 3.2.0 + */ + ATTRIBUTE_SET +}; + +/** specifies the mode of a parameter. + + There are three parameter modes which have impact of the handling of the + parameter in the UNO bridges and the UNO code generation. + */ +enum RTParamMode { + /// indicates an invalid parameter mode + RT_PARAM_INVALID = 0, + + /// indicates a pure in parameter which is used by value + RT_PARAM_IN = 1, + + /// indicates a pure out parameter which is used by reference + RT_PARAM_OUT = 2, + + /// indicates a in and out parameter which is used also by reference + RT_PARAM_INOUT = 3, + + /** + Indicates a rest parameter (currently only valid for service + constructors). + + This value can be combined with any of RT_PARAM_IN, RT_PARAM_OUT, and + RT_PARAM_INOUT (however, service constructors currently only allow + RT_PARAM_IN, anyway). + + @since UDK 3.2.0 + */ + RT_PARAM_REST = 4 +}; + +/** specifies the type of a reference used in a service description. + */ +enum class RTReferenceType { + /// the reference type is unknown + INVALID, + + /** the service support the interface that means a implementation of this + service must implement this interface. + */ + SUPPORTS, + + /** @deprecated + the service observes the interface. + */ + OBSERVES, + + /** the service exports the specified service that means this service + provides also the specified service. + */ + EXPORTS, + + /** @deprecated + the service needs the specified service that means in the context of + this service the specified service will be used or must be available. + */ + NEEDS, + + /** + Indicates a type parameter of a polymorphic struct type template. + + @since UDK 3.2.0 + */ + TYPE_PARAMETER +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/registry/writer.h b/include/registry/writer.h index bf5b314816ba..e05b09634ede 100644 --- a/include/registry/writer.h +++ b/include/registry/writer.h @@ -21,7 +21,7 @@ #define INCLUDED_REGISTRY_WRITER_H #include -#include +#include #include #include diff --git a/include/registry/writer.hxx b/include/registry/writer.hxx index f6dced52ffaa..023aa1ee2d70 100644 --- a/include/registry/writer.hxx +++ b/include/registry/writer.hxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 64ad999816bb..95ed912e8b68 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -37,7 +37,7 @@ #include "registry/reader.hxx" #include "registry/refltype.hxx" -#include "registry/types.h" +#include "registry/types.hxx" #include "registry/version.h" #include "reflcnst.hxx" -- cgit v1.2.3