update dev300-m58
[ooovba.git] / stoc / source / registry_tdprovider / base.hxx
blob10ecae154166cedecff5046dd32b7c382eda8427
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: base.hxx,v $
10 * $Revision: 1.20 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _STOC_RDBTDP_BASE_HXX
32 #define _STOC_RDBTDP_BASE_HXX
34 #include <osl/diagnose.h>
35 #include <osl/mutex.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <cppuhelper/implbase1.hxx>
38 #include <cppuhelper/implbase2.hxx>
39 #ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
40 #include <cppuhelper/implementationentry.hxx>
41 #endif
43 #include "registry/refltype.hxx"
45 #include <list>
46 #include <memory>
47 #include <vector>
49 #include <com/sun/star/reflection/XTypeDescription.hpp>
50 #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
51 #include <com/sun/star/reflection/XInterfaceTypeDescription.hpp>
52 #include <com/sun/star/reflection/XInterfaceTypeDescription2.hpp>
53 #include <com/sun/star/reflection/XCompoundTypeDescription.hpp>
54 #include <com/sun/star/reflection/XConstantTypeDescription.hpp>
55 #include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
56 #include <com/sun/star/reflection/XEnumTypeDescription.hpp>
57 #include <com/sun/star/reflection/XIndirectTypeDescription.hpp>
58 #include <com/sun/star/reflection/XServiceConstructorDescription.hpp>
59 #include <com/sun/star/reflection/XServiceTypeDescription.hpp>
60 #include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
61 #include <com/sun/star/reflection/XSingletonTypeDescription2.hpp>
62 #include <com/sun/star/reflection/XModuleTypeDescription.hpp>
63 #include <com/sun/star/reflection/XPublished.hpp>
64 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
65 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
66 #include <com/sun/star/registry/XRegistryKey.hpp>
68 using namespace std;
69 using namespace rtl;
70 using namespace osl;
71 using namespace cppu;
72 using namespace com::sun::star::uno;
73 using namespace com::sun::star::lang;
74 using namespace com::sun::star::container;
75 using namespace com::sun::star::reflection;
77 //--------------------------------------------------------------------------------------------------
79 extern rtl_StandardModuleCount g_moduleCount;
81 namespace stoc_rdbtdp
84 com::sun::star::uno::Reference< XTypeDescription > resolveTypedefs(
85 com::sun::star::uno::Reference< XTypeDescription > const & type);
88 ::osl::Mutex & getMutex();
90 //--------------------------------------------------------------------------------------------------
92 typedef ::std::list< ::com::sun::star::uno::Reference<
93 ::com::sun::star::registry::XRegistryKey > > RegistryKeyList;
95 //--------------------------------------------------------------------------------------------------
97 class RegistryKeyCloser
99 public:
100 RegistryKeyCloser( const ::com::sun::star::uno::Reference<
101 ::com::sun::star::registry::XRegistryKey > & xKey )
102 : m_xKey( xKey ) {}
103 ~RegistryKeyCloser()
104 { if ( m_xKey.is() ) { try { if ( m_xKey->isValid() ) m_xKey->closeKey(); } catch (...) {} } }
106 void reset() { m_xKey.clear(); }
107 private:
108 ::com::sun::star::uno::Reference<
109 ::com::sun::star::registry::XRegistryKey > m_xKey;
112 //--------------------------------------------------------------------------------------------------
114 // helper to create XTypeDescription instances using typereg::Reader
115 // (used from Type Provider and Type Description Enumeration implementation)
116 ::com::sun::star::uno::Reference<
117 ::com::sun::star::reflection::XTypeDescription >
118 createTypeDescription(
119 const ::com::sun::star::uno::Sequence< sal_Int8 > & rData,
120 const ::com::sun::star::uno::Reference<
121 ::com::sun::star::container::XHierarchicalNameAccess > & xNameAccess,
122 bool bReturnEmptyRefForUnknownType );
125 //--------------------------------------------------------------------------------------------------
126 inline sal_Int32 getRTValueAsInt32( const RTConstValue & rVal )
128 switch (rVal.m_type)
130 case RT_TYPE_BYTE:
131 return rVal.m_value.aByte;
132 case RT_TYPE_INT16:
133 return rVal.m_value.aShort;
134 case RT_TYPE_UINT16:
135 return rVal.m_value.aUShort;
136 case RT_TYPE_INT32:
137 return rVal.m_value.aLong;
138 case RT_TYPE_UINT32:
139 return rVal.m_value.aULong;
140 default:
141 OSL_ENSURE( sal_False, "### unexpected value type!" );
142 return 0;
145 //--------------------------------------------------------------------------------------------------
146 inline Any getRTValue( const RTConstValue & rVal )
148 switch (rVal.m_type)
150 case RT_TYPE_BOOL:
151 return Any( &rVal.m_value.aBool, ::getCppuBooleanType() );
152 case RT_TYPE_BYTE:
153 return Any( &rVal.m_value.aByte, ::getCppuType( (const sal_Int8 *)0 ) );
154 case RT_TYPE_INT16:
155 return Any( &rVal.m_value.aShort, ::getCppuType( (const sal_Int16 *)0 ) );
156 case RT_TYPE_UINT16:
157 return Any( &rVal.m_value.aUShort, ::getCppuType( (const sal_uInt16 *)0 ) );
158 case RT_TYPE_INT32:
159 return Any( &rVal.m_value.aLong, ::getCppuType( (const sal_Int32 *)0 ) );
160 case RT_TYPE_UINT32:
161 return Any( &rVal.m_value.aULong, ::getCppuType( (const sal_uInt32 *)0 ) );
162 case RT_TYPE_INT64:
163 return Any( &rVal.m_value.aHyper, ::getCppuType( (const sal_Int64 *)0 ) );
164 case RT_TYPE_UINT64:
165 return Any( &rVal.m_value.aUHyper, ::getCppuType( (const sal_uInt64 *)0 ) );
166 case RT_TYPE_FLOAT:
167 return Any( &rVal.m_value.aFloat, ::getCppuType( (const float *)0 ) );
168 case RT_TYPE_DOUBLE:
169 return Any( &rVal.m_value.aDouble, ::getCppuType( (const double *)0 ) );
170 case RT_TYPE_STRING:
172 OUString aStr( rVal.m_value.aString );
173 return Any( &aStr, ::getCppuType( (const OUString *)0 ) );
175 default:
176 OSL_ENSURE( sal_False, "### unexpected RTValue!" );
177 return Any();
181 //==================================================================================================
182 class TypeDescriptionImpl : public WeakImplHelper1< XTypeDescription >
184 TypeClass _eTypeClass;
185 OUString _aName;
187 public:
188 TypeDescriptionImpl( TypeClass eTypeClass, const OUString & rName )
189 : _eTypeClass( eTypeClass )
190 , _aName( rName )
192 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
194 virtual ~TypeDescriptionImpl();
196 // XTypeDescription
197 virtual TypeClass SAL_CALL getTypeClass() throw(::com::sun::star::uno::RuntimeException);
198 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
201 //==================================================================================================
202 class InterfaceTypeDescriptionImpl:
203 public WeakImplHelper2< XInterfaceTypeDescription2, XPublished >
205 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
206 Sequence< sal_Int8 > _aBytes;
208 OUString _aName;
210 Sequence< OUString > _aBaseTypes;
211 Sequence< com::sun::star::uno::Reference< XTypeDescription > > _xBaseTDs;
212 Sequence< OUString > _aOptionalBaseTypes;
213 Sequence< com::sun::star::uno::Reference< XTypeDescription > >
214 _xOptionalBaseTDs;
216 sal_Int32 _nBaseOffset;
217 Sequence<
218 com::sun::star::uno::Reference< XInterfaceMemberTypeDescription > >
219 _members;
220 bool _membersInit;
222 bool _published;
224 void checkInterfaceType(
225 com::sun::star::uno::Reference< XTypeDescription > const & type);
227 public:
228 InterfaceTypeDescriptionImpl(
229 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
230 xTDMgr,
231 const OUString & rName, const Sequence< OUString > & rBaseTypes,
232 const Sequence< OUString > & rOptionalBaseTypes,
233 const Sequence< sal_Int8 > & rBytes, bool published );
234 virtual ~InterfaceTypeDescriptionImpl();
236 // XTypeDescription
237 virtual TypeClass SAL_CALL getTypeClass() throw(::com::sun::star::uno::RuntimeException);
238 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
240 // XInterfaceTypeDescription2
241 virtual Uik SAL_CALL getUik() throw(::com::sun::star::uno::RuntimeException);
242 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
243 getBaseType() throw(::com::sun::star::uno::RuntimeException);
244 virtual
245 Sequence<
246 com::sun::star::uno::Reference< XInterfaceMemberTypeDescription > >
247 SAL_CALL getMembers() throw(::com::sun::star::uno::RuntimeException);
249 virtual Sequence< com::sun::star::uno::Reference< XTypeDescription > >
250 SAL_CALL getBaseTypes() throw (RuntimeException);
252 virtual Sequence< com::sun::star::uno::Reference< XTypeDescription > >
253 SAL_CALL getOptionalBaseTypes() throw (RuntimeException);
255 virtual sal_Bool SAL_CALL isPublished()
256 throw (::com::sun::star::uno::RuntimeException)
257 { return _published; }
260 //==================================================================================================
261 class CompoundTypeDescriptionImpl:
262 public WeakImplHelper2< XCompoundTypeDescription, XPublished >
264 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
265 TypeClass _eTypeClass;
266 Sequence< sal_Int8 > _aBytes;
267 OUString _aName;
269 OUString _aBaseType;
270 com::sun::star::uno::Reference< XTypeDescription > _xBaseTD;
272 Sequence< com::sun::star::uno::Reference< XTypeDescription > > * _pMembers;
273 Sequence< OUString > * _pMemberNames;
275 bool _published;
277 public:
278 CompoundTypeDescriptionImpl(
279 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
280 xTDMgr,
281 TypeClass eTypeClass,
282 const OUString & rName, const OUString & rBaseName,
283 const Sequence< sal_Int8 > & rBytes,
284 bool published )
285 : _xTDMgr( xTDMgr )
286 , _eTypeClass( eTypeClass )
287 , _aBytes( rBytes )
288 , _aName( rName )
289 , _aBaseType( rBaseName )
290 , _pMembers( 0 )
291 , _pMemberNames( 0 )
292 , _published( published )
294 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
296 virtual ~CompoundTypeDescriptionImpl();
298 // XTypeDescription
299 virtual TypeClass SAL_CALL getTypeClass() throw(::com::sun::star::uno::RuntimeException);
300 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
302 // XCompoundTypeDescription
303 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
304 getBaseType() throw(::com::sun::star::uno::RuntimeException);
305 virtual Sequence< com::sun::star::uno::Reference< XTypeDescription > >
306 SAL_CALL getMemberTypes() throw(::com::sun::star::uno::RuntimeException);
307 virtual Sequence< OUString > SAL_CALL getMemberNames() throw(::com::sun::star::uno::RuntimeException);
309 virtual sal_Bool SAL_CALL isPublished()
310 throw (::com::sun::star::uno::RuntimeException)
311 { return _published; }
314 //==================================================================================================
315 class EnumTypeDescriptionImpl:
316 public WeakImplHelper2< XEnumTypeDescription, XPublished >
318 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
319 Sequence< sal_Int8 > _aBytes;
321 OUString _aName;
322 sal_Int32 _nDefaultValue;
324 Sequence< OUString > * _pEnumNames;
325 Sequence< sal_Int32 > * _pEnumValues;
327 bool _published;
329 public:
330 EnumTypeDescriptionImpl(
331 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
332 xTDMgr,
333 const OUString & rName, sal_Int32 nDefaultValue,
334 const Sequence< sal_Int8 > & rBytes, bool published )
335 : _xTDMgr( xTDMgr )
336 , _aBytes( rBytes )
337 , _aName( rName )
338 , _nDefaultValue( nDefaultValue )
339 , _pEnumNames( 0 )
340 , _pEnumValues( 0 )
341 , _published( published )
343 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
345 virtual ~EnumTypeDescriptionImpl();
347 // XTypeDescription
348 virtual TypeClass SAL_CALL getTypeClass() throw(::com::sun::star::uno::RuntimeException);
349 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
351 // XEnumTypeDescription
352 virtual sal_Int32 SAL_CALL getDefaultEnumValue() throw(::com::sun::star::uno::RuntimeException);
353 virtual Sequence< OUString > SAL_CALL getEnumNames() throw(::com::sun::star::uno::RuntimeException);
354 virtual Sequence< sal_Int32 > SAL_CALL getEnumValues() throw(::com::sun::star::uno::RuntimeException);
356 virtual sal_Bool SAL_CALL isPublished()
357 throw (::com::sun::star::uno::RuntimeException)
358 { return _published; }
361 //==================================================================================================
362 class TypedefTypeDescriptionImpl:
363 public WeakImplHelper2< XIndirectTypeDescription, XPublished >
365 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
366 OUString _aName;
368 OUString _aRefName;
369 com::sun::star::uno::Reference< XTypeDescription > _xRefTD;
371 bool _published;
373 public:
374 TypedefTypeDescriptionImpl(
375 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
376 xTDMgr,
377 const OUString & rName, const OUString & rRefName, bool published )
378 : _xTDMgr( xTDMgr )
379 , _aName( rName )
380 , _aRefName( rRefName )
381 , _published( published )
383 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
385 virtual ~TypedefTypeDescriptionImpl();
387 // XTypeDescription
388 virtual TypeClass SAL_CALL getTypeClass() throw(::com::sun::star::uno::RuntimeException);
389 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
391 // XIndirectTypeDescription
392 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
393 getReferencedType() throw(::com::sun::star::uno::RuntimeException);
395 virtual sal_Bool SAL_CALL isPublished()
396 throw (::com::sun::star::uno::RuntimeException)
397 { return _published; }
400 //==================================================================================================
401 class ServiceTypeDescriptionImpl:
402 public WeakImplHelper2< XServiceTypeDescription2, XPublished >
404 OUString _aName;
405 Sequence< sal_Int8 > _aBytes;
406 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
407 bool _bInitReferences;
409 com::sun::star::uno::Reference< XTypeDescription > _xInterfaceTD;
410 std::auto_ptr<
411 Sequence<
412 com::sun::star::uno::Reference< XServiceConstructorDescription > > >
413 _pCtors;
414 Sequence< com::sun::star::uno::Reference< XServiceTypeDescription > >
415 _aMandatoryServices;
416 Sequence< com::sun::star::uno::Reference< XServiceTypeDescription > >
417 _aOptionalServices;
418 Sequence< com::sun::star::uno::Reference< XInterfaceTypeDescription > >
419 _aMandatoryInterfaces;
420 Sequence< com::sun::star::uno::Reference< XInterfaceTypeDescription > >
421 _aOptionalInterfaces;
422 std::auto_ptr<
423 Sequence< com::sun::star::uno::Reference< XPropertyTypeDescription > > >
424 _pProps;
426 bool _published;
428 public:
429 ServiceTypeDescriptionImpl(
430 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
431 xTDMgr,
432 const OUString & rName, const Sequence< sal_Int8 > & rBytes,
433 bool published)
434 : _aName( rName ), _aBytes( rBytes ), _xTDMgr( xTDMgr ),
435 _bInitReferences( false ), _published( published )
437 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
439 virtual ~ServiceTypeDescriptionImpl();
441 // XTypeDescription
442 virtual TypeClass SAL_CALL
443 getTypeClass()
444 throw(::com::sun::star::uno::RuntimeException);
445 virtual OUString SAL_CALL
446 getName()
447 throw(::com::sun::star::uno::RuntimeException);
449 // XServiceTypeDescription
450 virtual ::com::sun::star::uno::Sequence<
451 ::com::sun::star::uno::Reference<
452 ::com::sun::star::reflection::XServiceTypeDescription > > SAL_CALL
453 getMandatoryServices()
454 throw (::com::sun::star::uno::RuntimeException);
455 virtual ::com::sun::star::uno::Sequence<
456 ::com::sun::star::uno::Reference<
457 ::com::sun::star::reflection::XServiceTypeDescription > > SAL_CALL
458 getOptionalServices()
459 throw (::com::sun::star::uno::RuntimeException);
460 virtual ::com::sun::star::uno::Sequence<
461 ::com::sun::star::uno::Reference<
462 ::com::sun::star::reflection::XInterfaceTypeDescription > > SAL_CALL
463 getMandatoryInterfaces()
464 throw (::com::sun::star::uno::RuntimeException);
465 virtual ::com::sun::star::uno::Sequence<
466 ::com::sun::star::uno::Reference<
467 ::com::sun::star::reflection::XInterfaceTypeDescription > > SAL_CALL
468 getOptionalInterfaces()
469 throw (::com::sun::star::uno::RuntimeException);
470 virtual ::com::sun::star::uno::Sequence<
471 ::com::sun::star::uno::Reference<
472 ::com::sun::star::reflection::XPropertyTypeDescription > > SAL_CALL
473 getProperties()
474 throw (::com::sun::star::uno::RuntimeException);
476 // XServiceTypeDescription2
477 virtual sal_Bool SAL_CALL isSingleInterfaceBased()
478 throw (::com::sun::star::uno::RuntimeException);
479 virtual ::com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
480 getInterface() throw (::com::sun::star::uno::RuntimeException);
481 virtual ::com::sun::star::uno::Sequence<
482 ::com::sun::star::uno::Reference<
483 ::com::sun::star::reflection::XServiceConstructorDescription > >
484 SAL_CALL getConstructors()
485 throw (::com::sun::star::uno::RuntimeException);
487 virtual sal_Bool SAL_CALL isPublished()
488 throw (::com::sun::star::uno::RuntimeException)
489 { return _published; }
491 private:
492 void getReferences()
493 throw (::com::sun::star::uno::RuntimeException);
496 //==================================================================================================
497 class ModuleTypeDescriptionImpl : public WeakImplHelper1< XModuleTypeDescription >
499 OUString _aName;
500 com::sun::star::uno::Reference< XTypeDescriptionEnumerationAccess > _xTDMgr;
502 Sequence< com::sun::star::uno::Reference< XTypeDescription > > * _pMembers;
504 public:
505 ModuleTypeDescriptionImpl(
506 const com::sun::star::uno::Reference<
507 XTypeDescriptionEnumerationAccess > & xTDMgr,
508 const OUString & rName )
509 : _aName( rName ), _xTDMgr( xTDMgr ), _pMembers( 0 )
511 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
513 virtual ~ModuleTypeDescriptionImpl();
515 // XTypeDescription
516 virtual TypeClass SAL_CALL
517 getTypeClass()
518 throw( ::com::sun::star::uno::RuntimeException );
519 virtual OUString SAL_CALL
520 getName()
521 throw( ::com::sun::star::uno::RuntimeException );
523 // XModuleTypeDescription
524 virtual ::com::sun::star::uno::Sequence<
525 ::com::sun::star::uno::Reference<
526 ::com::sun::star::reflection::XTypeDescription > > SAL_CALL
527 getMembers()
528 throw ( ::com::sun::star::uno::RuntimeException );
531 //==================================================================================================
532 class ConstantTypeDescriptionImpl : public WeakImplHelper1< XConstantTypeDescription >
534 OUString _aName;
535 Any _aValue;
537 public:
538 ConstantTypeDescriptionImpl( const OUString & rName,
539 const Any & rValue )
540 : _aName( rName ), _aValue( rValue )
542 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
544 virtual ~ConstantTypeDescriptionImpl();
546 // XTypeDescription
547 virtual TypeClass SAL_CALL
548 getTypeClass()
549 throw( ::com::sun::star::uno::RuntimeException );
550 virtual OUString SAL_CALL
551 getName()
552 throw( ::com::sun::star::uno::RuntimeException );
554 // XConstantTypeDescription
555 virtual ::com::sun::star::uno::Any SAL_CALL
556 getConstantValue()
557 throw ( ::com::sun::star::uno::RuntimeException );
560 //==================================================================================================
561 class ConstantsTypeDescriptionImpl:
562 public WeakImplHelper2< XConstantsTypeDescription, XPublished >
564 OUString _aName;
565 Sequence< sal_Int8 > _aBytes;
566 Sequence< com::sun::star::uno::Reference< XConstantTypeDescription > > *
567 _pMembers;
569 bool _published;
571 public:
572 ConstantsTypeDescriptionImpl( const OUString & rName,
573 const Sequence< sal_Int8 > & rBytes,
574 bool published )
575 : _aName( rName ), _aBytes( rBytes), _pMembers( 0 ), _published( published )
577 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
579 virtual ~ConstantsTypeDescriptionImpl();
581 // XTypeDescription
582 virtual TypeClass SAL_CALL
583 getTypeClass()
584 throw( ::com::sun::star::uno::RuntimeException );
585 virtual OUString SAL_CALL
586 getName()
587 throw( ::com::sun::star::uno::RuntimeException );
589 // XConstantsTypeDescription
590 virtual
591 Sequence< com::sun::star::uno::Reference< XConstantTypeDescription > >
592 SAL_CALL getConstants() throw ( RuntimeException );
594 virtual sal_Bool SAL_CALL isPublished()
595 throw (::com::sun::star::uno::RuntimeException)
596 { return _published; }
599 //==================================================================================================
600 class SingletonTypeDescriptionImpl:
601 public WeakImplHelper2< XSingletonTypeDescription2, XPublished >
603 OUString _aName;
604 OUString _aBaseName;
605 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
606 com::sun::star::uno::Reference< XTypeDescription > _xInterfaceTD;
607 com::sun::star::uno::Reference< XServiceTypeDescription > _xServiceTD;
609 bool _published;
611 void init();
613 public:
614 SingletonTypeDescriptionImpl(
615 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
616 xTDMgr,
617 const OUString & rName, const OUString & rBaseName, bool published )
618 : _aName( rName ), _aBaseName( rBaseName), _xTDMgr( xTDMgr ),
619 _published( published )
621 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
623 virtual ~SingletonTypeDescriptionImpl();
625 // XTypeDescription
626 virtual TypeClass SAL_CALL
627 getTypeClass()
628 throw( ::com::sun::star::uno::RuntimeException );
629 virtual OUString SAL_CALL
630 getName()
631 throw( ::com::sun::star::uno::RuntimeException );
633 // XSingletonTypeDescription
634 virtual com::sun::star::uno::Reference< XServiceTypeDescription > SAL_CALL
635 getService() throw ( ::com::sun::star::uno::RuntimeException );
637 // XSingletonTypeDescription2
638 virtual sal_Bool SAL_CALL isInterfaceBased()
639 throw (::com::sun::star::uno::RuntimeException);
640 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
641 getInterface() throw (::com::sun::star::uno::RuntimeException);
643 virtual sal_Bool SAL_CALL isPublished()
644 throw (::com::sun::star::uno::RuntimeException)
645 { return _published; }
650 #endif /* _STOC_RDBTDP_BASE_HXX */