Update ooo320-m1
[ooovba.git] / ucb / source / ucp / ftp / ftpintreq.cxx
blob78d3db6ecd05b8a8559fcdf38dde3b943511cfde
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftpintreq.cxx,v $
10 * $Revision: 1.5 $
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"
38 using namespace cppu;
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;
44 using namespace ftp;
47 XInteractionApproveImpl::XInteractionApproveImpl()
48 : m_bSelected(false)
53 void SAL_CALL
54 XInteractionApproveImpl::acquire( void )
55 throw()
57 OWeakObject::acquire();
61 void SAL_CALL
62 XInteractionApproveImpl::release( void )
63 throw()
65 OWeakObject::release();
70 Any SAL_CALL
71 XInteractionApproveImpl::queryInterface( const Type& rType )
72 throw( RuntimeException )
74 Any aRet = cppu::queryInterface(
75 rType,
76 SAL_STATIC_CAST( lang::XTypeProvider*, this ),
77 SAL_STATIC_CAST( XInteractionApprove*,this) );
78 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
82 //////////////////////////////////////////////////////////////////////////////
83 // XTypeProvider
84 //////////////////////////////////////////////////////////////////////////////
86 XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl,
87 XTypeProvider,
88 XInteractionApprove )
91 void SAL_CALL XInteractionApproveImpl::select()
92 throw (RuntimeException)
94 m_bSelected = true;
98 bool XInteractionApproveImpl::isSelected() const
100 return m_bSelected;
105 // XInteractionDisapproveImpl
107 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
108 : m_bSelected(false)
113 void SAL_CALL
114 XInteractionDisapproveImpl::acquire( void )
115 throw()
117 OWeakObject::acquire();
121 void SAL_CALL
122 XInteractionDisapproveImpl::release( void )
123 throw()
125 OWeakObject::release();
130 Any SAL_CALL
131 XInteractionDisapproveImpl::queryInterface( const Type& rType )
132 throw( RuntimeException )
134 Any aRet = cppu::queryInterface(
135 rType,
136 SAL_STATIC_CAST( lang::XTypeProvider*, this ),
137 SAL_STATIC_CAST( XInteractionDisapprove*,this) );
138 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
142 //////////////////////////////////////////////////////////////////////////////
143 // XTypeProvider
144 //////////////////////////////////////////////////////////////////////////////
146 XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl,
147 XTypeProvider,
148 XInteractionDisapprove )
151 void SAL_CALL XInteractionDisapproveImpl::select()
152 throw (RuntimeException)
155 m_bSelected = true;
159 bool XInteractionDisapproveImpl::isSelected() const
161 return m_bSelected;
166 // XInteractionRequestImpl
168 XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName)
169 : p1( new XInteractionApproveImpl ),
170 p2( new XInteractionDisapproveImpl ),
171 m_aName(aName),
172 m_aSeq( 2 )
174 m_aSeq[0] = Reference<XInteractionContinuation>(p1);
175 m_aSeq[1] = Reference<XInteractionContinuation>(p2);
179 void SAL_CALL
180 XInteractionRequestImpl::acquire( void )
181 throw()
183 OWeakObject::acquire();
188 void SAL_CALL
189 XInteractionRequestImpl::release( void )
190 throw()
192 OWeakObject::release();
197 Any SAL_CALL
198 XInteractionRequestImpl::queryInterface( const Type& rType )
199 throw( RuntimeException )
201 Any aRet = cppu::queryInterface(
202 rType,
203 SAL_STATIC_CAST( lang::XTypeProvider*, this ),
204 SAL_STATIC_CAST( XInteractionRequest*,this) );
205 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
209 //////////////////////////////////////////////////////////////////////////////
210 // XTypeProvider
211 /////////////////////////////////////////////////////////////////////////////
213 XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl,
214 XTypeProvider,
215 XInteractionRequest )
218 Any SAL_CALL XInteractionRequestImpl::getRequest( )
219 throw (RuntimeException)
221 Any aAny;
222 UnsupportedNameClashException excep;
223 excep.NameClash = NameClash::ERROR;
224 aAny <<= excep;
225 return aAny;
229 Sequence<Reference<XInteractionContinuation > > SAL_CALL
230 XInteractionRequestImpl::getContinuations( )
231 throw (RuntimeException)
233 return m_aSeq;
237 bool XInteractionRequestImpl::aborted() const
239 return p2->isSelected();
243 bool XInteractionRequestImpl::approved() const
245 return p1->isSelected();