bump product version to 5.0.4.1
[LibreOffice.git] / scripting / source / basprov / basprov.hxx
blobb798d558993973a810bf8cc582453d1965fe720f
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 #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/implbase4.hxx>
33 class BasicManager;
37 namespace basprov
42 // class BasicProviderImpl
45 typedef ::cppu::WeakImplHelper4<
46 ::com::sun::star::lang::XServiceInfo,
47 ::com::sun::star::lang::XInitialization,
48 ::com::sun::star::script::provider::XScriptProvider,
49 ::com::sun::star::script::browse::XBrowseNode > BasicProviderImpl_BASE;
52 class BasicProviderImpl : public BasicProviderImpl_BASE
54 private:
55 BasicManager* m_pAppBasicManager;
56 BasicManager* m_pDocBasicManager;
57 ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer > m_xLibContainerApp;
58 ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer > m_xLibContainerDoc;
59 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
60 ::com::sun::star::uno::Reference< ::com::sun::star::document::XScriptInvocationContext > m_xInvocationContext;
61 OUString m_sScriptingContext;
62 bool m_bIsAppScriptCtx;
63 bool m_bIsUserCtx;
65 bool isLibraryShared(
66 const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& rxLibContainer,
67 const OUString& rLibName );
69 public:
70 BasicProviderImpl(
71 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
72 virtual ~BasicProviderImpl();
74 // XServiceInfo
75 virtual OUString SAL_CALL getImplementationName( )
76 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
78 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
80 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 // XInitialization
83 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
84 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 // XScriptProvider
87 virtual ::com::sun::star::uno::Reference < ::com::sun::star::script::provider::XScript > SAL_CALL getScript(
88 const OUString& scriptURI )
89 throw ( ::com::sun::star::script::provider::ScriptFrameworkErrorException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 // XBrowseNode
92 virtual OUString SAL_CALL getName( )
93 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
94 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > > SAL_CALL getChildNodes( )
95 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 virtual sal_Bool SAL_CALL hasChildNodes( )
97 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 virtual sal_Int16 SAL_CALL getType( )
99 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 } // namespace basprov
106 #endif // INCLUDED_SCRIPTING_SOURCE_BASPROV_BASPROV_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */