diff -urNpw @comphelper/inc/comphelper/InteractionHandlerWrapper.hxx comphelper/inc/comphelper/InteractionHandlerWrapper.hxx --- @comphelper/inc/comphelper/InteractionHandlerWrapper.hxx 1970-01-01 08:00:00.000000000 +0800 +++ comphelper/inc/comphelper/InteractionHandlerWrapper.hxx 2007-12-06 10:02:08.000000000 +0800 @@ -0,0 +1,110 @@ +/************************************************************************* +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: accessiblewrapper.hxx,v $ +* +* $Revision: 1.10 $ +* +* last change: $Author: hr $ $Date: 2006/06/19 22:41:57 $ +* +* 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 +* +************************************************************************/ + +#ifndef _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_ +#define _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_ + +#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_ +#include +#endif +#ifndef _COM_SUN_STAR_TASK_XINTERACITONREQUEST_ +#include +#endif +#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_ +#include +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_ +#include +#endif +#ifndef _COM_SUN_STAR_FRAME_DOUBLEINITIALIZATIONEXCEPTION_ +#include +#endif + +#ifndef _CPPUHELPER_IMPLBASE3_HXX_ +#include +#endif +#ifndef INCLUDED_COMPHELPERDLLAPI_H +#include "comphelper/comphelperdllapi.h" +#endif + +namespace comphelper { + + class COMPHELPER_DLLPUBLIC OInteractionHandlerWrapper : public ::cppu::WeakImplHelper3 + < ::com::sun::star::task::XInteractionHandler + , ::com::sun::star::lang::XInitialization + , ::com::sun::star::lang::XServiceInfo > + { + com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > m_xInter; + + public: + OInteractionHandlerWrapper( com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > xInteraction ); + ~OInteractionHandlerWrapper(); + + static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames(); + + + //____________________________________________________________________________________________________ + // XInteractionHandler + //____________________________________________________________________________________________________ + + virtual void SAL_CALL handle( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest >& xRequest) + throw( com::sun::star::uno::RuntimeException ); + + //____________________________________________________________________________________________________ + // XInitialization + //____________________________________________________________________________________________________ + + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw ( ::com::sun::star::uno::Exception, + ::com::sun::star::uno::RuntimeException, + ::com::sun::star::frame::DoubleInitializationException ) ; + + //____________________________________________________________________________________________________ + // XServiceInfo + //____________________________________________________________________________________________________ + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + + virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw ( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw ( ::com::sun::star::uno::RuntimeException ); + + }; +} +#endif diff -urNpw @comphelper/source/misc/InteractionHandlerWrapper.cxx comphelper/source/misc/InteractionHandlerWrapper.cxx --- @comphelper/source/misc/InteractionHandlerWrapper.cxx 1970-01-01 08:00:00.000000000 +0800 +++ comphelper/source/misc/InteractionHandlerWrapper.cxx 2007-12-06 10:02:26.000000000 +0800 @@ -0,0 +1,129 @@ +/************************************************************************* +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: accessiblewrapper.hxx,v $ +* +* $Revision: 1.10 $ +* +* last change: $Author: hr $ $Date: 2006/06/19 22:41:57 $ +* +* 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 +* +************************************************************************/ + +#include "precompiled_comphelper.hxx" + +#ifndef _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_ +#include "comphelper/InteractionHandlerWrapper.hxx" +#endif + +#ifndef _COM_SUN_STAR_DOCUMENT_NOSUCHFILTERREQUEST_ +#include +#endif + +//......................................................................... +namespace comphelper +{ +//......................................................................... + + using namespace ::com::sun::star; + + //---------------------------------------------------------------------------------------------------- + OInteractionHandlerWrapper::OInteractionHandlerWrapper( uno::Reference< task::XInteractionHandler > xInteraction ) + :m_xInter( xInteraction ) + { + } + + OInteractionHandlerWrapper::~OInteractionHandlerWrapper() + { + } + + //---------------------------------------------------------------------------------------------------- + uno::Sequence< ::rtl::OUString > SAL_CALL OInteractionHandlerWrapper::impl_staticGetSupportedServiceNames() + { + uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandlerWrapper"); + return aRet; + } + + ::rtl::OUString SAL_CALL OInteractionHandlerWrapper::impl_staticGetImplementationName() + { + return ::rtl::OUString::createFromAscii("com.sun.star.comp.task.InteractionHandlerWrapper"); + } + + //---------------------------------------------------------------------------------------------------- + // XInteractionHandler + //---------------------------------------------------------------------------------------------------- + void SAL_CALL OInteractionHandlerWrapper::handle( const uno::Reference< task::XInteractionRequest >& xRequest) + { + if( !m_xInter.is() ) + return; + + uno::Any aRequest = xRequest->getRequest(); + document::NoSuchFilterRequest aNoSuchFilterRequest; + if ( aRequest >>= aNoSuchFilterRequest ) + return; + else + m_xInter->handle( xRequest ); + } + + //---------------------------------------------------------------------------------------------------- + // XInitialization + //---------------------------------------------------------------------------------------------------- + void SAL_CALL OInteractionHandlerWrapper::initialize( const uno::Sequence< uno::Any >& aArguments ) + throw ( uno::Exception, + uno::RuntimeException, + frame::DoubleInitializationException ) + { + } + + //---------------------------------------------------------------------------------------------------- + // XServiceInfo + //---------------------------------------------------------------------------------------------------- + + ::rtl::OUString SAL_CALL OInteractionHandlerWrapper::getImplementationName() + throw ( uno::RuntimeException ) + { + return impl_staticGetImplementationName(); + } + + ::sal_Bool SAL_CALL OInteractionHandlerWrapper::supportsService( const ::rtl::OUString& ServiceName ) + throw ( uno::RuntimeException ) + { + uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames(); + + for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) + if ( ServiceName.compareTo( aSeq[nInd] ) == 0 ) + return sal_True; + + return sal_False; + } + + uno::Sequence< ::rtl::OUString > SAL_CALL OInteractionHandlerWrapper::getSupportedServiceNames() + throw ( uno::RuntimeException ) + { + return impl_staticGetSupportedServiceNames(); + } +} diff -urNpw @comphelper/source/misc/makefile.mk comphelper/source/misc/makefile.mk --- @comphelper/source/misc/makefile.mk 2007-07-06 18:25:04.000000000 +0800 +++ comphelper/source/misc/makefile.mk 2007-11-26 15:21:54.000000000 +0800 @@ -83,7 +83,8 @@ SLOFILES= \ $(SLO)$/officeresourcebundle.obj \ $(SLO)$/SelectionMultiplex.obj \ $(SLO)$/namedvaluecollection.obj \ - $(SLO)$/logging.obj + $(SLO)$/logging.obj \ + $(SLO)$/InteractionHandlerWrapper.obj # --- Targets ----------------------------------