1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UUI_SOURCE_GETCONTINUATIONS_HXX
21 #define INCLUDED_UUI_SOURCE_GETCONTINUATIONS_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
26 namespace com
{ namespace sun
{ namespace star
{
28 class XInteractionContinuation
;
34 css::uno::Reference
< css::task::XInteractionContinuation
> const & rContinuation
,
35 css::uno::Reference
< t1
> * pContinuation
)
37 if (pContinuation
&& !pContinuation
->is())
39 pContinuation
->set(rContinuation
, css::uno::UNO_QUERY
);
40 if (pContinuation
->is())
46 template< class t1
, class t2
>
47 void getContinuations(
49 css::uno::Reference
< css::task::XInteractionContinuation
> > const & rContinuations
,
50 css::uno::Reference
< t1
> * pContinuation1
,
51 css::uno::Reference
< t2
> * pContinuation2
)
53 for (sal_Int32 i
= 0; i
< rContinuations
.getLength(); ++i
)
55 if (setContinuation(rContinuations
[i
], pContinuation1
))
57 if (setContinuation(rContinuations
[i
], pContinuation2
))
62 template< class t1
, class t2
, class t3
>
63 void getContinuations(
65 css::uno::Reference
< css::task::XInteractionContinuation
> > const & rContinuations
,
66 css::uno::Reference
< t1
> * pContinuation1
,
67 css::uno::Reference
< t2
> * pContinuation2
,
68 css::uno::Reference
< t3
> * pContinuation3
)
70 for (sal_Int32 i
= 0; i
< rContinuations
.getLength(); ++i
)
72 if (setContinuation(rContinuations
[i
], pContinuation1
))
74 if (setContinuation(rContinuations
[i
], pContinuation2
))
76 if (setContinuation(rContinuations
[i
], pContinuation3
))
81 template< class t1
, class t2
, class t3
, class t4
>
82 void getContinuations(
84 css::uno::Reference
< css::task::XInteractionContinuation
> > const & rContinuations
,
85 css::uno::Reference
< t1
> * pContinuation1
,
86 css::uno::Reference
< t2
> * pContinuation2
,
87 css::uno::Reference
< t3
> * pContinuation3
,
88 css::uno::Reference
< t4
> * pContinuation4
)
90 for (sal_Int32 i
= 0; i
< rContinuations
.getLength(); ++i
)
92 if (setContinuation(rContinuations
[i
], pContinuation1
))
94 if (setContinuation(rContinuations
[i
], pContinuation2
))
96 if (setContinuation(rContinuations
[i
], pContinuation3
))
98 if (setContinuation(rContinuations
[i
], pContinuation4
))
103 #endif // INCLUDED_UUI_SOURCE_GETCONTINUATIONS_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */