1*6998d047SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6998d047SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6998d047SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6998d047SAndrew Rist * distributed with this work for additional information 6*6998d047SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6998d047SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6998d047SAndrew Rist * "License"); you may not use this file except in compliance 9*6998d047SAndrew Rist * with the License. You may obtain a copy of the License at 10*6998d047SAndrew Rist * 11*6998d047SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*6998d047SAndrew Rist * 13*6998d047SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6998d047SAndrew Rist * software distributed under the License is distributed on an 15*6998d047SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6998d047SAndrew Rist * KIND, either express or implied. See the License for the 17*6998d047SAndrew Rist * specific language governing permissions and limitations 18*6998d047SAndrew Rist * under the License. 19*6998d047SAndrew Rist * 20*6998d047SAndrew Rist *************************************************************/ 21*6998d047SAndrew Rist 22*6998d047SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SCRIPTING_BASPROV_HXX 25cdf0e10cSrcweir #define SCRIPTING_BASPROV_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 28cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 29cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 30cdf0e10cSrcweir #include <com/sun/star/script/XLibraryContainer.hpp> 31cdf0e10cSrcweir #include <com/sun/star/script/browse/XBrowseNode.hpp> 32cdf0e10cSrcweir #include <com/sun/star/script/provider/XScriptProvider.hpp> 33cdf0e10cSrcweir #include <com/sun/star/document/XScriptInvocationContext.hpp> 34cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 35cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir class BasicManager; 38cdf0e10cSrcweir 39cdf0e10cSrcweir 40cdf0e10cSrcweir //......................................................................... 41cdf0e10cSrcweir namespace basprov 42cdf0e10cSrcweir { 43cdf0e10cSrcweir //......................................................................... 44cdf0e10cSrcweir 45cdf0e10cSrcweir // ---------------------------------------------------- 46cdf0e10cSrcweir // class BasicProviderImpl 47cdf0e10cSrcweir // ---------------------------------------------------- 48cdf0e10cSrcweir 49cdf0e10cSrcweir typedef ::cppu::WeakImplHelper4< 50cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 51cdf0e10cSrcweir ::com::sun::star::lang::XInitialization, 52cdf0e10cSrcweir ::com::sun::star::script::provider::XScriptProvider, 53cdf0e10cSrcweir ::com::sun::star::script::browse::XBrowseNode > BasicProviderImpl_BASE; 54cdf0e10cSrcweir 55cdf0e10cSrcweir 56cdf0e10cSrcweir class BasicProviderImpl : public BasicProviderImpl_BASE 57cdf0e10cSrcweir { 58cdf0e10cSrcweir private: 59cdf0e10cSrcweir BasicManager* m_pAppBasicManager; 60cdf0e10cSrcweir BasicManager* m_pDocBasicManager; 61cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer > m_xLibContainerApp; 62cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer > m_xLibContainerDoc; 63cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 64cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::document::XScriptInvocationContext > m_xInvocationContext; 65cdf0e10cSrcweir ::rtl::OUString m_sScriptingContext; 66cdf0e10cSrcweir bool m_bIsAppScriptCtx; 67cdf0e10cSrcweir bool m_bIsUserCtx; 68cdf0e10cSrcweir ::rtl::OUString m_sCtxLocation; 69cdf0e10cSrcweir 70cdf0e10cSrcweir bool isLibraryShared( 71cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& rxLibContainer, 72cdf0e10cSrcweir const ::rtl::OUString& rLibName ); 73cdf0e10cSrcweir 74cdf0e10cSrcweir public: 75cdf0e10cSrcweir BasicProviderImpl( 76cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); 77cdf0e10cSrcweir virtual ~BasicProviderImpl(); 78cdf0e10cSrcweir 79cdf0e10cSrcweir // XServiceInfo 80cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) 81cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 82cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 83cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 85cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir 87cdf0e10cSrcweir // XInitialization 88cdf0e10cSrcweir virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) 89cdf0e10cSrcweir throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir 91cdf0e10cSrcweir // XScriptProvider 92cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference < ::com::sun::star::script::provider::XScript > SAL_CALL getScript( 93cdf0e10cSrcweir const ::rtl::OUString& scriptURI ) 94cdf0e10cSrcweir throw ( ::com::sun::star::script::provider::ScriptFrameworkErrorException, ::com::sun::star::uno::RuntimeException); 95cdf0e10cSrcweir 96cdf0e10cSrcweir // XBrowseNode 97cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getName( ) 98cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 99cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > > SAL_CALL getChildNodes( ) 100cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasChildNodes( ) 102cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 103cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getType( ) 104cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir }; 106cdf0e10cSrcweir 107cdf0e10cSrcweir //......................................................................... 108cdf0e10cSrcweir } // namespace basprov 109cdf0e10cSrcweir //......................................................................... 110cdf0e10cSrcweir 111cdf0e10cSrcweir #endif // SCRIPTING_BASPROV_HXX 112