UDK 3.2.7 C/C++ API Reference

registry/reflwrit.hxx

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 
00020 #ifndef _REGISTRY_REFLWRIT_HXX_
00021 #define _REGISTRY_REFLWRIT_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* TypeWriterImpl;
00030 
00031 /****************************************************************************
00032 
00033     C-Api
00034 
00035 *****************************************************************************/
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00045 struct RegistryTypeWriter_Api
00046 {
00047     TypeWriterImpl          (TYPEREG_CALLTYPE *createEntry)         (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
00048     void                    (TYPEREG_CALLTYPE *acquire)             (TypeWriterImpl);
00049     void                    (TYPEREG_CALLTYPE *release)             (TypeWriterImpl);
00050     void                    (TYPEREG_CALLTYPE *setUik)              (TypeWriterImpl, const RTUik*);
00051     void                    (TYPEREG_CALLTYPE *setDoku)             (TypeWriterImpl, rtl_uString*);
00052     void                    (TYPEREG_CALLTYPE *setFileName)         (TypeWriterImpl, rtl_uString*);
00053     void                    (TYPEREG_CALLTYPE *setFieldData)        (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
00054     void                    (TYPEREG_CALLTYPE *setMethodData)       (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, RTMethodMode, sal_uInt16, sal_uInt16, rtl_uString*);
00055     void                    (TYPEREG_CALLTYPE *setParamData)        (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*, rtl_uString*, RTParamMode);
00056     void                    (TYPEREG_CALLTYPE *setExcData)          (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*);
00057     const sal_uInt8*        (TYPEREG_CALLTYPE *getBlop)             (TypeWriterImpl);
00058     sal_uInt32              (TYPEREG_CALLTYPE *getBlopSize)         (TypeWriterImpl);
00059 
00060     void                    (TYPEREG_CALLTYPE *setReferenceData)    (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess);
00061 };
00062 
00065 REG_DLLPUBLIC RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api(void);
00066 
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070 
00080 class RegistryTypeWriter
00081 {
00082 public:
00083 
00096     inline RegistryTypeWriter(RTTypeClass               RTTypeClass,
00097                               const ::rtl::OUString&    typeName,
00098                               const ::rtl::OUString&    superTypeName,
00099                               sal_uInt16                fieldCount,
00100                               sal_uInt16                methodCount,
00101                               sal_uInt16                referenceCount);
00102 
00104     inline RegistryTypeWriter(const RegistryTypeWriter& toCopy);
00105 
00110     inline ~RegistryTypeWriter();
00111 
00113     inline RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
00114 
00122     inline void setUik(const RTUik& uik);
00123 
00129     inline void setDoku(const ::rtl::OUString& doku);
00130 
00133     inline void setFileName(const ::rtl::OUString& fileName);
00134 
00146     inline void setFieldData( sal_uInt16                index,
00147                               const ::rtl::OUString&    name,
00148                               const ::rtl::OUString&    typeName,
00149                               const ::rtl::OUString&    doku,
00150                               const ::rtl::OUString&    fileName,
00151                               RTFieldAccess             access,
00152                               RTConstValue              constValue = RTConstValue());
00153 
00164     inline void setMethodData(sal_uInt16                index,
00165                               const ::rtl::OUString&    name,
00166                               const ::rtl::OUString&    returnTypeName,
00167                               RTMethodMode              mode,
00168                               sal_uInt16                paramCount,
00169                               sal_uInt16                excCount,
00170                               const ::rtl::OUString&    doku);
00171 
00180     inline void setParamData(sal_uInt16             index,
00181                              sal_uInt16             paramIndex,
00182                              const ::rtl::OUString& type,
00183                              const ::rtl::OUString& name,
00184                              RTParamMode            mode);
00185 
00192     inline void setExcData(sal_uInt16               index,
00193                            sal_uInt16               excIndex,
00194                            const ::rtl::OUString&   type);
00195 
00201     inline const sal_uInt8*     getBlop();
00202 
00205     inline sal_uInt32       getBlopSize();
00206 
00215     inline void setReferenceData( sal_uInt16                index,
00216                                     const ::rtl::OUString&  name,
00217                                     RTReferenceType             refType,
00218                                     const ::rtl::OUString&  doku,
00219                                     RTFieldAccess               access = RT_ACCESS_INVALID);
00220 
00221 protected:
00222 
00224     const RegistryTypeWriter_Api*                                m_pApi;
00226     TypeWriterImpl                                               m_hImpl;
00227 };
00228 
00229 
00230 
00231 inline RegistryTypeWriter::RegistryTypeWriter(RTTypeClass               RTTypeClass,
00232                                               const ::rtl::OUString&    typeName,
00233                                               const ::rtl::OUString&    superTypeName,
00234                                               sal_uInt16                fieldCount,
00235                                               sal_uInt16                methodCount,
00236                                               sal_uInt16                referenceCount)
00237     : m_pApi(initRegistryTypeWriter_Api())
00238     , m_hImpl(NULL)
00239 {
00240     m_hImpl = m_pApi->createEntry(RTTypeClass,
00241                                   typeName.pData,
00242                                   superTypeName.pData,
00243                                   fieldCount,
00244                                   methodCount,
00245                                   referenceCount);
00246 }
00247 
00248 
00249 inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
00250     : m_pApi(toCopy.m_pApi)
00251     , m_hImpl(toCopy.m_hImpl)
00252 {
00253     m_pApi->acquire(m_hImpl);
00254 }
00255 
00256 inline RegistryTypeWriter::~RegistryTypeWriter()
00257 {
00258     m_pApi->release(m_hImpl);
00259 }
00260 
00261 inline RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
00262 {
00263     if (m_hImpl != toAssign.m_hImpl)
00264     {
00265         m_pApi->release(m_hImpl);
00266         m_hImpl = toAssign.m_hImpl;
00267         m_pApi->acquire(m_hImpl);
00268     }
00269 
00270     return *this;
00271 }
00272 
00273 inline void RegistryTypeWriter::setFieldData( sal_uInt16                index,
00274                                               const ::rtl::OUString&    name,
00275                                               const ::rtl::OUString&    typeName,
00276                                               const ::rtl::OUString&    doku,
00277                                               const ::rtl::OUString&    fileName,
00278                                               RTFieldAccess             access,
00279                                               RTConstValue              constValue)
00280 {
00281     m_pApi->setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
00282 }
00283 
00284 
00285 inline void RegistryTypeWriter::setMethodData(sal_uInt16                index,
00286                                               const ::rtl::OUString&    name,
00287                                               const ::rtl::OUString&    returnTypeName,
00288                                               RTMethodMode              mode,
00289                                               sal_uInt16                paramCount,
00290                                               sal_uInt16                excCount,
00291                                               const ::rtl::OUString&    doku)
00292 {
00293     m_pApi->setMethodData(m_hImpl, index, name.pData, returnTypeName.pData, mode, paramCount, excCount, doku.pData);
00294 }
00295 
00296 
00297 inline void RegistryTypeWriter::setUik(const RTUik& uik)
00298 {
00299     m_pApi->setUik(m_hImpl, &uik);
00300 }
00301 
00302 inline void RegistryTypeWriter::setDoku(const ::rtl::OUString& doku)
00303 {
00304     m_pApi->setDoku(m_hImpl, doku.pData);
00305 }
00306 
00307 inline void RegistryTypeWriter::setFileName(const ::rtl::OUString& doku)
00308 {
00309     m_pApi->setFileName(m_hImpl, doku.pData);
00310 }
00311 
00312 inline void RegistryTypeWriter::setParamData(sal_uInt16             index,
00313                                              sal_uInt16             paramIndex,
00314                                              const ::rtl::OUString& type,
00315                                              const ::rtl::OUString& name,
00316                                              RTParamMode            mode)
00317 {
00318     m_pApi->setParamData(m_hImpl, index, paramIndex, type.pData, name.pData, mode);
00319 }
00320 
00321 inline void RegistryTypeWriter::setExcData(sal_uInt16               index,
00322                                            sal_uInt16               excIndex,
00323                                            const ::rtl::OUString&   type)
00324 {
00325     m_pApi->setExcData(m_hImpl, index, excIndex, type.pData);
00326 }
00327 
00328 inline const sal_uInt8* RegistryTypeWriter::getBlop()
00329 {
00330     return m_pApi->getBlop(m_hImpl);
00331 }
00332 
00333 inline sal_uInt32 RegistryTypeWriter::getBlopSize()
00334 {
00335     return m_pApi->getBlopSize(m_hImpl);
00336 }
00337 
00338 
00339 inline void RegistryTypeWriter::setReferenceData( sal_uInt16                index,
00340                                                     const ::rtl::OUString&  name,
00341                                                     RTReferenceType             refType,
00342                                                     const ::rtl::OUString&  doku,
00343                                                     RTFieldAccess           access)
00344 {
00345     m_pApi->setReferenceData(m_hImpl, index, name.pData, refType, doku.pData, access);
00346 }
00347 
00348 #endif
00349 
00350 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines