My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
reflwrit.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef _REGISTRY_REFLWRIT_HXX_
21 #define _REGISTRY_REFLWRIT_HXX_
22 
23 #include <registry/regdllapi.h>
24 #include <registry/refltype.hxx>
25 #include <registry/regtype.h>
26 #include <rtl/ustring.hxx>
27 
29 typedef void* TypeWriterImpl;
30 
31 /****************************************************************************
32 
33  C-Api
34 
35 *****************************************************************************/
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
46 {
47  TypeWriterImpl (TYPEREG_CALLTYPE *createEntry) (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
50  void (TYPEREG_CALLTYPE *setUik) (TypeWriterImpl, const RTUik*);
51  void (TYPEREG_CALLTYPE *setDoku) (TypeWriterImpl, rtl_uString*);
52  void (TYPEREG_CALLTYPE *setFileName) (TypeWriterImpl, rtl_uString*);
53  void (TYPEREG_CALLTYPE *setFieldData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
54  void (TYPEREG_CALLTYPE *setMethodData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, RTMethodMode, sal_uInt16, sal_uInt16, rtl_uString*);
55  void (TYPEREG_CALLTYPE *setParamData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*, rtl_uString*, RTParamMode);
56  void (TYPEREG_CALLTYPE *setExcData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*);
59 
60  void (TYPEREG_CALLTYPE *setReferenceData) (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess);
61 };
62 
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
81 {
82 public:
83 
97  const ::rtl::OUString& typeName,
98  const ::rtl::OUString& superTypeName,
99  sal_uInt16 fieldCount,
100  sal_uInt16 methodCount,
101  sal_uInt16 referenceCount);
102 
104  inline RegistryTypeWriter(const RegistryTypeWriter& toCopy);
105 
110  inline ~RegistryTypeWriter();
111 
113  inline RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
114 
122  inline void setUik(const RTUik& uik);
123 
129  inline void setDoku(const ::rtl::OUString& doku);
130 
133  inline void setFileName(const ::rtl::OUString& fileName);
134 
146  inline void setFieldData( sal_uInt16 index,
147  const ::rtl::OUString& name,
148  const ::rtl::OUString& typeName,
149  const ::rtl::OUString& doku,
150  const ::rtl::OUString& fileName,
151  RTFieldAccess access,
152  RTConstValue constValue = RTConstValue());
153 
164  inline void setMethodData(sal_uInt16 index,
165  const ::rtl::OUString& name,
166  const ::rtl::OUString& returnTypeName,
167  RTMethodMode mode,
168  sal_uInt16 paramCount,
169  sal_uInt16 excCount,
170  const ::rtl::OUString& doku);
171 
180  inline void setParamData(sal_uInt16 index,
181  sal_uInt16 paramIndex,
182  const ::rtl::OUString& type,
183  const ::rtl::OUString& name,
184  RTParamMode mode);
185 
192  inline void setExcData(sal_uInt16 index,
193  sal_uInt16 excIndex,
194  const ::rtl::OUString& type);
195 
201  inline const sal_uInt8* getBlop();
202 
205  inline sal_uInt32 getBlopSize();
206 
215  inline void setReferenceData( sal_uInt16 index,
216  const ::rtl::OUString& name,
217  RTReferenceType refType,
218  const ::rtl::OUString& doku,
220 
221 protected:
222 
227 };
228 
229 
230 
232  const ::rtl::OUString& typeName,
233  const ::rtl::OUString& superTypeName,
234  sal_uInt16 fieldCount,
235  sal_uInt16 methodCount,
236  sal_uInt16 referenceCount)
237  : m_pApi(initRegistryTypeWriter_Api())
238  , m_hImpl(NULL)
239 {
240  m_hImpl = m_pApi->createEntry(RTTypeClass,
241  typeName.pData,
242  superTypeName.pData,
243  fieldCount,
244  methodCount,
245  referenceCount);
246 }
247 
248 
250  : m_pApi(toCopy.m_pApi)
251  , m_hImpl(toCopy.m_hImpl)
252 {
253  m_pApi->acquire(m_hImpl);
254 }
255 
257 {
258  m_pApi->release(m_hImpl);
259 }
260 
262 {
263  if (m_hImpl != toAssign.m_hImpl)
264  {
265  m_pApi->release(m_hImpl);
266  m_hImpl = toAssign.m_hImpl;
267  m_pApi->acquire(m_hImpl);
268  }
269 
270  return *this;
271 }
272 
273 inline void RegistryTypeWriter::setFieldData( sal_uInt16 index,
274  const ::rtl::OUString& name,
275  const ::rtl::OUString& typeName,
276  const ::rtl::OUString& doku,
277  const ::rtl::OUString& fileName,
278  RTFieldAccess access,
279  RTConstValue constValue)
280 {
281  m_pApi->setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
282 }
283 
284 
285 inline void RegistryTypeWriter::setMethodData(sal_uInt16 index,
286  const ::rtl::OUString& name,
287  const ::rtl::OUString& returnTypeName,
288  RTMethodMode mode,
289  sal_uInt16 paramCount,
290  sal_uInt16 excCount,
291  const ::rtl::OUString& doku)
292 {
293  m_pApi->setMethodData(m_hImpl, index, name.pData, returnTypeName.pData, mode, paramCount, excCount, doku.pData);
294 }
295 
296 
297 inline void RegistryTypeWriter::setUik(const RTUik& uik)
298 {
299  m_pApi->setUik(m_hImpl, &uik);
300 }
301 
302 inline void RegistryTypeWriter::setDoku(const ::rtl::OUString& doku)
303 {
304  m_pApi->setDoku(m_hImpl, doku.pData);
305 }
306 
307 inline void RegistryTypeWriter::setFileName(const ::rtl::OUString& doku)
308 {
309  m_pApi->setFileName(m_hImpl, doku.pData);
310 }
311 
312 inline void RegistryTypeWriter::setParamData(sal_uInt16 index,
313  sal_uInt16 paramIndex,
314  const ::rtl::OUString& type,
315  const ::rtl::OUString& name,
316  RTParamMode mode)
317 {
318  m_pApi->setParamData(m_hImpl, index, paramIndex, type.pData, name.pData, mode);
319 }
320 
321 inline void RegistryTypeWriter::setExcData(sal_uInt16 index,
322  sal_uInt16 excIndex,
323  const ::rtl::OUString& type)
324 {
325  m_pApi->setExcData(m_hImpl, index, excIndex, type.pData);
326 }
327 
329 {
330  return m_pApi->getBlop(m_hImpl);
331 }
332 
334 {
335  return m_pApi->getBlopSize(m_hImpl);
336 }
337 
338 
339 inline void RegistryTypeWriter::setReferenceData( sal_uInt16 index,
340  const ::rtl::OUString& name,
341  RTReferenceType refType,
342  const ::rtl::OUString& doku,
343  RTFieldAccess access)
344 {
345  m_pApi->setReferenceData(m_hImpl, index, name.pData, refType, doku.pData, access);
346 }
347 
348 #endif
349 
350 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */