1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
29 #define __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
30 
31 //_________________________________________________________________________________________________________________
32 //	my own includes
33 //_________________________________________________________________________________________________________________
34 
35 //_________________________________________________________________________________________________________________
36 //	interface includes
37 //_________________________________________________________________________________________________________________
38 
39 #include <com/sun/star/lang/XTypeProvider.hpp>
40 #include <com/sun/star/uno/RuntimeException.hpp>
41 
42 //_________________________________________________________________________________________________________________
43 //	other includes
44 //_________________________________________________________________________________________________________________
45 #include <com/sun/star/uno/Any.hxx>
46 #include <com/sun/star/uno/Reference.hxx>
47 #include <com/sun/star/uno/Sequence.hxx>
48 #include <com/sun/star/uno/Type.hxx>
49 #include <cppuhelper/typeprovider.hxx>
50 #include <osl/mutex.hxx>
51 #include <rtl/ustring.hxx>
52 
53 //_________________________________________________________________________________________________________________
54 //	namespace
55 //_________________________________________________________________________________________________________________
56 
57 namespace framework{
58 
59 /*_________________________________________________________________________________________________________________
60 
61 	macros for declaration and definition of XTypeProvider
62 	Please use follow public macros only!
63 
64 	1)	DEFINE_XTYPEPROVIDER															=> use it in header to declare XTypeProvider and his methods
65 	2)	DECLARE_TYPEPROVIDER_0( CLASS )													=> use it to define implementation of XTypeProvider for 0 supported type
66 		DECLARE_TYPEPROVIDER_1( CLASS, TYPE1 )											=> use it to define implementation of XTypeProvider for 1 supported type
67 		...
68 		DECLARE_TYPEPROVIDER_16( CLASS, TYPE1, ... , TYPE16 )
69 	3)	DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 )				=> use it to define implementation of XTypeProvider for 1 additional supported type to baseclass
70 		...
71 		DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, ..., TYPE5 )
72 
73 _________________________________________________________________________________________________________________*/
74 
75 //*****************************************************************************************************************
76 //	private
77 //	implementation of XTypeProvider::getImplementationId()
78 //*****************************************************************************************************************
79 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )																				\
80 	::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CLASS::getImplementationId() throw( ::com::sun::star::uno::RuntimeException )			\
81 	{																																			\
82 		/* Create one Id for all instances of this class.												*/										\
83 		/* Use ethernet address to do this! (sal_True)													*/										\
84 		/* Optimize this method																			*/										\
85 		/* We initialize a static variable only one time. And we don't must use a mutex at every call!	*/										\
86 		/* For the first call; pID is NULL - for the second call pID is different from NULL!			*/										\
87 		static ::cppu::OImplementationId* pID = NULL ;																							\
88 		if ( pID == NULL )																														\
89 		{																																		\
90 			/* Ready for multithreading; get global mutex for first call of this method only! see before   */									\
91 			::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );																			\
92 			/* Control these pointer again ... it can be, that another instance will be faster then these! */									\
93 			if ( pID == NULL )																													\
94 			{																																	\
95 				/* Create a new static ID ... */																								\
96 				static ::cppu::OImplementationId aID( sal_False );																				\
97 				/* ... and set his address to static pointer! */																				\
98 				pID = &aID ;																													\
99 			}																																	\
100 		}																																		\
101 		return pID->getImplementationId();																										\
102 	}
103 
104 //*****************************************************************************************************************
105 //	private
106 //	implementation of XTypeProvider::getTypes() with max. 12 interfaces!
107 //*****************************************************************************************************************
108 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES )																					\
109 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException )	\
110 	{																																			\
111 		/* Optimize this method !										*/																		\
112 		/* We initialize a static variable only one time.				*/																		\
113 		/* And we don't must use a mutex at every call!					*/																		\
114 		/* For the first call; pTypeCollection is NULL -				*/																		\
115 		/* for the second call pTypeCollection is different from NULL!	*/																		\
116 		static ::cppu::OTypeCollection* pTypeCollection = NULL ;																				\
117 		if ( pTypeCollection == NULL )																											\
118 		{																																		\
119 			/* Ready for multithreading; get global mutex for first call of this method only! see before   */									\
120 			::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );																			\
121 			/* Control these pointer again ... it can be, that another instance will be faster then these! */									\
122 			if ( pTypeCollection == NULL )																										\
123 			{																																	\
124 				/* Create a static typecollection ...			*/																				\
125 				/* Attention: "TYPES" will expand to "(...)"!	*/																				\
126 				static ::cppu::OTypeCollection aTypeCollection TYPES ;																			\
127 				/* ... and set his address to static pointer! */																				\
128 				pTypeCollection = &aTypeCollection ;																							\
129 			}																																	\
130 		}																																		\
131 		return pTypeCollection->getTypes();																										\
132 	}
133 
134 //*****************************************************************************************************************
135 //	private
136 //	implementation of XTypeProvider::getTypes() with more then 12 interfaces!
137 //*****************************************************************************************************************
138 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND )															\
139 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException )	\
140 	{																																			\
141 		/* Optimize this method !										*/																		\
142 		/* We initialize a static variable only one time.				*/																		\
143 		/* And we don't must use a mutex at every call!					*/																		\
144 		/* For the first call; pTypeCollection is NULL -				*/																		\
145 		/* for the second call pTypeCollection is different from NULL!	*/																		\
146 		static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ;											\
147 		if ( pTypeCollection == NULL )																											\
148 		{																																		\
149 			/* Ready for multithreading; get global mutex for first call of this method only! see before   */									\
150 			::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );																			\
151 			/* Control these pointer again ... it can be, that another instance will be faster then these! */									\
152 			if ( pTypeCollection == NULL )																										\
153 			{																																	\
154 				/* Create two typecollections							*/																		\
155 				/* (cppuhelper support 12 items per collection only!)	*/																		\
156 				::cppu::OTypeCollection aTypeCollection1 TYPES_FIRST	;																		\
157 				::cppu::OTypeCollection aTypeCollection2 TYPES_SECOND	;																		\
158 				/* Copy all items from both sequences to one result list! */																	\
159 				::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 			seqTypes1	= aTypeCollection1.getTypes();				\
160 				::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 			seqTypes2	= aTypeCollection2.getTypes();				\
161 				sal_Int32																nCount1		= seqTypes1.getLength();					\
162 				sal_Int32																nCount2		= seqTypes2.getLength();					\
163 				static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	seqResult	( nCount1+nCount2 );						\
164 				sal_Int32																nSource		= 0;										\
165 				sal_Int32																nDestination= 0;										\
166 				while( nSource<nCount1 )																										\
167 				{																																\
168 					seqResult[nDestination] = seqTypes1[nSource];																				\
169 					++nSource;																													\
170 					++nDestination;																												\
171 				}																																\
172 				nSource = 0;																													\
173 				while( nSource<nCount2 )																										\
174 				{																																\
175 					seqResult[nDestination] = seqTypes2[nSource];																				\
176 					++nSource;																													\
177 					++nDestination;																												\
178 				}																																\
179 				/* ... and set his address to static pointer! */																				\
180 				pTypeCollection = &seqResult;																									\
181 			}																																	\
182 		}																																		\
183 		return *pTypeCollection;																												\
184 	}
185 
186 //*****************************************************************************************************************
187 //	private
188 //	implementation of XTypeProvider::getTypes() with using max. 12 interfaces + baseclass!
189 //*****************************************************************************************************************
190 #define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES )																\
191 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException )	\
192 	{																																			\
193 		/* Optimize this method !										*/																		\
194 		/* We initialize a static variable only one time.				*/																		\
195 		/* And we don't must use a mutex at every call!					*/																		\
196 		/* For the first call; pTypeCollection is NULL -				*/																		\
197 		/* for the second call pTypeCollection is different from NULL!	*/																		\
198 		static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ;											\
199 		if ( pTypeCollection == NULL )																											\
200 		{																																		\
201 			/* Ready for multithreading; get global mutex for first call of this method only! see before   */									\
202 			::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );																			\
203 			/* Control these pointer again ... it can be, that another instance will be faster then these! */									\
204 			if ( pTypeCollection == NULL )																										\
205 			{																																	\
206 				/* Create static typecollection for my own interfaces!	*/																		\
207 				static ::cppu::OTypeCollection aTypeCollection TYPES ;																			\
208 				/* Copy all items from my list sequences and from my baseclass	*/																\
209 				/* to one result list!											*/																\
210 				::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 			seqTypes1	= aTypeCollection.getTypes();				\
211 				::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 			seqTypes2	= BASECLASS::getTypes();					\
212 				sal_Int32																nCount1		= seqTypes1.getLength();					\
213 				sal_Int32																nCount2		= seqTypes2.getLength();					\
214 				static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	seqResult	( nCount1+nCount2 );						\
215 				sal_Int32																nSource		= 0;										\
216 				sal_Int32																nDestination= 0;										\
217 				while( nSource<nCount1 )																										\
218 				{																																\
219 					seqResult[nDestination] = seqTypes1[nSource];																				\
220 					++nSource;																													\
221 					++nDestination;																												\
222 				}																																\
223 				nSource = 0;																													\
224 				while( nSource<nCount2 )																										\
225 				{																																\
226 					seqResult[nDestination] = seqTypes2[nSource];																				\
227 					++nSource;																													\
228 					++nDestination;																												\
229 				}																																\
230 				/* ... and set his address to static pointer! */																				\
231 				pTypeCollection = &seqResult;																									\
232 			}																																	\
233 		}																																		\
234 		return *pTypeCollection;																												\
235 	}
236 
237 //*****************************************************************************************************************
238 //	private
239 //	help macros to replace TYPES in getTypes() [see before]
240 //*****************************************************************************************************************
241 #define	PRIVATE_DEFINE_TYPE_1( TYPE1 )																											\
242 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE1 >*)NULL )
243 
244 #define	PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 )																									\
245 	PRIVATE_DEFINE_TYPE_1( TYPE1 ),																												\
246 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE2 >*)NULL )
247 
248 #define	PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 )																							\
249 	PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ),																										\
250 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE3 >*)NULL )
251 
252 #define	PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 )																						\
253 	PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ),																								\
254 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE4 >*)NULL )
255 
256 #define	PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 )																				\
257 	PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ),																						\
258 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE5 >*)NULL )
259 
260 #define	PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 )																		\
261 	PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ),																					\
262 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE6 >*)NULL )
263 
264 #define	PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 )																\
265 	PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ),																			\
266 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE7 >*)NULL )
267 
268 #define	PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 )															\
269 	PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ),																	\
270 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE8 >*)NULL )
271 
272 #define	PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 )													\
273 	PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ),															\
274 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE9 >*)NULL )
275 
276 #define	PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 )											\
277 	PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ),														\
278 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE10 >*)NULL )
279 
280 #define	PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 )									\
281 	PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ),											\
282 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE11 >*)NULL )
283 
284 #define	PRIVATE_DEFINE_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 )							\
285 	PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ),									\
286 	::getCppuType(( const ::com::sun::star::uno::Reference< TYPE12 >*)NULL )
287 
288 //*****************************************************************************************************************
289 //	private
290 //	complete implementation of XTypeProvider
291 //*****************************************************************************************************************
292 #define	PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS )																											\
293 	PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )																								\
294 	PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, ::getCppuType(( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider >*)NULL ) )
295 
296 #define	PRIVATE_DEFINE_XTYPEPROVIDER( CLASS, TYPES )																										\
297 	PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )																								\
298 	PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES )
299 
300 #define	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND )																				\
301 	PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )																								\
302 	PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND )
303 
304 #define	PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS( CLASS, BASECLASS, TYPES )																					\
305 	PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )																								\
306 	PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES )
307 
308 //*****************************************************************************************************************
309 //	public
310 //	declaration of XTypeProvider
311 //*****************************************************************************************************************
312 #define FWK_DECLARE_XTYPEPROVIDER																																\
313 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >  SAL_CALL getTypes           () throw( ::com::sun::star::uno::RuntimeException );\
314 	virtual ::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw( ::com::sun::star::uno::RuntimeException );
315 
316 //*****************************************************************************************************************
317 //	public
318 //	implementation of XTypeProvider
319 //*****************************************************************************************************************
320 //	implementation of XTypeProvider without additional interface for getTypes()
321 //	XTypeProvider is used as the only one interface automaticly.
322 //	Following defines don't use XTypeProvider automaticly!!!!
323 #define DEFINE_XTYPEPROVIDER_0( CLASS )																				\
324 	PRIVATE_DEFINE_XTYPEPROVIDER_PURE(	CLASS )
325 
326 //	implementation of XTypeProvider with 1 additional interface for getTypes()
327 #define DEFINE_XTYPEPROVIDER_1( CLASS, TYPE1 )																		\
328 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,																		\
329 										(PRIVATE_DEFINE_TYPE_1	(	TYPE1											\
330 																))													\
331 									)
332 
333 //	implementation of XTypeProvider with 2 additional interfaces for getTypes()
334 #define DEFINE_XTYPEPROVIDER_2( CLASS, TYPE1, TYPE2 )																\
335 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,																		\
336 										(PRIVATE_DEFINE_TYPE_2	(	TYPE1	,										\
337 																	TYPE2											\
338 																))                  								\
339 									)
340 
341 //	implementation of XTypeProvider with 3 additional interfaces for getTypes()
342 #define DEFINE_XTYPEPROVIDER_3( CLASS, TYPE1, TYPE2, TYPE3 )														\
343 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,																		\
344 										(PRIVATE_DEFINE_TYPE_3	(	TYPE1	,										\
345 																	TYPE2	,										\
346 																	TYPE3											\
347 																))                  								\
348 									)
349 
350 //	implementation of XTypeProvider with 4 additional interfaces for getTypes()
351 #define DEFINE_XTYPEPROVIDER_4( CLASS, TYPE1, TYPE2, TYPE3, TYPE4 )													\
352 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,																		\
353 										(PRIVATE_DEFINE_TYPE_4	(	TYPE1	,										\
354 																	TYPE2	,										\
355 																	TYPE3	,										\
356 																	TYPE4											\
357 																))                  								\
358 									)
359 
360 //	implementation of XTypeProvider with 5 additional interfaces for getTypes()
361 #define DEFINE_XTYPEPROVIDER_5( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 )											\
362 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,																		\
363 										(PRIVATE_DEFINE_TYPE_5	(	TYPE1	,										\
364 																	TYPE2	,										\
365 																	TYPE3	,										\
366 																	TYPE4	,										\
367 																	TYPE5											\
368 																))                  								\
369 									)
370 
371 //	implementation of XTypeProvider with 6 additional interfaces for getTypes()
372 #define DEFINE_XTYPEPROVIDER_6( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 )									\
373 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,																		\
374 										(PRIVATE_DEFINE_TYPE_6	(	TYPE1	,										\
375 																	TYPE2	,										\
376 																	TYPE3	,										\
377 																	TYPE4	,										\
378 																	TYPE5	,										\
379 																	TYPE6    										\
380 																))                  								\
381 									)
382 
383 //	implementation of XTypeProvider with 7 additional interfaces for getTypes()
384 #define DEFINE_XTYPEPROVIDER_7( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 )							\
385 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,                               										\
386 										(PRIVATE_DEFINE_TYPE_7	(	TYPE1	,       								\
387 																	TYPE2	,       								\
388 																	TYPE3	,       								\
389 																	TYPE4	,       								\
390 																	TYPE5	,       								\
391 																	TYPE6	,       								\
392 																	TYPE7           								\
393 																))                  								\
394 									)
395 
396 //	implementation of XTypeProvider with 8 additional interfaces for getTypes()
397 #define DEFINE_XTYPEPROVIDER_8( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 )						\
398 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,                                      								\
399 										(PRIVATE_DEFINE_TYPE_8	(	TYPE1	,       								\
400 																	TYPE2	,       								\
401 																	TYPE3	,       								\
402 																	TYPE4	,       								\
403 																	TYPE5	,       								\
404 																	TYPE6	,       								\
405 																	TYPE7	,       								\
406 																	TYPE8           								\
407 																))                  								\
408 									)
409 
410 //	implementation of XTypeProvider with 9 additional interfaces for getTypes()
411 #define DEFINE_XTYPEPROVIDER_9( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 )				\
412 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,                                      								\
413 										(PRIVATE_DEFINE_TYPE_9	(	TYPE1	,       								\
414 																	TYPE2	,       								\
415 																	TYPE3	,       								\
416 																	TYPE4	,       								\
417 																	TYPE5	,       								\
418 																	TYPE6	,       								\
419 																	TYPE7	,       								\
420 																	TYPE8	,       								\
421 																	TYPE9           								\
422 																))                  								\
423 									)
424 
425 //	implementation of XTypeProvider with 10 additional interfaces for getTypes()
426 #define DEFINE_XTYPEPROVIDER_10( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 )		\
427 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,                                      								\
428 										(PRIVATE_DEFINE_TYPE_10	(	TYPE1	,       								\
429 																	TYPE2	,       								\
430 																	TYPE3	,       								\
431 																	TYPE4	,       								\
432 																	TYPE5	,       								\
433 																	TYPE6	,       								\
434 																	TYPE7	,       								\
435 																	TYPE8	,       								\
436 																	TYPE9	,       								\
437 																	TYPE10          								\
438 																))                  								\
439 									)
440 
441 //	implementation of XTypeProvider with 11 additional interfaces for getTypes()
442 #define DEFINE_XTYPEPROVIDER_11( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 )	\
443 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,                                  										\
444 										(PRIVATE_DEFINE_TYPE_11	(	TYPE1	,   										\
445 																	TYPE2	,   										\
446 																	TYPE3	,   										\
447 																	TYPE4	,   										\
448 																	TYPE5	,   										\
449 																	TYPE6	,   										\
450 																	TYPE7	,   										\
451 																	TYPE8	,   										\
452 																	TYPE9	,   										\
453 																	TYPE10	,      										\
454 																	TYPE11												\
455 																))             											\
456 									)
457 
458 //	implementation of XTypeProvider with 12 additional interfaces for getTypes()
459 #define DEFINE_XTYPEPROVIDER_12( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 )	\
460 	PRIVATE_DEFINE_XTYPEPROVIDER	(	CLASS,                                  												\
461 										(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   												\
462 																	TYPE2	,   												\
463 																	TYPE3	,   												\
464 																	TYPE4	,   												\
465 																	TYPE5	,   												\
466 																	TYPE6	,   												\
467 																	TYPE7	,   												\
468 																	TYPE8	,   												\
469 																	TYPE9	,   												\
470 																	TYPE10	,      												\
471 																	TYPE11	,													\
472 																	TYPE12														\
473 																))																\
474 									)
475 
476 //	implementation of XTypeProvider with 13 additional interfaces for getTypes()
477 #define DEFINE_XTYPEPROVIDER_13( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 )	\
478 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  													\
479 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   													\
480 																		TYPE2	,   													\
481 																		TYPE3	,   													\
482 																		TYPE4	,   													\
483 																		TYPE5	,   													\
484 																		TYPE6	,   													\
485 																		TYPE7	,   													\
486 																		TYPE8	,   													\
487 																		TYPE9	,   													\
488 																		TYPE10	,      													\
489 																		TYPE11	,														\
490 																		TYPE12															\
491 																	)),             													\
492 											(PRIVATE_DEFINE_TYPE_1	(	TYPE13															\
493 																	))																	\
494 										)
495 
496 //	implementation of XTypeProvider with 14 additional interfaces for getTypes()
497 #define DEFINE_XTYPEPROVIDER_14( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14 )	\
498 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  															\
499 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   															\
500 																		TYPE2	,   															\
501 																		TYPE3	,   															\
502 																		TYPE4	,   															\
503 																		TYPE5	,   															\
504 																		TYPE6	,   															\
505 																		TYPE7	,   															\
506 																		TYPE8	,   															\
507 																		TYPE9	,   															\
508 																		TYPE10	,      															\
509 																		TYPE11	,																\
510 																		TYPE12																	\
511 																	)),             															\
512 											(PRIVATE_DEFINE_TYPE_2	(	TYPE13	,   															\
513 																		TYPE14																	\
514 																	))																			\
515 										)
516 
517 //	implementation of XTypeProvider with 15 additional interfaces for getTypes()
518 #define DEFINE_XTYPEPROVIDER_15( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15 )	\
519 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  																	\
520 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   																	\
521 																		TYPE2	,   																	\
522 																		TYPE3	,   																	\
523 																		TYPE4	,   																	\
524 																		TYPE5	,   																	\
525 																		TYPE6	,   																	\
526 																		TYPE7	,   																	\
527 																		TYPE8	,   																	\
528 																		TYPE9	,   																	\
529 																		TYPE10	,      																	\
530 																		TYPE11	,																		\
531 																		TYPE12																			\
532 																	)),             																	\
533 											(PRIVATE_DEFINE_TYPE_3	(	TYPE13	,   																	\
534 																		TYPE14	,   																	\
535 																		TYPE15   																		\
536 																	))																					\
537 										)
538 
539 //	implementation of XTypeProvider with 16 additional interfaces for getTypes()
540 #define DEFINE_XTYPEPROVIDER_16( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16 )	\
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_4	(	TYPE13	,   																			\
556 																		TYPE14	,   																			\
557 																		TYPE15	,   																			\
558 																		TYPE16   																				\
559 																	))																							\
560 										)
561 
562 //  implementation of XTypeProvider with 17 additional interfaces for getTypes()
563 #define DEFINE_XTYPEPROVIDER_17( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17 ) \
564 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  																			\
565 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   																			\
566 																		TYPE2	,   																			\
567 																		TYPE3	,   																			\
568 																		TYPE4	,   																			\
569 																		TYPE5	,   																			\
570 																		TYPE6	,   																			\
571 																		TYPE7	,   																			\
572 																		TYPE8	,   																			\
573 																		TYPE9	,   																			\
574 																		TYPE10	,      																			\
575 																		TYPE11	,																				\
576 																		TYPE12																					\
577 																	)),             																			\
578                                             (PRIVATE_DEFINE_TYPE_5  (   TYPE13  ,                                                                               \
579 																		TYPE14	,   																			\
580 																		TYPE15	,   																			\
581                                                                         TYPE16  ,                                                                               \
582                                                                         TYPE17                                                                                  \
583 																	))																							\
584 										)
585 
586 //  implementation of XTypeProvider with 18 additional interfaces for getTypes()
587 #define DEFINE_XTYPEPROVIDER_18( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18 ) \
588 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  																			\
589 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   																			\
590 																		TYPE2	,   																			\
591 																		TYPE3	,   																			\
592 																		TYPE4	,   																			\
593 																		TYPE5	,   																			\
594 																		TYPE6	,   																			\
595 																		TYPE7	,   																			\
596 																		TYPE8	,   																			\
597 																		TYPE9	,   																			\
598 																		TYPE10	,      																			\
599 																		TYPE11	,																				\
600 																		TYPE12																					\
601 																	)),             																			\
602                                             (PRIVATE_DEFINE_TYPE_6  (   TYPE13  ,                                                                               \
603 																		TYPE14	,   																			\
604 																		TYPE15	,   																			\
605                                                                         TYPE16  ,                                                                               \
606                                                                         TYPE17  ,                                                                               \
607                                                                         TYPE18                                                                                  \
608 																	))																							\
609 										)
610 
611 //  implementation of XTypeProvider with 19 additional interfaces for getTypes()
612 #define DEFINE_XTYPEPROVIDER_19( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19 ) \
613 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  																			\
614 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   																			\
615 																		TYPE2	,   																			\
616 																		TYPE3	,   																			\
617 																		TYPE4	,   																			\
618 																		TYPE5	,   																			\
619 																		TYPE6	,   																			\
620 																		TYPE7	,   																			\
621 																		TYPE8	,   																			\
622 																		TYPE9	,   																			\
623 																		TYPE10	,      																			\
624 																		TYPE11	,																				\
625 																		TYPE12																					\
626 																	)),             																			\
627                                             (PRIVATE_DEFINE_TYPE_7  (   TYPE13  ,                                                                               \
628 																		TYPE14	,   																			\
629 																		TYPE15	,   																			\
630                                                                         TYPE16  ,                                                                               \
631                                                                         TYPE17  ,                                                                               \
632                                                                         TYPE18  ,                                                                               \
633                                                                         TYPE19                                                                                  \
634 																	))																							\
635 										)
636 
637 //  implementation of XTypeProvider with 20 additional interfaces for getTypes()
638 #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 ) \
639 	PRIVATE_DEFINE_XTYPEPROVIDER_LARGE	(	CLASS,                                  																			\
640 											(PRIVATE_DEFINE_TYPE_12	(	TYPE1	,   																			\
641 																		TYPE2	,   																			\
642 																		TYPE3	,   																			\
643 																		TYPE4	,   																			\
644 																		TYPE5	,   																			\
645 																		TYPE6	,   																			\
646 																		TYPE7	,   																			\
647 																		TYPE8	,   																			\
648 																		TYPE9	,   																			\
649 																		TYPE10	,      																			\
650 																		TYPE11	,																				\
651 																		TYPE12																					\
652 																	)),             																			\
653                                             (PRIVATE_DEFINE_TYPE_8  (   TYPE13  ,                                                                               \
654 																		TYPE14	,   																			\
655 																		TYPE15	,   																			\
656                                                                         TYPE16  ,                                                                               \
657                                                                         TYPE17  ,                                                                               \
658                                                                         TYPE18  ,                                                                               \
659                                                                         TYPE19  ,                                                                               \
660                                                                         TYPE20                                                                                  \
661 																	))																							\
662 										)
663 
664 //	implementation of XTypeProvider with 1 additional interface for getTypes() AND using 1 baseclass
665 #define DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 )											\
666 	PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS	(	CLASS,																\
667 												BASECLASS,						 									\
668 												(PRIVATE_DEFINE_TYPE_1	(	TYPE1   								\
669 																		))											\
670 											)
671 
672 //	implementation of XTypeProvider with 2 additional interface for getTypes() AND using 1 baseclass
673 #define DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2 )										\
674 	PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS	(	CLASS,																\
675 												BASECLASS,						 									\
676 												(PRIVATE_DEFINE_TYPE_2	(	TYPE1	,   							\
677 																			TYPE2									\
678 																		))											\
679 											)
680 
681 //	implementation of XTypeProvider with 3 additional interface for getTypes() AND using 1 baseclass
682 #define DEFINE_XTYPEPROVIDER_3_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3 )								\
683 	PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS	(	CLASS,																\
684 												BASECLASS,						 									\
685 												(PRIVATE_DEFINE_TYPE_3	(	TYPE1	,   							\
686 																			TYPE2	,   							\
687 																			TYPE3									\
688 																		))											\
689 											)
690 //	implementation of XTypeProvider with 4 additional interface for getTypes() AND using 1 baseclass
691 #define DEFINE_XTYPEPROVIDER_4_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4 )						\
692 	PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS	(	CLASS,																\
693 												BASECLASS,						 									\
694 												(PRIVATE_DEFINE_TYPE_4	(	TYPE1	,   							\
695 																			TYPE2	,   							\
696 																			TYPE3	,   							\
697 																			TYPE4									\
698 																		))											\
699 											)
700 //	implementation of XTypeProvider with 5 additional interface for getTypes() AND using 1 baseclass
701 #define DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 )				\
702 	PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS	(	CLASS,																\
703 												BASECLASS,						 									\
704 												(PRIVATE_DEFINE_TYPE_5	(	TYPE1	,   							\
705 																			TYPE2	,   							\
706 																			TYPE3	,   							\
707 																			TYPE4	,   							\
708 																			TYPE5									\
709 																		))											\
710 											)
711 
712 }		//	namespace framework
713 
714 #endif	//	#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
715