LibreOffice Module uui (master) 1
requeststringresolver.cxx
Go to the documentation of this file.
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
21#include "iahndl.hxx"
22#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
25
26using namespace css;
27
29 uno::Reference< uno::XComponentContext > const &
30 rxContext)
31 : m_pImpl(rxContext)
32{
33}
34
36{
37}
38
39OUString SAL_CALL
41{
42 return "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
43}
44
45sal_Bool SAL_CALL
47 OUString const & rServiceName)
48{
49 return cppu::supportsService(this, rServiceName);
50}
51
52
53uno::Sequence< OUString > SAL_CALL
55{
56 return { "com.sun.star.task.InteractionRequestStringResolver" };
57}
58
59beans::Optional< OUString > SAL_CALL
61 const uno::Reference<
62 task::XInteractionRequest >& Request )
63{
64 try
65 {
66 return m_pImpl.getStringFromRequest(Request);
67 }
68 catch (uno::RuntimeException const & ex)
69 {
70 css::uno::Any anyEx = cppu::getCaughtException();
71 throw css::lang::WrappedTargetRuntimeException( ex.Message,
72 *this, anyEx );
73 }
74}
75
76extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
78 css::uno::XComponentContext *context,
79 css::uno::Sequence<css::uno::Any> const &)
80{
81 return cppu::acquire(new UUIInteractionRequestStringResolver(context));
82}
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
css::beans::Optional< OUString > getStringFromRequest(css::uno::Reference< css::task::XInteractionRequest > const &rRequest)
Definition: iahndl.cxx:201
virtual sal_Bool SAL_CALL supportsService(OUString const &rServiceName) override
virtual css::beans::Optional< OUString > SAL_CALL getStringFromInformationalRequest(const css::uno::Reference< css::task::XInteractionRequest > &Request) override
UUIInteractionRequestStringResolver(css::uno::Reference< css::uno::XComponentContext > const &rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Any SAL_CALL getCaughtException()
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_uui_UUIInteractionRequestStringResolver_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
unsigned char sal_Bool