LibreOffice Module scripting (master) 1
MasterScriptProviderFactory.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
23
24using namespace ::com::sun::star;
25using namespace ::com::sun::star::uno;
26using namespace ::com::sun::star::script;
27
28namespace func_provider
29{
30
32 Reference< XComponentContext > const & xComponentContext )
33 : m_xComponentContext( xComponentContext )
34{
35}
36
38{
39}
40
41Reference< provider::XScriptProvider > SAL_CALL
43{
44 Reference< provider::XScriptProvider > xMsp( getActiveMSPList() ->getMSPFromAnyContext( context ), UNO_SET_THROW );
45 return xMsp;
46}
47
50{
51 if ( !m_MSPList.is() )
52 {
53 ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
54 if ( !m_MSPList.is() )
56 }
57 return m_MSPList;
58}
59
61{
62 return "com.sun.star.script.provider.MasterScriptProviderFactory";
63}
64
66{
67 return { "com.sun.star.script.provider.MasterScriptProviderFactory" };
68}
69
71 OUString const & serviceName )
72{
73 return cppu::supportsService(this, serviceName);
74}
75
76} // namespace func_provider
77
78extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
80 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
81{
82 return cppu::acquire(new func_provider::MasterScriptProviderFactory(context));
83}
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XComponentContext > m_xComponentContext
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * scripting_MasterScriptProviderFactory_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL createScriptProvider(const css::uno::Any &context) override
const css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(OUString const &serviceName) override
MasterScriptProviderFactory(css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
const rtl::Reference< ActiveMSPList > & getActiveMSPList() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool