|
UDK 3.2.7 C/C++ API Reference
|
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 00020 #ifndef _REGISTRY_REFLREAD_HXX_ 00021 #define _REGISTRY_REFLREAD_HXX_ 00022 00023 #include <registry/regdllapi.h> 00024 #include <registry/refltype.hxx> 00025 #include <registry/regtype.h> 00026 #include <rtl/ustring.hxx> 00027 00029 typedef void* TypeReaderImpl; 00030 00031 /**************************************************************************** 00032 00033 C-Api 00034 00035 *****************************************************************************/ 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif 00040 00045 struct RegistryTypeReader_Api 00046 { 00047 TypeReaderImpl (TYPEREG_CALLTYPE *createEntry) (const sal_uInt8*, sal_uInt32, sal_Bool); 00048 void (TYPEREG_CALLTYPE *acquire) (TypeReaderImpl); 00049 void (TYPEREG_CALLTYPE *release) (TypeReaderImpl); 00050 sal_uInt16 (TYPEREG_CALLTYPE *getMinorVersion) (TypeReaderImpl); 00051 sal_uInt16 (TYPEREG_CALLTYPE *getMajorVersion) (TypeReaderImpl); 00052 RTTypeClass (TYPEREG_CALLTYPE *getTypeClass) (TypeReaderImpl); 00053 void (TYPEREG_CALLTYPE *getUik) (TypeReaderImpl, RTUik*); 00054 void (TYPEREG_CALLTYPE *getDoku) (TypeReaderImpl, rtl_uString**); 00055 void (TYPEREG_CALLTYPE *getFileName) (TypeReaderImpl, rtl_uString**); 00056 void (TYPEREG_CALLTYPE *getTypeName) (TypeReaderImpl, rtl_uString**); 00057 void (TYPEREG_CALLTYPE *getSuperTypeName) (TypeReaderImpl, rtl_uString**); 00058 sal_uInt32 (TYPEREG_CALLTYPE *getFieldCount) (TypeReaderImpl); 00059 void (TYPEREG_CALLTYPE *getFieldName) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00060 void (TYPEREG_CALLTYPE *getFieldType) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00061 RTFieldAccess (TYPEREG_CALLTYPE *getFieldAccess) (TypeReaderImpl, sal_uInt16); 00062 RTValueType (TYPEREG_CALLTYPE *getFieldConstValue) (TypeReaderImpl, sal_uInt16, RTConstValueUnion*); 00063 void (TYPEREG_CALLTYPE *getFieldDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00064 void (TYPEREG_CALLTYPE *getFieldFileName) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00065 sal_uInt32 (TYPEREG_CALLTYPE *getMethodCount) (TypeReaderImpl); 00066 void (TYPEREG_CALLTYPE *getMethodName) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00067 sal_uInt32 (TYPEREG_CALLTYPE *getMethodParamCount) (TypeReaderImpl, sal_uInt16); 00068 void (TYPEREG_CALLTYPE *getMethodParamType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16); 00069 void (TYPEREG_CALLTYPE *getMethodParamName) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16); 00070 RTParamMode (TYPEREG_CALLTYPE *getMethodParamMode) (TypeReaderImpl, sal_uInt16, sal_uInt16); 00071 sal_uInt32 (TYPEREG_CALLTYPE *getMethodExcCount) (TypeReaderImpl, sal_uInt16); 00072 void (TYPEREG_CALLTYPE *getMethodExcType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16); 00073 void (TYPEREG_CALLTYPE *getMethodReturnType) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00074 RTMethodMode (TYPEREG_CALLTYPE *getMethodMode) (TypeReaderImpl, sal_uInt16); 00075 void (TYPEREG_CALLTYPE *getMethodDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00076 00077 sal_uInt32 (TYPEREG_CALLTYPE *getReferenceCount) (TypeReaderImpl); 00078 void (TYPEREG_CALLTYPE *getReferenceName) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00079 RTReferenceType (TYPEREG_CALLTYPE *getReferenceType) (TypeReaderImpl, sal_uInt16); 00080 void (TYPEREG_CALLTYPE *getReferenceDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16); 00081 RTFieldAccess (TYPEREG_CALLTYPE *getReferenceAccess) (TypeReaderImpl, sal_uInt16); 00082 }; 00083 00086 REG_DLLPUBLIC RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api(void); 00087 00088 #ifdef __cplusplus 00089 } 00090 #endif 00091 00101 class RegistryTypeReader 00102 { 00103 public: 00104 00113 inline RegistryTypeReader(const sal_uInt8* buffer, 00114 sal_uInt32 bufferLen, 00115 sal_Bool copyData); 00116 00118 inline RegistryTypeReader(const RegistryTypeReader& toCopy); 00119 00121 inline ~RegistryTypeReader(); 00122 00124 inline RegistryTypeReader& operator == (const RegistryTypeReader& toAssign); 00125 00127 inline sal_Bool isValid() const; 00128 00135 inline sal_uInt16 getMinorVersion() const; 00136 00143 inline sal_uInt16 getMajorVersion() const; 00144 00150 inline RTTypeClass getTypeClass() const; 00151 00154 inline ::rtl::OUString getTypeName() const; 00155 00158 inline ::rtl::OUString getSuperTypeName() const; 00159 00167 inline void getUik(RTUik& uik) const; 00168 00171 inline ::rtl::OUString getDoku() const; 00172 00175 inline ::rtl::OUString getFileName() const; 00176 00181 inline sal_uInt32 getFieldCount() const; 00182 00185 inline ::rtl::OUString getFieldName( sal_uInt16 index ) const; 00186 00189 inline ::rtl::OUString getFieldType( sal_uInt16 index ) const; 00190 00193 inline RTFieldAccess getFieldAccess( sal_uInt16 index ) const; 00194 00199 inline RTConstValue getFieldConstValue( sal_uInt16 index ) const; 00200 00205 inline ::rtl::OUString getFieldDoku( sal_uInt16 index ) const; 00206 00212 inline ::rtl::OUString getFieldFileName( sal_uInt16 index ) const; 00213 00216 inline sal_uInt32 getMethodCount() const; 00217 00220 inline ::rtl::OUString getMethodName( sal_uInt16 index ) const; 00221 00224 inline sal_uInt32 getMethodParamCount( sal_uInt16 index ) const; 00225 00231 inline ::rtl::OUString getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const; 00232 00238 inline ::rtl::OUString getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const; 00239 00245 inline RTParamMode getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const; 00246 00251 inline sal_uInt32 getMethodExcCount( sal_uInt16 index ) const; 00252 00258 inline ::rtl::OUString getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const; 00259 00262 inline ::rtl::OUString getMethodReturnType( sal_uInt16 index ) const; 00263 00268 inline RTMethodMode getMethodMode( sal_uInt16 index ) const; 00269 00274 inline ::rtl::OUString getMethodDoku( sal_uInt16 index ) const; 00275 00278 inline sal_uInt32 getReferenceCount() const; 00279 00284 inline ::rtl::OUString getReferenceName( sal_uInt16 index ) const; 00285 00290 inline RTReferenceType getReferenceType( sal_uInt16 index ) const; 00291 00296 inline ::rtl::OUString getReferenceDoku( sal_uInt16 index ) const; 00297 00304 inline RTFieldAccess getReferenceAccess( sal_uInt16 index ) const; 00305 00306 protected: 00307 00309 const RegistryTypeReader_Api* m_pApi; 00311 TypeReaderImpl m_hImpl; 00312 }; 00313 00314 00315 00316 inline RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer, 00317 sal_uInt32 bufferLen, 00318 sal_Bool copyData) 00319 : m_pApi(initRegistryTypeReader_Api()) 00320 , m_hImpl(NULL) 00321 { 00322 m_hImpl = m_pApi->createEntry(buffer, bufferLen, copyData); 00323 } 00324 00325 00326 inline RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy) 00327 : m_pApi(toCopy.m_pApi) 00328 , m_hImpl(toCopy.m_hImpl) 00329 { m_pApi->acquire(m_hImpl); } 00330 00331 00332 inline RegistryTypeReader::~RegistryTypeReader() 00333 { m_pApi->release(m_hImpl); } 00334 00335 inline RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign) 00336 { 00337 if (m_hImpl != toAssign.m_hImpl) 00338 { 00339 m_pApi->release(m_hImpl); 00340 m_hImpl = toAssign.m_hImpl; 00341 m_pApi->acquire(m_hImpl); 00342 } 00343 00344 return *this; 00345 } 00346 00347 inline sal_uInt16 RegistryTypeReader::getMinorVersion() const 00348 { return m_pApi->getMinorVersion(m_hImpl); } 00349 00350 inline sal_Bool RegistryTypeReader::isValid() const 00351 { return (m_hImpl != NULL); } 00352 00353 inline sal_uInt16 RegistryTypeReader::getMajorVersion() const 00354 { return m_pApi->getMajorVersion(m_hImpl); } 00355 00356 inline RTTypeClass RegistryTypeReader::getTypeClass() const 00357 { return m_pApi->getTypeClass(m_hImpl); } 00358 00359 inline ::rtl::OUString RegistryTypeReader::getTypeName() const 00360 { 00361 ::rtl::OUString sRet; 00362 m_pApi->getTypeName(m_hImpl, &sRet.pData); 00363 return sRet; 00364 } 00365 00366 inline ::rtl::OUString RegistryTypeReader::getSuperTypeName() const 00367 { 00368 ::rtl::OUString sRet; 00369 m_pApi->getSuperTypeName(m_hImpl, &sRet.pData); 00370 return sRet; 00371 } 00372 00373 inline void RegistryTypeReader::getUik(RTUik& uik) const 00374 { m_pApi->getUik(m_hImpl, &uik); } 00375 00376 inline ::rtl::OUString RegistryTypeReader::getDoku() const 00377 { 00378 ::rtl::OUString sRet; 00379 m_pApi->getDoku(m_hImpl, &sRet.pData); 00380 return sRet; 00381 } 00382 00383 inline ::rtl::OUString RegistryTypeReader::getFileName() const 00384 { 00385 ::rtl::OUString sRet; 00386 m_pApi->getFileName(m_hImpl, &sRet.pData); 00387 return sRet; 00388 } 00389 00390 inline sal_uInt32 RegistryTypeReader::getFieldCount() const 00391 { return m_pApi->getFieldCount(m_hImpl); } 00392 00393 inline ::rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const 00394 { 00395 ::rtl::OUString sRet; 00396 m_pApi->getFieldName(m_hImpl, &sRet.pData, index); 00397 return sRet; 00398 } 00399 00400 inline ::rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const 00401 { 00402 ::rtl::OUString sRet; 00403 m_pApi->getFieldType(m_hImpl, &sRet.pData, index); 00404 return sRet; 00405 } 00406 00407 inline RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const 00408 { return m_pApi->getFieldAccess(m_hImpl, index); } 00409 00410 inline RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const 00411 { 00412 RTConstValue ret; 00413 ret.m_type = m_pApi->getFieldConstValue(m_hImpl, index, &ret.m_value); 00414 return ret; 00415 } 00416 00417 inline ::rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const 00418 { 00419 ::rtl::OUString sRet; 00420 m_pApi->getFieldDoku(m_hImpl, &sRet.pData, index); 00421 return sRet; 00422 } 00423 00424 inline ::rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const 00425 { 00426 ::rtl::OUString sRet; 00427 m_pApi->getFieldFileName(m_hImpl, &sRet.pData, index); 00428 return sRet; 00429 } 00430 00431 inline sal_uInt32 RegistryTypeReader::getMethodCount() const 00432 { return m_pApi->getMethodCount(m_hImpl); } 00433 00434 inline ::rtl::OUString RegistryTypeReader::getMethodName( sal_uInt16 index ) const 00435 { 00436 ::rtl::OUString sRet; 00437 m_pApi->getMethodName(m_hImpl, &sRet.pData, index); 00438 return sRet; 00439 } 00440 00441 inline sal_uInt32 RegistryTypeReader::getMethodParamCount( sal_uInt16 index ) const 00442 { return m_pApi->getMethodParamCount(m_hImpl, index); } 00443 00444 inline ::rtl::OUString RegistryTypeReader::getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const 00445 { 00446 ::rtl::OUString sRet; 00447 m_pApi->getMethodParamType(m_hImpl, &sRet.pData, index, paramIndex); 00448 return sRet; 00449 } 00450 00451 inline ::rtl::OUString RegistryTypeReader::getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const 00452 { 00453 ::rtl::OUString sRet; 00454 m_pApi->getMethodParamName(m_hImpl, &sRet.pData, index, paramIndex); 00455 return sRet; 00456 } 00457 00458 inline RTParamMode RegistryTypeReader::getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const 00459 { return m_pApi->getMethodParamMode(m_hImpl, index, paramIndex); } 00460 00461 inline sal_uInt32 RegistryTypeReader::getMethodExcCount( sal_uInt16 index ) const 00462 { return m_pApi->getMethodExcCount(m_hImpl, index); } 00463 00464 inline ::rtl::OUString RegistryTypeReader::getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const 00465 { 00466 ::rtl::OUString sRet; 00467 m_pApi->getMethodExcType(m_hImpl, &sRet.pData, index, excIndex); 00468 return sRet; 00469 } 00470 00471 inline ::rtl::OUString RegistryTypeReader::getMethodReturnType( sal_uInt16 index ) const 00472 { 00473 ::rtl::OUString sRet; 00474 m_pApi->getMethodReturnType(m_hImpl, &sRet.pData, index); 00475 return sRet; 00476 } 00477 00478 inline RTMethodMode RegistryTypeReader::getMethodMode( sal_uInt16 index ) const 00479 { return m_pApi->getMethodMode(m_hImpl, index); } 00480 00481 inline ::rtl::OUString RegistryTypeReader::getMethodDoku( sal_uInt16 index ) const 00482 { 00483 ::rtl::OUString sRet; 00484 m_pApi->getMethodDoku(m_hImpl, &sRet.pData, index); 00485 return sRet; 00486 } 00487 00488 inline sal_uInt32 RegistryTypeReader::getReferenceCount() const 00489 { return m_pApi->getReferenceCount(m_hImpl); } 00490 00491 inline ::rtl::OUString RegistryTypeReader::getReferenceName( sal_uInt16 index ) const 00492 { 00493 ::rtl::OUString sRet; 00494 m_pApi->getReferenceName(m_hImpl, &sRet.pData, index); 00495 return sRet; 00496 } 00497 00498 inline RTReferenceType RegistryTypeReader::getReferenceType( sal_uInt16 index ) const 00499 { return m_pApi->getReferenceType(m_hImpl, index); } 00500 00501 inline ::rtl::OUString RegistryTypeReader::getReferenceDoku( sal_uInt16 index ) const 00502 { 00503 ::rtl::OUString sRet; 00504 m_pApi->getReferenceDoku(m_hImpl, &sRet.pData, index); 00505 return sRet; 00506 } 00507 00508 inline RTFieldAccess RegistryTypeReader::getReferenceAccess( sal_uInt16 index ) const 00509 { return m_pApi->getReferenceAccess(m_hImpl, index); } 00510 00511 #endif 00512 00513 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
1.7.3