1*89dcb3daSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*89dcb3daSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*89dcb3daSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*89dcb3daSAndrew Rist * distributed with this work for additional information 6*89dcb3daSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*89dcb3daSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*89dcb3daSAndrew Rist * "License"); you may not use this file except in compliance 9*89dcb3daSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*89dcb3daSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*89dcb3daSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*89dcb3daSAndrew Rist * software distributed under the License is distributed on an 15*89dcb3daSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*89dcb3daSAndrew Rist * KIND, either express or implied. See the License for the 17*89dcb3daSAndrew Rist * specific language governing permissions and limitations 18*89dcb3daSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*89dcb3daSAndrew Rist *************************************************************/ 21*89dcb3daSAndrew Rist 22*89dcb3daSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_xmlhelp.hxx" 26cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 27cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp> 28cdf0e10cSrcweir #include <com/sun/star/registry/XRegistryKey.hpp> 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include "provider.hxx" 31cdf0e10cSrcweir 32cdf0e10cSrcweir using namespace com::sun::star; 33cdf0e10cSrcweir 34cdf0e10cSrcweir //========================================================================= 35cdf0e10cSrcweir extern "C" void SAL_CALL component_getImplementationEnvironment( 36cdf0e10cSrcweir const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) 37cdf0e10cSrcweir { 38cdf0e10cSrcweir *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; 39cdf0e10cSrcweir } 40cdf0e10cSrcweir 41cdf0e10cSrcweir //========================================================================= 42cdf0e10cSrcweir extern "C" void * SAL_CALL component_getFactory( 43cdf0e10cSrcweir const sal_Char * pImplName, 44cdf0e10cSrcweir void * pServiceManager, 45cdf0e10cSrcweir void * /*pRegistryKey*/ ) 46cdf0e10cSrcweir { 47cdf0e10cSrcweir void * pRet = 0; 48cdf0e10cSrcweir 49cdf0e10cSrcweir uno::Reference< lang::XMultiServiceFactory > xSMgr( 50cdf0e10cSrcweir reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); 51cdf0e10cSrcweir uno::Reference< lang::XSingleServiceFactory > xFactory; 52cdf0e10cSrcweir 53cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 54cdf0e10cSrcweir // Create factory, if implementation name matches. 55cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 56cdf0e10cSrcweir 57cdf0e10cSrcweir if ( ::chelp::ContentProvider::getImplementationName_Static(). 58cdf0e10cSrcweir compareToAscii( pImplName ) == 0 ) 59cdf0e10cSrcweir { 60cdf0e10cSrcweir xFactory = ::chelp::ContentProvider::createServiceFactory( xSMgr ); 61cdf0e10cSrcweir } 62cdf0e10cSrcweir 63cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 64cdf0e10cSrcweir 65cdf0e10cSrcweir if ( xFactory.is() ) 66cdf0e10cSrcweir { 67cdf0e10cSrcweir xFactory->acquire(); 68cdf0e10cSrcweir pRet = xFactory.get(); 69cdf0e10cSrcweir } 70cdf0e10cSrcweir 71cdf0e10cSrcweir return pRet; 72cdf0e10cSrcweir } 73cdf0e10cSrcweir 74