Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / ftp / ftpintreq.cxx
blob45a6dde67945a602d4c6e1aee42205ec56a55d22
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"
34 using namespace cppu;
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;
40 using namespace ftp;
43 XInteractionApproveImpl::XInteractionApproveImpl()
44 : m_bSelected(false)
49 void SAL_CALL
50 XInteractionApproveImpl::acquire( void )
51 throw()
53 OWeakObject::acquire();
57 void SAL_CALL
58 XInteractionApproveImpl::release( void )
59 throw()
61 OWeakObject::release();
66 Any SAL_CALL
67 XInteractionApproveImpl::queryInterface( const Type& rType )
68 throw( RuntimeException )
70 Any aRet = cppu::queryInterface(
71 rType,
72 (static_cast< lang::XTypeProvider* >(this)),
73 (static_cast< XInteractionApprove* >(this)) );
74 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
78 //////////////////////////////////////////////////////////////////////////////
79 // XTypeProvider
80 //////////////////////////////////////////////////////////////////////////////
82 XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl,
83 XTypeProvider,
84 XInteractionApprove )
87 void SAL_CALL XInteractionApproveImpl::select()
88 throw (RuntimeException)
90 m_bSelected = true;
94 bool XInteractionApproveImpl::isSelected() const
96 return m_bSelected;
100 // XInteractionDisapproveImpl
102 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
103 : m_bSelected(false)
108 void SAL_CALL
109 XInteractionDisapproveImpl::acquire( void )
110 throw()
112 OWeakObject::acquire();
116 void SAL_CALL
117 XInteractionDisapproveImpl::release( void )
118 throw()
120 OWeakObject::release();
125 Any SAL_CALL
126 XInteractionDisapproveImpl::queryInterface( const Type& rType )
127 throw( RuntimeException )
129 Any aRet = cppu::queryInterface(
130 rType,
131 (static_cast< lang::XTypeProvider* >(this)),
132 (static_cast< XInteractionDisapprove* >(this)) );
133 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
137 //////////////////////////////////////////////////////////////////////////////
138 // XTypeProvider
139 //////////////////////////////////////////////////////////////////////////////
141 XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl,
142 XTypeProvider,
143 XInteractionDisapprove )
146 void SAL_CALL XInteractionDisapproveImpl::select()
147 throw (RuntimeException)
150 m_bSelected = true;
154 // XInteractionRequestImpl
156 XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName)
157 : p1( new XInteractionApproveImpl ),
158 p2( new XInteractionDisapproveImpl ),
159 m_aName(aName),
160 m_aSeq( 2 )
162 m_aSeq[0] = Reference<XInteractionContinuation>(p1);
163 m_aSeq[1] = Reference<XInteractionContinuation>(p2);
167 void SAL_CALL
168 XInteractionRequestImpl::acquire( void )
169 throw()
171 OWeakObject::acquire();
176 void SAL_CALL
177 XInteractionRequestImpl::release( void )
178 throw()
180 OWeakObject::release();
185 Any SAL_CALL
186 XInteractionRequestImpl::queryInterface( const Type& rType )
187 throw( RuntimeException )
189 Any aRet = cppu::queryInterface(
190 rType,
191 (static_cast< lang::XTypeProvider* >(this)),
192 (static_cast< XInteractionRequest* >(this)) );
193 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
197 //////////////////////////////////////////////////////////////////////////////
198 // XTypeProvider
199 /////////////////////////////////////////////////////////////////////////////
201 XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl,
202 XTypeProvider,
203 XInteractionRequest )
206 Any SAL_CALL XInteractionRequestImpl::getRequest( )
207 throw (RuntimeException)
209 Any aAny;
210 UnsupportedNameClashException excep;
211 excep.NameClash = NameClash::ERROR;
212 aAny <<= excep;
213 return aAny;
217 Sequence<Reference<XInteractionContinuation > > SAL_CALL
218 XInteractionRequestImpl::getContinuations( )
219 throw (RuntimeException)
221 return m_aSeq;
225 bool XInteractionRequestImpl::approved() const
227 return p1->isSelected();
230 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */