Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #include "comphelper/ihwrapnofilter.hxx"
22 : #include <cppuhelper/supportsservice.hxx>
23 : #include <com/sun/star/document/NoSuchFilterRequest.hpp>
24 :
25 :
26 : namespace comphelper
27 : {
28 :
29 :
30 : using namespace ::com::sun::star;
31 :
32 :
33 0 : OIHWrapNoFilterDialog::OIHWrapNoFilterDialog( uno::Reference< task::XInteractionHandler > xInteraction )
34 0 : :m_xInter( xInteraction )
35 : {
36 0 : }
37 :
38 0 : OIHWrapNoFilterDialog::~OIHWrapNoFilterDialog()
39 : {
40 0 : }
41 :
42 :
43 0 : uno::Sequence< OUString > SAL_CALL OIHWrapNoFilterDialog::impl_staticGetSupportedServiceNames()
44 : {
45 0 : uno::Sequence< OUString > aRet(1);
46 0 : aRet[0] = "com.sun.star.task.InteractionHandlerWrapper";
47 0 : return aRet;
48 : }
49 :
50 0 : OUString SAL_CALL OIHWrapNoFilterDialog::impl_staticGetImplementationName()
51 : {
52 0 : return OUString("com.sun.star.comp.task.InteractionHandlerWrapper");
53 : }
54 :
55 :
56 : // XInteractionHandler
57 :
58 0 : void SAL_CALL OIHWrapNoFilterDialog::handle( const uno::Reference< task::XInteractionRequest >& xRequest)
59 : throw( com::sun::star::uno::RuntimeException, std::exception )
60 : {
61 0 : if( !m_xInter.is() )
62 0 : return;
63 :
64 0 : uno::Any aRequest = xRequest->getRequest();
65 0 : document::NoSuchFilterRequest aNoSuchFilterRequest;
66 0 : if ( aRequest >>= aNoSuchFilterRequest )
67 0 : return;
68 : else
69 0 : m_xInter->handle( xRequest );
70 : }
71 :
72 :
73 : // XInteractionHandler2
74 :
75 0 : sal_Bool SAL_CALL OIHWrapNoFilterDialog::handleInteractionRequest( const uno::Reference< task::XInteractionRequest >& xRequest)
76 : throw( com::sun::star::uno::RuntimeException, std::exception )
77 : {
78 0 : if( !m_xInter.is() )
79 0 : return sal_False;
80 :
81 0 : uno::Any aRequest = xRequest->getRequest();
82 0 : document::NoSuchFilterRequest aNoSuchFilterRequest;
83 0 : if ( aRequest >>= aNoSuchFilterRequest )
84 0 : return sal_False;
85 : else
86 : {
87 0 : m_xInter->handle( xRequest );
88 0 : return sal_True;
89 0 : }
90 : }
91 :
92 : // XServiceInfo
93 0 : OUString SAL_CALL OIHWrapNoFilterDialog::getImplementationName()
94 : throw ( uno::RuntimeException, std::exception )
95 : {
96 0 : return impl_staticGetImplementationName();
97 : }
98 :
99 0 : sal_Bool SAL_CALL OIHWrapNoFilterDialog::supportsService( const OUString& ServiceName )
100 : throw ( uno::RuntimeException, std::exception )
101 : {
102 0 : return cppu::supportsService(this, ServiceName);
103 : }
104 :
105 0 : uno::Sequence< OUString > SAL_CALL OIHWrapNoFilterDialog::getSupportedServiceNames()
106 : throw ( uno::RuntimeException, std::exception )
107 : {
108 0 : return impl_staticGetSupportedServiceNames();
109 : }
110 : }
111 :
112 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|