1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 #ifndef _STOC_RDBTDP_BASE_HXX
25 #define _STOC_RDBTDP_BASE_HXX
26
27 #include <osl/diagnose.h>
28 #include <osl/mutex.hxx>
29 #include <cppuhelper/weak.hxx>
30 #include <cppuhelper/implbase1.hxx>
31 #include <cppuhelper/implbase2.hxx>
32 #ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
33 #include <cppuhelper/implementationentry.hxx>
34 #endif
35
36 #include "registry/refltype.hxx"
37
38 #include <list>
39 #include <memory>
40 #include <vector>
41
42 #include <com/sun/star/reflection/XTypeDescription.hpp>
43 #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
44 #include <com/sun/star/reflection/XInterfaceTypeDescription.hpp>
45 #include <com/sun/star/reflection/XInterfaceTypeDescription2.hpp>
46 #include <com/sun/star/reflection/XCompoundTypeDescription.hpp>
47 #include <com/sun/star/reflection/XConstantTypeDescription.hpp>
48 #include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
49 #include <com/sun/star/reflection/XEnumTypeDescription.hpp>
50 #include <com/sun/star/reflection/XIndirectTypeDescription.hpp>
51 #include <com/sun/star/reflection/XServiceConstructorDescription.hpp>
52 #include <com/sun/star/reflection/XServiceTypeDescription.hpp>
53 #include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
54 #include <com/sun/star/reflection/XSingletonTypeDescription2.hpp>
55 #include <com/sun/star/reflection/XModuleTypeDescription.hpp>
56 #include <com/sun/star/reflection/XPublished.hpp>
57 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
58 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
59 #include <com/sun/star/registry/XRegistryKey.hpp>
60
61 using namespace std;
62 using namespace rtl;
63 using namespace osl;
64 using namespace cppu;
65 using namespace com::sun::star::uno;
66 using namespace com::sun::star::lang;
67 using namespace com::sun::star::container;
68 using namespace com::sun::star::reflection;
69
70 //--------------------------------------------------------------------------------------------------
71
72 extern rtl_StandardModuleCount g_moduleCount;
73
74 namespace stoc_rdbtdp
75 {
76
77 com::sun::star::uno::Reference< XTypeDescription > resolveTypedefs(
78 com::sun::star::uno::Reference< XTypeDescription > const & type);
79
80
81 ::osl::Mutex & getMutex();
82
83 //--------------------------------------------------------------------------------------------------
84
85 typedef ::std::list< ::com::sun::star::uno::Reference<
86 ::com::sun::star::registry::XRegistryKey > > RegistryKeyList;
87
88 //--------------------------------------------------------------------------------------------------
89
90 class RegistryKeyCloser
91 {
92 public:
RegistryKeyCloser(const::com::sun::star::uno::Reference<::com::sun::star::registry::XRegistryKey> & xKey)93 RegistryKeyCloser( const ::com::sun::star::uno::Reference<
94 ::com::sun::star::registry::XRegistryKey > & xKey )
95 : m_xKey( xKey ) {}
~RegistryKeyCloser()96 ~RegistryKeyCloser()
97 { if ( m_xKey.is() ) { try { if ( m_xKey->isValid() ) m_xKey->closeKey(); } catch (...) {} } }
98
reset()99 void reset() { m_xKey.clear(); }
100 private:
101 ::com::sun::star::uno::Reference<
102 ::com::sun::star::registry::XRegistryKey > m_xKey;
103 };
104
105 //--------------------------------------------------------------------------------------------------
106
107 // helper to create XTypeDescription instances using typereg::Reader
108 // (used from Type Provider and Type Description Enumeration implementation)
109 ::com::sun::star::uno::Reference<
110 ::com::sun::star::reflection::XTypeDescription >
111 createTypeDescription(
112 const ::com::sun::star::uno::Sequence< sal_Int8 > & rData,
113 const ::com::sun::star::uno::Reference<
114 ::com::sun::star::container::XHierarchicalNameAccess > & xNameAccess,
115 bool bReturnEmptyRefForUnknownType );
116
117
118 //--------------------------------------------------------------------------------------------------
getRTValueAsInt32(const RTConstValue & rVal)119 inline sal_Int32 getRTValueAsInt32( const RTConstValue & rVal )
120 {
121 switch (rVal.m_type)
122 {
123 case RT_TYPE_BYTE:
124 return rVal.m_value.aByte;
125 case RT_TYPE_INT16:
126 return rVal.m_value.aShort;
127 case RT_TYPE_UINT16:
128 return rVal.m_value.aUShort;
129 case RT_TYPE_INT32:
130 return rVal.m_value.aLong;
131 case RT_TYPE_UINT32:
132 return rVal.m_value.aULong;
133 default:
134 OSL_ENSURE( sal_False, "### unexpected value type!" );
135 return 0;
136 }
137 }
138 //--------------------------------------------------------------------------------------------------
getRTValue(const RTConstValue & rVal)139 inline Any getRTValue( const RTConstValue & rVal )
140 {
141 switch (rVal.m_type)
142 {
143 case RT_TYPE_BOOL:
144 return Any( &rVal.m_value.aBool, ::getCppuBooleanType() );
145 case RT_TYPE_BYTE:
146 return Any( &rVal.m_value.aByte, ::getCppuType( (const sal_Int8 *)0 ) );
147 case RT_TYPE_INT16:
148 return Any( &rVal.m_value.aShort, ::getCppuType( (const sal_Int16 *)0 ) );
149 case RT_TYPE_UINT16:
150 return Any( &rVal.m_value.aUShort, ::getCppuType( (const sal_uInt16 *)0 ) );
151 case RT_TYPE_INT32:
152 return Any( &rVal.m_value.aLong, ::getCppuType( (const sal_Int32 *)0 ) );
153 case RT_TYPE_UINT32:
154 return Any( &rVal.m_value.aULong, ::getCppuType( (const sal_uInt32 *)0 ) );
155 case RT_TYPE_INT64:
156 return Any( &rVal.m_value.aHyper, ::getCppuType( (const sal_Int64 *)0 ) );
157 case RT_TYPE_UINT64:
158 return Any( &rVal.m_value.aUHyper, ::getCppuType( (const sal_uInt64 *)0 ) );
159 case RT_TYPE_FLOAT:
160 return Any( &rVal.m_value.aFloat, ::getCppuType( (const float *)0 ) );
161 case RT_TYPE_DOUBLE:
162 return Any( &rVal.m_value.aDouble, ::getCppuType( (const double *)0 ) );
163 case RT_TYPE_STRING:
164 {
165 OUString aStr( rVal.m_value.aString );
166 return Any( &aStr, ::getCppuType( (const OUString *)0 ) );
167 }
168 default:
169 OSL_ENSURE( sal_False, "### unexpected RTValue!" );
170 return Any();
171 }
172 }
173
174 //==================================================================================================
175 class TypeDescriptionImpl : public WeakImplHelper1< XTypeDescription >
176 {
177 TypeClass _eTypeClass;
178 OUString _aName;
179
180 public:
TypeDescriptionImpl(TypeClass eTypeClass,const OUString & rName)181 TypeDescriptionImpl( TypeClass eTypeClass, const OUString & rName )
182 : _eTypeClass( eTypeClass )
183 , _aName( rName )
184 {
185 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
186 }
187 virtual ~TypeDescriptionImpl();
188
189 // XTypeDescription
190 virtual TypeClass SAL_CALL getTypeClass();
191 virtual OUString SAL_CALL getName();
192 };
193
194 //==================================================================================================
195 class InterfaceTypeDescriptionImpl:
196 public WeakImplHelper2< XInterfaceTypeDescription2, XPublished >
197 {
198 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
199 Sequence< sal_Int8 > _aBytes;
200
201 OUString _aName;
202
203 Sequence< OUString > _aBaseTypes;
204 Sequence< com::sun::star::uno::Reference< XTypeDescription > > _xBaseTDs;
205 Sequence< OUString > _aOptionalBaseTypes;
206 Sequence< com::sun::star::uno::Reference< XTypeDescription > >
207 _xOptionalBaseTDs;
208
209 sal_Int32 _nBaseOffset;
210 Sequence<
211 com::sun::star::uno::Reference< XInterfaceMemberTypeDescription > >
212 _members;
213 bool _membersInit;
214
215 bool _published;
216
217 void checkInterfaceType(
218 com::sun::star::uno::Reference< XTypeDescription > const & type);
219
220 public:
221 InterfaceTypeDescriptionImpl(
222 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
223 xTDMgr,
224 const OUString & rName, const Sequence< OUString > & rBaseTypes,
225 const Sequence< OUString > & rOptionalBaseTypes,
226 const Sequence< sal_Int8 > & rBytes, bool published );
227 virtual ~InterfaceTypeDescriptionImpl();
228
229 // XTypeDescription
230 virtual TypeClass SAL_CALL getTypeClass();
231 virtual OUString SAL_CALL getName();
232
233 // XInterfaceTypeDescription2
234 virtual Uik SAL_CALL getUik();
235 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
236 getBaseType();
237 virtual
238 Sequence<
239 com::sun::star::uno::Reference< XInterfaceMemberTypeDescription > >
240 SAL_CALL getMembers();
241
242 virtual Sequence< com::sun::star::uno::Reference< XTypeDescription > >
243 SAL_CALL getBaseTypes();
244
245 virtual Sequence< com::sun::star::uno::Reference< XTypeDescription > >
246 SAL_CALL getOptionalBaseTypes();
247
isPublished()248 virtual sal_Bool SAL_CALL isPublished()
249 { return _published; }
250 };
251
252 //==================================================================================================
253 class CompoundTypeDescriptionImpl:
254 public WeakImplHelper2< XCompoundTypeDescription, XPublished >
255 {
256 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
257 TypeClass _eTypeClass;
258 Sequence< sal_Int8 > _aBytes;
259 OUString _aName;
260
261 OUString _aBaseType;
262 com::sun::star::uno::Reference< XTypeDescription > _xBaseTD;
263
264 Sequence< com::sun::star::uno::Reference< XTypeDescription > > * _pMembers;
265 Sequence< OUString > * _pMemberNames;
266
267 bool _published;
268
269 public:
CompoundTypeDescriptionImpl(const com::sun::star::uno::Reference<XHierarchicalNameAccess> & xTDMgr,TypeClass eTypeClass,const OUString & rName,const OUString & rBaseName,const Sequence<sal_Int8> & rBytes,bool published)270 CompoundTypeDescriptionImpl(
271 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
272 xTDMgr,
273 TypeClass eTypeClass,
274 const OUString & rName, const OUString & rBaseName,
275 const Sequence< sal_Int8 > & rBytes,
276 bool published )
277 : _xTDMgr( xTDMgr )
278 , _eTypeClass( eTypeClass )
279 , _aBytes( rBytes )
280 , _aName( rName )
281 , _aBaseType( rBaseName )
282 , _pMembers( 0 )
283 , _pMemberNames( 0 )
284 , _published( published )
285 {
286 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
287 }
288 virtual ~CompoundTypeDescriptionImpl();
289
290 // XTypeDescription
291 virtual TypeClass SAL_CALL getTypeClass();
292 virtual OUString SAL_CALL getName();
293
294 // XCompoundTypeDescription
295 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
296 getBaseType();
297 virtual Sequence< com::sun::star::uno::Reference< XTypeDescription > >
298 SAL_CALL getMemberTypes();
299 virtual Sequence< OUString > SAL_CALL getMemberNames();
300
isPublished()301 virtual sal_Bool SAL_CALL isPublished()
302 { return _published; }
303 };
304
305 //==================================================================================================
306 class EnumTypeDescriptionImpl:
307 public WeakImplHelper2< XEnumTypeDescription, XPublished >
308 {
309 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
310 Sequence< sal_Int8 > _aBytes;
311
312 OUString _aName;
313 sal_Int32 _nDefaultValue;
314
315 Sequence< OUString > * _pEnumNames;
316 Sequence< sal_Int32 > * _pEnumValues;
317
318 bool _published;
319
320 public:
EnumTypeDescriptionImpl(const com::sun::star::uno::Reference<XHierarchicalNameAccess> & xTDMgr,const OUString & rName,sal_Int32 nDefaultValue,const Sequence<sal_Int8> & rBytes,bool published)321 EnumTypeDescriptionImpl(
322 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
323 xTDMgr,
324 const OUString & rName, sal_Int32 nDefaultValue,
325 const Sequence< sal_Int8 > & rBytes, bool published )
326 : _xTDMgr( xTDMgr )
327 , _aBytes( rBytes )
328 , _aName( rName )
329 , _nDefaultValue( nDefaultValue )
330 , _pEnumNames( 0 )
331 , _pEnumValues( 0 )
332 , _published( published )
333 {
334 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
335 }
336 virtual ~EnumTypeDescriptionImpl();
337
338 // XTypeDescription
339 virtual TypeClass SAL_CALL getTypeClass();
340 virtual OUString SAL_CALL getName();
341
342 // XEnumTypeDescription
343 virtual sal_Int32 SAL_CALL getDefaultEnumValue();
344 virtual Sequence< OUString > SAL_CALL getEnumNames();
345 virtual Sequence< sal_Int32 > SAL_CALL getEnumValues();
346
isPublished()347 virtual sal_Bool SAL_CALL isPublished()
348 { return _published; }
349 };
350
351 //==================================================================================================
352 class TypedefTypeDescriptionImpl:
353 public WeakImplHelper2< XIndirectTypeDescription, XPublished >
354 {
355 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
356 OUString _aName;
357
358 OUString _aRefName;
359 com::sun::star::uno::Reference< XTypeDescription > _xRefTD;
360
361 bool _published;
362
363 public:
TypedefTypeDescriptionImpl(const com::sun::star::uno::Reference<XHierarchicalNameAccess> & xTDMgr,const OUString & rName,const OUString & rRefName,bool published)364 TypedefTypeDescriptionImpl(
365 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
366 xTDMgr,
367 const OUString & rName, const OUString & rRefName, bool published )
368 : _xTDMgr( xTDMgr )
369 , _aName( rName )
370 , _aRefName( rRefName )
371 , _published( published )
372 {
373 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
374 }
375 virtual ~TypedefTypeDescriptionImpl();
376
377 // XTypeDescription
378 virtual TypeClass SAL_CALL getTypeClass();
379 virtual OUString SAL_CALL getName();
380
381 // XIndirectTypeDescription
382 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
383 getReferencedType();
384
isPublished()385 virtual sal_Bool SAL_CALL isPublished()
386 { return _published; }
387 };
388
389 //==================================================================================================
390 class ServiceTypeDescriptionImpl:
391 public WeakImplHelper2< XServiceTypeDescription2, XPublished >
392 {
393 OUString _aName;
394 Sequence< sal_Int8 > _aBytes;
395 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
396 bool _bInitReferences;
397
398 com::sun::star::uno::Reference< XTypeDescription > _xInterfaceTD;
399 std::auto_ptr<
400 Sequence<
401 com::sun::star::uno::Reference< XServiceConstructorDescription > > >
402 _pCtors;
403 Sequence< com::sun::star::uno::Reference< XServiceTypeDescription > >
404 _aMandatoryServices;
405 Sequence< com::sun::star::uno::Reference< XServiceTypeDescription > >
406 _aOptionalServices;
407 Sequence< com::sun::star::uno::Reference< XInterfaceTypeDescription > >
408 _aMandatoryInterfaces;
409 Sequence< com::sun::star::uno::Reference< XInterfaceTypeDescription > >
410 _aOptionalInterfaces;
411 std::auto_ptr<
412 Sequence< com::sun::star::uno::Reference< XPropertyTypeDescription > > >
413 _pProps;
414
415 bool _published;
416
417 public:
ServiceTypeDescriptionImpl(const com::sun::star::uno::Reference<XHierarchicalNameAccess> & xTDMgr,const OUString & rName,const Sequence<sal_Int8> & rBytes,bool published)418 ServiceTypeDescriptionImpl(
419 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
420 xTDMgr,
421 const OUString & rName, const Sequence< sal_Int8 > & rBytes,
422 bool published)
423 : _aName( rName ), _aBytes( rBytes ), _xTDMgr( xTDMgr ),
424 _bInitReferences( false ), _published( published )
425 {
426 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
427 }
428 virtual ~ServiceTypeDescriptionImpl();
429
430 // XTypeDescription
431 virtual TypeClass SAL_CALL
432 getTypeClass();
433 virtual OUString SAL_CALL
434 getName();
435
436 // XServiceTypeDescription
437 virtual ::com::sun::star::uno::Sequence<
438 ::com::sun::star::uno::Reference<
439 ::com::sun::star::reflection::XServiceTypeDescription > > SAL_CALL
440 getMandatoryServices();
441 virtual ::com::sun::star::uno::Sequence<
442 ::com::sun::star::uno::Reference<
443 ::com::sun::star::reflection::XServiceTypeDescription > > SAL_CALL
444 getOptionalServices();
445 virtual ::com::sun::star::uno::Sequence<
446 ::com::sun::star::uno::Reference<
447 ::com::sun::star::reflection::XInterfaceTypeDescription > > SAL_CALL
448 getMandatoryInterfaces();
449 virtual ::com::sun::star::uno::Sequence<
450 ::com::sun::star::uno::Reference<
451 ::com::sun::star::reflection::XInterfaceTypeDescription > > SAL_CALL
452 getOptionalInterfaces();
453 virtual ::com::sun::star::uno::Sequence<
454 ::com::sun::star::uno::Reference<
455 ::com::sun::star::reflection::XPropertyTypeDescription > > SAL_CALL
456 getProperties();
457
458 // XServiceTypeDescription2
459 virtual sal_Bool SAL_CALL isSingleInterfaceBased();
460 virtual ::com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
461 getInterface();
462 virtual ::com::sun::star::uno::Sequence<
463 ::com::sun::star::uno::Reference<
464 ::com::sun::star::reflection::XServiceConstructorDescription > >
465 SAL_CALL getConstructors();
466
isPublished()467 virtual sal_Bool SAL_CALL isPublished()
468 { return _published; }
469
470 private:
471 void getReferences();
472 };
473
474 //==================================================================================================
475 class ModuleTypeDescriptionImpl : public WeakImplHelper1< XModuleTypeDescription >
476 {
477 OUString _aName;
478 com::sun::star::uno::Reference< XTypeDescriptionEnumerationAccess > _xTDMgr;
479
480 Sequence< com::sun::star::uno::Reference< XTypeDescription > > * _pMembers;
481
482 public:
ModuleTypeDescriptionImpl(const com::sun::star::uno::Reference<XTypeDescriptionEnumerationAccess> & xTDMgr,const OUString & rName)483 ModuleTypeDescriptionImpl(
484 const com::sun::star::uno::Reference<
485 XTypeDescriptionEnumerationAccess > & xTDMgr,
486 const OUString & rName )
487 : _aName( rName ), _xTDMgr( xTDMgr ), _pMembers( 0 )
488 {
489 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
490 }
491 virtual ~ModuleTypeDescriptionImpl();
492
493 // XTypeDescription
494 virtual TypeClass SAL_CALL
495 getTypeClass();
496 virtual OUString SAL_CALL
497 getName();
498
499 // XModuleTypeDescription
500 virtual ::com::sun::star::uno::Sequence<
501 ::com::sun::star::uno::Reference<
502 ::com::sun::star::reflection::XTypeDescription > > SAL_CALL
503 getMembers();
504 };
505
506 //==================================================================================================
507 class ConstantTypeDescriptionImpl : public WeakImplHelper1< XConstantTypeDescription >
508 {
509 OUString _aName;
510 Any _aValue;
511
512 public:
ConstantTypeDescriptionImpl(const OUString & rName,const Any & rValue)513 ConstantTypeDescriptionImpl( const OUString & rName,
514 const Any & rValue )
515 : _aName( rName ), _aValue( rValue )
516 {
517 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
518 }
519 virtual ~ConstantTypeDescriptionImpl();
520
521 // XTypeDescription
522 virtual TypeClass SAL_CALL
523 getTypeClass();
524 virtual OUString SAL_CALL
525 getName();
526
527 // XConstantTypeDescription
528 virtual ::com::sun::star::uno::Any SAL_CALL
529 getConstantValue();
530 };
531
532 //==================================================================================================
533 class ConstantsTypeDescriptionImpl:
534 public WeakImplHelper2< XConstantsTypeDescription, XPublished >
535 {
536 OUString _aName;
537 Sequence< sal_Int8 > _aBytes;
538 Sequence< com::sun::star::uno::Reference< XConstantTypeDescription > > *
539 _pMembers;
540
541 bool _published;
542
543 public:
ConstantsTypeDescriptionImpl(const OUString & rName,const Sequence<sal_Int8> & rBytes,bool published)544 ConstantsTypeDescriptionImpl( const OUString & rName,
545 const Sequence< sal_Int8 > & rBytes,
546 bool published )
547 : _aName( rName ), _aBytes( rBytes), _pMembers( 0 ), _published( published )
548 {
549 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
550 }
551 virtual ~ConstantsTypeDescriptionImpl();
552
553 // XTypeDescription
554 virtual TypeClass SAL_CALL
555 getTypeClass();
556 virtual OUString SAL_CALL
557 getName();
558
559 // XConstantsTypeDescription
560 virtual
561 Sequence< com::sun::star::uno::Reference< XConstantTypeDescription > >
562 SAL_CALL getConstants();
563
isPublished()564 virtual sal_Bool SAL_CALL isPublished()
565 { return _published; }
566 };
567
568 //==================================================================================================
569 class SingletonTypeDescriptionImpl:
570 public WeakImplHelper2< XSingletonTypeDescription2, XPublished >
571 {
572 OUString _aName;
573 OUString _aBaseName;
574 com::sun::star::uno::Reference< XHierarchicalNameAccess > _xTDMgr;
575 com::sun::star::uno::Reference< XTypeDescription > _xInterfaceTD;
576 com::sun::star::uno::Reference< XServiceTypeDescription > _xServiceTD;
577
578 bool _published;
579
580 void init();
581
582 public:
SingletonTypeDescriptionImpl(const com::sun::star::uno::Reference<XHierarchicalNameAccess> & xTDMgr,const OUString & rName,const OUString & rBaseName,bool published)583 SingletonTypeDescriptionImpl(
584 const com::sun::star::uno::Reference< XHierarchicalNameAccess > &
585 xTDMgr,
586 const OUString & rName, const OUString & rBaseName, bool published )
587 : _aName( rName ), _aBaseName( rBaseName), _xTDMgr( xTDMgr ),
588 _published( published )
589 {
590 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
591 }
592 virtual ~SingletonTypeDescriptionImpl();
593
594 // XTypeDescription
595 virtual TypeClass SAL_CALL
596 getTypeClass();
597 virtual OUString SAL_CALL
598 getName();
599
600 // XSingletonTypeDescription
601 virtual com::sun::star::uno::Reference< XServiceTypeDescription > SAL_CALL
602 getService();
603
604 // XSingletonTypeDescription2
605 virtual sal_Bool SAL_CALL isInterfaceBased();
606 virtual com::sun::star::uno::Reference< XTypeDescription > SAL_CALL
607 getInterface();
608
isPublished()609 virtual sal_Bool SAL_CALL isPublished()
610 { return _published; }
611 };
612
613 }
614
615 #endif /* _STOC_RDBTDP_BASE_HXX */
616