update credits
[LibreOffice.git] / framework / inc / macros / xtypeprovider.hxx
blob85648a75bb998eaba708f0e77570ea4caa5c9d50
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
21 #define __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
23 #include <com/sun/star/lang/XTypeProvider.hpp>
24 #include <com/sun/star/uno/RuntimeException.hpp>
26 #include <com/sun/star/uno/Any.hxx>
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <com/sun/star/uno/Sequence.hxx>
29 #include <com/sun/star/uno/Type.hxx>
30 #include <cppuhelper/typeprovider.hxx>
31 #include <osl/mutex.hxx>
32 #include <rtl/ustring.hxx>
34 namespace framework{
36 /*_________________________________________________________________________________________________________________
38 macros for declaration and definition of XTypeProvider
39 Please use follow public macros only!
41 1) DEFINE_XTYPEPROVIDER => use it in header to declare XTypeProvider and his methods
42 2) DECLARE_TYPEPROVIDER_0( CLASS ) => use it to define implementation of XTypeProvider for 0 supported type
43 DECLARE_TYPEPROVIDER_1( CLASS, TYPE1 ) => use it to define implementation of XTypeProvider for 1 supported type
44 ...
45 DECLARE_TYPEPROVIDER_16( CLASS, TYPE1, ... , TYPE16 )
46 3) DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) => use it to define implementation of XTypeProvider for 1 additional supported type to baseclass
47 ...
48 DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, ..., TYPE5 )
50 _________________________________________________________________________________________________________________*/
52 //*****************************************************************************************************************
53 // private
54 // implementation of XTypeProvider::getImplementationId()
55 //*****************************************************************************************************************
56 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
57 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CLASS::getImplementationId() throw( ::com::sun::star::uno::RuntimeException ) \
58 { \
59 /* Create one Id for all instances of this class. */ \
60 /* Use ethernet address to do this! (sal_True) */ \
61 /* Optimize this method */ \
62 /* We initialize a static variable only one time. And we don't must use a mutex at every call! */ \
63 /* For the first call; pID is NULL - for the second call pID is different from NULL! */ \
64 static ::cppu::OImplementationId* pID = NULL ; \
65 if ( pID == NULL ) \
66 { \
67 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
68 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
69 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
70 if ( pID == NULL ) \
71 { \
72 /* Create a new static ID ... */ \
73 static ::cppu::OImplementationId aID( sal_False ); \
74 /* ... and set his address to static pointer! */ \
75 pID = &aID ; \
76 } \
77 } \
78 return pID->getImplementationId(); \
81 //*****************************************************************************************************************
82 // private
83 // implementation of XTypeProvider::getTypes() with max. 12 interfaces!
84 //*****************************************************************************************************************
85 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES ) \
86 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
87 { \
88 /* Optimize this method ! */ \
89 /* We initialize a static variable only one time. */ \
90 /* And we don't must use a mutex at every call! */ \
91 /* For the first call; pTypeCollection is NULL - */ \
92 /* for the second call pTypeCollection is different from NULL! */ \
93 static ::cppu::OTypeCollection* pTypeCollection = NULL ; \
94 if ( pTypeCollection == NULL ) \
95 { \
96 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
97 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
98 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
99 if ( pTypeCollection == NULL ) \
101 /* Create a static typecollection ... */ \
102 /* Attention: "TYPES" will expand to "(...)"! */ \
103 static ::cppu::OTypeCollection aTypeCollection TYPES ; \
104 /* ... and set his address to static pointer! */ \
105 pTypeCollection = &aTypeCollection ; \
108 return pTypeCollection->getTypes(); \
111 //*****************************************************************************************************************
112 // private
113 // implementation of XTypeProvider::getTypes() with more then 12 interfaces!
114 //*****************************************************************************************************************
115 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND ) \
116 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
118 /* Optimize this method ! */ \
119 /* We initialize a static variable only one time. */ \
120 /* And we don't must use a mutex at every call! */ \
121 /* For the first call; pTypeCollection is NULL - */ \
122 /* for the second call pTypeCollection is different from NULL! */ \
123 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ; \
124 if ( pTypeCollection == NULL ) \
126 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
127 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
128 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
129 if ( pTypeCollection == NULL ) \
131 /* Create two typecollections */ \
132 /* (cppuhelper support 12 items per collection only!) */ \
133 ::cppu::OTypeCollection aTypeCollection1 TYPES_FIRST ; \
134 ::cppu::OTypeCollection aTypeCollection2 TYPES_SECOND ; \
135 /* Copy all items from both sequences to one result list! */ \
136 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes1 = aTypeCollection1.getTypes(); \
137 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes2 = aTypeCollection2.getTypes(); \
138 sal_Int32 nCount1 = seqTypes1.getLength(); \
139 sal_Int32 nCount2 = seqTypes2.getLength(); \
140 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqResult ( nCount1+nCount2 ); \
141 sal_Int32 nSource = 0; \
142 sal_Int32 nDestination= 0; \
143 while( nSource<nCount1 ) \
145 seqResult[nDestination] = seqTypes1[nSource]; \
146 ++nSource; \
147 ++nDestination; \
149 nSource = 0; \
150 while( nSource<nCount2 ) \
152 seqResult[nDestination] = seqTypes2[nSource]; \
153 ++nSource; \
154 ++nDestination; \
156 /* ... and set his address to static pointer! */ \
157 pTypeCollection = &seqResult; \
160 return *pTypeCollection; \
163 //*****************************************************************************************************************
164 // private
165 // implementation of XTypeProvider::getTypes() with using max. 12 interfaces + baseclass!
166 //*****************************************************************************************************************
167 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES ) \
168 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
170 /* Optimize this method ! */ \
171 /* We initialize a static variable only one time. */ \
172 /* And we don't must use a mutex at every call! */ \
173 /* For the first call; pTypeCollection is NULL - */ \
174 /* for the second call pTypeCollection is different from NULL! */ \
175 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ; \
176 if ( pTypeCollection == NULL ) \
178 /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
179 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
180 /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
181 if ( pTypeCollection == NULL ) \
183 /* Create static typecollection for my own interfaces! */ \
184 static ::cppu::OTypeCollection aTypeCollection TYPES ; \
185 /* Copy all items from my list sequences and from my baseclass */ \
186 /* to one result list! */ \
187 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes1 = aTypeCollection.getTypes(); \
188 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes2 = BASECLASS::getTypes(); \
189 sal_Int32 nCount1 = seqTypes1.getLength(); \
190 sal_Int32 nCount2 = seqTypes2.getLength(); \
191 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqResult ( nCount1+nCount2 ); \
192 sal_Int32 nSource = 0; \
193 sal_Int32 nDestination= 0; \
194 while( nSource<nCount1 ) \
196 seqResult[nDestination] = seqTypes1[nSource]; \
197 ++nSource; \
198 ++nDestination; \
200 nSource = 0; \
201 while( nSource<nCount2 ) \
203 seqResult[nDestination] = seqTypes2[nSource]; \
204 ++nSource; \
205 ++nDestination; \
207 /* ... and set his address to static pointer! */ \
208 pTypeCollection = &seqResult; \
211 return *pTypeCollection; \
214 //*****************************************************************************************************************
215 // private
216 // help macros to replace TYPES in getTypes() [see before]
217 //*****************************************************************************************************************
218 #define PRIVATE_DEFINE_TYPE_1( TYPE1 ) \
219 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE1 >*)NULL )
221 #define PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ) \
222 PRIVATE_DEFINE_TYPE_1( TYPE1 ), \
223 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE2 >*)NULL )
225 #define PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ) \
226 PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ), \
227 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE3 >*)NULL )
229 #define PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ) \
230 PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ), \
231 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE4 >*)NULL )
233 #define PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
234 PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ), \
235 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE5 >*)NULL )
237 #define PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
238 PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ), \
239 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE6 >*)NULL )
241 #define PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
242 PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ), \
243 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE7 >*)NULL )
245 #define PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
246 PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ), \
247 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE8 >*)NULL )
249 #define PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
250 PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ), \
251 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE9 >*)NULL )
253 #define PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
254 PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ), \
255 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE10 >*)NULL )
257 #define PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
258 PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ), \
259 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE11 >*)NULL )
261 #define PRIVATE_DEFINE_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
262 PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ), \
263 ::getCppuType(( const ::com::sun::star::uno::Reference< TYPE12 >*)NULL )
265 //*****************************************************************************************************************
266 // private
267 // complete implementation of XTypeProvider
268 //*****************************************************************************************************************
269 #define PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS ) \
270 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
271 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, ::getCppuType(( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider >*)NULL ) )
273 #define PRIVATE_DEFINE_XTYPEPROVIDER( CLASS, TYPES ) \
274 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
275 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES )
277 #define PRIVATE_DEFINE_XTYPEPROVIDER_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND ) \
278 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
279 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND )
281 #define PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS( CLASS, BASECLASS, TYPES ) \
282 PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
283 PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES )
285 //*****************************************************************************************************************
286 // public
287 // declaration of XTypeProvider
288 //*****************************************************************************************************************
289 #define FWK_DECLARE_XTYPEPROVIDER \
290 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes () throw( ::com::sun::star::uno::RuntimeException );\
291 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( ::com::sun::star::uno::RuntimeException );
293 //*****************************************************************************************************************
294 // public
295 // implementation of XTypeProvider
296 //*****************************************************************************************************************
297 // implementation of XTypeProvider without additional interface for getTypes()
298 // XTypeProvider is used as the only one interface automaticly.
299 // Following defines don't use XTypeProvider automaticly!!!!
300 #define DEFINE_XTYPEPROVIDER_0( CLASS ) \
301 PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS )
303 // implementation of XTypeProvider with 1 additional interface for getTypes()
304 #define DEFINE_XTYPEPROVIDER_1( CLASS, TYPE1 ) \
305 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
306 (PRIVATE_DEFINE_TYPE_1 ( TYPE1 \
307 )) \
310 // implementation of XTypeProvider with 2 additional interfaces for getTypes()
311 #define DEFINE_XTYPEPROVIDER_2( CLASS, TYPE1, TYPE2 ) \
312 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
313 (PRIVATE_DEFINE_TYPE_2 ( TYPE1 , \
314 TYPE2 \
315 )) \
318 // implementation of XTypeProvider with 3 additional interfaces for getTypes()
319 #define DEFINE_XTYPEPROVIDER_3( CLASS, TYPE1, TYPE2, TYPE3 ) \
320 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
321 (PRIVATE_DEFINE_TYPE_3 ( TYPE1 , \
322 TYPE2 , \
323 TYPE3 \
324 )) \
327 // implementation of XTypeProvider with 4 additional interfaces for getTypes()
328 #define DEFINE_XTYPEPROVIDER_4( CLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
329 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
330 (PRIVATE_DEFINE_TYPE_4 ( TYPE1 , \
331 TYPE2 , \
332 TYPE3 , \
333 TYPE4 \
334 )) \
337 // implementation of XTypeProvider with 5 additional interfaces for getTypes()
338 #define DEFINE_XTYPEPROVIDER_5( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
339 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
340 (PRIVATE_DEFINE_TYPE_5 ( TYPE1 , \
341 TYPE2 , \
342 TYPE3 , \
343 TYPE4 , \
344 TYPE5 \
345 )) \
348 // implementation of XTypeProvider with 6 additional interfaces for getTypes()
349 #define DEFINE_XTYPEPROVIDER_6( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
350 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
351 (PRIVATE_DEFINE_TYPE_6 ( TYPE1 , \
352 TYPE2 , \
353 TYPE3 , \
354 TYPE4 , \
355 TYPE5 , \
356 TYPE6 \
357 )) \
360 // implementation of XTypeProvider with 7 additional interfaces for getTypes()
361 #define DEFINE_XTYPEPROVIDER_7( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
362 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
363 (PRIVATE_DEFINE_TYPE_7 ( TYPE1 , \
364 TYPE2 , \
365 TYPE3 , \
366 TYPE4 , \
367 TYPE5 , \
368 TYPE6 , \
369 TYPE7 \
370 )) \
373 // implementation of XTypeProvider with 8 additional interfaces for getTypes()
374 #define DEFINE_XTYPEPROVIDER_8( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
375 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
376 (PRIVATE_DEFINE_TYPE_8 ( TYPE1 , \
377 TYPE2 , \
378 TYPE3 , \
379 TYPE4 , \
380 TYPE5 , \
381 TYPE6 , \
382 TYPE7 , \
383 TYPE8 \
384 )) \
387 // implementation of XTypeProvider with 9 additional interfaces for getTypes()
388 #define DEFINE_XTYPEPROVIDER_9( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
389 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
390 (PRIVATE_DEFINE_TYPE_9 ( TYPE1 , \
391 TYPE2 , \
392 TYPE3 , \
393 TYPE4 , \
394 TYPE5 , \
395 TYPE6 , \
396 TYPE7 , \
397 TYPE8 , \
398 TYPE9 \
399 )) \
402 // implementation of XTypeProvider with 10 additional interfaces for getTypes()
403 #define DEFINE_XTYPEPROVIDER_10( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
404 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
405 (PRIVATE_DEFINE_TYPE_10 ( TYPE1 , \
406 TYPE2 , \
407 TYPE3 , \
408 TYPE4 , \
409 TYPE5 , \
410 TYPE6 , \
411 TYPE7 , \
412 TYPE8 , \
413 TYPE9 , \
414 TYPE10 \
415 )) \
418 // implementation of XTypeProvider with 11 additional interfaces for getTypes()
419 #define DEFINE_XTYPEPROVIDER_11( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
420 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
421 (PRIVATE_DEFINE_TYPE_11 ( TYPE1 , \
422 TYPE2 , \
423 TYPE3 , \
424 TYPE4 , \
425 TYPE5 , \
426 TYPE6 , \
427 TYPE7 , \
428 TYPE8 , \
429 TYPE9 , \
430 TYPE10 , \
431 TYPE11 \
432 )) \
435 // implementation of XTypeProvider with 12 additional interfaces for getTypes()
436 #define DEFINE_XTYPEPROVIDER_12( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
437 PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
438 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
439 TYPE2 , \
440 TYPE3 , \
441 TYPE4 , \
442 TYPE5 , \
443 TYPE6 , \
444 TYPE7 , \
445 TYPE8 , \
446 TYPE9 , \
447 TYPE10 , \
448 TYPE11 , \
449 TYPE12 \
450 )) \
453 // implementation of XTypeProvider with 13 additional interfaces for getTypes()
454 #define DEFINE_XTYPEPROVIDER_13( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 ) \
455 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
456 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
457 TYPE2 , \
458 TYPE3 , \
459 TYPE4 , \
460 TYPE5 , \
461 TYPE6 , \
462 TYPE7 , \
463 TYPE8 , \
464 TYPE9 , \
465 TYPE10 , \
466 TYPE11 , \
467 TYPE12 \
468 )), \
469 (PRIVATE_DEFINE_TYPE_1 ( TYPE13 \
470 )) \
473 // implementation of XTypeProvider with 14 additional interfaces for getTypes()
474 #define DEFINE_XTYPEPROVIDER_14( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14 ) \
475 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
476 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
477 TYPE2 , \
478 TYPE3 , \
479 TYPE4 , \
480 TYPE5 , \
481 TYPE6 , \
482 TYPE7 , \
483 TYPE8 , \
484 TYPE9 , \
485 TYPE10 , \
486 TYPE11 , \
487 TYPE12 \
488 )), \
489 (PRIVATE_DEFINE_TYPE_2 ( TYPE13 , \
490 TYPE14 \
491 )) \
494 // implementation of XTypeProvider with 15 additional interfaces for getTypes()
495 #define DEFINE_XTYPEPROVIDER_15( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15 ) \
496 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
497 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
498 TYPE2 , \
499 TYPE3 , \
500 TYPE4 , \
501 TYPE5 , \
502 TYPE6 , \
503 TYPE7 , \
504 TYPE8 , \
505 TYPE9 , \
506 TYPE10 , \
507 TYPE11 , \
508 TYPE12 \
509 )), \
510 (PRIVATE_DEFINE_TYPE_3 ( TYPE13 , \
511 TYPE14 , \
512 TYPE15 \
513 )) \
516 // implementation of XTypeProvider with 16 additional interfaces for getTypes()
517 #define DEFINE_XTYPEPROVIDER_16( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16 ) \
518 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
519 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
520 TYPE2 , \
521 TYPE3 , \
522 TYPE4 , \
523 TYPE5 , \
524 TYPE6 , \
525 TYPE7 , \
526 TYPE8 , \
527 TYPE9 , \
528 TYPE10 , \
529 TYPE11 , \
530 TYPE12 \
531 )), \
532 (PRIVATE_DEFINE_TYPE_4 ( TYPE13 , \
533 TYPE14 , \
534 TYPE15 , \
535 TYPE16 \
536 )) \
539 // implementation of XTypeProvider with 17 additional interfaces for getTypes()
540 #define DEFINE_XTYPEPROVIDER_17( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17 ) \
541 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
542 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
543 TYPE2 , \
544 TYPE3 , \
545 TYPE4 , \
546 TYPE5 , \
547 TYPE6 , \
548 TYPE7 , \
549 TYPE8 , \
550 TYPE9 , \
551 TYPE10 , \
552 TYPE11 , \
553 TYPE12 \
554 )), \
555 (PRIVATE_DEFINE_TYPE_5 ( TYPE13 , \
556 TYPE14 , \
557 TYPE15 , \
558 TYPE16 , \
559 TYPE17 \
560 )) \
563 // implementation of XTypeProvider with 18 additional interfaces for getTypes()
564 #define DEFINE_XTYPEPROVIDER_18( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18 ) \
565 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
566 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
567 TYPE2 , \
568 TYPE3 , \
569 TYPE4 , \
570 TYPE5 , \
571 TYPE6 , \
572 TYPE7 , \
573 TYPE8 , \
574 TYPE9 , \
575 TYPE10 , \
576 TYPE11 , \
577 TYPE12 \
578 )), \
579 (PRIVATE_DEFINE_TYPE_6 ( TYPE13 , \
580 TYPE14 , \
581 TYPE15 , \
582 TYPE16 , \
583 TYPE17 , \
584 TYPE18 \
585 )) \
588 // implementation of XTypeProvider with 19 additional interfaces for getTypes()
589 #define DEFINE_XTYPEPROVIDER_19( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19 ) \
590 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
591 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
592 TYPE2 , \
593 TYPE3 , \
594 TYPE4 , \
595 TYPE5 , \
596 TYPE6 , \
597 TYPE7 , \
598 TYPE8 , \
599 TYPE9 , \
600 TYPE10 , \
601 TYPE11 , \
602 TYPE12 \
603 )), \
604 (PRIVATE_DEFINE_TYPE_7 ( TYPE13 , \
605 TYPE14 , \
606 TYPE15 , \
607 TYPE16 , \
608 TYPE17 , \
609 TYPE18 , \
610 TYPE19 \
611 )) \
614 // implementation of XTypeProvider with 20 additional interfaces for getTypes()
615 #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 ) \
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_8 ( TYPE13 , \
631 TYPE14 , \
632 TYPE15 , \
633 TYPE16 , \
634 TYPE17 , \
635 TYPE18 , \
636 TYPE19 , \
637 TYPE20 \
638 )) \
641 // implementation of XTypeProvider with 20 additional interfaces for getTypes()
642 #define DEFINE_XTYPEPROVIDER_21( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19, TYPE20, TYPE21 ) \
643 PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
644 (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
645 TYPE2 , \
646 TYPE3 , \
647 TYPE4 , \
648 TYPE5 , \
649 TYPE6 , \
650 TYPE7 , \
651 TYPE8 , \
652 TYPE9 , \
653 TYPE10 , \
654 TYPE11 , \
655 TYPE12 \
656 )), \
657 (PRIVATE_DEFINE_TYPE_9 ( TYPE13 , \
658 TYPE14 , \
659 TYPE15 , \
660 TYPE16 , \
661 TYPE17 , \
662 TYPE18 , \
663 TYPE19 , \
664 TYPE20 , \
665 TYPE21 \
666 )) \
669 // implementation of XTypeProvider with 1 additional interface for getTypes() AND using 1 baseclass
670 #define DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) \
671 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
672 BASECLASS, \
673 (PRIVATE_DEFINE_TYPE_1 ( TYPE1 \
674 )) \
677 // implementation of XTypeProvider with 2 additional interface for getTypes() AND using 1 baseclass
678 #define DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2 ) \
679 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
680 BASECLASS, \
681 (PRIVATE_DEFINE_TYPE_2 ( TYPE1 , \
682 TYPE2 \
683 )) \
686 // implementation of XTypeProvider with 3 additional interface for getTypes() AND using 1 baseclass
687 #define DEFINE_XTYPEPROVIDER_3_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3 ) \
688 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
689 BASECLASS, \
690 (PRIVATE_DEFINE_TYPE_3 ( TYPE1 , \
691 TYPE2 , \
692 TYPE3 \
693 )) \
695 // implementation of XTypeProvider with 4 additional interface for getTypes() AND using 1 baseclass
696 #define DEFINE_XTYPEPROVIDER_4_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
697 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
698 BASECLASS, \
699 (PRIVATE_DEFINE_TYPE_4 ( TYPE1 , \
700 TYPE2 , \
701 TYPE3 , \
702 TYPE4 \
703 )) \
705 // implementation of XTypeProvider with 5 additional interface for getTypes() AND using 1 baseclass
706 #define DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
707 PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
708 BASECLASS, \
709 (PRIVATE_DEFINE_TYPE_5 ( TYPE1 , \
710 TYPE2 , \
711 TYPE3 , \
712 TYPE4 , \
713 TYPE5 \
714 )) \
717 } // namespace framework
719 #endif // #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
721 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */