/************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ftpintreq.cxx,v $ * * $Revision: 1.4 $ * * last change: $Author: obo $ $Date: 2006-09-17 13:51:29 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * * * GNU Lesser General Public License Version 2.1 * ============================================= * Copyright 2005 by Sun Microsystems, Inc. * 901 San Antonio Road, Palo Alto, CA 94303, USA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" #include #include #include "ftpintreq.hxx" using namespace cppu; using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::ucb; using namespace com::sun::star::task; using namespace ftp; XInteractionApproveImpl::XInteractionApproveImpl() : m_bSelected(false) { } void SAL_CALL XInteractionApproveImpl::acquire( void ) throw() { OWeakObject::acquire(); } void SAL_CALL XInteractionApproveImpl::release( void ) throw() { OWeakObject::release(); } Any SAL_CALL XInteractionApproveImpl::queryInterface( const Type& rType ) throw( RuntimeException ) { Any aRet = cppu::queryInterface( rType, SAL_STATIC_CAST( lang::XTypeProvider*, this ), SAL_STATIC_CAST( XInteractionApprove*,this) ); return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); } ////////////////////////////////////////////////////////////////////////////// // XTypeProvider ////////////////////////////////////////////////////////////////////////////// XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl, XTypeProvider, XInteractionApprove ) void SAL_CALL XInteractionApproveImpl::select() throw (RuntimeException) { m_bSelected = true; } bool XInteractionApproveImpl::isSelected() const { return m_bSelected; } // XInteractionDisapproveImpl XInteractionDisapproveImpl::XInteractionDisapproveImpl() : m_bSelected(false) { } void SAL_CALL XInteractionDisapproveImpl::acquire( void ) throw() { OWeakObject::acquire(); } void SAL_CALL XInteractionDisapproveImpl::release( void ) throw() { OWeakObject::release(); } Any SAL_CALL XInteractionDisapproveImpl::queryInterface( const Type& rType ) throw( RuntimeException ) { Any aRet = cppu::queryInterface( rType, SAL_STATIC_CAST( lang::XTypeProvider*, this ), SAL_STATIC_CAST( XInteractionDisapprove*,this) ); return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); } ////////////////////////////////////////////////////////////////////////////// // XTypeProvider ////////////////////////////////////////////////////////////////////////////// XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl, XTypeProvider, XInteractionDisapprove ) void SAL_CALL XInteractionDisapproveImpl::select() throw (RuntimeException) { m_bSelected = true; } bool XInteractionDisapproveImpl::isSelected() const { return m_bSelected; } // XInteractionRequestImpl XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName) : p1( new XInteractionApproveImpl ), p2( new XInteractionDisapproveImpl ), m_aName(aName), m_aSeq( 2 ) { m_aSeq[0] = Reference(p1); m_aSeq[1] = Reference(p2); } void SAL_CALL XInteractionRequestImpl::acquire( void ) throw() { OWeakObject::acquire(); } void SAL_CALL XInteractionRequestImpl::release( void ) throw() { OWeakObject::release(); } Any SAL_CALL XInteractionRequestImpl::queryInterface( const Type& rType ) throw( RuntimeException ) { Any aRet = cppu::queryInterface( rType, SAL_STATIC_CAST( lang::XTypeProvider*, this ), SAL_STATIC_CAST( XInteractionRequest*,this) ); return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); } ////////////////////////////////////////////////////////////////////////////// // XTypeProvider ///////////////////////////////////////////////////////////////////////////// XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl, XTypeProvider, XInteractionRequest ) Any SAL_CALL XInteractionRequestImpl::getRequest( ) throw (RuntimeException) { Any aAny; UnsupportedNameClashException excep; excep.NameClash = NameClash::ERROR; aAny <<= excep; return aAny; } Sequence > SAL_CALL XInteractionRequestImpl::getContinuations( ) throw (RuntimeException) { return m_aSeq; } bool XInteractionRequestImpl::aborted() const { return p2->isSelected(); } bool XInteractionRequestImpl::approved() const { return p1->isSelected(); }