1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: requeststringresolver.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "requeststringresolver.hxx"
34 using namespace com::sun
;
36 UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
37 star::uno::Reference
< star::lang::XMultiServiceFactory
> const &
40 : m_xServiceFactory(rServiceFactory
),
41 m_pImpl(new UUIInteractionHelper(rServiceFactory
))
45 UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver()
50 rtl::OUString SAL_CALL
51 UUIInteractionRequestStringResolver::getImplementationName()
52 throw (star::uno::RuntimeException
)
54 return rtl::OUString::createFromAscii(m_aImplementationName
);
58 UUIInteractionRequestStringResolver::supportsService(
59 rtl::OUString
const & rServiceName
)
60 throw (star::uno::RuntimeException
)
62 star::uno::Sequence
< rtl::OUString
>
63 aNames(getSupportedServiceNames_static());
64 for (sal_Int32 i
= 0; i
< aNames
.getLength(); ++i
)
65 if (aNames
[i
] == rServiceName
)
70 star::uno::Sequence
< rtl::OUString
> SAL_CALL
71 UUIInteractionRequestStringResolver::getSupportedServiceNames()
72 throw (star::uno::RuntimeException
)
74 return getSupportedServiceNames_static();
77 star::beans::Optional
< rtl::OUString
> SAL_CALL
78 UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
79 const star::uno::Reference
<
80 star::task::XInteractionRequest
>& Request
)
81 throw (star::uno::RuntimeException
)
85 return m_pImpl
->getStringFromRequest(Request
);
87 catch (star::uno::RuntimeException
const & ex
)
89 throw star::uno::RuntimeException(ex
.Message
, *this);
93 char const UUIInteractionRequestStringResolver::m_aImplementationName
[]
94 = "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
96 star::uno::Sequence
< rtl::OUString
>
97 UUIInteractionRequestStringResolver::getSupportedServiceNames_static()
99 star::uno::Sequence
< rtl::OUString
> aNames(1);
100 aNames
[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
101 "com.sun.star.task.InteractionRequestStringResolver"));
105 star::uno::Reference
< star::uno::XInterface
> SAL_CALL
106 UUIInteractionRequestStringResolver::createInstance(
107 star::uno::Reference
< star::lang::XMultiServiceFactory
> const &
109 SAL_THROW((star::uno::Exception
))
113 return *new UUIInteractionRequestStringResolver(rServiceFactory
);
115 catch (std::bad_alloc
const &)
117 throw star::uno::RuntimeException(
118 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),