bump product version to 5.0.4.1
[LibreOffice.git] / uui / source / requeststringresolver.cxx
blob48f6d6506b87c04ab08a75a93ce489548300b9f6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include "requeststringresolver.hxx"
21 #include "iahndl.hxx"
22 #include <comphelper/processfactory.hxx>
23 #include <cppuhelper/supportsservice.hxx>
25 using namespace css;
27 UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
28 uno::Reference< uno::XComponentContext > const &
29 rxContext)
30 : m_pImpl(new UUIInteractionHelper(rxContext))
34 UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver()
36 delete m_pImpl;
39 OUString SAL_CALL
40 UUIInteractionRequestStringResolver::getImplementationName()
41 throw (uno::RuntimeException, std::exception)
43 return OUString::createFromAscii(m_aImplementationName);
46 sal_Bool SAL_CALL
47 UUIInteractionRequestStringResolver::supportsService(
48 OUString const & rServiceName)
49 throw (uno::RuntimeException, std::exception)
51 return cppu::supportsService(this, rServiceName);
54 uno::Sequence< OUString > SAL_CALL
55 UUIInteractionRequestStringResolver::getSupportedServiceNames()
56 throw (uno::RuntimeException, std::exception)
58 return getSupportedServiceNames_static();
61 beans::Optional< OUString > SAL_CALL
62 UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
63 const uno::Reference<
64 task::XInteractionRequest >& Request )
65 throw (uno::RuntimeException, std::exception)
67 try
69 return m_pImpl->getStringFromRequest(Request);
71 catch (uno::RuntimeException const & ex)
73 throw uno::RuntimeException(ex.Message, *this);
77 char const UUIInteractionRequestStringResolver::m_aImplementationName[]
78 = "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
80 uno::Sequence< OUString >
81 UUIInteractionRequestStringResolver::getSupportedServiceNames_static()
83 uno::Sequence< OUString > aNames(1);
84 aNames[0] = "com.sun.star.task.InteractionRequestStringResolver";
85 return aNames;
88 uno::Reference< uno::XInterface > SAL_CALL
89 UUIInteractionRequestStringResolver::createInstance(
90 uno::Reference< lang::XMultiServiceFactory > const &
91 rServiceFactory)
93 try
95 return *new UUIInteractionRequestStringResolver(comphelper::getComponentContext(rServiceFactory));
97 catch (std::bad_alloc const &)
99 throw uno::RuntimeException("out of memory", 0);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */