1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #include "precompiled_comphelper.hxx"
30 #include "comphelper/ihwrapnofilter.hxx"
31 #include <com/sun/star/document/NoSuchFilterRequest.hpp>
33 //.........................................................................
36 //.........................................................................
38 using namespace ::com::sun::star
;
40 //----------------------------------------------------------------------------------------------------
41 OIHWrapNoFilterDialog::OIHWrapNoFilterDialog( uno::Reference
< task::XInteractionHandler
> xInteraction
)
42 :m_xInter( xInteraction
)
46 OIHWrapNoFilterDialog::~OIHWrapNoFilterDialog()
50 //----------------------------------------------------------------------------------------------------
51 uno::Sequence
< ::rtl::OUString
> SAL_CALL
OIHWrapNoFilterDialog::impl_staticGetSupportedServiceNames()
53 uno::Sequence
< ::rtl::OUString
> aRet(1);
54 aRet
[0] = ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandlerWrapper");
58 ::rtl::OUString SAL_CALL
OIHWrapNoFilterDialog::impl_staticGetImplementationName()
60 return ::rtl::OUString::createFromAscii("com.sun.star.comp.task.InteractionHandlerWrapper");
63 //----------------------------------------------------------------------------------------------------
64 // XInteractionHandler
65 //----------------------------------------------------------------------------------------------------
66 void SAL_CALL
OIHWrapNoFilterDialog::handle( const uno::Reference
< task::XInteractionRequest
>& xRequest
)
67 throw( com::sun::star::uno::RuntimeException
)
72 uno::Any aRequest
= xRequest
->getRequest();
73 document::NoSuchFilterRequest aNoSuchFilterRequest
;
74 if ( aRequest
>>= aNoSuchFilterRequest
)
77 m_xInter
->handle( xRequest
);
80 //----------------------------------------------------------------------------------------------------
82 //----------------------------------------------------------------------------------------------------
83 void SAL_CALL
OIHWrapNoFilterDialog::initialize( const uno::Sequence
< uno::Any
>& )
84 throw ( uno::Exception
,
85 uno::RuntimeException
,
86 frame::DoubleInitializationException
)
90 //----------------------------------------------------------------------------------------------------
92 //----------------------------------------------------------------------------------------------------
94 ::rtl::OUString SAL_CALL
OIHWrapNoFilterDialog::getImplementationName()
95 throw ( uno::RuntimeException
)
97 return impl_staticGetImplementationName();
100 ::sal_Bool SAL_CALL
OIHWrapNoFilterDialog::supportsService( const ::rtl::OUString
& ServiceName
)
101 throw ( uno::RuntimeException
)
103 uno::Sequence
< ::rtl::OUString
> aSeq
= impl_staticGetSupportedServiceNames();
105 for ( sal_Int32 nInd
= 0; nInd
< aSeq
.getLength(); nInd
++ )
106 if ( ServiceName
.compareTo( aSeq
[nInd
] ) == 0 )
112 uno::Sequence
< ::rtl::OUString
> SAL_CALL
OIHWrapNoFilterDialog::getSupportedServiceNames()
113 throw ( uno::RuntimeException
)
115 return impl_staticGetSupportedServiceNames();