My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
reflread.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_REFLREAD_HXX_
30 #define _REGISTRY_REFLREAD_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* TypeReaderImpl;
39 
40 /****************************************************************************
41 
42  C-Api
43 
44 *****************************************************************************/
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
55 {
59  sal_uInt16 (TYPEREG_CALLTYPE *getMinorVersion) (TypeReaderImpl);
60  sal_uInt16 (TYPEREG_CALLTYPE *getMajorVersion) (TypeReaderImpl);
63  void (TYPEREG_CALLTYPE *getDoku) (TypeReaderImpl, rtl_uString**);
64  void (TYPEREG_CALLTYPE *getFileName) (TypeReaderImpl, rtl_uString**);
65  void (TYPEREG_CALLTYPE *getTypeName) (TypeReaderImpl, rtl_uString**);
66  void (TYPEREG_CALLTYPE *getSuperTypeName) (TypeReaderImpl, rtl_uString**);
67  sal_uInt32 (TYPEREG_CALLTYPE *getFieldCount) (TypeReaderImpl);
68  void (TYPEREG_CALLTYPE *getFieldName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
69  void (TYPEREG_CALLTYPE *getFieldType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
72  void (TYPEREG_CALLTYPE *getFieldDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
73  void (TYPEREG_CALLTYPE *getFieldFileName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
74  sal_uInt32 (TYPEREG_CALLTYPE *getMethodCount) (TypeReaderImpl);
75  void (TYPEREG_CALLTYPE *getMethodName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
76  sal_uInt32 (TYPEREG_CALLTYPE *getMethodParamCount) (TypeReaderImpl, sal_uInt16);
77  void (TYPEREG_CALLTYPE *getMethodParamType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
78  void (TYPEREG_CALLTYPE *getMethodParamName) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
80  sal_uInt32 (TYPEREG_CALLTYPE *getMethodExcCount) (TypeReaderImpl, sal_uInt16);
81  void (TYPEREG_CALLTYPE *getMethodExcType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
82  void (TYPEREG_CALLTYPE *getMethodReturnType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
84  void (TYPEREG_CALLTYPE *getMethodDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
85 
86  sal_uInt32 (TYPEREG_CALLTYPE *getReferenceCount) (TypeReaderImpl);
87  void (TYPEREG_CALLTYPE *getReferenceName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
89  void (TYPEREG_CALLTYPE *getReferenceDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
91 };
92 
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
111 {
112 public:
113 
122  inline RegistryTypeReader(const sal_uInt8* buffer,
123  sal_uInt32 bufferLen,
124  sal_Bool copyData);
125 
127  inline RegistryTypeReader(const RegistryTypeReader& toCopy);
128 
130  inline ~RegistryTypeReader();
131 
133  inline RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
134 
136  inline sal_Bool isValid() const;
137 
144  inline sal_uInt16 getMinorVersion() const;
145 
152  inline sal_uInt16 getMajorVersion() const;
153 
159  inline RTTypeClass getTypeClass() const;
160 
163  inline ::rtl::OUString getTypeName() const;
164 
167  inline ::rtl::OUString getSuperTypeName() const;
168 
176  inline void getUik(RTUik& uik) const;
177 
180  inline ::rtl::OUString getDoku() const;
181 
184  inline ::rtl::OUString getFileName() const;
185 
190  inline sal_uInt32 getFieldCount() const;
191 
194  inline ::rtl::OUString getFieldName( sal_uInt16 index ) const;
195 
198  inline ::rtl::OUString getFieldType( sal_uInt16 index ) const;
199 
202  inline RTFieldAccess getFieldAccess( sal_uInt16 index ) const;
203 
208  inline RTConstValue getFieldConstValue( sal_uInt16 index ) const;
209 
214  inline ::rtl::OUString getFieldDoku( sal_uInt16 index ) const;
215 
221  inline ::rtl::OUString getFieldFileName( sal_uInt16 index ) const;
222 
225  inline sal_uInt32 getMethodCount() const;
226 
229  inline ::rtl::OUString getMethodName( sal_uInt16 index ) const;
230 
233  inline sal_uInt32 getMethodParamCount( sal_uInt16 index ) const;
234 
240  inline ::rtl::OUString getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const;
241 
247  inline ::rtl::OUString getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const;
248 
254  inline RTParamMode getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const;
255 
260  inline sal_uInt32 getMethodExcCount( sal_uInt16 index ) const;
261 
267  inline ::rtl::OUString getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const;
268 
271  inline ::rtl::OUString getMethodReturnType( sal_uInt16 index ) const;
272 
277  inline RTMethodMode getMethodMode( sal_uInt16 index ) const;
278 
283  inline ::rtl::OUString getMethodDoku( sal_uInt16 index ) const;
284 
287  inline sal_uInt32 getReferenceCount() const;
288 
293  inline ::rtl::OUString getReferenceName( sal_uInt16 index ) const;
294 
299  inline RTReferenceType getReferenceType( sal_uInt16 index ) const;
300 
305  inline ::rtl::OUString getReferenceDoku( sal_uInt16 index ) const;
306 
313  inline RTFieldAccess getReferenceAccess( sal_uInt16 index ) const;
314 
315 protected:
316 
321 };
322 
323 
324 
326  sal_uInt32 bufferLen,
327  sal_Bool copyData)
328  : m_pApi(initRegistryTypeReader_Api())
329  , m_hImpl(NULL)
330  {
331  m_hImpl = m_pApi->createEntry(buffer, bufferLen, copyData);
332  }
333 
334 
336  : m_pApi(toCopy.m_pApi)
337  , m_hImpl(toCopy.m_hImpl)
338  { m_pApi->acquire(m_hImpl); }
339 
340 
342  { m_pApi->release(m_hImpl); }
343 
345 {
346  if (m_hImpl != toAssign.m_hImpl)
347  {
348  m_pApi->release(m_hImpl);
349  m_hImpl = toAssign.m_hImpl;
350  m_pApi->acquire(m_hImpl);
351  }
352 
353  return *this;
354 }
355 
356 inline sal_uInt16 RegistryTypeReader::getMinorVersion() const
357  { return m_pApi->getMinorVersion(m_hImpl); }
358 
360  { return (m_hImpl != NULL); }
361 
362 inline sal_uInt16 RegistryTypeReader::getMajorVersion() const
363  { return m_pApi->getMajorVersion(m_hImpl); }
364 
366  { return m_pApi->getTypeClass(m_hImpl); }
367 
368 inline ::rtl::OUString RegistryTypeReader::getTypeName() const
369  {
370  ::rtl::OUString sRet;
371  m_pApi->getTypeName(m_hImpl, &sRet.pData);
372  return sRet;
373  }
374 
375 inline ::rtl::OUString RegistryTypeReader::getSuperTypeName() const
376  {
377  ::rtl::OUString sRet;
378  m_pApi->getSuperTypeName(m_hImpl, &sRet.pData);
379  return sRet;
380  }
381 
382 inline void RegistryTypeReader::getUik(RTUik& uik) const
383  { m_pApi->getUik(m_hImpl, &uik); }
384 
385 inline ::rtl::OUString RegistryTypeReader::getDoku() const
386  {
387  ::rtl::OUString sRet;
388  m_pApi->getDoku(m_hImpl, &sRet.pData);
389  return sRet;
390  }
391 
392 inline ::rtl::OUString RegistryTypeReader::getFileName() const
393  {
394  ::rtl::OUString sRet;
395  m_pApi->getFileName(m_hImpl, &sRet.pData);
396  return sRet;
397  }
398 
399 inline sal_uInt32 RegistryTypeReader::getFieldCount() const
400  { return m_pApi->getFieldCount(m_hImpl); }
401 
402 inline ::rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
403  {
404  ::rtl::OUString sRet;
405  m_pApi->getFieldName(m_hImpl, &sRet.pData, index);
406  return sRet;
407  }
408 
409 inline ::rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
410  {
411  ::rtl::OUString sRet;
412  m_pApi->getFieldType(m_hImpl, &sRet.pData, index);
413  return sRet;
414  }
415 
416 inline RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
417  { return m_pApi->getFieldAccess(m_hImpl, index); }
418 
419 inline RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
420  {
421  RTConstValue ret;
422  ret.m_type = m_pApi->getFieldConstValue(m_hImpl, index, &ret.m_value);
423  return ret;
424  }
425 
426 inline ::rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
427  {
428  ::rtl::OUString sRet;
429  m_pApi->getFieldDoku(m_hImpl, &sRet.pData, index);
430  return sRet;
431  }
432 
433 inline ::rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
434  {
435  ::rtl::OUString sRet;
436  m_pApi->getFieldFileName(m_hImpl, &sRet.pData, index);
437  return sRet;
438  }
439 
440 inline sal_uInt32 RegistryTypeReader::getMethodCount() const
441  { return m_pApi->getMethodCount(m_hImpl); }
442 
443 inline ::rtl::OUString RegistryTypeReader::getMethodName( sal_uInt16 index ) const
444  {
445  ::rtl::OUString sRet;
446  m_pApi->getMethodName(m_hImpl, &sRet.pData, index);
447  return sRet;
448  }
449 
450 inline sal_uInt32 RegistryTypeReader::getMethodParamCount( sal_uInt16 index ) const
451  { return m_pApi->getMethodParamCount(m_hImpl, index); }
452 
453 inline ::rtl::OUString RegistryTypeReader::getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const
454  {
455  ::rtl::OUString sRet;
456  m_pApi->getMethodParamType(m_hImpl, &sRet.pData, index, paramIndex);
457  return sRet;
458  }
459 
460 inline ::rtl::OUString RegistryTypeReader::getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const
461  {
462  ::rtl::OUString sRet;
463  m_pApi->getMethodParamName(m_hImpl, &sRet.pData, index, paramIndex);
464  return sRet;
465  }
466 
467 inline RTParamMode RegistryTypeReader::getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const
468  { return m_pApi->getMethodParamMode(m_hImpl, index, paramIndex); }
469 
470 inline sal_uInt32 RegistryTypeReader::getMethodExcCount( sal_uInt16 index ) const
471  { return m_pApi->getMethodExcCount(m_hImpl, index); }
472 
473 inline ::rtl::OUString RegistryTypeReader::getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const
474  {
475  ::rtl::OUString sRet;
476  m_pApi->getMethodExcType(m_hImpl, &sRet.pData, index, excIndex);
477  return sRet;
478  }
479 
480 inline ::rtl::OUString RegistryTypeReader::getMethodReturnType( sal_uInt16 index ) const
481  {
482  ::rtl::OUString sRet;
483  m_pApi->getMethodReturnType(m_hImpl, &sRet.pData, index);
484  return sRet;
485  }
486 
487 inline RTMethodMode RegistryTypeReader::getMethodMode( sal_uInt16 index ) const
488  { return m_pApi->getMethodMode(m_hImpl, index); }
489 
490 inline ::rtl::OUString RegistryTypeReader::getMethodDoku( sal_uInt16 index ) const
491  {
492  ::rtl::OUString sRet;
493  m_pApi->getMethodDoku(m_hImpl, &sRet.pData, index);
494  return sRet;
495  }
496 
497 inline sal_uInt32 RegistryTypeReader::getReferenceCount() const
498  { return m_pApi->getReferenceCount(m_hImpl); }
499 
500 inline ::rtl::OUString RegistryTypeReader::getReferenceName( sal_uInt16 index ) const
501  {
502  ::rtl::OUString sRet;
503  m_pApi->getReferenceName(m_hImpl, &sRet.pData, index);
504  return sRet;
505  }
506 
508  { return m_pApi->getReferenceType(m_hImpl, index); }
509 
510 inline ::rtl::OUString RegistryTypeReader::getReferenceDoku( sal_uInt16 index ) const
511  {
512  ::rtl::OUString sRet;
513  m_pApi->getReferenceDoku(m_hImpl, &sRet.pData, index);
514  return sRet;
515  }
516 
518  { return m_pApi->getReferenceAccess(m_hImpl, index); }
519 
520 #endif
521 
522 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */