Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / uui / source / requeststringresolver.cxx
blob28698a1106ed42bbaef4cce5c5b274bccf5d36a4
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 com::sun;
27 UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
28 star::uno::Reference< star::uno::XComponentContext > const &
29 rxContext)
30 SAL_THROW(())
31 : m_pImpl(new UUIInteractionHelper(rxContext))
35 UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver()
37 delete m_pImpl;
40 OUString SAL_CALL
41 UUIInteractionRequestStringResolver::getImplementationName()
42 throw (star::uno::RuntimeException)
44 return OUString::createFromAscii(m_aImplementationName);
47 sal_Bool SAL_CALL
48 UUIInteractionRequestStringResolver::supportsService(
49 OUString const & rServiceName)
50 throw (star::uno::RuntimeException)
52 return cppu::supportsService(this, rServiceName);
55 star::uno::Sequence< OUString > SAL_CALL
56 UUIInteractionRequestStringResolver::getSupportedServiceNames()
57 throw (star::uno::RuntimeException)
59 return getSupportedServiceNames_static();
62 star::beans::Optional< OUString > SAL_CALL
63 UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
64 const star::uno::Reference<
65 star::task::XInteractionRequest >& Request )
66 throw (star::uno::RuntimeException)
68 try
70 return m_pImpl->getStringFromRequest(Request);
72 catch (star::uno::RuntimeException const & ex)
74 throw star::uno::RuntimeException(ex.Message, *this);
78 char const UUIInteractionRequestStringResolver::m_aImplementationName[]
79 = "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
81 star::uno::Sequence< OUString >
82 UUIInteractionRequestStringResolver::getSupportedServiceNames_static()
84 star::uno::Sequence< OUString > aNames(1);
85 aNames[0] = "com.sun.star.task.InteractionRequestStringResolver";
86 return aNames;
89 star::uno::Reference< star::uno::XInterface > SAL_CALL
90 UUIInteractionRequestStringResolver::createInstance(
91 star::uno::Reference< star::lang::XMultiServiceFactory > const &
92 rServiceFactory)
93 SAL_THROW((star::uno::Exception))
95 try
97 return *new UUIInteractionRequestStringResolver(comphelper::getComponentContext(rServiceFactory));
99 catch (std::bad_alloc const &)
101 throw star::uno::RuntimeException("out of memory", 0);
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */