UDK 3.2.7 C/C++ API Reference
typelib/typedescription.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*************************************************************************
00003  *
00004  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
00005  *
00006  * Copyright 2000, 2010 Oracle and/or its affiliates.
00007  *
00008  * OpenOffice.org - a multi-platform office productivity suite
00009  *
00010  * This file is part of OpenOffice.org.
00011  *
00012  * OpenOffice.org is free software: you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 3
00014  * only, as published by the Free Software Foundation.
00015  *
00016  * OpenOffice.org is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License version 3 for more details
00020  * (a copy is included in the LICENSE file that accompanied this code).
00021  *
00022  * You should have received a copy of the GNU Lesser General Public License
00023  * version 3 along with OpenOffice.org.  If not, see
00024  * <http://www.openoffice.org/license.html>
00025  * for a copy of the LGPLv3 License.
00026  *
00027  ************************************************************************/
00028 #ifndef _TYPELIB_TYPEDESCRIPTION_H_
00029 #define _TYPELIB_TYPEDESCRIPTION_H_
00030 
00031 #include <cppu/cppudllapi.h>
00032 #include <typelib/uik.h>
00033 #include <typelib/typeclass.h>
00034 #include <rtl/ustring.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00041 struct _typelib_TypeDescription;
00042 
00043 #if defined( SAL_W32)
00044 #pragma pack(push, 8)
00045 #endif
00046 
00049 typedef struct _typelib_TypeDescriptionReference
00050 {
00054     sal_Int32                           nRefCount;
00058     sal_Int32                           nStaticRefCount;
00061     typelib_TypeClass                   eTypeClass;
00064     rtl_uString *                       pTypeName;
00067     struct _typelib_TypeDescription *   pType;
00070     void *                              pUniqueIdentifier;
00073     void *                              pReserved;
00074 } typelib_TypeDescriptionReference;
00075 
00080 typedef struct _typelib_TypeDescription
00081 {
00085     sal_Int32                           nRefCount;
00089     sal_Int32                           nStaticRefCount;
00092     typelib_TypeClass                   eTypeClass;
00095     rtl_uString *                       pTypeName;
00098     struct _typelib_TypeDescription *   pSelf;
00101     void *                              pUniqueIdentifier;
00104     void *                              pReserved;
00105 
00111     sal_Bool                            bComplete;
00114     sal_Int32                           nSize;
00117     sal_Int32                           nAlignment;
00120     typelib_TypeDescriptionReference *  pWeakRef;
00123     sal_Bool                            bOnDemand;
00124 } typelib_TypeDescription;
00125 
00128 typedef struct _typelib_CompoundTypeDescription
00129 {
00132     typelib_TypeDescription             aBase;
00133 
00136     struct _typelib_CompoundTypeDescription * pBaseTypeDescription;
00137 
00140     sal_Int32                           nMembers;
00143     sal_Int32 *                         pMemberOffsets;
00146     typelib_TypeDescriptionReference ** ppTypeRefs;
00149     rtl_uString **                      ppMemberNames;
00150 } typelib_CompoundTypeDescription;
00151 
00161 typedef struct _typelib_StructTypeDescription
00162 {
00166     typelib_CompoundTypeDescription aBase;
00167 
00174     sal_Bool * pParameterizedTypes;
00175 } typelib_StructTypeDescription;
00176 
00179 typedef struct _typelib_UnionTypeDescription
00180 {
00183     typelib_TypeDescription             aBase;
00184 
00187     typelib_TypeDescriptionReference *  pDiscriminantTypeRef;
00188 
00191     sal_Int64                           nDefaultDiscriminant;
00194     typelib_TypeDescriptionReference *  pDefaultTypeRef;
00197     sal_Int32                           nMembers;
00200     sal_Int64 *                         pDiscriminants;
00203     typelib_TypeDescriptionReference ** ppTypeRefs;
00206     rtl_uString **                      ppMemberNames;
00209     sal_Int32                           nValueOffset;
00210 } typelib_UnionTypeDescription;
00211 
00214 typedef struct _typelib_IndirectTypeDescription
00215 {
00218     typelib_TypeDescription             aBase;
00219 
00222     typelib_TypeDescriptionReference *  pType;
00223 } typelib_IndirectTypeDescription;
00224 
00227 typedef struct _typelib_ArrayTypeDescription
00228 {
00231     typelib_IndirectTypeDescription     aBase;
00232 
00235     sal_Int32                           nDimensions;
00238     sal_Int32                           nTotalElements;
00241     sal_Int32 *                         pDimensions;
00242 } typelib_ArrayTypeDescription;
00243 
00246 typedef struct _typelib_EnumTypeDescription
00247 {
00250     typelib_TypeDescription             aBase;
00251 
00254     sal_Int32                           nDefaultEnumValue;
00257     sal_Int32                           nEnumValues;
00260     rtl_uString **                      ppEnumNames;
00263     sal_Int32 *                         pEnumValues;
00264 } typelib_EnumTypeDescription;
00265 
00268 typedef struct _typelib_MethodParameter
00269 {
00272     rtl_uString *                       pName;
00275     typelib_TypeDescriptionReference *  pTypeRef;
00279     sal_Bool                            bIn;
00283     sal_Bool                            bOut;
00284 } typelib_MethodParameter;
00285 
00289 typedef struct _typelib_InterfaceMemberTypeDescription
00290 {
00293     typelib_TypeDescription             aBase;
00294 
00298     sal_Int32                           nPosition;
00301     rtl_uString *                       pMemberName;
00302 } typelib_InterfaceMemberTypeDescription;
00303 
00307 typedef struct _typelib_InterfaceMethodTypeDescription
00308 {
00311     typelib_InterfaceMemberTypeDescription      aBase;
00312 
00315     typelib_TypeDescriptionReference *          pReturnTypeRef;
00318     sal_Int32                                   nParams;
00321     typelib_MethodParameter *                   pParams;
00324     sal_Int32                                   nExceptions;
00327     typelib_TypeDescriptionReference **         ppExceptions;
00330     sal_Bool                                    bOneWay;
00331 
00334     struct _typelib_InterfaceTypeDescription *  pInterface;
00340     typelib_TypeDescriptionReference *          pBaseRef;
00348     sal_Int32                                   nIndex;
00349 } typelib_InterfaceMethodTypeDescription;
00350 
00354 typedef struct _typelib_InterfaceAttributeTypeDescription
00355 {
00358     typelib_InterfaceMemberTypeDescription      aBase;
00359 
00362     sal_Bool                                    bReadOnly;
00365     typelib_TypeDescriptionReference *          pAttributeTypeRef;
00366 
00369     struct _typelib_InterfaceTypeDescription *  pInterface;
00375     typelib_TypeDescriptionReference *          pBaseRef;
00383     sal_Int32                                   nIndex;
00388     sal_Int32                                   nGetExceptions;
00393     typelib_TypeDescriptionReference **         ppGetExceptions;
00398     sal_Int32                                   nSetExceptions;
00403     typelib_TypeDescriptionReference **         ppSetExceptions;
00404 } typelib_InterfaceAttributeTypeDescription;
00405 
00433 typedef struct _typelib_InterfaceTypeDescription
00435 {
00438     typelib_TypeDescription                     aBase;
00439 
00445     struct _typelib_InterfaceTypeDescription *  pBaseTypeDescription;
00448     typelib_Uik                                 aUik;
00451     sal_Int32                                   nMembers;
00454     typelib_TypeDescriptionReference **         ppMembers;
00457     sal_Int32                                   nAllMembers;
00460     typelib_TypeDescriptionReference **         ppAllMembers;
00464     sal_Int32 *                                 pMapMemberIndexToFunctionIndex;
00467     sal_Int32                                   nMapFunctionIndexToMemberIndex;
00470     sal_Int32 *                                 pMapFunctionIndexToMemberIndex;
00475     sal_Int32                                   nBaseTypes;
00480     struct _typelib_InterfaceTypeDescription ** ppBaseTypes;
00481 } typelib_InterfaceTypeDescription;
00482 
00485 typedef struct _typelib_CompoundMember_Init
00486 {
00489     typelib_TypeClass   eTypeClass;
00495     rtl_uString *       pTypeName;
00498     rtl_uString *       pMemberName;
00499 } typelib_CompoundMember_Init;
00500 
00506 typedef struct _typelib_StructMember_Init
00507 {
00511     typelib_CompoundMember_Init aBase;
00512 
00517     sal_Bool bParameterizedType;
00518 } typelib_StructMember_Init;
00519 
00522 typedef struct _typelib_Parameter_Init
00523 {
00526     typelib_TypeClass   eTypeClass;
00529     rtl_uString *       pTypeName;
00532     rtl_uString *       pParamName;
00535     sal_Bool            bIn;
00538     sal_Bool            bOut;
00539 } typelib_Parameter_Init;
00540 
00543 typedef struct _typelib_Union_Init
00544 {
00547     sal_Int64           nDiscriminant;
00550     rtl_uString *       pMemberName;
00553     typelib_TypeDescriptionReference* pTypeRef;
00554 } typelib_Union_Init;
00555 
00556 #if defined( SAL_W32)
00557 #pragma pack(pop)
00558 #endif
00559 
00560 
00572 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newUnion(
00573     typelib_TypeDescription ** ppRet,
00574     rtl_uString * pTypeName,
00575     typelib_TypeDescriptionReference * pDiscriminantTypeRef,
00576     sal_Int64 nDefaultDiscriminant,
00577     typelib_TypeDescriptionReference * pDefaultTypeRef,
00578     sal_Int32 nMembers,
00579     typelib_Union_Init * pMembers )
00580     SAL_THROW_EXTERN_C();
00581 
00591 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newEnum(
00592     typelib_TypeDescription ** ppRet,
00593     rtl_uString * pTypeName,
00594     sal_Int32 nDefaultValue,
00595     sal_Int32 nEnumValues,
00596     rtl_uString ** ppEnumNames,
00597     sal_Int32 * pEnumValues )
00598     SAL_THROW_EXTERN_C();
00599 
00607 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newArray(
00608     typelib_TypeDescription ** ppRet,
00609     typelib_TypeDescriptionReference * pElementTypeRef,
00610     sal_Int32 nDimensions,
00611     sal_Int32 * pDimensions )
00612     SAL_THROW_EXTERN_C ();
00613 
00629 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_new(
00630     typelib_TypeDescription ** ppRet,
00631     typelib_TypeClass eTypeClass,
00632     rtl_uString * pTypeName,
00633     typelib_TypeDescriptionReference * pType,
00634     sal_Int32 nMembers,
00635     typelib_CompoundMember_Init * pMembers )
00636     SAL_THROW_EXTERN_C();
00637 
00648 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newStruct(
00649     typelib_TypeDescription ** ppRet,
00650     rtl_uString * pTypeName,
00651     typelib_TypeDescriptionReference * pType,
00652     sal_Int32 nMembers,
00653     typelib_StructMember_Init * pMembers )
00654     SAL_THROW_EXTERN_C();
00655 
00672 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterface(
00673     typelib_InterfaceTypeDescription ** ppRet,
00674     rtl_uString * pTypeName,
00675     sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5,
00676     typelib_TypeDescriptionReference * pBaseInterface,
00677     sal_Int32 nMembers,
00678     typelib_TypeDescriptionReference ** ppMembers )
00679     SAL_THROW_EXTERN_C();
00680 
00697 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newMIInterface(
00698     typelib_InterfaceTypeDescription ** ppRet,
00699     rtl_uString * pTypeName,
00700     sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5,
00701     sal_Int32 nBaseInterfaces,
00702     typelib_TypeDescriptionReference ** ppBaseInterfaces,
00703     sal_Int32 nMembers,
00704     typelib_TypeDescriptionReference ** ppMembers )
00705     SAL_THROW_EXTERN_C();
00706 
00720 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterfaceMethod(
00721     typelib_InterfaceMethodTypeDescription ** ppRet,
00722     sal_Int32 nAbsolutePosition,
00723     sal_Bool bOneWay,
00724     rtl_uString * pMethodName,
00725     typelib_TypeClass eReturnTypeClass,
00726     rtl_uString * pReturnTypeName,
00727     sal_Int32 nParams,
00728     typelib_Parameter_Init * pParams,
00729     sal_Int32 nExceptions,
00730     rtl_uString ** ppExceptionNames )
00731     SAL_THROW_EXTERN_C();
00732 
00746 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterfaceAttribute(
00747     typelib_InterfaceAttributeTypeDescription ** ppRet,
00748     sal_Int32 nAbsolutePosition,
00749     rtl_uString * pAttributeName,
00750     typelib_TypeClass eAttributeTypeClass,
00751     rtl_uString * pAttributeTypeName,
00752     sal_Bool bReadOnly )
00753     SAL_THROW_EXTERN_C();
00754 
00772 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute(
00773     typelib_InterfaceAttributeTypeDescription ** ppRet,
00774     sal_Int32 nAbsolutePosition,
00775     rtl_uString * pAttributeName,
00776     typelib_TypeClass eAttributeTypeClass,
00777     rtl_uString * pAttributeTypeName,
00778     sal_Bool bReadOnly,
00779     sal_Int32 nGetExceptions, rtl_uString ** ppGetExceptionNames,
00780     sal_Int32 nSetExceptions, rtl_uString ** ppSetExceptionNames )
00781     SAL_THROW_EXTERN_C();
00782 
00787 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_acquire(
00788     typelib_TypeDescription * pDesc )
00789     SAL_THROW_EXTERN_C();
00790 
00796 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_release(
00797     typelib_TypeDescription * pDesc )
00798     SAL_THROW_EXTERN_C();
00799 
00805 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register(
00806     typelib_TypeDescription ** ppNewDescription )
00807     SAL_THROW_EXTERN_C();
00808 
00815 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_equals(
00816     const typelib_TypeDescription * p1, const typelib_TypeDescription * p2 )
00817     SAL_THROW_EXTERN_C();
00818 
00824 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_getByName(
00825     typelib_TypeDescription ** ppRet, rtl_uString * pName )
00826     SAL_THROW_EXTERN_C();
00827 
00832 CPPU_DLLPUBLIC void SAL_CALL typelib_setCacheSize(
00833     sal_Int32 nNewSize )
00834     SAL_THROW_EXTERN_C();
00835 
00843 typedef void (SAL_CALL * typelib_typedescription_Callback)(
00844     void * pContext, typelib_TypeDescription ** ppRet, rtl_uString * pTypeName );
00845 
00851 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_registerCallback(
00852     void * pContext, typelib_typedescription_Callback pCallback )
00853     SAL_THROW_EXTERN_C();
00854 
00860 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_revokeCallback(
00861     void * pContext, typelib_typedescription_Callback pCallback )
00862     SAL_THROW_EXTERN_C();
00863 
00864 
00865 /*----------------------------------------------------------------------------*/
00866 /*----------------------------------------------------------------------------*/
00867 /*----------------------------------------------------------------------------*/
00868 
00870 
00877 #define TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( eTypeClass ) \
00878     ((eTypeClass) == typelib_TypeClass_INTERFACE_METHOD || \
00879      (eTypeClass) == typelib_TypeClass_INTERFACE_ATTRIBUTE)
00880 
00885 #define TYPELIB_DANGER_GET( ppDescription, pTypeRef ) \
00886 { \
00887     typelib_TypeDescriptionReference * pMacroTypeRef = (pTypeRef); \
00888     typelib_TypeDescription ** ppMacroTypeDescr = (ppDescription); \
00889     if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pMacroTypeRef->eTypeClass )) \
00890     { \
00891         typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); \
00892     } \
00893     else if (!pMacroTypeRef->pType || !pMacroTypeRef->pType->pWeakRef) \
00894     { \
00895         typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); \
00896         if (*ppMacroTypeDescr) \
00897             typelib_typedescription_release( *ppMacroTypeDescr ); \
00898     } \
00899     else \
00900     { \
00901         *ppMacroTypeDescr = pMacroTypeRef->pType; \
00902     } \
00903 }
00904 
00907 #define TYPELIB_DANGER_RELEASE( pDescription ) \
00908 { \
00909     if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( (pDescription)->eTypeClass )) \
00910         typelib_typedescription_release( pDescription ); \
00911 }
00912 
00914 
00922 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_new(
00923     typelib_TypeDescriptionReference ** ppTDR,
00924     typelib_TypeClass eTypeClass,
00925     rtl_uString * pTypeName )
00926     SAL_THROW_EXTERN_C();
00927 
00935 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_newByAsciiName(
00936     typelib_TypeDescriptionReference ** ppTDR,
00937     typelib_TypeClass eTypeClass,
00938     const sal_Char * pTypeName )
00939     SAL_THROW_EXTERN_C();
00940 
00945 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_acquire(
00946     typelib_TypeDescriptionReference * pRef )
00947     SAL_THROW_EXTERN_C();
00948 
00954 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_release(
00955     typelib_TypeDescriptionReference * pRef )
00956     SAL_THROW_EXTERN_C();
00957 
00963 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_getDescription(
00964     typelib_TypeDescription ** ppRet, typelib_TypeDescriptionReference * pRef )
00965     SAL_THROW_EXTERN_C();
00966 
00973 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescriptionreference_equals(
00974     const typelib_TypeDescriptionReference * p1, const typelib_TypeDescriptionReference * p2 )
00975     SAL_THROW_EXTERN_C();
00976 
00982 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_assign(
00983     typelib_TypeDescriptionReference ** ppDest,
00984     typelib_TypeDescriptionReference * pSource )
00985     SAL_THROW_EXTERN_C();
00986 
00993 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom(
00994     typelib_TypeDescription * pAssignable,
00995     typelib_TypeDescription * pFrom )
00996     SAL_THROW_EXTERN_C();
00997 
01004 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom(
01005     typelib_TypeDescriptionReference * pAssignable,
01006     typelib_TypeDescriptionReference * pFrom )
01007     SAL_THROW_EXTERN_C();
01008 
01018 CPPU_DLLPUBLIC typelib_TypeDescriptionReference ** SAL_CALL typelib_static_type_getByTypeClass(
01019     typelib_TypeClass eTypeClass )
01020     SAL_THROW_EXTERN_C();
01021 
01028 CPPU_DLLPUBLIC void SAL_CALL typelib_static_type_init(
01029     typelib_TypeDescriptionReference ** ppRef,
01030     typelib_TypeClass eTypeClass, const sal_Char * pTypeName )
01031     SAL_THROW_EXTERN_C();
01032 
01038 CPPU_DLLPUBLIC void SAL_CALL typelib_static_sequence_type_init(
01039     typelib_TypeDescriptionReference ** ppRef,
01040     typelib_TypeDescriptionReference * pElementType )
01041     SAL_THROW_EXTERN_C ();
01042 
01050 CPPU_DLLPUBLIC void SAL_CALL typelib_static_array_type_init(
01051     typelib_TypeDescriptionReference ** ppRef,
01052     typelib_TypeDescriptionReference * pElementType,
01053     sal_Int32 nDimensions, ... )
01054     SAL_THROW_EXTERN_C ();
01055 
01069 CPPU_DLLPUBLIC void SAL_CALL typelib_static_compound_type_init(
01070     typelib_TypeDescriptionReference ** ppRef,
01071     typelib_TypeClass eTypeClass, const sal_Char * pTypeName,
01072     typelib_TypeDescriptionReference * pBaseType,
01073     sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers )
01074     SAL_THROW_EXTERN_C();
01075 
01091 CPPU_DLLPUBLIC void SAL_CALL typelib_static_struct_type_init(
01092     typelib_TypeDescriptionReference ** ppRef, const sal_Char * pTypeName,
01093     typelib_TypeDescriptionReference * pBaseType,
01094     sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers,
01095     sal_Bool const * pParameterizedTypes )
01096     SAL_THROW_EXTERN_C();
01097 
01104 CPPU_DLLPUBLIC void SAL_CALL typelib_static_interface_type_init(
01105     typelib_TypeDescriptionReference ** ppRef,
01106     const sal_Char * pTypeName,
01107     typelib_TypeDescriptionReference * pBaseType )
01108     SAL_THROW_EXTERN_C();
01109 
01120 CPPU_DLLPUBLIC void SAL_CALL typelib_static_mi_interface_type_init(
01121     typelib_TypeDescriptionReference ** ppRef,
01122     const sal_Char * pTypeName,
01123     sal_Int32 nBaseTypes,
01124     typelib_TypeDescriptionReference ** ppBaseTypes )
01125     SAL_THROW_EXTERN_C();
01126 
01133 CPPU_DLLPUBLIC void SAL_CALL typelib_static_enum_type_init(
01134     typelib_TypeDescriptionReference ** ppRef,
01135     const sal_Char * pTypeName,
01136     sal_Int32 nDefaultValue )
01137     SAL_THROW_EXTERN_C();
01138 
01147 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_complete(
01148     typelib_TypeDescription ** ppTypeDescr )
01149     SAL_THROW_EXTERN_C();
01150 
01151 #ifdef __cplusplus
01152 }
01153 #endif
01154 
01155 #endif
01156 
01157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines