xref: /AOO41X/main/cppuhelper/inc/cppuhelper/stdidlclass.hxx (revision 6da5f31158a7dd09f46f041b4f15bb7ae3eb92a4)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CPPUHELPER_STDIDLCLASS_HXX_
24 #define _CPPUHELPER_STDIDLCLASS_HXX_
25 
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/reflection/XIdlClass.hpp>
28 
29 
30 namespace cppu {
31 
32 /*
33   @deprecated
34 */
35 ::com::sun::star::reflection::XIdlClass * SAL_CALL createStandardClassWithSequence(
36     const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr ,
37     const ::rtl::OUString & sImplementationName ,
38     const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > & rSuperClass,
39     const ::com::sun::star::uno::Sequence < ::rtl::OUString > &seq )
40     SAL_THROW( () );
41 
42 
43 
44 /**
45    Standardfunction to create an XIdlClass for a component.
46    There is a function for each number of supported interfaces up to 10.
47 
48    Since the switch to the final component model, there are no use cases anymore, where
49    these functions should be used. Instead use the implementation helpers directly
50    (see cppuhelper/implbase1.hxx).
51 
52    @see OTypeCollection
53 
54    @deprecated
55  */
56 template < class Interface1 >
57 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
58 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *)59 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
60                         const ::rtl::OUString &sImplementationName  ,
61                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
62                         const Interface1 *
63                      )
64     SAL_THROW( () )
65 {
66     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(1);
67     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
68     return createStandardClassWithSequence(
69                                             rSMgr,
70                                             sImplementationName,
71                                             rSuperClass,
72                                             seqInterface
73                                           );
74 }
75 
76 
77 
78 template < class Interface1, class Interface2 >
79 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
80 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *)81 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
82                         const ::rtl::OUString &sImplementationName  ,
83                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
84                         const Interface1 *,
85                         const Interface2 *
86                      )
87     SAL_THROW( () )
88 {
89     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(2);
90     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
91     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
92     return createStandardClassWithSequence(
93                                             rSMgr,
94                                             sImplementationName,
95                                             rSuperClass,
96                                             seqInterface
97                                           );
98 }
99 
100 
101 
102 
103 
104 template < class Interface1, class Interface2 , class Interface3 >
105 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
106 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *)107 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
108                         const ::rtl::OUString &sImplementationName  ,
109                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
110                         const Interface1 *,
111                         const Interface2 *,
112                         const Interface3 *
113                      )
114     SAL_THROW( () )
115 {
116     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(3);
117     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
118     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
119     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
120     return createStandardClassWithSequence(
121                                             rSMgr,
122                                             sImplementationName,
123                                             rSuperClass,
124                                             seqInterface
125                                           );
126 }
127 
128 
129 
130 
131 
132 template < class Interface1, class Interface2 , class Interface3 , class Interface4 >
133 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
134 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *)135 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
136                         const ::rtl::OUString &sImplementationName  ,
137                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
138                         const Interface1 *,
139                         const Interface2 *,
140                         const Interface3 *,
141                         const Interface4 *
142                      )
143     SAL_THROW( () )
144 {
145     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(4);
146     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
147     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
148     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
149     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
150     return createStandardClassWithSequence(
151                                             rSMgr,
152                                             sImplementationName,
153                                             rSuperClass,
154                                             seqInterface
155                                           );
156 }
157 
158 
159 
160 
161 
162 
163 
164 template < class Interface1, class Interface2 , class Interface3 , class Interface4 , class Interface5 >
165 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
166 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *,const Interface5 *)167 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
168                         const ::rtl::OUString &sImplementationName  ,
169                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
170                         const Interface1 *,
171                         const Interface2 *,
172                         const Interface3 *,
173                         const Interface4 *,
174                         const Interface5 *
175                      )
176     SAL_THROW( () )
177 {
178     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(5);
179     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
180     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
181     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
182     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
183     seqInterface.getArray()[4] = Interface5::static_type().getTypeName();
184     return createStandardClassWithSequence(
185                                             rSMgr,
186                                             sImplementationName,
187                                             rSuperClass,
188                                             seqInterface
189                                           );
190 }
191 
192 
193 
194 
195 template <  class Interface1, class Interface2 , class Interface3 , class Interface4 , class Interface5 ,
196             class Interface6 >
197 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
198 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *,const Interface5 *,const Interface6 *)199 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
200                         const ::rtl::OUString &sImplementationName  ,
201                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
202                         const Interface1 *,
203                         const Interface2 *,
204                         const Interface3 *,
205                         const Interface4 *,
206                         const Interface5 *,
207                         const Interface6 *
208                      )
209     SAL_THROW( () )
210 {
211     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(6);
212     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
213     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
214     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
215     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
216     seqInterface.getArray()[4] = Interface5::static_type().getTypeName();
217     seqInterface.getArray()[5] = Interface6::static_type().getTypeName();
218     return createStandardClassWithSequence(
219                                             rSMgr,
220                                             sImplementationName,
221                                             rSuperClass,
222                                             seqInterface
223                                           );
224 }
225 
226 
227 
228 
229 
230 template <  class Interface1, class Interface2 , class Interface3 , class Interface4 , class Interface5 ,
231             class Interface6, class Interface7 >
232 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
233 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *,const Interface5 *,const Interface6 *,const Interface7 *)234 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
235                         const ::rtl::OUString &sImplementationName  ,
236                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
237                         const Interface1 *,
238                         const Interface2 *,
239                         const Interface3 *,
240                         const Interface4 *,
241                         const Interface5 *,
242                         const Interface6 *,
243                         const Interface7 *
244                      )
245     SAL_THROW( () )
246 {
247     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(7);
248     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
249     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
250     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
251     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
252     seqInterface.getArray()[4] = Interface5::static_type().getTypeName();
253     seqInterface.getArray()[5] = Interface6::static_type().getTypeName();
254     seqInterface.getArray()[6] = Interface7::static_type().getTypeName();
255     return createStandardClassWithSequence(
256                                             rSMgr,
257                                             sImplementationName,
258                                             rSuperClass,
259                                             seqInterface
260                                           );
261 }
262 
263 
264 
265 
266 
267 
268 template <  class Interface1, class Interface2, class Interface3 , class Interface4 , class Interface5 ,
269             class Interface6, class Interface7, class Interface8 >
270 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
271 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *,const Interface5 *,const Interface6 *,const Interface7 *,const Interface8 *)272 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
273                         const ::rtl::OUString &sImplementationName  ,
274                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
275                         const Interface1 *,
276                         const Interface2 *,
277                         const Interface3 *,
278                         const Interface4 *,
279                         const Interface5 *,
280                         const Interface6 *,
281                         const Interface7 *,
282                         const Interface8 *
283                      )
284     SAL_THROW( () )
285 {
286     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(8);
287     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
288     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
289     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
290     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
291     seqInterface.getArray()[4] = Interface5::static_type().getTypeName();
292     seqInterface.getArray()[5] = Interface6::static_type().getTypeName();
293     seqInterface.getArray()[6] = Interface7::static_type().getTypeName();
294     seqInterface.getArray()[7] = Interface8::static_type().getTypeName();
295     return createStandardClassWithSequence(
296                                             rSMgr,
297                                             sImplementationName,
298                                             rSuperClass,
299                                             seqInterface
300                                           );
301 }
302 
303 
304 
305 
306 template <  class Interface1, class Interface2, class Interface3 , class Interface4 , class Interface5 ,
307             class Interface6, class Interface7, class Interface8 , class Interface9 >
308 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
309 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *,const Interface5 *,const Interface6 *,const Interface7 *,const Interface8 *,const Interface9 *)310 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
311                         const ::rtl::OUString &sImplementationName  ,
312                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
313                         const Interface1 *,
314                         const Interface2 *,
315                         const Interface3 *,
316                         const Interface4 *,
317                         const Interface5 *,
318                         const Interface6 *,
319                         const Interface7 *,
320                         const Interface8 *,
321                         const Interface9 *
322                      )
323     SAL_THROW( () )
324 {
325     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(9);
326     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
327     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
328     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
329     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
330     seqInterface.getArray()[4] = Interface5::static_type().getTypeName();
331     seqInterface.getArray()[5] = Interface6::static_type().getTypeName();
332     seqInterface.getArray()[6] = Interface7::static_type().getTypeName();
333     seqInterface.getArray()[7] = Interface8::static_type().getTypeName();
334     seqInterface.getArray()[8] = Interface9::static_type().getTypeName();
335     return createStandardClassWithSequence(
336                                             rSMgr,
337                                             sImplementationName,
338                                             rSuperClass,
339                                             seqInterface
340                                           );
341 }
342 
343 
344 template <  class Interface1, class Interface2, class Interface3 , class Interface4 , class Interface5 ,
345             class Interface6, class Interface7, class Interface8 , class Interface9 , class Interface10 >
346 inline ::com::sun::star::reflection::XIdlClass * SAL_CALL
347 //inline ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass >
createStandardClass(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMgr,const::rtl::OUString & sImplementationName,const::com::sun::star::uno::Reference<::com::sun::star::reflection::XIdlClass> & rSuperClass,const Interface1 *,const Interface2 *,const Interface3 *,const Interface4 *,const Interface5 *,const Interface6 *,const Interface7 *,const Interface8 *,const Interface9 *,const Interface10 *)348 createStandardClass(    const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > &rSMgr,
349                         const ::rtl::OUString &sImplementationName  ,
350                         const ::com::sun::star::uno::Reference < ::com::sun::star::reflection::XIdlClass > &rSuperClass ,
351                         const Interface1 *,
352                         const Interface2 *,
353                         const Interface3 *,
354                         const Interface4 *,
355                         const Interface5 *,
356                         const Interface6 *,
357                         const Interface7 *,
358                         const Interface8 *,
359                         const Interface9 *,
360                         const Interface10 *
361                      )
362     SAL_THROW( () )
363 {
364     ::com::sun::star::uno::Sequence < ::rtl::OUString > seqInterface(10);
365     seqInterface.getArray()[0] = Interface1::static_type().getTypeName();
366     seqInterface.getArray()[1] = Interface2::static_type().getTypeName();
367     seqInterface.getArray()[2] = Interface3::static_type().getTypeName();
368     seqInterface.getArray()[3] = Interface4::static_type().getTypeName();
369     seqInterface.getArray()[4] = Interface5::static_type().getTypeName();
370     seqInterface.getArray()[5] = Interface6::static_type().getTypeName();
371     seqInterface.getArray()[6] = Interface7::static_type().getTypeName();
372     seqInterface.getArray()[7] = Interface8::static_type().getTypeName();
373     seqInterface.getArray()[8] = Interface9::static_type().getTypeName();
374     seqInterface.getArray()[9] = Interface10::static_type().getTypeName();
375     return createStandardClassWithSequence(
376                                             rSMgr,
377                                             sImplementationName,
378                                             rSuperClass,
379                                             seqInterface
380                                           );
381 }
382 
383 } // end namespace cppu
384 
385 #endif
386