1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "comphelper/ihwrapnofilter.hxx"
22 #include <com/sun/star/document/NoSuchFilterRequest.hpp>
24 //.........................................................................
27 //.........................................................................
29 using namespace ::com::sun::star
;
31 //----------------------------------------------------------------------------------------------------
32 OIHWrapNoFilterDialog::OIHWrapNoFilterDialog( uno::Reference
< task::XInteractionHandler
> xInteraction
)
33 :m_xInter( xInteraction
)
37 OIHWrapNoFilterDialog::~OIHWrapNoFilterDialog()
41 //----------------------------------------------------------------------------------------------------
42 uno::Sequence
< OUString
> SAL_CALL
OIHWrapNoFilterDialog::impl_staticGetSupportedServiceNames()
44 uno::Sequence
< OUString
> aRet(1);
45 aRet
[0] = "com.sun.star.task.InteractionHandlerWrapper";
49 OUString SAL_CALL
OIHWrapNoFilterDialog::impl_staticGetImplementationName()
51 return OUString("com.sun.star.comp.task.InteractionHandlerWrapper");
54 //----------------------------------------------------------------------------------------------------
55 // XInteractionHandler
56 //----------------------------------------------------------------------------------------------------
57 void SAL_CALL
OIHWrapNoFilterDialog::handle( const uno::Reference
< task::XInteractionRequest
>& xRequest
)
58 throw( com::sun::star::uno::RuntimeException
)
63 uno::Any aRequest
= xRequest
->getRequest();
64 document::NoSuchFilterRequest aNoSuchFilterRequest
;
65 if ( aRequest
>>= aNoSuchFilterRequest
)
68 m_xInter
->handle( xRequest
);
71 //----------------------------------------------------------------------------------------------------
72 // XInteractionHandler2
73 //----------------------------------------------------------------------------------------------------
74 sal_Bool SAL_CALL
OIHWrapNoFilterDialog::handleInteractionRequest( const uno::Reference
< task::XInteractionRequest
>& xRequest
)
75 throw( com::sun::star::uno::RuntimeException
)
80 uno::Any aRequest
= xRequest
->getRequest();
81 document::NoSuchFilterRequest aNoSuchFilterRequest
;
82 if ( aRequest
>>= aNoSuchFilterRequest
)
86 m_xInter
->handle( xRequest
);
91 //----------------------------------------------------------------------------------------------------
93 //----------------------------------------------------------------------------------------------------
94 void SAL_CALL
OIHWrapNoFilterDialog::initialize( const uno::Sequence
< uno::Any
>& )
95 throw ( uno::Exception
,
96 uno::RuntimeException
,
97 frame::DoubleInitializationException
)
101 //----------------------------------------------------------------------------------------------------
103 //----------------------------------------------------------------------------------------------------
105 OUString SAL_CALL
OIHWrapNoFilterDialog::getImplementationName()
106 throw ( uno::RuntimeException
)
108 return impl_staticGetImplementationName();
111 ::sal_Bool SAL_CALL
OIHWrapNoFilterDialog::supportsService( const OUString
& ServiceName
)
112 throw ( uno::RuntimeException
)
114 uno::Sequence
< OUString
> aSeq
= impl_staticGetSupportedServiceNames();
116 for ( sal_Int32 nInd
= 0; nInd
< aSeq
.getLength(); nInd
++ )
117 if ( ServiceName
== aSeq
[nInd
] )
123 uno::Sequence
< OUString
> SAL_CALL
OIHWrapNoFilterDialog::getSupportedServiceNames()
124 throw ( uno::RuntimeException
)
126 return impl_staticGetSupportedServiceNames();
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */