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 .
20 #include "requeststringresolver.hxx"
22 #include <comphelper/processfactory.hxx>
23 #include <cppuhelper/supportsservice.hxx>
27 UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
28 uno::Reference
< uno::XComponentContext
> const &
30 : m_pImpl(new UUIInteractionHelper(rxContext
))
34 UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver()
40 UUIInteractionRequestStringResolver::getImplementationName()
41 throw (uno::RuntimeException
, std::exception
)
43 return OUString::createFromAscii(m_aImplementationName
);
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(
64 task::XInteractionRequest
>& Request
)
65 throw (uno::RuntimeException
, std::exception
)
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";
88 uno::Reference
< uno::XInterface
> SAL_CALL
89 UUIInteractionRequestStringResolver::createInstance(
90 uno::Reference
< lang::XMultiServiceFactory
> const &
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: */