1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftpintreq.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 // MARKER(update_precomp.py): autogen include statement, do not remove
33 #include "precompiled_ucb.hxx"
34 #include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
35 #include <com/sun/star/ucb/NameClash.hpp>
36 #include "ftpintreq.hxx"
39 using namespace com::sun::star
;
40 using namespace com::sun::star::uno
;
41 using namespace com::sun::star::lang
;
42 using namespace com::sun::star::ucb
;
43 using namespace com::sun::star::task
;
47 XInteractionApproveImpl::XInteractionApproveImpl()
54 XInteractionApproveImpl::acquire( void )
57 OWeakObject::acquire();
62 XInteractionApproveImpl::release( void )
65 OWeakObject::release();
71 XInteractionApproveImpl::queryInterface( const Type
& rType
)
72 throw( RuntimeException
)
74 Any aRet
= cppu::queryInterface(
76 SAL_STATIC_CAST( lang::XTypeProvider
*, this ),
77 SAL_STATIC_CAST( XInteractionApprove
*,this) );
78 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
82 //////////////////////////////////////////////////////////////////////////////
84 //////////////////////////////////////////////////////////////////////////////
86 XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl
,
91 void SAL_CALL
XInteractionApproveImpl::select()
92 throw (RuntimeException
)
98 bool XInteractionApproveImpl::isSelected() const
105 // XInteractionDisapproveImpl
107 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
114 XInteractionDisapproveImpl::acquire( void )
117 OWeakObject::acquire();
122 XInteractionDisapproveImpl::release( void )
125 OWeakObject::release();
131 XInteractionDisapproveImpl::queryInterface( const Type
& rType
)
132 throw( RuntimeException
)
134 Any aRet
= cppu::queryInterface(
136 SAL_STATIC_CAST( lang::XTypeProvider
*, this ),
137 SAL_STATIC_CAST( XInteractionDisapprove
*,this) );
138 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
142 //////////////////////////////////////////////////////////////////////////////
144 //////////////////////////////////////////////////////////////////////////////
146 XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl
,
148 XInteractionDisapprove
)
151 void SAL_CALL
XInteractionDisapproveImpl::select()
152 throw (RuntimeException
)
159 bool XInteractionDisapproveImpl::isSelected() const
166 // XInteractionRequestImpl
168 XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString
& aName
)
169 : p1( new XInteractionApproveImpl
),
170 p2( new XInteractionDisapproveImpl
),
174 m_aSeq
[0] = Reference
<XInteractionContinuation
>(p1
);
175 m_aSeq
[1] = Reference
<XInteractionContinuation
>(p2
);
180 XInteractionRequestImpl::acquire( void )
183 OWeakObject::acquire();
189 XInteractionRequestImpl::release( void )
192 OWeakObject::release();
198 XInteractionRequestImpl::queryInterface( const Type
& rType
)
199 throw( RuntimeException
)
201 Any aRet
= cppu::queryInterface(
203 SAL_STATIC_CAST( lang::XTypeProvider
*, this ),
204 SAL_STATIC_CAST( XInteractionRequest
*,this) );
205 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
209 //////////////////////////////////////////////////////////////////////////////
211 /////////////////////////////////////////////////////////////////////////////
213 XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl
,
215 XInteractionRequest
)
218 Any SAL_CALL
XInteractionRequestImpl::getRequest( )
219 throw (RuntimeException
)
222 UnsupportedNameClashException excep
;
223 excep
.NameClash
= NameClash::ERROR
;
229 Sequence
<Reference
<XInteractionContinuation
> > SAL_CALL
230 XInteractionRequestImpl::getContinuations( )
231 throw (RuntimeException
)
237 bool XInteractionRequestImpl::aborted() const
239 return p2
->isSelected();
243 bool XInteractionRequestImpl::approved() const
245 return p1
->isSelected();