1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
31 #include <com/sun/star/ucb/NameClash.hpp>
32 #include "ftpintreq.hxx"
35 using namespace com::sun::star
;
36 using namespace com::sun::star::uno
;
37 using namespace com::sun::star::lang
;
38 using namespace com::sun::star::ucb
;
39 using namespace com::sun::star::task
;
43 XInteractionApproveImpl::XInteractionApproveImpl()
50 XInteractionApproveImpl::acquire( void )
53 OWeakObject::acquire();
58 XInteractionApproveImpl::release( void )
61 OWeakObject::release();
67 XInteractionApproveImpl::queryInterface( const Type
& rType
)
68 throw( RuntimeException
)
70 Any aRet
= cppu::queryInterface(
72 (static_cast< lang::XTypeProvider
* >(this)),
73 (static_cast< XInteractionApprove
* >(this)) );
74 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
78 //////////////////////////////////////////////////////////////////////////////
80 //////////////////////////////////////////////////////////////////////////////
82 XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl
,
87 void SAL_CALL
XInteractionApproveImpl::select()
88 throw (RuntimeException
)
94 bool XInteractionApproveImpl::isSelected() const
100 // XInteractionDisapproveImpl
102 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
109 XInteractionDisapproveImpl::acquire( void )
112 OWeakObject::acquire();
117 XInteractionDisapproveImpl::release( void )
120 OWeakObject::release();
126 XInteractionDisapproveImpl::queryInterface( const Type
& rType
)
127 throw( RuntimeException
)
129 Any aRet
= cppu::queryInterface(
131 (static_cast< lang::XTypeProvider
* >(this)),
132 (static_cast< XInteractionDisapprove
* >(this)) );
133 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
137 //////////////////////////////////////////////////////////////////////////////
139 //////////////////////////////////////////////////////////////////////////////
141 XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl
,
143 XInteractionDisapprove
)
146 void SAL_CALL
XInteractionDisapproveImpl::select()
147 throw (RuntimeException
)
154 // XInteractionRequestImpl
156 XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString
& aName
)
157 : p1( new XInteractionApproveImpl
),
158 p2( new XInteractionDisapproveImpl
),
162 m_aSeq
[0] = Reference
<XInteractionContinuation
>(p1
);
163 m_aSeq
[1] = Reference
<XInteractionContinuation
>(p2
);
168 XInteractionRequestImpl::acquire( void )
171 OWeakObject::acquire();
177 XInteractionRequestImpl::release( void )
180 OWeakObject::release();
186 XInteractionRequestImpl::queryInterface( const Type
& rType
)
187 throw( RuntimeException
)
189 Any aRet
= cppu::queryInterface(
191 (static_cast< lang::XTypeProvider
* >(this)),
192 (static_cast< XInteractionRequest
* >(this)) );
193 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
197 //////////////////////////////////////////////////////////////////////////////
199 /////////////////////////////////////////////////////////////////////////////
201 XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl
,
203 XInteractionRequest
)
206 Any SAL_CALL
XInteractionRequestImpl::getRequest( )
207 throw (RuntimeException
)
210 UnsupportedNameClashException excep
;
211 excep
.NameClash
= NameClash::ERROR
;
217 Sequence
<Reference
<XInteractionContinuation
> > SAL_CALL
218 XInteractionRequestImpl::getContinuations( )
219 throw (RuntimeException
)
225 bool XInteractionRequestImpl::approved() const
227 return p1
->isSelected();
230 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */