1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _TYPELIB_TYPEDESCRIPTION_H_ 28 #define _TYPELIB_TYPEDESCRIPTION_H_ 29 30 #include <sal/types.h> 31 #include <typelib/uik.h> 32 #include <typelib/typeclass.h> 33 #include <rtl/ustring.h> 34 35 #ifdef __cplusplus 36 extern "C" 37 { 38 #endif 39 40 struct _typelib_TypeDescription; 41 42 #if defined( SAL_W32) 43 #pragma pack(push, 8) 44 #elif defined(SAL_OS2) 45 #pragma pack(push, 8) 46 #endif 47 48 /** Holds a weak reference to a type description. 49 */ 50 typedef struct _typelib_TypeDescriptionReference 51 { 52 /** reference count of type; don't ever modify this by yourself, use 53 typelib_typedescriptionreference_acquire() and typelib_typedescriptionreference_release() 54 */ 55 sal_Int32 nRefCount; 56 /** number of static references of type, because of the fact that some types are needed 57 until program termination and are commonly held static. 58 */ 59 sal_Int32 nStaticRefCount; 60 /** type class of type 61 */ 62 typelib_TypeClass eTypeClass; 63 /** fully qualified name of type 64 */ 65 rtl_uString * pTypeName; 66 /** pointer to full typedescription; this value is only valid if the type is never swapped out 67 */ 68 struct _typelib_TypeDescription * pType; 69 /** pointer to optimize the runtime; not for public use 70 */ 71 void * pUniqueIdentifier; 72 /** reserved for future use; 0 if not used 73 */ 74 void * pReserved; 75 } typelib_TypeDescriptionReference; 76 77 /** Full type description of a type. Memory layout of this struct is identical to the 78 typelib_TypeDescriptionReference for the first six members. 79 So a typedescription can be used as type reference. 80 */ 81 typedef struct _typelib_TypeDescription 82 { 83 /** reference count; don't ever modify this by yourself, use 84 typelib_typedescription_acquire() and typelib_typedescription_release() 85 */ 86 sal_Int32 nRefCount; 87 /** number of static references of type, because of the fact that some types are needed 88 until program termination and are commonly held static. 89 */ 90 sal_Int32 nStaticRefCount; 91 /** type class of type 92 */ 93 typelib_TypeClass eTypeClass; 94 /** fully qualified name of type 95 */ 96 rtl_uString * pTypeName; 97 /** pointer to self to distinguish reference from description; for internal use only 98 */ 99 struct _typelib_TypeDescription * pSelf; 100 /** pointer to optimize the runtime; not for public use 101 */ 102 void * pUniqueIdentifier; 103 /** reserved for future use; 0 if not used 104 */ 105 void * pReserved; 106 107 /** flag to determine whether the description is complete: 108 compound and union types lack of member names, enums lack of member types and names, 109 interfaces lack of members and table init. 110 Call typelib_typedescription_complete() if false. 111 */ 112 sal_Bool bComplete; 113 /** size of type 114 */ 115 sal_Int32 nSize; 116 /** alignment of type 117 */ 118 sal_Int32 nAlignment; 119 /** pointer to weak reference 120 */ 121 typelib_TypeDescriptionReference * pWeakRef; 122 /** determines, if type can be unloaded (and it is possible to reloaded it) 123 */ 124 sal_Bool bOnDemand; 125 } typelib_TypeDescription; 126 127 /** Type description for exception types. 128 */ 129 typedef struct _typelib_CompoundTypeDescription 130 { 131 /** inherits all members of typelib_TypeDescription 132 */ 133 typelib_TypeDescription aBase; 134 135 /** pointer to base type description, else 0 136 */ 137 struct _typelib_CompoundTypeDescription * pBaseTypeDescription; 138 139 /** number of members 140 */ 141 sal_Int32 nMembers; 142 /** byte offsets of each member including the size the base type 143 */ 144 sal_Int32 * pMemberOffsets; 145 /** members of the struct or exception 146 */ 147 typelib_TypeDescriptionReference ** ppTypeRefs; 148 /** member names of the struct or exception 149 */ 150 rtl_uString ** ppMemberNames; 151 } typelib_CompoundTypeDescription; 152 153 /** 154 Type description for struct types. 155 156 This is only used to represent plain struct types and instantiated 157 polymorphic struct types; there is no representation of polymorphic struct 158 type templates at this level. 159 160 @since UDK 3.2.0 161 */ 162 typedef struct _typelib_StructTypeDescription 163 { 164 /** 165 Derived from typelib_CompoundTypeDescription. 166 */ 167 typelib_CompoundTypeDescription aBase; 168 169 /** 170 Flags for direct members, specifying whether they are of parameterized 171 type (true) or explict type (false). 172 173 For a plain struct type, this is a null pointer. 174 */ 175 sal_Bool * pParameterizedTypes; 176 } typelib_StructTypeDescription; 177 178 /** Type description of a union. The type class of this description is typelib_TypeClass_UNION. 179 */ 180 typedef struct _typelib_UnionTypeDescription 181 { 182 /** inherits all members of typelib_TypeDescription 183 */ 184 typelib_TypeDescription aBase; 185 186 /** type of the discriminant 187 */ 188 typelib_TypeDescriptionReference * pDiscriminantTypeRef; 189 190 /** union default descriminant 191 */ 192 sal_Int64 nDefaultDiscriminant; 193 /** union default member type (may be 0) 194 */ 195 typelib_TypeDescriptionReference * pDefaultTypeRef; 196 /** number of union member types 197 */ 198 sal_Int32 nMembers; 199 /** union member discriminant values (same order as idl declaration) 200 */ 201 sal_Int64 * pDiscriminants; 202 /** union member value types (same order as idl declaration) 203 */ 204 typelib_TypeDescriptionReference ** ppTypeRefs; 205 /** union member value names (same order as idl declaration) 206 */ 207 rtl_uString ** ppMemberNames; 208 /** union value offset for data access 209 */ 210 sal_Int32 nValueOffset; 211 } typelib_UnionTypeDescription; 212 213 /** Type description of an array or sequence. 214 */ 215 typedef struct _typelib_IndirectTypeDescription 216 { 217 /** inherits all members of typelib_TypeDescription 218 */ 219 typelib_TypeDescription aBase; 220 221 /** array, sequence: pointer to element type 222 */ 223 typelib_TypeDescriptionReference * pType; 224 } typelib_IndirectTypeDescription; 225 226 /** Type description of an array. 227 */ 228 typedef struct _typelib_ArrayTypeDescription 229 { 230 /** inherits all members of typelib_IndirectTypeDescription 231 */ 232 typelib_IndirectTypeDescription aBase; 233 234 /** number of dimensions 235 */ 236 sal_Int32 nDimensions; 237 /** number of total array elements 238 */ 239 sal_Int32 nTotalElements; 240 /** array of dimensions 241 */ 242 sal_Int32 * pDimensions; 243 } typelib_ArrayTypeDescription; 244 245 /** Type description of an enum. The type class of this description is typelib_TypeClass_ENUM. 246 */ 247 typedef struct _typelib_EnumTypeDescription 248 { 249 /** inherits all members of typelib_TypeDescription 250 */ 251 typelib_TypeDescription aBase; 252 253 /** first value of the enum 254 */ 255 sal_Int32 nDefaultEnumValue; 256 /** number of enum values 257 */ 258 sal_Int32 nEnumValues; 259 /** names of enum values 260 */ 261 rtl_uString ** ppEnumNames; 262 /** values of enum (corresponding to names in similar order) 263 */ 264 sal_Int32 * pEnumValues; 265 } typelib_EnumTypeDescription; 266 267 /** Description of an interface method parameter. 268 */ 269 typedef struct _typelib_MethodParameter 270 { 271 /** name of parameter 272 */ 273 rtl_uString * pName; 274 /** type of parameter 275 */ 276 typelib_TypeDescriptionReference * pTypeRef; 277 /** true: the call type of this parameter is [in] or [inout] 278 false: the call type of this parameter is [out] 279 */ 280 sal_Bool bIn; 281 /** true: the call type of this parameter is [out] or [inout] 282 false: the call type of this parameter is [in] 283 */ 284 sal_Bool bOut; 285 } typelib_MethodParameter; 286 287 /** Common base type description of typelib_InterfaceMethodTypeDescription and 288 typelib_InterfaceAttributeTypeDescription. 289 */ 290 typedef struct _typelib_InterfaceMemberTypeDescription 291 { 292 /** inherits all members of typelib_TypeDescription 293 */ 294 typelib_TypeDescription aBase; 295 296 /** position of member in the interface including the number of members of 297 any base interfaces 298 */ 299 sal_Int32 nPosition; 300 /** name of member 301 */ 302 rtl_uString * pMemberName; 303 } typelib_InterfaceMemberTypeDescription; 304 305 /** Type description of an interface method. The type class of this description is 306 typelib_TypeClass_INTERFACE_METHOD. The size and the alignment are 0. 307 */ 308 typedef struct _typelib_InterfaceMethodTypeDescription 309 { 310 /** inherits all members of typelib_InterfaceMemberTypeDescription 311 */ 312 typelib_InterfaceMemberTypeDescription aBase; 313 314 /** type of the return value 315 */ 316 typelib_TypeDescriptionReference * pReturnTypeRef; 317 /** number of parameters 318 */ 319 sal_Int32 nParams; 320 /** array of parameters 321 */ 322 typelib_MethodParameter * pParams; 323 /** number of exceptions 324 */ 325 sal_Int32 nExceptions; 326 /** array of exception types 327 */ 328 typelib_TypeDescriptionReference ** ppExceptions; 329 /** determines whether method is declared oneway 330 */ 331 sal_Bool bOneWay; 332 333 /** the interface description this method is a member of 334 335 @since #i21150# 336 */ 337 struct _typelib_InterfaceTypeDescription * pInterface; 338 /** the inherited direct base method (null for a method that is not 339 inherited) 340 341 @since UDK 3.2.0 342 */ 343 typelib_TypeDescriptionReference * pBaseRef; 344 /** if pBaseRef is null, the member position of this method within 345 pInterface, not counting members inherited from bases; if pBaseRef is 346 not null, the index of the direct base within pInterface from which this 347 method is inherited 348 349 @since UDK 3.2.0 350 */ 351 sal_Int32 nIndex; 352 } typelib_InterfaceMethodTypeDescription; 353 354 /** The description of an interface attribute. The type class of this description is 355 typelib_TypeClass_INTERFACE_ATTRIBUTE. The size and the alignment are 0. 356 */ 357 typedef struct _typelib_InterfaceAttributeTypeDescription 358 { 359 /** inherits all members of typelib_InterfaceMemberTypeDescription 360 */ 361 typelib_InterfaceMemberTypeDescription aBase; 362 363 /** determines whether attribute is read only 364 */ 365 sal_Bool bReadOnly; 366 /** type of the attribute 367 */ 368 typelib_TypeDescriptionReference * pAttributeTypeRef; 369 370 /** the interface description this attribute is a member of 371 372 @since #i21150# 373 */ 374 struct _typelib_InterfaceTypeDescription * pInterface; 375 /** the inherited direct base attribute (null for an attribute that is not 376 inherited) 377 378 @since UDK 3.2.0 379 */ 380 typelib_TypeDescriptionReference * pBaseRef; 381 /** if pBaseRef is null, the member position of this attribute within 382 pInterface, not counting members inherited from bases; if pBaseRef is 383 not null, the index of the direct base within pInterface from which this 384 attribute is inherited 385 386 @since UDK 3.2.0 387 */ 388 sal_Int32 nIndex; 389 /** number of getter exceptions 390 391 @since UDK 3.2.0 392 */ 393 sal_Int32 nGetExceptions; 394 /** array of getter exception types 395 396 @since UDK 3.2.0 397 */ 398 typelib_TypeDescriptionReference ** ppGetExceptions; 399 /** number of setter exceptions 400 401 @since UDK 3.2.0 402 */ 403 sal_Int32 nSetExceptions; 404 /** array of setter exception types 405 406 @since UDK 3.2.0 407 */ 408 typelib_TypeDescriptionReference ** ppSetExceptions; 409 } typelib_InterfaceAttributeTypeDescription; 410 411 /// @HTML 412 /** Type description of an interface. 413 414 <p>Not all members are always initialized (not yet initialized members being 415 null); there are three levels:</p> 416 <ul> 417 <li>Minimally, only <code>aBase</code>, 418 <code>pBaseTypeDescription</code>, <code>aUik</code>, 419 <code>nBaseTypes</code>, and <code>ppBaseTypes</code> are initialized; 420 <code>aBase.bComplete</code> is false. This only happens when an 421 interface type description is created with 422 <code>typelib_static_mi_interface_type_init</code> or 423 <code>typelib_static_interface_type_init</code>.</li> 424 425 <li>At the next level, <code>nMembers</code>, <code>ppMembers</code>, 426 <code>nAllMembers</code>, <code>ppAllMembers</code> are also 427 initialized; <code>aBase.bComplete</code> is still false. This happens 428 when an interface type description is created with 429 <code>typelib_typedescription_newMIInterface</cocde> or 430 <code>typelib_typedescription_newInterface</code>.</li> 431 432 <li>At the final level, <code>pMapMemberIndexToFunctionIndex</code>, 433 <code>nMapFunctionIndexToMemberIndex</code>, and 434 <code>pMapFunctionIndexToMemberIndex</code> are also initialized; 435 <code>aBase.bComplete</code> is true. This happens after a call to 436 <code>typelib_typedescription_complete</code>.</li> 437 </ul> 438 */ 439 typedef struct _typelib_InterfaceTypeDescription 440 /// @NOHTML 441 { 442 /** inherits all members of typelib_TypeDescription 443 */ 444 typelib_TypeDescription aBase; 445 446 /** pointer to base type description, else 0 447 448 @deprecated 449 use nBaseTypes and ppBaseTypes instead 450 */ 451 struct _typelib_InterfaceTypeDescription * pBaseTypeDescription; 452 /** unique identifier of interface 453 */ 454 typelib_Uik aUik; 455 /** number of members 456 */ 457 sal_Int32 nMembers; 458 /** array of members; references attributes or methods 459 */ 460 typelib_TypeDescriptionReference ** ppMembers; 461 /** number of members including members of base interface 462 */ 463 sal_Int32 nAllMembers; 464 /** array of members including members of base interface; references attributes or methods 465 */ 466 typelib_TypeDescriptionReference ** ppAllMembers; 467 /** array mapping index of the member description to an index doubling for read-write 468 attributes (called function index); size of array is nAllMembers 469 */ 470 sal_Int32 * pMapMemberIndexToFunctionIndex; 471 /** number of members plus number of read-write attributes 472 */ 473 sal_Int32 nMapFunctionIndexToMemberIndex; 474 /** array mapping function index to member index; size of arry is nMapFunctionIndexToMemberIndex 475 */ 476 sal_Int32 * pMapFunctionIndexToMemberIndex; 477 /** number of base types 478 479 @since UDK 3.2.0 480 */ 481 sal_Int32 nBaseTypes; 482 /** array of base type descriptions 483 484 @since UDK 3.2.0 485 */ 486 struct _typelib_InterfaceTypeDescription ** ppBaseTypes; 487 } typelib_InterfaceTypeDescription; 488 489 /** Init struct of compound members for typelib_typedescription_new(). 490 */ 491 typedef struct _typelib_CompoundMember_Init 492 { 493 /** type class of compound member 494 */ 495 typelib_TypeClass eTypeClass; 496 /** name of type of compound member 497 498 For a member of an instantiated polymorphic struct type that is of 499 parameterized type, this will be a null pointer. 500 */ 501 rtl_uString * pTypeName; 502 /** name of compound member 503 */ 504 rtl_uString * pMemberName; 505 } typelib_CompoundMember_Init; 506 507 /** 508 Init struct of members for typelib_typedescription_newStruct(). 509 510 @since UDK 3.2.0 511 */ 512 typedef struct _typelib_StructMember_Init 513 { 514 /** 515 Derived from typelib_CompoundMember_Init; 516 */ 517 typelib_CompoundMember_Init aBase; 518 519 /** 520 Flag specifying whether the member is of parameterized type (true) or 521 explict type (false). 522 */ 523 sal_Bool bParameterizedType; 524 } typelib_StructMember_Init; 525 526 /** Init struct of interface methods for typelib_typedescription_new(). 527 */ 528 typedef struct _typelib_Parameter_Init 529 { 530 /** type class of parameter 531 */ 532 typelib_TypeClass eTypeClass; 533 /** name of parameter 534 */ 535 rtl_uString * pTypeName; 536 /** name of parameter 537 */ 538 rtl_uString * pParamName; 539 /** true, if parameter is [in] or [inout] 540 */ 541 sal_Bool bIn; 542 /** true, if parameter is [out] or [inout] 543 */ 544 sal_Bool bOut; 545 } typelib_Parameter_Init; 546 547 /** Init struct of union types for typelib_typedescription_newUnion(). 548 */ 549 typedef struct _typelib_Union_Init 550 { 551 /** union member discriminant 552 */ 553 sal_Int64 nDiscriminant; 554 /** union member name 555 */ 556 rtl_uString * pMemberName; 557 /** union member type 558 */ 559 typelib_TypeDescriptionReference* pTypeRef; 560 } typelib_Union_Init; 561 562 #if defined( SAL_W32) || defined(SAL_OS2) 563 #pragma pack(pop) 564 #endif 565 566 567 /** Creates a union type description. All discriminants are handled as int64 values. 568 The pDiscriminantTypeRef must be of type byte, short, ..., up to hyper. 569 570 @param ppRet inout union type description 571 @param pTypeName name of union type 572 @param pDiscriminantTypeRef discriminant type 573 @param nDefaultDiscriminant default discriminant 574 @param pDefaultTypeRef default value type of union 575 @param nMembers number of union members 576 @param pMembers init members 577 */ 578 void SAL_CALL typelib_typedescription_newUnion( 579 typelib_TypeDescription ** ppRet, 580 rtl_uString * pTypeName, 581 typelib_TypeDescriptionReference * pDiscriminantTypeRef, 582 sal_Int64 nDefaultDiscriminant, 583 typelib_TypeDescriptionReference * pDefaultTypeRef, 584 sal_Int32 nMembers, 585 typelib_Union_Init * pMembers ) 586 SAL_THROW_EXTERN_C(); 587 588 /** Creates an enum type description. 589 590 @param ppRet inout enum type description 591 @param pTypeName name of enum 592 @param nDefaultEnumValue default enum value 593 @param nEnumValues number of enum values 594 @param ppEnumNames names of enum values 595 @param pEnumValues enum values 596 */ 597 void SAL_CALL typelib_typedescription_newEnum( 598 typelib_TypeDescription ** ppRet, 599 rtl_uString * pTypeName, 600 sal_Int32 nDefaultValue, 601 sal_Int32 nEnumValues, 602 rtl_uString ** ppEnumNames, 603 sal_Int32 * pEnumValues ) 604 SAL_THROW_EXTERN_C(); 605 606 /** Creates an array type description. 607 608 @param ppRet inout enum type description 609 @param pElementTypeRef element type 610 @param nDimensions number of dimensions 611 @param pDimensions dimensions 612 */ 613 void SAL_CALL typelib_typedescription_newArray( 614 typelib_TypeDescription ** ppRet, 615 typelib_TypeDescriptionReference * pElementTypeRef, 616 sal_Int32 nDimensions, 617 sal_Int32 * pDimensions ) 618 SAL_THROW_EXTERN_C (); 619 620 /** Creates a new type description. 621 622 Since this function can only be used to create type descriptions for plain 623 struct types, not for instantiated polymorphic struct types, the function 624 typelib_typedescription_newStruct should be used instead for all struct 625 types. 626 627 @param ppRet inout type description 628 @param eTypeClass type class 629 @param pTypeName name of type 630 @param pType sequence, array: element type; 631 struct, Exception: base type; 632 @param nMembers number of members if struct, exception 633 @param pMember array of members if struct, exception 634 */ 635 void SAL_CALL typelib_typedescription_new( 636 typelib_TypeDescription ** ppRet, 637 typelib_TypeClass eTypeClass, 638 rtl_uString * pTypeName, 639 typelib_TypeDescriptionReference * pType, 640 sal_Int32 nMembers, 641 typelib_CompoundMember_Init * pMembers ) 642 SAL_THROW_EXTERN_C(); 643 644 /** Creates a new struct type description. 645 646 @param ppRet inout type description 647 @param pTypeName name of type 648 @param pType base type; 649 @param nMembers number of members 650 @param pMember array of members 651 652 @since UDK 3.2.0 653 */ 654 void SAL_CALL typelib_typedescription_newStruct( 655 typelib_TypeDescription ** ppRet, 656 rtl_uString * pTypeName, 657 typelib_TypeDescriptionReference * pType, 658 sal_Int32 nMembers, 659 typelib_StructMember_Init * pMembers ) 660 SAL_THROW_EXTERN_C(); 661 662 /** Creates an interface type description. 663 664 @param ppRet inout interface type description 665 @param pTypeName the fully qualified name of the interface. 666 @param nUik1 uik part 667 @param nUik2 uik part 668 @param nUik3 uik part 669 @param nUik4 uik part 670 @param nUik5 uik part 671 @param pBaseInterface base interface type, else 0 672 @param nMembers number of members 673 @param ppMembers members; attributes or methods 674 675 @deprecated 676 use typelib_typedescription_newMIInterface instead 677 */ 678 void SAL_CALL typelib_typedescription_newInterface( 679 typelib_InterfaceTypeDescription ** ppRet, 680 rtl_uString * pTypeName, 681 sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5, 682 typelib_TypeDescriptionReference * pBaseInterface, 683 sal_Int32 nMembers, 684 typelib_TypeDescriptionReference ** ppMembers ) 685 SAL_THROW_EXTERN_C(); 686 687 /** Creates a multiple-inheritance interface type description. 688 689 @param ppRet inout interface type description 690 @param pTypeName the fully qualified name of the interface. 691 @param nUik1 uik part 692 @param nUik2 uik part 693 @param nUik3 uik part 694 @param nUik4 uik part 695 @param nUik5 uik part 696 @param nBaseInterfaces number of base interface types 697 @param ppBaseInterface base interface types 698 @param nMembers number of members 699 @param ppMembers members; attributes or methods 700 701 @since UDK 3.2.0 702 */ 703 void SAL_CALL typelib_typedescription_newMIInterface( 704 typelib_InterfaceTypeDescription ** ppRet, 705 rtl_uString * pTypeName, 706 sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5, 707 sal_Int32 nBaseInterfaces, 708 typelib_TypeDescriptionReference ** ppBaseInterfaces, 709 sal_Int32 nMembers, 710 typelib_TypeDescriptionReference ** ppMembers ) 711 SAL_THROW_EXTERN_C(); 712 713 /** Creates an interface method type description. 714 715 @param ppRet inout method type description 716 @param nAbsolutePosition position of member including all members of base interfaces 717 @param bOneWay determines whether method is declared oneway 718 @param pTypeName fully qualified name of method including interface name 719 @param eReturnTypeClass type class of return type 720 @param pReturnTypeName type name of the return type 721 @param nParams number of parameters 722 @param pParams parameter types 723 @param nExceptions number of exceptions 724 @param ppExceptionNames type names of exceptions 725 */ 726 void SAL_CALL typelib_typedescription_newInterfaceMethod( 727 typelib_InterfaceMethodTypeDescription ** ppRet, 728 sal_Int32 nAbsolutePosition, 729 sal_Bool bOneWay, 730 rtl_uString * pMethodName, 731 typelib_TypeClass eReturnTypeClass, 732 rtl_uString * pReturnTypeName, 733 sal_Int32 nParams, 734 typelib_Parameter_Init * pParams, 735 sal_Int32 nExceptions, 736 rtl_uString ** ppExceptionNames ) 737 SAL_THROW_EXTERN_C(); 738 739 /** Creates an interface attribute type description. 740 741 @param ppRet inout attribute type description 742 @param nAbsolutePosition position of this attribute including all members of base interfaces 743 @param pAttributeName fully qualified name of attribute including interface 744 name 745 @param eAttributeTypeClass type class of attribute type 746 @param pAttributeTypeName type name of attribute type 747 @param bReadOnly determines whether attribute is read-only 748 749 @deprecated 750 use typelib_typedescription_newExtendedInterfaceAttribute instead 751 */ 752 void SAL_CALL typelib_typedescription_newInterfaceAttribute( 753 typelib_InterfaceAttributeTypeDescription ** ppRet, 754 sal_Int32 nAbsolutePosition, 755 rtl_uString * pAttributeName, 756 typelib_TypeClass eAttributeTypeClass, 757 rtl_uString * pAttributeTypeName, 758 sal_Bool bReadOnly ) 759 SAL_THROW_EXTERN_C(); 760 761 /** Creates an extended interface attribute type description. 762 763 @param ppRet inout attribute type description 764 @param nAbsolutePosition position of this attribute including all members of 765 base interfaces 766 @param pAttributeName fully qualified name of attribute including interface 767 name 768 @param eAttributeTypeClass type class of attribute type 769 @param pAttributeTypeName type name of attribute type 770 @param bReadOnly determines whether attribute is read-only 771 @param nGetExceptions number of getter exceptions 772 @param ppGetExceptionNames type names of getter exceptions 773 @param nSetExceptions number of setter exceptions 774 @param ppSetExceptionNames type names of setter exceptions 775 776 @since UDK 3.2.0 777 */ 778 void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute( 779 typelib_InterfaceAttributeTypeDescription ** ppRet, 780 sal_Int32 nAbsolutePosition, 781 rtl_uString * pAttributeName, 782 typelib_TypeClass eAttributeTypeClass, 783 rtl_uString * pAttributeTypeName, 784 sal_Bool bReadOnly, 785 sal_Int32 nGetExceptions, rtl_uString ** ppGetExceptionNames, 786 sal_Int32 nSetExceptions, rtl_uString ** ppSetExceptionNames ) 787 SAL_THROW_EXTERN_C(); 788 789 /** Increments reference count of given type description. 790 791 @param pDesc type description 792 */ 793 void SAL_CALL typelib_typedescription_acquire( 794 typelib_TypeDescription * pDesc ) 795 SAL_THROW_EXTERN_C(); 796 797 /** Decrements reference count of given type. If reference count reaches 0, the trype description 798 is deleted. 799 800 @param pDesc type description 801 */ 802 void SAL_CALL typelib_typedescription_release( 803 typelib_TypeDescription * pDesc ) 804 SAL_THROW_EXTERN_C(); 805 806 /** Registers a type description and creates a type description reference. Type descriptions 807 will be registered automatically if they are provided via the callback chain. 808 809 @param ppNewDescription inout description to be registered; 810 */ 811 void SAL_CALL typelib_typedescription_register( 812 typelib_TypeDescription ** ppNewDescription ) 813 SAL_THROW_EXTERN_C(); 814 815 /** Tests whether two types descriptions are equal, i.e. type class and names are equal. 816 817 @param p1 a type description 818 @param p2 another type description 819 @return true, if type descriptions are equal 820 */ 821 sal_Bool SAL_CALL typelib_typedescription_equals( 822 const typelib_TypeDescription * p1, const typelib_TypeDescription * p2 ) 823 SAL_THROW_EXTERN_C(); 824 825 /** Retrieves a type description via its fully qualified name. 826 827 @param ppRet inout type description; *ppRet is 0, if type description was not found 828 @param pName name demanded type description 829 */ 830 void SAL_CALL typelib_typedescription_getByName( 831 typelib_TypeDescription ** ppRet, rtl_uString * pName ) 832 SAL_THROW_EXTERN_C(); 833 834 /** Sets size of type description cache. 835 836 @param nNewSize new size of cache 837 */ 838 void SAL_CALL typelib_setCacheSize( 839 sal_Int32 nNewSize ) 840 SAL_THROW_EXTERN_C(); 841 842 /** Function pointer declaration of callback function get additional descriptions. Callbacks 843 must provide complete type descriptions (see typelib_typedescription_complete())! 844 845 @param pContext callback context 846 @param ppRet inout type description 847 @param pTypeName name of demanded type description 848 */ 849 typedef void (SAL_CALL * typelib_typedescription_Callback)( 850 void * pContext, typelib_TypeDescription ** ppRet, rtl_uString * pTypeName ); 851 852 /** Registers callback function providing additional type descriptions. 853 854 @param pContext callback context 855 @param pCallback callback function 856 */ 857 void SAL_CALL typelib_typedescription_registerCallback( 858 void * pContext, typelib_typedescription_Callback pCallback ) 859 SAL_THROW_EXTERN_C(); 860 861 /** Revokes a previously registered callback function. 862 863 @param pContext callback context 864 @param pCallback registered callback function 865 */ 866 void SAL_CALL typelib_typedescription_revokeCallback( 867 void * pContext, typelib_typedescription_Callback pCallback ) 868 SAL_THROW_EXTERN_C(); 869 870 871 /*----------------------------------------------------------------------------*/ 872 /*----------------------------------------------------------------------------*/ 873 /*----------------------------------------------------------------------------*/ 874 875 /** Returns true, if the type description reference may lose the type description. Otherwise 876 pType is a valid pointer and cannot be discarded through the lifetime of this reference. 877 Remark: If the pWeakObj of the type is set too, you can avoid the call of 878 ...getDescription(...) and use the description directly. pWeakObj == 0 means, that the 879 description is not initialized. 880 @internal 881 */ 882 #define TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( eTypeClass ) \ 883 ((eTypeClass) == typelib_TypeClass_INTERFACE_METHOD || \ 884 (eTypeClass) == typelib_TypeClass_INTERFACE_ATTRIBUTE) 885 886 /** Gets a description from the reference. The description may not be locked by this call. 887 You must use the TYPELIB_DANGER_RELEASE macro to release the description fetched with 888 this macro. 889 @internal 890 */ 891 #define TYPELIB_DANGER_GET( ppDescription, pTypeRef ) \ 892 { \ 893 typelib_TypeDescriptionReference * pMacroTypeRef = (pTypeRef); \ 894 typelib_TypeDescription ** ppMacroTypeDescr = (ppDescription); \ 895 if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pMacroTypeRef->eTypeClass )) \ 896 { \ 897 typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); \ 898 } \ 899 else if (!pMacroTypeRef->pType || !pMacroTypeRef->pType->pWeakRef) \ 900 { \ 901 typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); \ 902 if (*ppMacroTypeDescr) \ 903 typelib_typedescription_release( *ppMacroTypeDescr ); \ 904 } \ 905 else \ 906 { \ 907 *ppMacroTypeDescr = pMacroTypeRef->pType; \ 908 } \ 909 } 910 911 /** Releases the description previouse fetched by TYPELIB_DANGER_GET. 912 @internal 913 */ 914 #define TYPELIB_DANGER_RELEASE( pDescription ) \ 915 { \ 916 if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( (pDescription)->eTypeClass )) \ 917 typelib_typedescription_release( pDescription ); \ 918 } 919 920 /** Creates a type description reference. This is a weak reference not holding the description. 921 If the description is already registered, the previous one is returned. 922 923 @param ppTDR inout type description reference 924 @param eTypeClass type class of type 925 @param pTypeName name of type 926 */ 927 void SAL_CALL typelib_typedescriptionreference_new( 928 typelib_TypeDescriptionReference ** ppTDR, 929 typelib_TypeClass eTypeClass, 930 rtl_uString * pTypeName ) 931 SAL_THROW_EXTERN_C(); 932 933 /** Creates a type description reference. This is a weak reference not holding the description. 934 If the description is already registered, the previous one is returned. 935 936 @param ppTDR inout type description reference 937 @param eTypeClass type class of type 938 @param pTypeName ascii name of type 939 */ 940 void SAL_CALL typelib_typedescriptionreference_newByAsciiName( 941 typelib_TypeDescriptionReference ** ppTDR, 942 typelib_TypeClass eTypeClass, 943 const sal_Char * pTypeName ) 944 SAL_THROW_EXTERN_C(); 945 946 /** Increments reference count of type description reference. 947 948 @param pRef type description reference 949 */ 950 void SAL_CALL typelib_typedescriptionreference_acquire( 951 typelib_TypeDescriptionReference * pRef ) 952 SAL_THROW_EXTERN_C(); 953 954 /** Increments reference count of type description reference. If the reference count reaches 0, 955 then the reference is deleted. 956 957 @param pRef type description reference 958 */ 959 void SAL_CALL typelib_typedescriptionreference_release( 960 typelib_TypeDescriptionReference * pRef ) 961 SAL_THROW_EXTERN_C(); 962 963 /** Retrieves the type description for a given reference. If it is not possible to resolve the 964 reference, null is returned. 965 966 @param ppRet inout type description 967 */ 968 void SAL_CALL typelib_typedescriptionreference_getDescription( 969 typelib_TypeDescription ** ppRet, typelib_TypeDescriptionReference * pRef ) 970 SAL_THROW_EXTERN_C(); 971 972 /** Tests whether two types description references are equal, i.e. type class and names are equal. 973 974 @param p1 a type description reference 975 @param p2 another type description reference 976 @return true, if type description references are equal 977 */ 978 sal_Bool SAL_CALL typelib_typedescriptionreference_equals( 979 const typelib_TypeDescriptionReference * p1, const typelib_TypeDescriptionReference * p2 ) 980 SAL_THROW_EXTERN_C(); 981 982 /** Assigns a type. 983 984 @param ppDest destination type 985 @param pSource source type 986 */ 987 void SAL_CALL typelib_typedescriptionreference_assign( 988 typelib_TypeDescriptionReference ** ppDest, 989 typelib_TypeDescriptionReference * pSource ) 990 SAL_THROW_EXTERN_C(); 991 992 /** Tests if values of type pAssignable can be assigned by values of type pFrom. This includes 993 widening conversion (e.g., long assignable from short), as long as there is no data loss. 994 995 @param pAssignable type description of value to be assigned 996 @param pFrom type description of value 997 */ 998 sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom( 999 typelib_TypeDescription * pAssignable, 1000 typelib_TypeDescription * pFrom ) 1001 SAL_THROW_EXTERN_C(); 1002 1003 /** Tests if values of type pAssignable can be assigned by values of type pFrom. This includes 1004 widening conversion (e.g., long assignable from short), as long as there is no data loss. 1005 1006 @param pAssignable type of value to be assigned 1007 @param pFrom type of value 1008 */ 1009 sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom( 1010 typelib_TypeDescriptionReference * pAssignable, 1011 typelib_TypeDescriptionReference * pFrom ) 1012 SAL_THROW_EXTERN_C(); 1013 1014 /** Gets static type reference of standard types by type class. 1015 ADDITIONAL OPT: provides Type com.sun.star.uno.Exception for typelib_TypeClass_EXCEPTION 1016 and com.sun.star.uno.XInterface for typelib_TypeClass_INTERFACE. 1017 1018 Thread synchronizes on typelib mutex. 1019 1020 @param eTypeClass type class of basic type 1021 @return pointer to type reference pointer 1022 */ 1023 typelib_TypeDescriptionReference ** SAL_CALL typelib_static_type_getByTypeClass( 1024 typelib_TypeClass eTypeClass ) 1025 SAL_THROW_EXTERN_C(); 1026 1027 /** Inits static type reference. Thread synchronizes on typelib init mutex. 1028 1029 @param ppRef pointer to type reference pointer 1030 @param eTypeClass type class of type 1031 @param pTypeName ascii name of type 1032 */ 1033 void SAL_CALL typelib_static_type_init( 1034 typelib_TypeDescriptionReference ** ppRef, 1035 typelib_TypeClass eTypeClass, const sal_Char * pTypeName ) 1036 SAL_THROW_EXTERN_C(); 1037 1038 /** Inits static sequence type reference. Thread synchronizes on typelib init mutex. 1039 1040 @param ppRef pointer to type reference pointer 1041 @param pElementType element type of sequence 1042 */ 1043 void SAL_CALL typelib_static_sequence_type_init( 1044 typelib_TypeDescriptionReference ** ppRef, 1045 typelib_TypeDescriptionReference * pElementType ) 1046 SAL_THROW_EXTERN_C (); 1047 1048 /** Inits static array type reference. Thread synchronizes on typelib init mutex. 1049 1050 @param ppRef pointer to type reference pointer 1051 @param pElementType element type of sequence 1052 @param nDimensions number of dimensions 1053 @param ... additional sal_Int32 parameter for each dimension 1054 */ 1055 void SAL_CALL typelib_static_array_type_init( 1056 typelib_TypeDescriptionReference ** ppRef, 1057 typelib_TypeDescriptionReference * pElementType, 1058 sal_Int32 nDimensions, ... ) 1059 SAL_THROW_EXTERN_C (); 1060 1061 /** Inits incomplete static compound type reference. Thread synchronizes on typelib init mutex. 1062 1063 Since this function can only be used to create type descriptions for plain 1064 struct types, not for instantiated polymorphic struct types, the function 1065 typelib_static_struct_type_init should be used instead for all struct types. 1066 1067 @param ppRef pointer to type reference pointer 1068 @param eTypeClass typelib_TypeClass_STRUCT or typelib_TypeClass_EXCEPTION 1069 @param pTypeName name of type 1070 @param pBaseType base type 1071 @param nMembers number of members 1072 @param ppMembers member types 1073 */ 1074 void SAL_CALL typelib_static_compound_type_init( 1075 typelib_TypeDescriptionReference ** ppRef, 1076 typelib_TypeClass eTypeClass, const sal_Char * pTypeName, 1077 typelib_TypeDescriptionReference * pBaseType, 1078 sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers ) 1079 SAL_THROW_EXTERN_C(); 1080 1081 /** Inits incomplete static struct type reference. 1082 1083 Thread synchronizes on typelib init mutex. 1084 1085 @param ppRef pointer to type reference pointer 1086 @param pTypeName name of type 1087 @param pBaseType base type 1088 @param nMembers number of members 1089 @param ppMembers member types 1090 @param pParameterizedTypes flags for direct members, specifying whether they 1091 are of parameterized type (true) or explict type (false); must be null 1092 for a plain struct type 1093 1094 @since UDK 3.2.0 1095 */ 1096 void SAL_CALL typelib_static_struct_type_init( 1097 typelib_TypeDescriptionReference ** ppRef, const sal_Char * pTypeName, 1098 typelib_TypeDescriptionReference * pBaseType, 1099 sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers, 1100 sal_Bool const * pParameterizedTypes ) 1101 SAL_THROW_EXTERN_C(); 1102 1103 /** Inits incomplete static interface type reference. Thread synchronizes on typelib init mutex. 1104 1105 @param ppRef pointer to type reference pointer 1106 @param pTypeName name of interface 1107 @param pBaseType base type 1108 */ 1109 void SAL_CALL typelib_static_interface_type_init( 1110 typelib_TypeDescriptionReference ** ppRef, 1111 const sal_Char * pTypeName, 1112 typelib_TypeDescriptionReference * pBaseType ) 1113 SAL_THROW_EXTERN_C(); 1114 1115 /** Inits incomplete static multiple-inheritance interface type reference. 1116 Thread synchronizes on typelib init mutex. 1117 1118 @param ppRef pointer to type reference pointer 1119 @param pTypeName name of interface 1120 @param nBaseTypes number of base types 1121 @param ppBaseTypes base types 1122 1123 @since UDK 3.2.0 1124 */ 1125 void SAL_CALL typelib_static_mi_interface_type_init( 1126 typelib_TypeDescriptionReference ** ppRef, 1127 const sal_Char * pTypeName, 1128 sal_Int32 nBaseTypes, 1129 typelib_TypeDescriptionReference ** ppBaseTypes ) 1130 SAL_THROW_EXTERN_C(); 1131 1132 /** Inits incomplete static enum type reference. Thread synchronizes on typelib init mutex. 1133 1134 @param ppRef pointer to type reference pointer 1135 @param pTypeName name of enum 1136 @param nDefaultEnumValue default enum value 1137 */ 1138 void SAL_CALL typelib_static_enum_type_init( 1139 typelib_TypeDescriptionReference ** ppRef, 1140 const sal_Char * pTypeName, 1141 sal_Int32 nDefaultValue ) 1142 SAL_THROW_EXTERN_C(); 1143 1144 /** Completes a typedescription to be used for, e.g., marshalling values. COMPOUND, UNION, 1145 INTERFACE and ENUM type descriptions may be partly initialized (see typelib_static_...(), 1146 typelib_TypeDescription::bComplete). For interface type descriptions, this will also 1147 init index tables. 1148 1149 @param ppTypeDescr [inout] type description to be completed (may be exchanged!) 1150 @return true, if type description is complete 1151 */ 1152 sal_Bool SAL_CALL typelib_typedescription_complete( 1153 typelib_TypeDescription ** ppTypeDescr ) 1154 SAL_THROW_EXTERN_C(); 1155 1156 #ifdef __cplusplus 1157 } 1158 #endif 1159 1160 #endif 1161