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 .
21 #include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
22 #include <com/sun/star/ucb/NameClash.hpp>
23 #include "ftpintreq.hxx"
26 using namespace com::sun::star
;
27 using namespace com::sun::star::uno
;
28 using namespace com::sun::star::lang
;
29 using namespace com::sun::star::ucb
;
30 using namespace com::sun::star::task
;
34 XInteractionApproveImpl::XInteractionApproveImpl()
41 XInteractionApproveImpl::acquire( void )
44 OWeakObject::acquire();
49 XInteractionApproveImpl::release( void )
52 OWeakObject::release();
58 XInteractionApproveImpl::queryInterface( const Type
& rType
)
59 throw( RuntimeException
)
61 Any aRet
= cppu::queryInterface(
63 (static_cast< lang::XTypeProvider
* >(this)),
64 (static_cast< XInteractionApprove
* >(this)) );
65 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
69 //////////////////////////////////////////////////////////////////////////////
71 //////////////////////////////////////////////////////////////////////////////
73 XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl
,
78 void SAL_CALL
XInteractionApproveImpl::select()
79 throw (RuntimeException
)
85 bool XInteractionApproveImpl::isSelected() const
91 // XInteractionDisapproveImpl
93 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
100 XInteractionDisapproveImpl::acquire( void )
103 OWeakObject::acquire();
108 XInteractionDisapproveImpl::release( void )
111 OWeakObject::release();
117 XInteractionDisapproveImpl::queryInterface( const Type
& rType
)
118 throw( RuntimeException
)
120 Any aRet
= cppu::queryInterface(
122 (static_cast< lang::XTypeProvider
* >(this)),
123 (static_cast< XInteractionDisapprove
* >(this)) );
124 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
128 //////////////////////////////////////////////////////////////////////////////
130 //////////////////////////////////////////////////////////////////////////////
132 XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl
,
134 XInteractionDisapprove
)
137 void SAL_CALL
XInteractionDisapproveImpl::select()
138 throw (RuntimeException
)
145 // XInteractionRequestImpl
147 XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString
& aName
)
148 : p1( new XInteractionApproveImpl
),
149 p2( new XInteractionDisapproveImpl
),
153 m_aSeq
[0] = Reference
<XInteractionContinuation
>(p1
);
154 m_aSeq
[1] = Reference
<XInteractionContinuation
>(p2
);
159 XInteractionRequestImpl::acquire( void )
162 OWeakObject::acquire();
168 XInteractionRequestImpl::release( void )
171 OWeakObject::release();
177 XInteractionRequestImpl::queryInterface( const Type
& rType
)
178 throw( RuntimeException
)
180 Any aRet
= cppu::queryInterface(
182 (static_cast< lang::XTypeProvider
* >(this)),
183 (static_cast< XInteractionRequest
* >(this)) );
184 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
188 //////////////////////////////////////////////////////////////////////////////
190 /////////////////////////////////////////////////////////////////////////////
192 XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl
,
194 XInteractionRequest
)
197 Any SAL_CALL
XInteractionRequestImpl::getRequest( )
198 throw (RuntimeException
)
201 UnsupportedNameClashException excep
;
202 excep
.NameClash
= NameClash::ERROR
;
208 Sequence
<Reference
<XInteractionContinuation
> > SAL_CALL
209 XInteractionRequestImpl::getContinuations( )
210 throw (RuntimeException
)
216 bool XInteractionRequestImpl::approved() const
218 return p1
->isSelected();
221 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */