update dev300-m58
[ooovba.git] / framework / inc / macros / xtypeprovider.hxx
blobe7e2f3cf2ccdf0379686203fd96bc97848e79ac8
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: xtypeprovider.hxx,v $
10 * $Revision: 1.8 $
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 __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
32 #define __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
34 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 //_________________________________________________________________________________________________________________
39 // interface includes
40 //_________________________________________________________________________________________________________________
42 #include <com/sun/star/lang/XTypeProvider.hpp>
43 #include <com/sun/star/uno/RuntimeException.hpp>
45 //_________________________________________________________________________________________________________________
46 // other includes
47 //_________________________________________________________________________________________________________________
48 #include <com/sun/star/uno/Any.hxx>
49 #include <com/sun/star/uno/Reference.hxx>
50 #include <com/sun/star/uno/Sequence.hxx>
51 #include <com/sun/star/uno/Type.hxx>
52 #include <cppuhelper/typeprovider.hxx>
53 #include <osl/mutex.hxx>
54 #include <rtl/ustring.hxx>
56 //_________________________________________________________________________________________________________________
57 // namespace
58 //_________________________________________________________________________________________________________________
60 namespace framework{
62 /*_________________________________________________________________________________________________________________
64 macros for declaration and definition of XTypeProvider
65 Please use follow public macros only!
67 1) DEFINE_XTYPEPROVIDER => use it in header to declare XTypeProvider and his methods
68 2) DECLARE_TYPEPROVIDER_0( CLASS ) => use it to define implementation of XTypeProvider for 0 supported type
69 DECLARE_TYPEPROVIDER_1( CLASS, TYPE1 ) => use it to define implementation of XTypeProvider for 1 supported type
70 ...
71 DECLARE_TYPEPROVIDER_16( CLASS, TYPE1, ... , TYPE16 )
72 3) DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) => use it to define implementation of XTypeProvider for 1 additional supported type to baseclass
73 ...
74 DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, ..., TYPE5 )
76 _________________________________________________________________________________________________________________*/
78 //*****************************************************************************************************************
79 // private
80 // implementation of XTypeProvider::getImplementationId()
81 //*****************************************************************************************************************
82 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
83 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CLASS::getImplementationId() throw( ::com::sun::star::uno::RuntimeException ) \
84 { \
85 /* Create one Id for all instances of this class. */ \
86 /* Use ethernet address to do this! (sal_True) */ \
87 /* Optimize this method */ \
88 /* We initialize a static variable only one time. And we don't must use a mutex at every call! */ \
89 /* For the first call; pID is NULL - for the second call pID is different from NULL! */ \
90 static ::cppu::OImplementationId* pID = NULL ; \
91 if ( pID == NULL ) \
92 { \
93 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
94 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
95 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
96 if ( pID == NULL ) \
97 { \
98 /* Create a new static ID ... */ \
99 static ::cppu::OImplementationId aID( sal_False ); \
100 /* ... and set his address to static pointer! */ \
101 pID = &aID ; \
104 return pID->getImplementationId(); \
107 //*****************************************************************************************************************
108 // private
109 // implementation of XTypeProvider::getTypes() with max. 12 interfaces!
110 //*****************************************************************************************************************
111 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES ) \
112 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
114 /* Optimize this method ! */ \
115 /* We initialize a static variable only one time. */ \
116 /* And we don't must use a mutex at every call! */ \
117 /* For the first call; pTypeCollection is NULL - */ \
118 /* for the second call pTypeCollection is different from NULL! */ \
119 static ::cppu::OTypeCollection* pTypeCollection = NULL ; \
120 if ( pTypeCollection == NULL ) \
122 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
123 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
124 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
125 if ( pTypeCollection == NULL ) \
127 /* Create a static typecollection ... */ \
128 /* Attention: "TYPES" will expand to "(...)"! */ \
129 static ::cppu::OTypeCollection aTypeCollection TYPES ; \
130 /* ... and set his address to static pointer! */ \
131 pTypeCollection = &aTypeCollection ; \
134 return pTypeCollection->getTypes(); \
137 //*****************************************************************************************************************
138 // private
139 // implementation of XTypeProvider::getTypes() with more then 12 interfaces!
140 //*****************************************************************************************************************
141 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND ) \
142 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
144 /* Optimize this method ! */ \
145 /* We initialize a static variable only one time. */ \
146 /* And we don't must use a mutex at every call! */ \
147 /* For the first call; pTypeCollection is NULL - */ \
148 /* for the second call pTypeCollection is different from NULL! */ \
149 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ; \
150 if ( pTypeCollection == NULL ) \
152 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
153 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
154 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
155 if ( pTypeCollection == NULL ) \
157 /* Create two typecollections */ \
158 /* (cppuhelper support 12 items per collection only!) */ \
159 ::cppu::OTypeCollection aTypeCollection1 TYPES_FIRST ; \
160 ::cppu::OTypeCollection aTypeCollection2 TYPES_SECOND ; \
161 /* Copy all items from both sequences to one result list! */ \
162 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes1 = aTypeCollection1.getTypes(); \
163 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes2 = aTypeCollection2.getTypes(); \
164 sal_Int32 nCount1 = seqTypes1.getLength(); \
165 sal_Int32 nCount2 = seqTypes2.getLength(); \
166 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqResult ( nCount1+nCount2 ); \
167 sal_Int32 nSource = 0; \
168 sal_Int32 nDestination= 0; \
169 while( nSource<nCount1 ) \
171 seqResult[nDestination] = seqTypes1[nSource]; \
172 ++nSource; \
173 ++nDestination; \
175 nSource = 0; \
176 while( nSource<nCount2 ) \
178 seqResult[nDestination] = seqTypes2[nSource]; \
179 ++nSource; \
180 ++nDestination; \
182 /* ... and set his address to static pointer! */ \
183 pTypeCollection = &seqResult; \
186 return *pTypeCollection; \
189 //*****************************************************************************************************************
190 // private
191 // implementation of XTypeProvider::getTypes() with using max. 12 interfaces + baseclass!
192 //*****************************************************************************************************************
193 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES ) \
194 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
196 /* Optimize this method ! */ \
197 /* We initialize a static variable only one time. */ \
198 /* And we don't must use a mutex at every call! */ \
199 /* For the first call; pTypeCollection is NULL - */ \
200 /* for the second call pTypeCollection is different from NULL! */ \
201 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ; \
202 if ( pTypeCollection == NULL ) \
204 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
205 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
206 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
207 if ( pTypeCollection == NULL ) \
209 /* Create static typecollection for my own interfaces! */ \
210 static ::cppu::OTypeCollection aTypeCollection TYPES ; \
211 /* Copy all items from my list sequences and from my baseclass */ \
212 /* to one result list! */ \
213 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes1 = aTypeCollection.getTypes(); \
214 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes2 = BASECLASS::getTypes(); \
215 sal_Int32 nCount1 = seqTypes1.getLength(); \
216 sal_Int32 nCount2 = seqTypes2.getLength(); \
217 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqResult ( nCount1+nCount2 ); \
218 sal_Int32 nSource = 0; \
219 sal_Int32 nDestination= 0; \
220 while( nSource<nCount1 ) \
222 seqResult[nDestination] = seqTypes1[nSource]; \
223 ++nSource; \
224 ++nDestination; \
226 nSource = 0; \
227 while( nSource<nCount2 ) \
229 seqResult[nDestination] = seqTypes2[nSource]; \
230 ++nSource; \
231 ++nDestination; \
233 /* ... and set his address to static pointer! */ \
234 pTypeCollection = &seqResult; \
237 return *pTypeCollection; \
240 //*****************************************************************************************************************
241 // private
242 // help macros to replace TYPES in getTypes() [see before]
243 //*****************************************************************************************************************
244 #define PRIVATE_DEFINE_TYPE_1( TYPE1 ) \
245 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE1 >*)NULL )
247 #define PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ) \
248 PRIVATE_DEFINE_TYPE_1( TYPE1 ), \
249 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE2 >*)NULL )
251 #define PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ) \
252 PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ), \
253 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE3 >*)NULL )
255 #define PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ) \
256 PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ), \
257 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE4 >*)NULL )
259 #define PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
260 PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ), \
261 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE5 >*)NULL )
263 #define PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
264 PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ), \
265 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE6 >*)NULL )
267 #define PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
268 PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ), \
269 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE7 >*)NULL )
271 #define PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
272 PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ), \
273 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE8 >*)NULL )
275 #define PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
276 PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ), \
277 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE9 >*)NULL )
279 #define PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
280 PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ), \
281 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE10 >*)NULL )
283 #define PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
284 PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ), \
285 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE11 >*)NULL )
287 #define PRIVATE_DEFINE_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
288 PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ), \
289 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE12 >*)NULL )
291 //*****************************************************************************************************************
292 // private
293 // complete implementation of XTypeProvider
294 //*****************************************************************************************************************
295 #define PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS ) \
296 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
297 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, ::getCppuType(( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider >*)NULL ) )
299 #define PRIVATE_DEFINE_XTYPEPROVIDER( CLASS, TYPES ) \
300 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
301 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES )
303 #define PRIVATE_DEFINE_XTYPEPROVIDER_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND ) \
304 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
305 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND )
307 #define PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS( CLASS, BASECLASS, TYPES ) \
308 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
309 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES )
311 //*****************************************************************************************************************
312 // public
313 // declaration of XTypeProvider
314 //*****************************************************************************************************************
315 #define FWK_DECLARE_XTYPEPROVIDER \
316 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes () throw( ::com::sun::star::uno::RuntimeException );\
317 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( ::com::sun::star::uno::RuntimeException );
319 //*****************************************************************************************************************
320 // public
321 // implementation of XTypeProvider
322 //*****************************************************************************************************************
323 // implementation of XTypeProvider without additional interface for getTypes()
324 // XTypeProvider is used as the only one interface automaticly.
325 // Following defines don't use XTypeProvider automaticly!!!!
326 #define DEFINE_XTYPEPROVIDER_0( CLASS ) \
327 PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS )
329 // implementation of XTypeProvider with 1 additional interface for getTypes()
330 #define DEFINE_XTYPEPROVIDER_1( CLASS, TYPE1 ) \
331 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
332 (PRIVATE_DEFINE_TYPE_1 ( TYPE1 \
333 )) \
336 // implementation of XTypeProvider with 2 additional interfaces for getTypes()
337 #define DEFINE_XTYPEPROVIDER_2( CLASS, TYPE1, TYPE2 ) \
338 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
339 (PRIVATE_DEFINE_TYPE_2 ( TYPE1 , \
340 TYPE2 \
341 )) \
344 // implementation of XTypeProvider with 3 additional interfaces for getTypes()
345 #define DEFINE_XTYPEPROVIDER_3( CLASS, TYPE1, TYPE2, TYPE3 ) \
346 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
347 (PRIVATE_DEFINE_TYPE_3 ( TYPE1 , \
348 TYPE2 , \
349 TYPE3 \
350 )) \
353 // implementation of XTypeProvider with 4 additional interfaces for getTypes()
354 #define DEFINE_XTYPEPROVIDER_4( CLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
355 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
356 (PRIVATE_DEFINE_TYPE_4 ( TYPE1 , \
357 TYPE2 , \
358 TYPE3 , \
359 TYPE4 \
360 )) \
363 // implementation of XTypeProvider with 5 additional interfaces for getTypes()
364 #define DEFINE_XTYPEPROVIDER_5( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
365 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
366 (PRIVATE_DEFINE_TYPE_5 ( TYPE1 , \
367 TYPE2 , \
368 TYPE3 , \
369 TYPE4 , \
370 TYPE5 \
371 )) \
374 // implementation of XTypeProvider with 6 additional interfaces for getTypes()
375 #define DEFINE_XTYPEPROVIDER_6( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
376 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
377 (PRIVATE_DEFINE_TYPE_6 ( TYPE1 , \
378 TYPE2 , \
379 TYPE3 , \
380 TYPE4 , \
381 TYPE5 , \
382 TYPE6 \
383 )) \
386 // implementation of XTypeProvider with 7 additional interfaces for getTypes()
387 #define DEFINE_XTYPEPROVIDER_7( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
388 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
389 (PRIVATE_DEFINE_TYPE_7 ( TYPE1 , \
390 TYPE2 , \
391 TYPE3 , \
392 TYPE4 , \
393 TYPE5 , \
394 TYPE6 , \
395 TYPE7 \
396 )) \
399 // implementation of XTypeProvider with 8 additional interfaces for getTypes()
400 #define DEFINE_XTYPEPROVIDER_8( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
401 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
402 (PRIVATE_DEFINE_TYPE_8 ( TYPE1 , \
403 TYPE2 , \
404 TYPE3 , \
405 TYPE4 , \
406 TYPE5 , \
407 TYPE6 , \
408 TYPE7 , \
409 TYPE8 \
410 )) \
413 // implementation of XTypeProvider with 9 additional interfaces for getTypes()
414 #define DEFINE_XTYPEPROVIDER_9( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
415 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
416 (PRIVATE_DEFINE_TYPE_9 ( TYPE1 , \
417 TYPE2 , \
418 TYPE3 , \
419 TYPE4 , \
420 TYPE5 , \
421 TYPE6 , \
422 TYPE7 , \
423 TYPE8 , \
424 TYPE9 \
425 )) \
428 // implementation of XTypeProvider with 10 additional interfaces for getTypes()
429 #define DEFINE_XTYPEPROVIDER_10( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
430 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
431 (PRIVATE_DEFINE_TYPE_10 ( TYPE1 , \
432 TYPE2 , \
433 TYPE3 , \
434 TYPE4 , \
435 TYPE5 , \
436 TYPE6 , \
437 TYPE7 , \
438 TYPE8 , \
439 TYPE9 , \
440 TYPE10 \
441 )) \
444 // implementation of XTypeProvider with 11 additional interfaces for getTypes()
445 #define DEFINE_XTYPEPROVIDER_11( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
446 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
447 (PRIVATE_DEFINE_TYPE_11 ( TYPE1 , \
448 TYPE2 , \
449 TYPE3 , \
450 TYPE4 , \
451 TYPE5 , \
452 TYPE6 , \
453 TYPE7 , \
454 TYPE8 , \
455 TYPE9 , \
456 TYPE10 , \
457 TYPE11 \
458 )) \
461 // implementation of XTypeProvider with 12 additional interfaces for getTypes()
462 #define DEFINE_XTYPEPROVIDER_12( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
463 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
464 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
465 TYPE2 , \
466 TYPE3 , \
467 TYPE4 , \
468 TYPE5 , \
469 TYPE6 , \
470 TYPE7 , \
471 TYPE8 , \
472 TYPE9 , \
473 TYPE10 , \
474 TYPE11 , \
475 TYPE12 \
476 )) \
479 // implementation of XTypeProvider with 13 additional interfaces for getTypes()
480 #define DEFINE_XTYPEPROVIDER_13( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 ) \
481 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
482 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
483 TYPE2 , \
484 TYPE3 , \
485 TYPE4 , \
486 TYPE5 , \
487 TYPE6 , \
488 TYPE7 , \
489 TYPE8 , \
490 TYPE9 , \
491 TYPE10 , \
492 TYPE11 , \
493 TYPE12 \
494 )), \
495 (PRIVATE_DEFINE_TYPE_1 ( TYPE13 \
496 )) \
499 // implementation of XTypeProvider with 14 additional interfaces for getTypes()
500 #define DEFINE_XTYPEPROVIDER_14( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14 ) \
501 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
502 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
503 TYPE2 , \
504 TYPE3 , \
505 TYPE4 , \
506 TYPE5 , \
507 TYPE6 , \
508 TYPE7 , \
509 TYPE8 , \
510 TYPE9 , \
511 TYPE10 , \
512 TYPE11 , \
513 TYPE12 \
514 )), \
515 (PRIVATE_DEFINE_TYPE_2 ( TYPE13 , \
516 TYPE14 \
517 )) \
520 // implementation of XTypeProvider with 15 additional interfaces for getTypes()
521 #define DEFINE_XTYPEPROVIDER_15( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15 ) \
522 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
523 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
524 TYPE2 , \
525 TYPE3 , \
526 TYPE4 , \
527 TYPE5 , \
528 TYPE6 , \
529 TYPE7 , \
530 TYPE8 , \
531 TYPE9 , \
532 TYPE10 , \
533 TYPE11 , \
534 TYPE12 \
535 )), \
536 (PRIVATE_DEFINE_TYPE_3 ( TYPE13 , \
537 TYPE14 , \
538 TYPE15 \
539 )) \
542 // implementation of XTypeProvider with 16 additional interfaces for getTypes()
543 #define DEFINE_XTYPEPROVIDER_16( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16 ) \
544 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
545 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
546 TYPE2 , \
547 TYPE3 , \
548 TYPE4 , \
549 TYPE5 , \
550 TYPE6 , \
551 TYPE7 , \
552 TYPE8 , \
553 TYPE9 , \
554 TYPE10 , \
555 TYPE11 , \
556 TYPE12 \
557 )), \
558 (PRIVATE_DEFINE_TYPE_4 ( TYPE13 , \
559 TYPE14 , \
560 TYPE15 , \
561 TYPE16 \
562 )) \
565 // implementation of XTypeProvider with 17 additional interfaces for getTypes()
566 #define DEFINE_XTYPEPROVIDER_17( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17 ) \
567 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
568 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
569 TYPE2 , \
570 TYPE3 , \
571 TYPE4 , \
572 TYPE5 , \
573 TYPE6 , \
574 TYPE7 , \
575 TYPE8 , \
576 TYPE9 , \
577 TYPE10 , \
578 TYPE11 , \
579 TYPE12 \
580 )), \
581 (PRIVATE_DEFINE_TYPE_5 ( TYPE13 , \
582 TYPE14 , \
583 TYPE15 , \
584 TYPE16 , \
585 TYPE17 \
586 )) \
589 // implementation of XTypeProvider with 18 additional interfaces for getTypes()
590 #define DEFINE_XTYPEPROVIDER_18( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18 ) \
591 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
592 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
593 TYPE2 , \
594 TYPE3 , \
595 TYPE4 , \
596 TYPE5 , \
597 TYPE6 , \
598 TYPE7 , \
599 TYPE8 , \
600 TYPE9 , \
601 TYPE10 , \
602 TYPE11 , \
603 TYPE12 \
604 )), \
605 (PRIVATE_DEFINE_TYPE_6 ( TYPE13 , \
606 TYPE14 , \
607 TYPE15 , \
608 TYPE16 , \
609 TYPE17 , \
610 TYPE18 \
611 )) \
614 // implementation of XTypeProvider with 19 additional interfaces for getTypes()
615 #define DEFINE_XTYPEPROVIDER_19( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19 ) \
616 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
617 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
618 TYPE2 , \
619 TYPE3 , \
620 TYPE4 , \
621 TYPE5 , \
622 TYPE6 , \
623 TYPE7 , \
624 TYPE8 , \
625 TYPE9 , \
626 TYPE10 , \
627 TYPE11 , \
628 TYPE12 \
629 )), \
630 (PRIVATE_DEFINE_TYPE_7 ( TYPE13 , \
631 TYPE14 , \
632 TYPE15 , \
633 TYPE16 , \
634 TYPE17 , \
635 TYPE18 , \
636 TYPE19 \
637 )) \
640 // implementation of XTypeProvider with 20 additional interfaces for getTypes()
641 #define DEFINE_XTYPEPROVIDER_20( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19, TYPE20 ) \
642 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
643 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
644 TYPE2 , \
645 TYPE3 , \
646 TYPE4 , \
647 TYPE5 , \
648 TYPE6 , \
649 TYPE7 , \
650 TYPE8 , \
651 TYPE9 , \
652 TYPE10 , \
653 TYPE11 , \
654 TYPE12 \
655 )), \
656 (PRIVATE_DEFINE_TYPE_8 ( TYPE13 , \
657 TYPE14 , \
658 TYPE15 , \
659 TYPE16 , \
660 TYPE17 , \
661 TYPE18 , \
662 TYPE19 , \
663 TYPE20 \
664 )) \
667 // implementation of XTypeProvider with 1 additional interface for getTypes() AND using 1 baseclass
668 #define DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) \
669 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
670 BASECLASS, \
671 (PRIVATE_DEFINE_TYPE_1 ( TYPE1 \
672 )) \
675 // implementation of XTypeProvider with 2 additional interface for getTypes() AND using 1 baseclass
676 #define DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2 ) \
677 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
678 BASECLASS, \
679 (PRIVATE_DEFINE_TYPE_2 ( TYPE1 , \
680 TYPE2 \
681 )) \
684 // implementation of XTypeProvider with 3 additional interface for getTypes() AND using 1 baseclass
685 #define DEFINE_XTYPEPROVIDER_3_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3 ) \
686 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
687 BASECLASS, \
688 (PRIVATE_DEFINE_TYPE_3 ( TYPE1 , \
689 TYPE2 , \
690 TYPE3 \
691 )) \
693 // implementation of XTypeProvider with 4 additional interface for getTypes() AND using 1 baseclass
694 #define DEFINE_XTYPEPROVIDER_4_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
695 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
696 BASECLASS, \
697 (PRIVATE_DEFINE_TYPE_4 ( TYPE1 , \
698 TYPE2 , \
699 TYPE3 , \
700 TYPE4 \
701 )) \
703 // implementation of XTypeProvider with 5 additional interface for getTypes() AND using 1 baseclass
704 #define DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
705 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
706 BASECLASS, \
707 (PRIVATE_DEFINE_TYPE_5 ( TYPE1 , \
708 TYPE2 , \
709 TYPE3 , \
710 TYPE4 , \
711 TYPE5 \
712 )) \
715 } // namespace framework
717 #endif // #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_