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"
23 using namespace com::sun
;
25 UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
26 star::uno::Reference
< star::lang::XMultiServiceFactory
> const &
29 : m_xServiceFactory(rServiceFactory
),
30 m_pImpl(new UUIInteractionHelper(rServiceFactory
))
34 UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver()
39 rtl::OUString SAL_CALL
40 UUIInteractionRequestStringResolver::getImplementationName()
41 throw (star::uno::RuntimeException
)
43 return rtl::OUString::createFromAscii(m_aImplementationName
);
47 UUIInteractionRequestStringResolver::supportsService(
48 rtl::OUString
const & rServiceName
)
49 throw (star::uno::RuntimeException
)
51 star::uno::Sequence
< rtl::OUString
>
52 aNames(getSupportedServiceNames_static());
53 for (sal_Int32 i
= 0; i
< aNames
.getLength(); ++i
)
54 if (aNames
[i
] == rServiceName
)
59 star::uno::Sequence
< rtl::OUString
> SAL_CALL
60 UUIInteractionRequestStringResolver::getSupportedServiceNames()
61 throw (star::uno::RuntimeException
)
63 return getSupportedServiceNames_static();
66 star::beans::Optional
< rtl::OUString
> SAL_CALL
67 UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
68 const star::uno::Reference
<
69 star::task::XInteractionRequest
>& Request
)
70 throw (star::uno::RuntimeException
)
74 return m_pImpl
->getStringFromRequest(Request
);
76 catch (star::uno::RuntimeException
const & ex
)
78 throw star::uno::RuntimeException(ex
.Message
, *this);
82 char const UUIInteractionRequestStringResolver::m_aImplementationName
[]
83 = "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
85 star::uno::Sequence
< rtl::OUString
>
86 UUIInteractionRequestStringResolver::getSupportedServiceNames_static()
88 star::uno::Sequence
< rtl::OUString
> aNames(1);
89 aNames
[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
90 "com.sun.star.task.InteractionRequestStringResolver"));
94 star::uno::Reference
< star::uno::XInterface
> SAL_CALL
95 UUIInteractionRequestStringResolver::createInstance(
96 star::uno::Reference
< star::lang::XMultiServiceFactory
> const &
98 SAL_THROW((star::uno::Exception
))
102 return *new UUIInteractionRequestStringResolver(rServiceFactory
);
104 catch (std::bad_alloc
const &)
106 throw star::uno::RuntimeException(
107 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */