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 #ifndef INCLUDED_SCRIPTING_SOURCE_BASPROV_BASPROV_HXX
21 #define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASPROV_HXX
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/script/XLibraryContainer.hpp>
27 #include <com/sun/star/script/browse/XBrowseNode.hpp>
28 #include <com/sun/star/script/provider/XScriptProvider.hpp>
29 #include <com/sun/star/document/XScriptInvocationContext.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <cppuhelper/implbase.hxx>
32 #include <svl/lstner.hxx>
41 // class BasicProviderImpl
44 typedef ::cppu::WeakImplHelper
<
45 css::lang::XServiceInfo
,
46 css::lang::XInitialization
,
47 css::script::provider::XScriptProvider
,
48 css::script::browse::XBrowseNode
> BasicProviderImpl_BASE
;
51 class BasicProviderImpl
: public BasicProviderImpl_BASE
, public SfxListener
54 BasicManager
* m_pAppBasicManager
;
55 BasicManager
* m_pDocBasicManager
;
56 css::uno::Reference
< css::script::XLibraryContainer
> m_xLibContainerApp
;
57 css::uno::Reference
< css::script::XLibraryContainer
> m_xLibContainerDoc
;
58 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
59 css::uno::Reference
< css::document::XScriptInvocationContext
> m_xInvocationContext
;
60 OUString m_sScriptingContext
;
61 bool m_bIsAppScriptCtx
;
65 const css::uno::Reference
< css::script::XLibraryContainer
>& rxLibContainer
,
66 const OUString
& rLibName
);
69 explicit BasicProviderImpl(
70 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
);
71 virtual ~BasicProviderImpl() override
;
74 virtual OUString SAL_CALL
getImplementationName( ) override
;
75 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
76 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
79 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
82 virtual css::uno::Reference
< css::script::provider::XScript
> SAL_CALL
getScript(
83 const OUString
& scriptURI
) override
;
86 virtual OUString SAL_CALL
getName( ) override
;
87 virtual css::uno::Sequence
< css::uno::Reference
< css::script::browse::XBrowseNode
> > SAL_CALL
getChildNodes( ) override
;
88 virtual sal_Bool SAL_CALL
hasChildNodes( ) override
;
89 virtual sal_Int16 SAL_CALL
getType( ) override
;
93 virtual void Notify(SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
97 } // namespace basprov
100 #endif // INCLUDED_SCRIPTING_SOURCE_BASPROV_BASPROV_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */