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  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #ifndef _REGISTRY_REFLWRIT_HXX_
30 #define _REGISTRY_REFLWRIT_HXX_
31 
32 #include <registry/regdllapi.h>
33 #include <registry/refltype.hxx>
34 #include <registry/regtype.h>
35 #include <rtl/ustring.hxx>
36 
38 typedef void* TypeWriterImpl;
39 
40 /****************************************************************************
41 
42  C-Api
43 
44 *****************************************************************************/
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
55 {
56  TypeWriterImpl (TYPEREG_CALLTYPE *createEntry) (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
59  void (TYPEREG_CALLTYPE *setUik) (TypeWriterImpl, const RTUik*);
60  void (TYPEREG_CALLTYPE *setDoku) (TypeWriterImpl, rtl_uString*);
61  void (TYPEREG_CALLTYPE *setFileName) (TypeWriterImpl, rtl_uString*);
62  void (TYPEREG_CALLTYPE *setFieldData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
63  void (TYPEREG_CALLTYPE *setMethodData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, RTMethodMode, sal_uInt16, sal_uInt16, rtl_uString*);
64  void (TYPEREG_CALLTYPE *setParamData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*, rtl_uString*, RTParamMode);
65  void (TYPEREG_CALLTYPE *setExcData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*);
68 
69  void (TYPEREG_CALLTYPE *setReferenceData) (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess);
70 };
71 
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
90 {
91 public:
92 
106  const ::rtl::OUString& typeName,
107  const ::rtl::OUString& superTypeName,
108  sal_uInt16 fieldCount,
109  sal_uInt16 methodCount,
110  sal_uInt16 referenceCount);
111 
113  inline RegistryTypeWriter(const RegistryTypeWriter& toCopy);
114 
119  inline ~RegistryTypeWriter();
120 
122  inline RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
123 
131  inline void setUik(const RTUik& uik);
132 
138  inline void setDoku(const ::rtl::OUString& doku);
139 
142  inline void setFileName(const ::rtl::OUString& fileName);
143 
155  inline void setFieldData( sal_uInt16 index,
156  const ::rtl::OUString& name,
157  const ::rtl::OUString& typeName,
158  const ::rtl::OUString& doku,
159  const ::rtl::OUString& fileName,
160  RTFieldAccess access,
161  RTConstValue constValue = RTConstValue());
162 
173  inline void setMethodData(sal_uInt16 index,
174  const ::rtl::OUString& name,
175  const ::rtl::OUString& returnTypeName,
176  RTMethodMode mode,
177  sal_uInt16 paramCount,
178  sal_uInt16 excCount,
179  const ::rtl::OUString& doku);
180 
189  inline void setParamData(sal_uInt16 index,
190  sal_uInt16 paramIndex,
191  const ::rtl::OUString& type,
192  const ::rtl::OUString& name,
193  RTParamMode mode);
194 
201  inline void setExcData(sal_uInt16 index,
202  sal_uInt16 excIndex,
203  const ::rtl::OUString& type);
204 
210  inline const sal_uInt8* getBlop();
211 
214  inline sal_uInt32 getBlopSize();
215 
224  inline void setReferenceData( sal_uInt16 index,
225  const ::rtl::OUString& name,
226  RTReferenceType refType,
227  const ::rtl::OUString& doku,
229 
230 protected:
231 
236 };
237 
238 
239 
241  const ::rtl::OUString& typeName,
242  const ::rtl::OUString& superTypeName,
243  sal_uInt16 fieldCount,
244  sal_uInt16 methodCount,
245  sal_uInt16 referenceCount)
246  : m_pApi(initRegistryTypeWriter_Api())
247  , m_hImpl(NULL)
248 {
249  m_hImpl = m_pApi->createEntry(RTTypeClass,
250  typeName.pData,
251  superTypeName.pData,
252  fieldCount,
253  methodCount,
254  referenceCount);
255 }
256 
257 
259  : m_pApi(toCopy.m_pApi)
260  , m_hImpl(toCopy.m_hImpl)
261 {
262  m_pApi->acquire(m_hImpl);
263 }
264 
266 {
267  m_pApi->release(m_hImpl);
268 }
269 
271 {
272  if (m_hImpl != toAssign.m_hImpl)
273  {
274  m_pApi->release(m_hImpl);
275  m_hImpl = toAssign.m_hImpl;
276  m_pApi->acquire(m_hImpl);
277  }
278 
279  return *this;
280 }
281 
282 inline void RegistryTypeWriter::setFieldData( sal_uInt16 index,
283  const ::rtl::OUString& name,
284  const ::rtl::OUString& typeName,
285  const ::rtl::OUString& doku,
286  const ::rtl::OUString& fileName,
287  RTFieldAccess access,
288  RTConstValue constValue)
289 {
290  m_pApi->setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
291 }
292 
293 
294 inline void RegistryTypeWriter::setMethodData(sal_uInt16 index,
295  const ::rtl::OUString& name,
296  const ::rtl::OUString& returnTypeName,
297  RTMethodMode mode,
298  sal_uInt16 paramCount,
299  sal_uInt16 excCount,
300  const ::rtl::OUString& doku)
301 {
302  m_pApi->setMethodData(m_hImpl, index, name.pData, returnTypeName.pData, mode, paramCount, excCount, doku.pData);
303 }
304 
305 
306 inline void RegistryTypeWriter::setUik(const RTUik& uik)
307 {
308  m_pApi->setUik(m_hImpl, &uik);
309 }
310 
311 inline void RegistryTypeWriter::setDoku(const ::rtl::OUString& doku)
312 {
313  m_pApi->setDoku(m_hImpl, doku.pData);
314 }
315 
316 inline void RegistryTypeWriter::setFileName(const ::rtl::OUString& doku)
317 {
318  m_pApi->setFileName(m_hImpl, doku.pData);
319 }
320 
321 inline void RegistryTypeWriter::setParamData(sal_uInt16 index,
322  sal_uInt16 paramIndex,
323  const ::rtl::OUString& type,
324  const ::rtl::OUString& name,
325  RTParamMode mode)
326 {
327  m_pApi->setParamData(m_hImpl, index, paramIndex, type.pData, name.pData, mode);
328 }
329 
330 inline void RegistryTypeWriter::setExcData(sal_uInt16 index,
331  sal_uInt16 excIndex,
332  const ::rtl::OUString& type)
333 {
334  m_pApi->setExcData(m_hImpl, index, excIndex, type.pData);
335 }
336 
338 {
339  return m_pApi->getBlop(m_hImpl);
340 }
341 
343 {
344  return m_pApi->getBlopSize(m_hImpl);
345 }
346 
347 
348 inline void RegistryTypeWriter::setReferenceData( sal_uInt16 index,
349  const ::rtl::OUString& name,
350  RTReferenceType refType,
351  const ::rtl::OUString& doku,
352  RTFieldAccess access)
353 {
354  m_pApi->setReferenceData(m_hImpl, index, name.pData, refType, doku.pData, access);
355 }
356 
357 #endif
358 
359 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */