1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_registry_reader_h 25 #define INCLUDED_registry_reader_h 26 27 #include "registry/types.h" 28 #include "registry/version.h" 29 30 #include "rtl/ustring.h" 31 #include "sal/types.h" 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 /// @HTML 38 39 /** 40 Creates a type reader working on a binary blob that represents a UNOIDL type. 41 42 <p>If a non-null handle is returned through <code>result</code>, its 43 reference count will be one. Operations on a non-null handle are not 44 multi-thread–safe.</p> 45 46 @param buffer the binary blob representing the type; must point to at least 47 <code>length</code> bytes, and need only be byte-aligned 48 49 @param length the size in bytes of the binary blob representing the type 50 51 @param copy if true, the type reader creates an internal copy of the given 52 buffer, and the given buffer is not accessed after this function returns; if 53 false, the type reader works directly on the given buffer, which must remain 54 available unmodified until the type reader is destroyed 55 56 @param maxVersion the maximum binary blob version the client is prepared to 57 handle; must not be negative 58 59 @param result an out-parameter obtaining a handle on the type reader; must 60 not be null; if the given binary blob is malformed, or of a version larger 61 than <code>maxVersion</code>, null is returned 62 63 @return false iff an out-of-memory condition occured, in which case 64 <code>result</code> is left unchanged, and no type reader is created 65 66 @since UDK 3.2.0 67 */ 68 sal_Bool SAL_CALL typereg_reader_create( 69 void const * buffer, sal_uInt32 length, sal_Bool copy, 70 enum typereg_Version maxVersion, void ** result) 71 SAL_THROW_EXTERN_C(); 72 73 /** 74 Increments the reference count of a type reader. 75 76 @param handle a handle on a type reader; may be null 77 78 @since UDK 3.2.0 79 */ 80 void SAL_CALL typereg_reader_acquire(void * handle) SAL_THROW_EXTERN_C(); 81 82 /** 83 Decrements the reference count of a type reader. 84 85 <p>If the reference count drops to zero, the type reader is destroyed.</p> 86 87 @param handle a handle on a type reader; may be null 88 89 @since UDK 3.2.0 90 */ 91 void SAL_CALL typereg_reader_release(void * handle) SAL_THROW_EXTERN_C(); 92 93 /** 94 Returns the binary blob version of a type reader. 95 96 @param handle a handle on a type reader; may be null 97 98 @return the version of the binary blob from which the type reader was 99 constructed; if <code>handle</code> is null, <code>TYPEREG_VERSION_0</code> 100 is returned 101 102 @since UDK 3.2.0 103 */ 104 enum typereg_Version SAL_CALL typereg_reader_getVersion(void * handle) 105 SAL_THROW_EXTERN_C(); 106 107 /** 108 Returns the documentation of a type reader. 109 110 @param handle a handle on a type reader; may be null 111 112 @param result an out-parameter obtaining the documentation string; must not 113 be null; if <code>handle</code> is null, an empty string is returned; if an 114 out-of-memory condition occurs, a pointer to a null pointer is returned 115 116 @since UDK 3.2.0 117 */ 118 void SAL_CALL typereg_reader_getDocumentation( 119 void * handle, rtl_uString ** result) SAL_THROW_EXTERN_C(); 120 121 /** 122 Returns the file name of a type reader. 123 124 @param handle a handle on a type reader; may be null 125 126 @param result an out-parameter obtaining the file name string; must not be 127 null; if <code>handle</code> is null, an empty string is returned; if an 128 out-of-memory condition occurs, a pointer to a null pointer is returned 129 130 @since UDK 3.2.0 131 @deprecated 132 */ 133 void SAL_CALL typereg_reader_getFileName(void * handle, rtl_uString ** result) 134 SAL_THROW_EXTERN_C(); 135 136 /** 137 Returns the type class of a type reader. 138 139 <p>This function will always return the type class without the internal 140 <code>RT_TYPE_PUBLISHED</code> flag set. Use 141 <code>typereg_reader_isPublished</code> to determine whether a type reader is 142 published.</p> 143 144 @param handle a handle on a type reader; may be null 145 146 @return the type class of the type reader; if <code>handle</code> is null, 147 <code>RT_TYPE_INVALID</code> is returned 148 149 @since UDK 3.2.0 150 */ 151 enum RTTypeClass SAL_CALL typereg_reader_getTypeClass(void * handle) 152 SAL_THROW_EXTERN_C(); 153 154 /** 155 Returns whether a type reader is published. 156 157 @param handle a handle on a type reader; may be null 158 159 @return whether the type reader is published; if <code>handle</code> is null, 160 <code>sal_False</code> is returned 161 162 @since UDK 3.2.0 163 */ 164 sal_Bool SAL_CALL typereg_reader_isPublished(void * handle) 165 SAL_THROW_EXTERN_C(); 166 167 /** 168 Returns the type name of a type reader. 169 170 @param handle a handle on a type reader; may be null 171 172 @param result an out-parameter obtaining the type name string; must not be 173 null; if <code>handle</code> is null, an empty string is returned; if an 174 out-of-memory condition occurs, a pointer to a null pointer is returned 175 176 @since UDK 3.2.0 177 */ 178 void SAL_CALL typereg_reader_getTypeName(void * handle, rtl_uString ** result) 179 SAL_THROW_EXTERN_C(); 180 181 /** 182 Returns the number of super types of a type reader. 183 184 @param handle a handle on a type reader; may be null 185 186 @return the number of super types of the type reader; if <code>handle</code> 187 is null, zero is returned 188 189 @since UDK 3.2.0 190 */ 191 sal_uInt16 SAL_CALL typereg_reader_getSuperTypeCount(void * handle) 192 SAL_THROW_EXTERN_C(); 193 194 /** 195 Returns the type name of a super type of a type reader. 196 197 @param handle a handle on a type reader; must not be null 198 199 @param result an out-parameter obtaining the super type's type name string; 200 must not be null; if an out-of-memory condition occurs, a pointer to a null 201 pointer is returned 202 203 @param index a valid index into the range of super types of the given type 204 reader 205 206 @since UDK 3.2.0 207 */ 208 void SAL_CALL typereg_reader_getSuperTypeName( 209 void * handle, rtl_uString ** result, sal_uInt16 index) 210 SAL_THROW_EXTERN_C(); 211 212 /** 213 Returns the number of fields of a type reader. 214 215 @param handle a handle on a type reader; may be null 216 217 @return the number of fields of the type reader; if <code>handle</code> is 218 null, zero is returned 219 220 @since UDK 3.2.0 221 */ 222 sal_uInt16 SAL_CALL typereg_reader_getFieldCount(void * handle) 223 SAL_THROW_EXTERN_C(); 224 225 /** 226 Returns the documentation of a field of a type reader. 227 228 @param handle a handle on a type reader; must not be null 229 230 @param result an out-parameter obtaining the field's documentation string; 231 must not be null; if an out-of-memory condition occurs, a pointer to a null 232 pointer is returned 233 234 @param index a valid index into the range of fields of the given type reader 235 236 @since UDK 3.2.0 237 */ 238 void SAL_CALL typereg_reader_getFieldDocumentation( 239 void * handle, rtl_uString ** result, sal_uInt16 index) 240 SAL_THROW_EXTERN_C(); 241 242 /** 243 Returns the file name of a field of a type reader. 244 245 @param handle a handle on a type reader; must not be null 246 247 @param result an out-parameter obtaining the field's file name string; must 248 not be null; if an out-of-memory condition occurs, a pointer to a null 249 pointer is returned 250 251 @param index a valid index into the range of fields of the given type reader 252 253 @since UDK 3.2.0 254 @deprecated 255 */ 256 void SAL_CALL typereg_reader_getFieldFileName( 257 void * handle, rtl_uString ** result, sal_uInt16 index) 258 SAL_THROW_EXTERN_C(); 259 260 /** 261 Returns the flags of a field of a type reader. 262 263 @param handle a handle on a type reader; must not be null 264 265 @param index a valid index into the range of fields of the given type reader 266 267 @return the flags of the given field of the type reader 268 269 @since UDK 3.2.0 270 */ 271 RTFieldAccess SAL_CALL typereg_reader_getFieldFlags( 272 void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C(); 273 274 /** 275 Returns the name of a field of a type reader. 276 277 @param handle a handle on a type reader; must not be null 278 279 @param result an out-parameter obtaining the field's name string; must not be 280 null; if an out-of-memory condition occurs, a pointer to a null pointer is 281 returned 282 283 @param index a valid index into the range of fields of the given type reader 284 285 @since UDK 3.2.0 286 */ 287 void SAL_CALL typereg_reader_getFieldName( 288 void * handle, rtl_uString ** result, sal_uInt16 index) 289 SAL_THROW_EXTERN_C(); 290 291 /** 292 Returns the type name of a field of a type reader. 293 294 @param handle a handle on a type reader; must not be null 295 296 @param result an out-parameter obtaining the field's type name string; must 297 not be null; if an out-of-memory condition occurs, a pointer to a null 298 pointer is returned 299 300 @param index a valid index into the range of fields of the given type reader 301 302 @since UDK 3.2.0 303 */ 304 void SAL_CALL typereg_reader_getFieldTypeName( 305 void * handle, rtl_uString ** result, sal_uInt16 index) 306 SAL_THROW_EXTERN_C(); 307 308 /** 309 Returns the value of a field of a type reader. 310 311 @param handle a handle on a type reader; must not be null 312 313 @param index a valid index into the range of fields of the given type reader 314 315 @param type an out-parameter obtaining the field value's type; must not be 316 null 317 318 @param result an out-parameter obtaining the field value's value; must not be 319 null 320 321 @return false iff an out-of-memory condition occured, in which case 322 <code>type</code> and <code>value</code> are left unchanged 323 324 @since UDK 3.2.0 325 */ 326 sal_Bool SAL_CALL typereg_reader_getFieldValue( 327 void * handle, sal_uInt16 index, enum RTValueType * type, 328 union RTConstValueUnion * value) 329 SAL_THROW_EXTERN_C(); 330 331 /** 332 Returns the number of methods of a type reader. 333 334 @param handle a handle on a type reader; may be null 335 336 @return the number of methods of the type reader; if <code>handle</code> is 337 null, zero is returned 338 339 @since UDK 3.2.0 340 */ 341 sal_uInt16 SAL_CALL typereg_reader_getMethodCount(void * handle) 342 SAL_THROW_EXTERN_C(); 343 344 /** 345 Returns the documentation of a method of a type reader. 346 347 @param handle a handle on a type reader; must not be null 348 349 @param result an out-parameter obtaining the methods's documentation string; 350 must not be null; if an out-of-memory condition occurs, a pointer to a null 351 pointer is returned 352 353 @param index a valid index into the range of methods of the given type reader 354 355 @since UDK 3.2.0 356 */ 357 void SAL_CALL typereg_reader_getMethodDocumentation( 358 void * handle, rtl_uString ** result, sal_uInt16 index) 359 SAL_THROW_EXTERN_C(); 360 361 /** 362 Returns the flags of a method of a type reader. 363 364 @param handle a handle on a type reader; must not be null 365 366 @param index a valid index into the range of methods of the given type reader 367 368 @return the flags of the given method of the type reader 369 370 @since UDK 3.2.0 371 */ 372 enum RTMethodMode SAL_CALL typereg_reader_getMethodFlags( 373 void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C(); 374 375 /** 376 Returns the name of a method of a type reader. 377 378 @param handle a handle on a type reader; must not be null 379 380 @param result an out-parameter obtaining the methods's name string; must not 381 be null; if an out-of-memory condition occurs, a pointer to a null pointer is 382 returned 383 384 @param index a valid index into the range of methods of the given type reader 385 386 @since UDK 3.2.0 387 */ 388 void SAL_CALL typereg_reader_getMethodName( 389 void * handle, rtl_uString ** result, sal_uInt16 index) 390 SAL_THROW_EXTERN_C(); 391 392 /** 393 Returns the return type name of a method of a type reader. 394 395 @param handle a handle on a type reader; must not be null 396 397 @param result an out-parameter obtaining the methods's return type name 398 string; must not be null; if an out-of-memory condition occurs, a pointer to 399 a null pointer is returned 400 401 @param index a valid index into the range of methods of the given type reader 402 403 @since UDK 3.2.0 404 */ 405 void SAL_CALL typereg_reader_getMethodReturnTypeName( 406 void * handle, rtl_uString ** result, sal_uInt16 index) 407 SAL_THROW_EXTERN_C(); 408 409 /** 410 Returns the number of parameters of a method of a type reader. 411 412 @param handle a handle on a type reader; must not be null 413 414 @param index a valid index into the range of methods of the given type reader 415 416 @return the number of parameters of the given method of the type reader 417 418 @since UDK 3.2.0 419 */ 420 sal_uInt16 SAL_CALL typereg_reader_getMethodParameterCount( 421 void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C(); 422 423 /** 424 Returns the flags of a parameter of a method of a type reader. 425 426 @param handle a handle on a type reader; must not be null 427 428 @param methodIndex a valid index into the range of methods of the given type 429 reader 430 431 @param parameterIndex a valid index into the range of parameters of the given 432 method 433 434 @return the flags of the given parameter of the given method of the type 435 reader 436 437 @since UDK 3.2.0 438 */ 439 enum RTParamMode SAL_CALL typereg_reader_getMethodParameterFlags( 440 void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex) 441 SAL_THROW_EXTERN_C(); 442 443 /** 444 Returns the name of a parameter of a method of a type reader. 445 446 @param handle a handle on a type reader; must not be null 447 448 @param result an out-parameter obtaining the parameter's name string; must 449 not be null; if an out-of-memory condition occurs, a pointer to a null 450 pointer is returned 451 452 @param methodIndex a valid index into the range of methods of the given type 453 reader 454 455 @param parameterIndex a valid index into the range of parameters of the given 456 method 457 458 @since UDK 3.2.0 459 */ 460 void SAL_CALL typereg_reader_getMethodParameterName( 461 void * handle, rtl_uString ** result, sal_uInt16 methodIndex, 462 sal_uInt16 parameterIndex) 463 SAL_THROW_EXTERN_C(); 464 465 /** 466 Returns the type name of a parameter of a method of a type reader. 467 468 @param handle a handle on a type reader; must not be null 469 470 @param result an out-parameter obtaining the parameter's type name string; 471 must not be null; if an out-of-memory condition occurs, a pointer to a null 472 pointer is returned 473 474 @param methodIndex a valid index into the range of methods of the given type 475 reader 476 477 @param parameterIndex a valid index into the range of parameters of the given 478 method 479 480 @since UDK 3.2.0 481 */ 482 void SAL_CALL typereg_reader_getMethodParameterTypeName( 483 void * handle, rtl_uString ** result, sal_uInt16 methodIndex, 484 sal_uInt16 parameterIndex) 485 SAL_THROW_EXTERN_C(); 486 487 /** 488 Returns the number of exceptions of a method of a type reader. 489 490 @param handle a handle on a type reader; must not be null 491 492 @param index a valid index into the range of methods of the given type reader 493 494 @return the number of exceptions of the given method of the type reader 495 496 @since UDK 3.2.0 497 */ 498 sal_uInt16 SAL_CALL typereg_reader_getMethodExceptionCount( 499 void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C(); 500 501 /** 502 Returns the type name of an exception of a method of a type reader. 503 504 @param handle a handle on a type reader; must not be null 505 506 @param result an out-parameter obtaining the exception's type name string; 507 must not be null; if an out-of-memory condition occurs, a pointer to a null 508 pointer is returned 509 510 @param methodIndex a valid index into the range of methods of the given type 511 reader 512 513 @param exceptionIndex a valid index into the range of exceptions of the given 514 method 515 516 @since UDK 3.2.0 517 */ 518 void SAL_CALL typereg_reader_getMethodExceptionTypeName( 519 void * handle, rtl_uString ** result, sal_uInt16 methodIndex, 520 sal_uInt16 exceptionIndex) 521 SAL_THROW_EXTERN_C(); 522 523 /** 524 Returns the number of references of a type reader. 525 526 @param handle a handle on a type reader; may be null 527 528 @return the number of references of the type reader; if <code>handle</code> 529 is null, zero is returned 530 531 @since UDK 3.2.0 532 */ 533 sal_uInt16 SAL_CALL typereg_reader_getReferenceCount(void * handle) 534 SAL_THROW_EXTERN_C(); 535 536 /** 537 Returns the documentation of a reference of a type reader. 538 539 @param handle a handle on a type reader; must not be null 540 541 @param result an out-parameter obtaining the reference's documentation 542 string; must not be null; if an out-of-memory condition occurs, a pointer to 543 a null pointer is returned 544 545 @param index a valid index into the range of references of the given type 546 reader 547 548 @since UDK 3.2.0 549 */ 550 void SAL_CALL typereg_reader_getReferenceDocumentation( 551 void * handle, rtl_uString ** result, sal_uInt16 index) 552 SAL_THROW_EXTERN_C(); 553 554 /** 555 Returns the flags of a reference of a type reader. 556 557 @param handle a handle on a type reader; must not be null 558 559 @param index a valid index into the range of references of the given type 560 reader 561 562 @return the flags of the given reference of the type reader 563 564 @since UDK 3.2.0 565 */ 566 RTFieldAccess SAL_CALL typereg_reader_getReferenceFlags( 567 void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C(); 568 569 /** 570 Returns the sort of a reference of a type reader. 571 572 @param handle a handle on a type reader; must not be null 573 574 @param index a valid index into the range of references of the given type 575 reader 576 577 @return the sort of the given reference of the type reader 578 579 @since UDK 3.2.0 580 */ 581 enum RTReferenceType SAL_CALL typereg_reader_getReferenceSort( 582 void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C(); 583 584 /** 585 Returns the type name of a reference of a type reader. 586 587 @param handle a handle on a type reader; must not be null 588 589 @param result an out-parameter obtaining the reference's type name string; 590 must not be null; if an out-of-memory condition occurs, a pointer to a null 591 pointer is returned 592 593 @param index a valid index into the range of references of the given type 594 reader 595 596 @since UDK 3.2.0 597 */ 598 void SAL_CALL typereg_reader_getReferenceTypeName( 599 void * handle, rtl_uString ** result, sal_uInt16 index) 600 SAL_THROW_EXTERN_C(); 601 602 #ifdef __cplusplus 603 } 604 #endif 605 606 #endif 607