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  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
00018  */
00019 #ifndef _TYPELIB_TYPEDESCRIPTION_H_
00020 #define _TYPELIB_TYPEDESCRIPTION_H_
00021 
00022 #include <cppu/cppudllapi.h>
00023 #include <typelib/uik.h>
00024 #include <typelib/typeclass.h>
00025 #include <rtl/ustring.h>
00026 
00027 #ifdef __cplusplus
00028 extern "C"
00029 {
00030 #endif
00031 
00032 struct _typelib_TypeDescription;
00033 
00034 #if defined( SAL_W32)
00035 #pragma pack(push, 8)
00036 #endif
00037 
00040 typedef struct _typelib_TypeDescriptionReference
00041 {
00045     sal_Int32                           nRefCount;
00049     sal_Int32                           nStaticRefCount;
00052     typelib_TypeClass                   eTypeClass;
00055     rtl_uString *                       pTypeName;
00058     struct _typelib_TypeDescription *   pType;
00061     void *                              pUniqueIdentifier;
00064     void *                              pReserved;
00065 } typelib_TypeDescriptionReference;
00066 
00071 typedef struct _typelib_TypeDescription
00072 {
00076     sal_Int32                           nRefCount;
00080     sal_Int32                           nStaticRefCount;
00083     typelib_TypeClass                   eTypeClass;
00086     rtl_uString *                       pTypeName;
00089     struct _typelib_TypeDescription *   pSelf;
00092     void *                              pUniqueIdentifier;
00095     void *                              pReserved;
00096 
00102     sal_Bool                            bComplete;
00105     sal_Int32                           nSize;
00108     sal_Int32                           nAlignment;
00111     typelib_TypeDescriptionReference *  pWeakRef;
00114     sal_Bool                            bOnDemand;
00115 } typelib_TypeDescription;
00116 
00119 typedef struct _typelib_CompoundTypeDescription
00120 {
00123     typelib_TypeDescription             aBase;
00124 
00127     struct _typelib_CompoundTypeDescription * pBaseTypeDescription;
00128 
00131     sal_Int32                           nMembers;
00134     sal_Int32 *                         pMemberOffsets;
00137     typelib_TypeDescriptionReference ** ppTypeRefs;
00140     rtl_uString **                      ppMemberNames;
00141 } typelib_CompoundTypeDescription;
00142 
00152 typedef struct _typelib_StructTypeDescription
00153 {
00157     typelib_CompoundTypeDescription aBase;
00158 
00165     sal_Bool * pParameterizedTypes;
00166 } typelib_StructTypeDescription;
00167 
00170 typedef struct _typelib_UnionTypeDescription
00171 {
00174     typelib_TypeDescription             aBase;
00175 
00178     typelib_TypeDescriptionReference *  pDiscriminantTypeRef;
00179 
00182     sal_Int64                           nDefaultDiscriminant;
00185     typelib_TypeDescriptionReference *  pDefaultTypeRef;
00188     sal_Int32                           nMembers;
00191     sal_Int64 *                         pDiscriminants;
00194     typelib_TypeDescriptionReference ** ppTypeRefs;
00197     rtl_uString **                      ppMemberNames;
00200     sal_Int32                           nValueOffset;
00201 } typelib_UnionTypeDescription;
00202 
00205 typedef struct _typelib_IndirectTypeDescription
00206 {
00209     typelib_TypeDescription             aBase;
00210 
00213     typelib_TypeDescriptionReference *  pType;
00214 } typelib_IndirectTypeDescription;
00215 
00218 typedef struct _typelib_ArrayTypeDescription
00219 {
00222     typelib_IndirectTypeDescription     aBase;
00223 
00226     sal_Int32                           nDimensions;
00229     sal_Int32                           nTotalElements;
00232     sal_Int32 *                         pDimensions;
00233 } typelib_ArrayTypeDescription;
00234 
00237 typedef struct _typelib_EnumTypeDescription
00238 {
00241     typelib_TypeDescription             aBase;
00242 
00245     sal_Int32                           nDefaultEnumValue;
00248     sal_Int32                           nEnumValues;
00251     rtl_uString **                      ppEnumNames;
00254     sal_Int32 *                         pEnumValues;
00255 } typelib_EnumTypeDescription;
00256 
00259 typedef struct _typelib_MethodParameter
00260 {
00263     rtl_uString *                       pName;
00266     typelib_TypeDescriptionReference *  pTypeRef;
00270     sal_Bool                            bIn;
00274     sal_Bool                            bOut;
00275 } typelib_MethodParameter;
00276 
00280 typedef struct _typelib_InterfaceMemberTypeDescription
00281 {
00284     typelib_TypeDescription             aBase;
00285 
00289     sal_Int32                           nPosition;
00292     rtl_uString *                       pMemberName;
00293 } typelib_InterfaceMemberTypeDescription;
00294 
00298 typedef struct _typelib_InterfaceMethodTypeDescription
00299 {
00302     typelib_InterfaceMemberTypeDescription      aBase;
00303 
00306     typelib_TypeDescriptionReference *          pReturnTypeRef;
00309     sal_Int32                                   nParams;
00312     typelib_MethodParameter *                   pParams;
00315     sal_Int32                                   nExceptions;
00318     typelib_TypeDescriptionReference **         ppExceptions;
00321     sal_Bool                                    bOneWay;
00322 
00325     struct _typelib_InterfaceTypeDescription *  pInterface;
00331     typelib_TypeDescriptionReference *          pBaseRef;
00339     sal_Int32                                   nIndex;
00340 } typelib_InterfaceMethodTypeDescription;
00341 
00345 typedef struct _typelib_InterfaceAttributeTypeDescription
00346 {
00349     typelib_InterfaceMemberTypeDescription      aBase;
00350 
00353     sal_Bool                                    bReadOnly;
00356     typelib_TypeDescriptionReference *          pAttributeTypeRef;
00357 
00360     struct _typelib_InterfaceTypeDescription *  pInterface;
00366     typelib_TypeDescriptionReference *          pBaseRef;
00374     sal_Int32                                   nIndex;
00379     sal_Int32                                   nGetExceptions;
00384     typelib_TypeDescriptionReference **         ppGetExceptions;
00389     sal_Int32                                   nSetExceptions;
00394     typelib_TypeDescriptionReference **         ppSetExceptions;
00395 } typelib_InterfaceAttributeTypeDescription;
00396 
00424 typedef struct _typelib_InterfaceTypeDescription
00426 {
00429     typelib_TypeDescription                     aBase;
00430 
00436     struct _typelib_InterfaceTypeDescription *  pBaseTypeDescription;
00439     typelib_Uik                                 aUik;
00442     sal_Int32                                   nMembers;
00445     typelib_TypeDescriptionReference **         ppMembers;
00448     sal_Int32                                   nAllMembers;
00451     typelib_TypeDescriptionReference **         ppAllMembers;
00455     sal_Int32 *                                 pMapMemberIndexToFunctionIndex;
00458     sal_Int32                                   nMapFunctionIndexToMemberIndex;
00461     sal_Int32 *                                 pMapFunctionIndexToMemberIndex;
00466     sal_Int32                                   nBaseTypes;
00471     struct _typelib_InterfaceTypeDescription ** ppBaseTypes;
00472 } typelib_InterfaceTypeDescription;
00473 
00476 typedef struct _typelib_CompoundMember_Init
00477 {
00480     typelib_TypeClass   eTypeClass;
00486     rtl_uString *       pTypeName;
00489     rtl_uString *       pMemberName;
00490 } typelib_CompoundMember_Init;
00491 
00497 typedef struct _typelib_StructMember_Init
00498 {
00502     typelib_CompoundMember_Init aBase;
00503 
00508     sal_Bool bParameterizedType;
00509 } typelib_StructMember_Init;
00510 
00513 typedef struct _typelib_Parameter_Init
00514 {
00517     typelib_TypeClass   eTypeClass;
00520     rtl_uString *       pTypeName;
00523     rtl_uString *       pParamName;
00526     sal_Bool            bIn;
00529     sal_Bool            bOut;
00530 } typelib_Parameter_Init;
00531 
00534 typedef struct _typelib_Union_Init
00535 {
00538     sal_Int64           nDiscriminant;
00541     rtl_uString *       pMemberName;
00544     typelib_TypeDescriptionReference* pTypeRef;
00545 } typelib_Union_Init;
00546 
00547 #if defined( SAL_W32)
00548 #pragma pack(pop)
00549 #endif
00550 
00551 
00563 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newUnion(
00564     typelib_TypeDescription ** ppRet,
00565     rtl_uString * pTypeName,
00566     typelib_TypeDescriptionReference * pDiscriminantTypeRef,
00567     sal_Int64 nDefaultDiscriminant,
00568     typelib_TypeDescriptionReference * pDefaultTypeRef,
00569     sal_Int32 nMembers,
00570     typelib_Union_Init * pMembers )
00571     SAL_THROW_EXTERN_C();
00572 
00582 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newEnum(
00583     typelib_TypeDescription ** ppRet,
00584     rtl_uString * pTypeName,
00585     sal_Int32 nDefaultValue,
00586     sal_Int32 nEnumValues,
00587     rtl_uString ** ppEnumNames,
00588     sal_Int32 * pEnumValues )
00589     SAL_THROW_EXTERN_C();
00590 
00598 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newArray(
00599     typelib_TypeDescription ** ppRet,
00600     typelib_TypeDescriptionReference * pElementTypeRef,
00601     sal_Int32 nDimensions,
00602     sal_Int32 * pDimensions )
00603     SAL_THROW_EXTERN_C ();
00604 
00620 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_new(
00621     typelib_TypeDescription ** ppRet,
00622     typelib_TypeClass eTypeClass,
00623     rtl_uString * pTypeName,
00624     typelib_TypeDescriptionReference * pType,
00625     sal_Int32 nMembers,
00626     typelib_CompoundMember_Init * pMembers )
00627     SAL_THROW_EXTERN_C();
00628 
00639 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newStruct(
00640     typelib_TypeDescription ** ppRet,
00641     rtl_uString * pTypeName,
00642     typelib_TypeDescriptionReference * pType,
00643     sal_Int32 nMembers,
00644     typelib_StructMember_Init * pMembers )
00645     SAL_THROW_EXTERN_C();
00646 
00663 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterface(
00664     typelib_InterfaceTypeDescription ** ppRet,
00665     rtl_uString * pTypeName,
00666     sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5,
00667     typelib_TypeDescriptionReference * pBaseInterface,
00668     sal_Int32 nMembers,
00669     typelib_TypeDescriptionReference ** ppMembers )
00670     SAL_THROW_EXTERN_C();
00671 
00688 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newMIInterface(
00689     typelib_InterfaceTypeDescription ** ppRet,
00690     rtl_uString * pTypeName,
00691     sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5,
00692     sal_Int32 nBaseInterfaces,
00693     typelib_TypeDescriptionReference ** ppBaseInterfaces,
00694     sal_Int32 nMembers,
00695     typelib_TypeDescriptionReference ** ppMembers )
00696     SAL_THROW_EXTERN_C();
00697 
00711 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterfaceMethod(
00712     typelib_InterfaceMethodTypeDescription ** ppRet,
00713     sal_Int32 nAbsolutePosition,
00714     sal_Bool bOneWay,
00715     rtl_uString * pMethodName,
00716     typelib_TypeClass eReturnTypeClass,
00717     rtl_uString * pReturnTypeName,
00718     sal_Int32 nParams,
00719     typelib_Parameter_Init * pParams,
00720     sal_Int32 nExceptions,
00721     rtl_uString ** ppExceptionNames )
00722     SAL_THROW_EXTERN_C();
00723 
00737 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterfaceAttribute(
00738     typelib_InterfaceAttributeTypeDescription ** ppRet,
00739     sal_Int32 nAbsolutePosition,
00740     rtl_uString * pAttributeName,
00741     typelib_TypeClass eAttributeTypeClass,
00742     rtl_uString * pAttributeTypeName,
00743     sal_Bool bReadOnly )
00744     SAL_THROW_EXTERN_C();
00745 
00763 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute(
00764     typelib_InterfaceAttributeTypeDescription ** ppRet,
00765     sal_Int32 nAbsolutePosition,
00766     rtl_uString * pAttributeName,
00767     typelib_TypeClass eAttributeTypeClass,
00768     rtl_uString * pAttributeTypeName,
00769     sal_Bool bReadOnly,
00770     sal_Int32 nGetExceptions, rtl_uString ** ppGetExceptionNames,
00771     sal_Int32 nSetExceptions, rtl_uString ** ppSetExceptionNames )
00772     SAL_THROW_EXTERN_C();
00773 
00778 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_acquire(
00779     typelib_TypeDescription * pDesc )
00780     SAL_THROW_EXTERN_C();
00781 
00787 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_release(
00788     typelib_TypeDescription * pDesc )
00789     SAL_THROW_EXTERN_C();
00790 
00796 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register(
00797     typelib_TypeDescription ** ppNewDescription )
00798     SAL_THROW_EXTERN_C();
00799 
00806 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_equals(
00807     const typelib_TypeDescription * p1, const typelib_TypeDescription * p2 )
00808     SAL_THROW_EXTERN_C();
00809 
00815 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_getByName(
00816     typelib_TypeDescription ** ppRet, rtl_uString * pName )
00817     SAL_THROW_EXTERN_C();
00818 
00823 CPPU_DLLPUBLIC void SAL_CALL typelib_setCacheSize(
00824     sal_Int32 nNewSize )
00825     SAL_THROW_EXTERN_C();
00826 
00834 typedef void (SAL_CALL * typelib_typedescription_Callback)(
00835     void * pContext, typelib_TypeDescription ** ppRet, rtl_uString * pTypeName );
00836 
00842 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_registerCallback(
00843     void * pContext, typelib_typedescription_Callback pCallback )
00844     SAL_THROW_EXTERN_C();
00845 
00851 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_revokeCallback(
00852     void * pContext, typelib_typedescription_Callback pCallback )
00853     SAL_THROW_EXTERN_C();
00854 
00855 
00856 /*----------------------------------------------------------------------------*/
00857 /*----------------------------------------------------------------------------*/
00858 /*----------------------------------------------------------------------------*/
00859 
00861 
00868 #define TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( eTypeClass ) \
00869     ((eTypeClass) == typelib_TypeClass_INTERFACE_METHOD || \
00870      (eTypeClass) == typelib_TypeClass_INTERFACE_ATTRIBUTE)
00871 
00876 #define TYPELIB_DANGER_GET( ppDescription, pTypeRef ) \
00877 { \
00878     typelib_TypeDescriptionReference * pMacroTypeRef = (pTypeRef); \
00879     typelib_TypeDescription ** ppMacroTypeDescr = (ppDescription); \
00880     if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pMacroTypeRef->eTypeClass )) \
00881     { \
00882         typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); \
00883     } \
00884     else if (!pMacroTypeRef->pType || !pMacroTypeRef->pType->pWeakRef) \
00885     { \
00886         typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); \
00887         if (*ppMacroTypeDescr) \
00888             typelib_typedescription_release( *ppMacroTypeDescr ); \
00889     } \
00890     else \
00891     { \
00892         *ppMacroTypeDescr = pMacroTypeRef->pType; \
00893     } \
00894 }
00895 
00898 #define TYPELIB_DANGER_RELEASE( pDescription ) \
00899 { \
00900     if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( (pDescription)->eTypeClass )) \
00901         typelib_typedescription_release( pDescription ); \
00902 }
00903 
00905 
00913 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_new(
00914     typelib_TypeDescriptionReference ** ppTDR,
00915     typelib_TypeClass eTypeClass,
00916     rtl_uString * pTypeName )
00917     SAL_THROW_EXTERN_C();
00918 
00926 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_newByAsciiName(
00927     typelib_TypeDescriptionReference ** ppTDR,
00928     typelib_TypeClass eTypeClass,
00929     const sal_Char * pTypeName )
00930     SAL_THROW_EXTERN_C();
00931 
00936 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_acquire(
00937     typelib_TypeDescriptionReference * pRef )
00938     SAL_THROW_EXTERN_C();
00939 
00945 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_release(
00946     typelib_TypeDescriptionReference * pRef )
00947     SAL_THROW_EXTERN_C();
00948 
00954 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_getDescription(
00955     typelib_TypeDescription ** ppRet, typelib_TypeDescriptionReference * pRef )
00956     SAL_THROW_EXTERN_C();
00957 
00964 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescriptionreference_equals(
00965     const typelib_TypeDescriptionReference * p1, const typelib_TypeDescriptionReference * p2 )
00966     SAL_THROW_EXTERN_C();
00967 
00973 CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_assign(
00974     typelib_TypeDescriptionReference ** ppDest,
00975     typelib_TypeDescriptionReference * pSource )
00976     SAL_THROW_EXTERN_C();
00977 
00984 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom(
00985     typelib_TypeDescription * pAssignable,
00986     typelib_TypeDescription * pFrom )
00987     SAL_THROW_EXTERN_C();
00988 
00995 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom(
00996     typelib_TypeDescriptionReference * pAssignable,
00997     typelib_TypeDescriptionReference * pFrom )
00998     SAL_THROW_EXTERN_C();
00999 
01009 CPPU_DLLPUBLIC typelib_TypeDescriptionReference ** SAL_CALL typelib_static_type_getByTypeClass(
01010     typelib_TypeClass eTypeClass )
01011     SAL_THROW_EXTERN_C();
01012 
01019 CPPU_DLLPUBLIC void SAL_CALL typelib_static_type_init(
01020     typelib_TypeDescriptionReference ** ppRef,
01021     typelib_TypeClass eTypeClass, const sal_Char * pTypeName )
01022     SAL_THROW_EXTERN_C();
01023 
01029 CPPU_DLLPUBLIC void SAL_CALL typelib_static_sequence_type_init(
01030     typelib_TypeDescriptionReference ** ppRef,
01031     typelib_TypeDescriptionReference * pElementType )
01032     SAL_THROW_EXTERN_C ();
01033 
01041 CPPU_DLLPUBLIC void SAL_CALL typelib_static_array_type_init(
01042     typelib_TypeDescriptionReference ** ppRef,
01043     typelib_TypeDescriptionReference * pElementType,
01044     sal_Int32 nDimensions, ... )
01045     SAL_THROW_EXTERN_C ();
01046 
01060 CPPU_DLLPUBLIC void SAL_CALL typelib_static_compound_type_init(
01061     typelib_TypeDescriptionReference ** ppRef,
01062     typelib_TypeClass eTypeClass, const sal_Char * pTypeName,
01063     typelib_TypeDescriptionReference * pBaseType,
01064     sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers )
01065     SAL_THROW_EXTERN_C();
01066 
01082 CPPU_DLLPUBLIC void SAL_CALL typelib_static_struct_type_init(
01083     typelib_TypeDescriptionReference ** ppRef, const sal_Char * pTypeName,
01084     typelib_TypeDescriptionReference * pBaseType,
01085     sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers,
01086     sal_Bool const * pParameterizedTypes )
01087     SAL_THROW_EXTERN_C();
01088 
01095 CPPU_DLLPUBLIC void SAL_CALL typelib_static_interface_type_init(
01096     typelib_TypeDescriptionReference ** ppRef,
01097     const sal_Char * pTypeName,
01098     typelib_TypeDescriptionReference * pBaseType )
01099     SAL_THROW_EXTERN_C();
01100 
01111 CPPU_DLLPUBLIC void SAL_CALL typelib_static_mi_interface_type_init(
01112     typelib_TypeDescriptionReference ** ppRef,
01113     const sal_Char * pTypeName,
01114     sal_Int32 nBaseTypes,
01115     typelib_TypeDescriptionReference ** ppBaseTypes )
01116     SAL_THROW_EXTERN_C();
01117 
01124 CPPU_DLLPUBLIC void SAL_CALL typelib_static_enum_type_init(
01125     typelib_TypeDescriptionReference ** ppRef,
01126     const sal_Char * pTypeName,
01127     sal_Int32 nDefaultValue )
01128     SAL_THROW_EXTERN_C();
01129 
01138 CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescription_complete(
01139     typelib_TypeDescription ** ppTypeDescr )
01140     SAL_THROW_EXTERN_C();
01141 
01142 #ifdef __cplusplus
01143 }
01144 #endif
01145 
01146 #endif
01147 
01148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines