1*6da5f311SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*6da5f311SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*6da5f311SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*6da5f311SAndrew Rist * distributed with this work for additional information
6*6da5f311SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*6da5f311SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*6da5f311SAndrew Rist * "License"); you may not use this file except in compliance
9*6da5f311SAndrew Rist * with the License. You may obtain a copy of the License at
10*6da5f311SAndrew Rist *
11*6da5f311SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*6da5f311SAndrew Rist *
13*6da5f311SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*6da5f311SAndrew Rist * software distributed under the License is distributed on an
15*6da5f311SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6da5f311SAndrew Rist * KIND, either express or implied. See the License for the
17*6da5f311SAndrew Rist * specific language governing permissions and limitations
18*6da5f311SAndrew Rist * under the License.
19*6da5f311SAndrew Rist *
20*6da5f311SAndrew Rist *************************************************************/
21*6da5f311SAndrew Rist
22*6da5f311SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
25cdf0e10cSrcweir #define _CPPUHELPER_QUERYINTERFACE_HXX_
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #include "com/sun/star/uno/Any.hxx"
29cdf0e10cSrcweir #include "com/sun/star/uno/Type.hxx"
30cdf0e10cSrcweir #include "sal/types.h"
31cdf0e10cSrcweir
32cdf0e10cSrcweir namespace cppu
33cdf0e10cSrcweir {
34cdf0e10cSrcweir
35cdf0e10cSrcweir /** Compares demanded type to given template argument types.
36cdf0e10cSrcweir
37cdf0e10cSrcweir @tplparam Interface1 interface type
38cdf0e10cSrcweir @param rType demanded type
39cdf0e10cSrcweir @param p1 interface pointer
40cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
41cdf0e10cSrcweir */
42cdf0e10cSrcweir template< class Interface1 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1)43cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
44cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
45cdf0e10cSrcweir Interface1 * p1 )
46cdf0e10cSrcweir SAL_THROW( () )
47cdf0e10cSrcweir {
48cdf0e10cSrcweir if (rType == Interface1::static_type())
49cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
50cdf0e10cSrcweir else
51cdf0e10cSrcweir return ::com::sun::star::uno::Any();
52cdf0e10cSrcweir }
53cdf0e10cSrcweir /** Compares demanded type to given template argument types.
54cdf0e10cSrcweir
55cdf0e10cSrcweir @tplparam Interface1 interface type
56cdf0e10cSrcweir @tplparam Interface2 interface type
57cdf0e10cSrcweir @param rType demanded type
58cdf0e10cSrcweir @param p1 interface pointer
59cdf0e10cSrcweir @param p2 interface pointer
60cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
61cdf0e10cSrcweir */
62cdf0e10cSrcweir template< class Interface1, class Interface2 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2)63cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
64cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
65cdf0e10cSrcweir Interface1 * p1, Interface2 * p2 )
66cdf0e10cSrcweir SAL_THROW( () )
67cdf0e10cSrcweir {
68cdf0e10cSrcweir if (rType == Interface1::static_type())
69cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
70cdf0e10cSrcweir else if (rType == Interface2::static_type())
71cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
72cdf0e10cSrcweir else
73cdf0e10cSrcweir return ::com::sun::star::uno::Any();
74cdf0e10cSrcweir }
75cdf0e10cSrcweir /** Compares demanded type to given template argument types.
76cdf0e10cSrcweir
77cdf0e10cSrcweir @tplparam Interface1 interface type
78cdf0e10cSrcweir @tplparam Interface2 interface type
79cdf0e10cSrcweir @tplparam Interface3 interface type
80cdf0e10cSrcweir @param rType demanded type
81cdf0e10cSrcweir @param p1 interface pointer
82cdf0e10cSrcweir @param p2 interface pointer
83cdf0e10cSrcweir @param p3 interface pointer
84cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
85cdf0e10cSrcweir */
86cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3)87cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
88cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
89cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3 )
90cdf0e10cSrcweir SAL_THROW( () )
91cdf0e10cSrcweir {
92cdf0e10cSrcweir if (rType == Interface1::static_type())
93cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
94cdf0e10cSrcweir else if (rType == Interface2::static_type())
95cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
96cdf0e10cSrcweir else if (rType == Interface3::static_type())
97cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
98cdf0e10cSrcweir else
99cdf0e10cSrcweir return ::com::sun::star::uno::Any();
100cdf0e10cSrcweir }
101cdf0e10cSrcweir /** Compares demanded type to given template argument types.
102cdf0e10cSrcweir
103cdf0e10cSrcweir @tplparam Interface1 interface type
104cdf0e10cSrcweir @tplparam Interface2 interface type
105cdf0e10cSrcweir @tplparam Interface3 interface type
106cdf0e10cSrcweir @tplparam Interface4 interface type
107cdf0e10cSrcweir @param rType demanded type
108cdf0e10cSrcweir @param p1 interface pointer
109cdf0e10cSrcweir @param p2 interface pointer
110cdf0e10cSrcweir @param p3 interface pointer
111cdf0e10cSrcweir @param p4 interface pointer
112cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
113cdf0e10cSrcweir */
114cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4)115cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
116cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
117cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4 )
118cdf0e10cSrcweir SAL_THROW( () )
119cdf0e10cSrcweir {
120cdf0e10cSrcweir if (rType == Interface1::static_type())
121cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
122cdf0e10cSrcweir else if (rType == Interface2::static_type())
123cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
124cdf0e10cSrcweir else if (rType == Interface3::static_type())
125cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
126cdf0e10cSrcweir else if (rType == Interface4::static_type())
127cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
128cdf0e10cSrcweir else
129cdf0e10cSrcweir return ::com::sun::star::uno::Any();
130cdf0e10cSrcweir }
131cdf0e10cSrcweir /** Compares demanded type to given template argument types.
132cdf0e10cSrcweir
133cdf0e10cSrcweir @tplparam Interface1 interface type
134cdf0e10cSrcweir @tplparam Interface2 interface type
135cdf0e10cSrcweir @tplparam Interface3 interface type
136cdf0e10cSrcweir @tplparam Interface4 interface type
137cdf0e10cSrcweir @tplparam Interface5 interface type
138cdf0e10cSrcweir @param rType demanded type
139cdf0e10cSrcweir @param p1 interface pointer
140cdf0e10cSrcweir @param p2 interface pointer
141cdf0e10cSrcweir @param p3 interface pointer
142cdf0e10cSrcweir @param p4 interface pointer
143cdf0e10cSrcweir @param p5 interface pointer
144cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
145cdf0e10cSrcweir */
146cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5)147cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
148cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
149cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5 )
150cdf0e10cSrcweir SAL_THROW( () )
151cdf0e10cSrcweir {
152cdf0e10cSrcweir if (rType == Interface1::static_type())
153cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
154cdf0e10cSrcweir else if (rType == Interface2::static_type())
155cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
156cdf0e10cSrcweir else if (rType == Interface3::static_type())
157cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
158cdf0e10cSrcweir else if (rType == Interface4::static_type())
159cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
160cdf0e10cSrcweir else if (rType == Interface5::static_type())
161cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
162cdf0e10cSrcweir else
163cdf0e10cSrcweir return ::com::sun::star::uno::Any();
164cdf0e10cSrcweir }
165cdf0e10cSrcweir /** Compares demanded type to given template argument types.
166cdf0e10cSrcweir
167cdf0e10cSrcweir @tplparam Interface1 interface type
168cdf0e10cSrcweir @tplparam Interface2 interface type
169cdf0e10cSrcweir @tplparam Interface3 interface type
170cdf0e10cSrcweir @tplparam Interface4 interface type
171cdf0e10cSrcweir @tplparam Interface5 interface type
172cdf0e10cSrcweir @tplparam Interface6 interface type
173cdf0e10cSrcweir @param rType demanded type
174cdf0e10cSrcweir @param p1 interface pointer
175cdf0e10cSrcweir @param p2 interface pointer
176cdf0e10cSrcweir @param p3 interface pointer
177cdf0e10cSrcweir @param p4 interface pointer
178cdf0e10cSrcweir @param p5 interface pointer
179cdf0e10cSrcweir @param p6 interface pointer
180cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
181cdf0e10cSrcweir */
182cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
183cdf0e10cSrcweir class Interface6 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6)184cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
185cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
186cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
187cdf0e10cSrcweir Interface6 * p6 )
188cdf0e10cSrcweir SAL_THROW( () )
189cdf0e10cSrcweir {
190cdf0e10cSrcweir if (rType == Interface1::static_type())
191cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
192cdf0e10cSrcweir else if (rType == Interface2::static_type())
193cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
194cdf0e10cSrcweir else if (rType == Interface3::static_type())
195cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
196cdf0e10cSrcweir else if (rType == Interface4::static_type())
197cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
198cdf0e10cSrcweir else if (rType == Interface5::static_type())
199cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
200cdf0e10cSrcweir else if (rType == Interface6::static_type())
201cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
202cdf0e10cSrcweir else
203cdf0e10cSrcweir return ::com::sun::star::uno::Any();
204cdf0e10cSrcweir }
205cdf0e10cSrcweir /** Compares demanded type to given template argument types.
206cdf0e10cSrcweir
207cdf0e10cSrcweir @tplparam Interface1 interface type
208cdf0e10cSrcweir @tplparam Interface2 interface type
209cdf0e10cSrcweir @tplparam Interface3 interface type
210cdf0e10cSrcweir @tplparam Interface4 interface type
211cdf0e10cSrcweir @tplparam Interface5 interface type
212cdf0e10cSrcweir @tplparam Interface6 interface type
213cdf0e10cSrcweir @tplparam Interface7 interface type
214cdf0e10cSrcweir @param rType demanded type
215cdf0e10cSrcweir @param p1 interface pointer
216cdf0e10cSrcweir @param p2 interface pointer
217cdf0e10cSrcweir @param p3 interface pointer
218cdf0e10cSrcweir @param p4 interface pointer
219cdf0e10cSrcweir @param p5 interface pointer
220cdf0e10cSrcweir @param p6 interface pointer
221cdf0e10cSrcweir @param p7 interface pointer
222cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
223cdf0e10cSrcweir */
224cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
225cdf0e10cSrcweir class Interface6, class Interface7 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6,Interface7 * p7)226cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
227cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
228cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
229cdf0e10cSrcweir Interface6 * p6, Interface7 * p7 )
230cdf0e10cSrcweir SAL_THROW( () )
231cdf0e10cSrcweir {
232cdf0e10cSrcweir if (rType == Interface1::static_type())
233cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
234cdf0e10cSrcweir else if (rType == Interface2::static_type())
235cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
236cdf0e10cSrcweir else if (rType == Interface3::static_type())
237cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
238cdf0e10cSrcweir else if (rType == Interface4::static_type())
239cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
240cdf0e10cSrcweir else if (rType == Interface5::static_type())
241cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
242cdf0e10cSrcweir else if (rType == Interface6::static_type())
243cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
244cdf0e10cSrcweir else if (rType == Interface7::static_type())
245cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p7, rType );
246cdf0e10cSrcweir else
247cdf0e10cSrcweir return ::com::sun::star::uno::Any();
248cdf0e10cSrcweir }
249cdf0e10cSrcweir /** Compares demanded type to given template argument types.
250cdf0e10cSrcweir
251cdf0e10cSrcweir @tplparam Interface1 interface type
252cdf0e10cSrcweir @tplparam Interface2 interface type
253cdf0e10cSrcweir @tplparam Interface3 interface type
254cdf0e10cSrcweir @tplparam Interface4 interface type
255cdf0e10cSrcweir @tplparam Interface5 interface type
256cdf0e10cSrcweir @tplparam Interface6 interface type
257cdf0e10cSrcweir @tplparam Interface7 interface type
258cdf0e10cSrcweir @tplparam Interface8 interface type
259cdf0e10cSrcweir @param rType demanded type
260cdf0e10cSrcweir @param p1 interface pointer
261cdf0e10cSrcweir @param p2 interface pointer
262cdf0e10cSrcweir @param p3 interface pointer
263cdf0e10cSrcweir @param p4 interface pointer
264cdf0e10cSrcweir @param p5 interface pointer
265cdf0e10cSrcweir @param p6 interface pointer
266cdf0e10cSrcweir @param p7 interface pointer
267cdf0e10cSrcweir @param p8 interface pointer
268cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
269cdf0e10cSrcweir */
270cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
271cdf0e10cSrcweir class Interface6, class Interface7, class Interface8 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6,Interface7 * p7,Interface8 * p8)272cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
273cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
274cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
275cdf0e10cSrcweir Interface6 * p6, Interface7 * p7, Interface8 * p8 )
276cdf0e10cSrcweir SAL_THROW( () )
277cdf0e10cSrcweir {
278cdf0e10cSrcweir if (rType == Interface1::static_type())
279cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
280cdf0e10cSrcweir else if (rType == Interface2::static_type())
281cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
282cdf0e10cSrcweir else if (rType == Interface3::static_type())
283cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
284cdf0e10cSrcweir else if (rType == Interface4::static_type())
285cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
286cdf0e10cSrcweir else if (rType == Interface5::static_type())
287cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
288cdf0e10cSrcweir else if (rType == Interface6::static_type())
289cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
290cdf0e10cSrcweir else if (rType == Interface7::static_type())
291cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p7, rType );
292cdf0e10cSrcweir else if (rType == Interface8::static_type())
293cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p8, rType );
294cdf0e10cSrcweir else
295cdf0e10cSrcweir return ::com::sun::star::uno::Any();
296cdf0e10cSrcweir }
297cdf0e10cSrcweir /** Compares demanded type to given template argument types.
298cdf0e10cSrcweir
299cdf0e10cSrcweir @tplparam Interface1 interface type
300cdf0e10cSrcweir @tplparam Interface2 interface type
301cdf0e10cSrcweir @tplparam Interface3 interface type
302cdf0e10cSrcweir @tplparam Interface4 interface type
303cdf0e10cSrcweir @tplparam Interface5 interface type
304cdf0e10cSrcweir @tplparam Interface6 interface type
305cdf0e10cSrcweir @tplparam Interface7 interface type
306cdf0e10cSrcweir @tplparam Interface8 interface type
307cdf0e10cSrcweir @tplparam Interface9 interface type
308cdf0e10cSrcweir @param rType demanded type
309cdf0e10cSrcweir @param p1 interface pointer
310cdf0e10cSrcweir @param p2 interface pointer
311cdf0e10cSrcweir @param p3 interface pointer
312cdf0e10cSrcweir @param p4 interface pointer
313cdf0e10cSrcweir @param p5 interface pointer
314cdf0e10cSrcweir @param p6 interface pointer
315cdf0e10cSrcweir @param p7 interface pointer
316cdf0e10cSrcweir @param p8 interface pointer
317cdf0e10cSrcweir @param p9 interface pointer
318cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
319cdf0e10cSrcweir */
320cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
321cdf0e10cSrcweir class Interface6, class Interface7, class Interface8, class Interface9 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6,Interface7 * p7,Interface8 * p8,Interface9 * p9)322cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
323cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
324cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
325cdf0e10cSrcweir Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9 )
326cdf0e10cSrcweir SAL_THROW( () )
327cdf0e10cSrcweir {
328cdf0e10cSrcweir if (rType == Interface1::static_type())
329cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
330cdf0e10cSrcweir else if (rType == Interface2::static_type())
331cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
332cdf0e10cSrcweir else if (rType == Interface3::static_type())
333cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
334cdf0e10cSrcweir else if (rType == Interface4::static_type())
335cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
336cdf0e10cSrcweir else if (rType == Interface5::static_type())
337cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
338cdf0e10cSrcweir else if (rType == Interface6::static_type())
339cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
340cdf0e10cSrcweir else if (rType == Interface7::static_type())
341cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p7, rType );
342cdf0e10cSrcweir else if (rType == Interface8::static_type())
343cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p8, rType );
344cdf0e10cSrcweir else if (rType == Interface9::static_type())
345cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p9, rType );
346cdf0e10cSrcweir else
347cdf0e10cSrcweir return ::com::sun::star::uno::Any();
348cdf0e10cSrcweir }
349cdf0e10cSrcweir /** Compares demanded type to given template argument types.
350cdf0e10cSrcweir
351cdf0e10cSrcweir @tplparam Interface1 interface type
352cdf0e10cSrcweir @tplparam Interface2 interface type
353cdf0e10cSrcweir @tplparam Interface3 interface type
354cdf0e10cSrcweir @tplparam Interface4 interface type
355cdf0e10cSrcweir @tplparam Interface5 interface type
356cdf0e10cSrcweir @tplparam Interface6 interface type
357cdf0e10cSrcweir @tplparam Interface7 interface type
358cdf0e10cSrcweir @tplparam Interface8 interface type
359cdf0e10cSrcweir @tplparam Interface9 interface type
360cdf0e10cSrcweir @tplparam Interface10 interface type
361cdf0e10cSrcweir @param rType demanded type
362cdf0e10cSrcweir @param p1 interface pointer
363cdf0e10cSrcweir @param p2 interface pointer
364cdf0e10cSrcweir @param p3 interface pointer
365cdf0e10cSrcweir @param p4 interface pointer
366cdf0e10cSrcweir @param p5 interface pointer
367cdf0e10cSrcweir @param p6 interface pointer
368cdf0e10cSrcweir @param p7 interface pointer
369cdf0e10cSrcweir @param p8 interface pointer
370cdf0e10cSrcweir @param p9 interface pointer
371cdf0e10cSrcweir @param p10 interface pointer
372cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
373cdf0e10cSrcweir */
374cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
375cdf0e10cSrcweir class Interface6, class Interface7, class Interface8, class Interface9, class Interface10 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6,Interface7 * p7,Interface8 * p8,Interface9 * p9,Interface10 * p10)376cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
377cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
378cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
379cdf0e10cSrcweir Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10 )
380cdf0e10cSrcweir SAL_THROW( () )
381cdf0e10cSrcweir {
382cdf0e10cSrcweir if (rType == Interface1::static_type())
383cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
384cdf0e10cSrcweir else if (rType == Interface2::static_type())
385cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
386cdf0e10cSrcweir else if (rType == Interface3::static_type())
387cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
388cdf0e10cSrcweir else if (rType == Interface4::static_type())
389cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
390cdf0e10cSrcweir else if (rType == Interface5::static_type())
391cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
392cdf0e10cSrcweir else if (rType == Interface6::static_type())
393cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
394cdf0e10cSrcweir else if (rType == Interface7::static_type())
395cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p7, rType );
396cdf0e10cSrcweir else if (rType == Interface8::static_type())
397cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p8, rType );
398cdf0e10cSrcweir else if (rType == Interface9::static_type())
399cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p9, rType );
400cdf0e10cSrcweir else if (rType == Interface10::static_type())
401cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p10, rType );
402cdf0e10cSrcweir else
403cdf0e10cSrcweir return ::com::sun::star::uno::Any();
404cdf0e10cSrcweir }
405cdf0e10cSrcweir /** Compares demanded type to given template argument types.
406cdf0e10cSrcweir
407cdf0e10cSrcweir @tplparam Interface1 interface type
408cdf0e10cSrcweir @tplparam Interface2 interface type
409cdf0e10cSrcweir @tplparam Interface3 interface type
410cdf0e10cSrcweir @tplparam Interface4 interface type
411cdf0e10cSrcweir @tplparam Interface5 interface type
412cdf0e10cSrcweir @tplparam Interface6 interface type
413cdf0e10cSrcweir @tplparam Interface7 interface type
414cdf0e10cSrcweir @tplparam Interface8 interface type
415cdf0e10cSrcweir @tplparam Interface9 interface type
416cdf0e10cSrcweir @tplparam Interface10 interface type
417cdf0e10cSrcweir @tplparam Interface11 interface type
418cdf0e10cSrcweir @param rType demanded type
419cdf0e10cSrcweir @param p1 interface pointer
420cdf0e10cSrcweir @param p2 interface pointer
421cdf0e10cSrcweir @param p3 interface pointer
422cdf0e10cSrcweir @param p4 interface pointer
423cdf0e10cSrcweir @param p5 interface pointer
424cdf0e10cSrcweir @param p6 interface pointer
425cdf0e10cSrcweir @param p7 interface pointer
426cdf0e10cSrcweir @param p8 interface pointer
427cdf0e10cSrcweir @param p9 interface pointer
428cdf0e10cSrcweir @param p10 interface pointer
429cdf0e10cSrcweir @param p11 interface pointer
430cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
431cdf0e10cSrcweir */
432cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
433cdf0e10cSrcweir class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
434cdf0e10cSrcweir class Interface11 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6,Interface7 * p7,Interface8 * p8,Interface9 * p9,Interface10 * p10,Interface11 * p11)435cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
436cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
437cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
438cdf0e10cSrcweir Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
439cdf0e10cSrcweir Interface11 * p11 )
440cdf0e10cSrcweir SAL_THROW( () )
441cdf0e10cSrcweir {
442cdf0e10cSrcweir if (rType == Interface1::static_type())
443cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
444cdf0e10cSrcweir else if (rType == Interface2::static_type())
445cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
446cdf0e10cSrcweir else if (rType == Interface3::static_type())
447cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
448cdf0e10cSrcweir else if (rType == Interface4::static_type())
449cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
450cdf0e10cSrcweir else if (rType == Interface5::static_type())
451cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
452cdf0e10cSrcweir else if (rType == Interface6::static_type())
453cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
454cdf0e10cSrcweir else if (rType == Interface7::static_type())
455cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p7, rType );
456cdf0e10cSrcweir else if (rType == Interface8::static_type())
457cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p8, rType );
458cdf0e10cSrcweir else if (rType == Interface9::static_type())
459cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p9, rType );
460cdf0e10cSrcweir else if (rType == Interface10::static_type())
461cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p10, rType );
462cdf0e10cSrcweir else if (rType == Interface11::static_type())
463cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p11, rType );
464cdf0e10cSrcweir else
465cdf0e10cSrcweir return ::com::sun::star::uno::Any();
466cdf0e10cSrcweir }
467cdf0e10cSrcweir /** Compares demanded type to given template argument types.
468cdf0e10cSrcweir
469cdf0e10cSrcweir @tplparam Interface1 interface type
470cdf0e10cSrcweir @tplparam Interface2 interface type
471cdf0e10cSrcweir @tplparam Interface3 interface type
472cdf0e10cSrcweir @tplparam Interface4 interface type
473cdf0e10cSrcweir @tplparam Interface5 interface type
474cdf0e10cSrcweir @tplparam Interface6 interface type
475cdf0e10cSrcweir @tplparam Interface7 interface type
476cdf0e10cSrcweir @tplparam Interface8 interface type
477cdf0e10cSrcweir @tplparam Interface9 interface type
478cdf0e10cSrcweir @tplparam Interface10 interface type
479cdf0e10cSrcweir @tplparam Interface11 interface type
480cdf0e10cSrcweir @tplparam Interface12 interface type
481cdf0e10cSrcweir @param rType demanded type
482cdf0e10cSrcweir @param p1 interface pointer
483cdf0e10cSrcweir @param p2 interface pointer
484cdf0e10cSrcweir @param p3 interface pointer
485cdf0e10cSrcweir @param p4 interface pointer
486cdf0e10cSrcweir @param p5 interface pointer
487cdf0e10cSrcweir @param p6 interface pointer
488cdf0e10cSrcweir @param p7 interface pointer
489cdf0e10cSrcweir @param p8 interface pointer
490cdf0e10cSrcweir @param p9 interface pointer
491cdf0e10cSrcweir @param p10 interface pointer
492cdf0e10cSrcweir @param p11 interface pointer
493cdf0e10cSrcweir @param p12 interface pointer
494cdf0e10cSrcweir @return acquired interface of demanded type or empty Any
495cdf0e10cSrcweir */
496cdf0e10cSrcweir template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
497cdf0e10cSrcweir class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
498cdf0e10cSrcweir class Interface11, class Interface12 >
queryInterface(const::com::sun::star::uno::Type & rType,Interface1 * p1,Interface2 * p2,Interface3 * p3,Interface4 * p4,Interface5 * p5,Interface6 * p6,Interface7 * p7,Interface8 * p8,Interface9 * p9,Interface10 * p10,Interface11 * p11,Interface12 * p12)499cdf0e10cSrcweir inline ::com::sun::star::uno::Any SAL_CALL queryInterface(
500cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType,
501cdf0e10cSrcweir Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
502cdf0e10cSrcweir Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
503cdf0e10cSrcweir Interface11 * p11, Interface12 * p12 )
504cdf0e10cSrcweir SAL_THROW( () )
505cdf0e10cSrcweir {
506cdf0e10cSrcweir if (rType == Interface1::static_type())
507cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p1, rType );
508cdf0e10cSrcweir else if (rType == Interface2::static_type())
509cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p2, rType );
510cdf0e10cSrcweir else if (rType == Interface3::static_type())
511cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p3, rType );
512cdf0e10cSrcweir else if (rType == Interface4::static_type())
513cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p4, rType );
514cdf0e10cSrcweir else if (rType == Interface5::static_type())
515cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p5, rType );
516cdf0e10cSrcweir else if (rType == Interface6::static_type())
517cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p6, rType );
518cdf0e10cSrcweir else if (rType == Interface7::static_type())
519cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p7, rType );
520cdf0e10cSrcweir else if (rType == Interface8::static_type())
521cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p8, rType );
522cdf0e10cSrcweir else if (rType == Interface9::static_type())
523cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p9, rType );
524cdf0e10cSrcweir else if (rType == Interface10::static_type())
525cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p10, rType );
526cdf0e10cSrcweir else if (rType == Interface11::static_type())
527cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p11, rType );
528cdf0e10cSrcweir else if (rType == Interface12::static_type())
529cdf0e10cSrcweir return ::com::sun::star::uno::Any( &p12, rType );
530cdf0e10cSrcweir else
531cdf0e10cSrcweir return ::com::sun::star::uno::Any();
532cdf0e10cSrcweir }
533cdf0e10cSrcweir
534cdf0e10cSrcweir }
535cdf0e10cSrcweir
536cdf0e10cSrcweir #endif
537cdf0e10cSrcweir
538