1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_extensions.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <memory> 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #include "updatecheck.hxx" 34*cdf0e10cSrcweir #include "updatecheckconfig.hxx" 35*cdf0e10cSrcweir #include "updatehdl.hxx" 36*cdf0e10cSrcweir #include "updateprotocol.hxx" 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 39*cdf0e10cSrcweir #include <cppuhelper/implementationentry.hxx> 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir #include "com/sun/star/frame/XDesktop.hpp" 42*cdf0e10cSrcweir #include "com/sun/star/frame/XTerminateListener.hpp" 43*cdf0e10cSrcweir #include <com/sun/star/task/XJob.hpp> 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir namespace beans = com::sun::star::beans ; 46*cdf0e10cSrcweir namespace frame = com::sun::star::frame ; 47*cdf0e10cSrcweir namespace lang = com::sun::star::lang ; 48*cdf0e10cSrcweir namespace task = com::sun::star::task ; 49*cdf0e10cSrcweir namespace uno = com::sun::star::uno ; 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir #define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir namespace 54*cdf0e10cSrcweir { 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir class InitUpdateCheckJobThread : public osl::Thread 57*cdf0e10cSrcweir { 58*cdf0e10cSrcweir public: 59*cdf0e10cSrcweir InitUpdateCheckJobThread( const uno::Reference< uno::XComponentContext > &xContext, 60*cdf0e10cSrcweir const uno::Sequence< beans::NamedValue > &xParameters, 61*cdf0e10cSrcweir bool bShowDialog ); 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir virtual void SAL_CALL run(); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir void setTerminating(); 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir private: 68*cdf0e10cSrcweir osl::Condition m_aCondition; 69*cdf0e10cSrcweir uno::Reference<uno::XComponentContext> m_xContext; 70*cdf0e10cSrcweir uno::Sequence<beans::NamedValue> m_xParameters; 71*cdf0e10cSrcweir bool m_bShowDialog; 72*cdf0e10cSrcweir bool m_bTerminating; 73*cdf0e10cSrcweir }; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir class UpdateCheckJob : 76*cdf0e10cSrcweir public ::cppu::WeakImplHelper3< task::XJob, lang::XServiceInfo, frame::XTerminateListener > 77*cdf0e10cSrcweir { 78*cdf0e10cSrcweir virtual ~UpdateCheckJob(); 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir public: 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir UpdateCheckJob(const uno::Reference<uno::XComponentContext>& xContext); 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir static uno::Sequence< rtl::OUString > getServiceNames(); 85*cdf0e10cSrcweir static rtl::OUString getImplName(); 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir // Allows runtime exceptions to be thrown by const methods 88*cdf0e10cSrcweir inline SAL_CALL operator uno::Reference< uno::XInterface > () const 89*cdf0e10cSrcweir { return const_cast< cppu::OWeakObject * > (static_cast< cppu::OWeakObject const * > (this)); }; 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir // XJob 92*cdf0e10cSrcweir virtual uno::Any SAL_CALL execute(const uno::Sequence<beans::NamedValue>&) 93*cdf0e10cSrcweir throw (lang::IllegalArgumentException, uno::Exception); 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir // XServiceInfo 96*cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName() 97*cdf0e10cSrcweir throw (uno::RuntimeException); 98*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & serviceName) 99*cdf0e10cSrcweir throw (uno::RuntimeException); 100*cdf0e10cSrcweir virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() 101*cdf0e10cSrcweir throw (uno::RuntimeException); 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir // XEventListener 104*cdf0e10cSrcweir virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt ) 105*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir // XTerminateListener 108*cdf0e10cSrcweir virtual void SAL_CALL queryTermination( lang::EventObject const & evt ) 109*cdf0e10cSrcweir throw ( frame::TerminationVetoException, uno::RuntimeException ); 110*cdf0e10cSrcweir virtual void SAL_CALL notifyTermination( lang::EventObject const & evt ) 111*cdf0e10cSrcweir throw ( uno::RuntimeException ); 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir private: 114*cdf0e10cSrcweir uno::Reference<uno::XComponentContext> m_xContext; 115*cdf0e10cSrcweir uno::Reference< frame::XDesktop > m_xDesktop; 116*cdf0e10cSrcweir std::auto_ptr< InitUpdateCheckJobThread > m_pInitThread; 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir void handleExtensionUpdates( const uno::Sequence< beans::NamedValue > &rListProp ); 119*cdf0e10cSrcweir }; 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir //------------------------------------------------------------------------------ 122*cdf0e10cSrcweir //------------------------------------------------------------------------------ 123*cdf0e10cSrcweir //------------------------------------------------------------------------------ 124*cdf0e10cSrcweir InitUpdateCheckJobThread::InitUpdateCheckJobThread( 125*cdf0e10cSrcweir const uno::Reference< uno::XComponentContext > &xContext, 126*cdf0e10cSrcweir const uno::Sequence< beans::NamedValue > &xParameters, 127*cdf0e10cSrcweir bool bShowDialog ) : 128*cdf0e10cSrcweir m_xContext( xContext ), 129*cdf0e10cSrcweir m_xParameters( xParameters ), 130*cdf0e10cSrcweir m_bShowDialog( bShowDialog ), 131*cdf0e10cSrcweir m_bTerminating( false ) 132*cdf0e10cSrcweir { 133*cdf0e10cSrcweir create(); 134*cdf0e10cSrcweir } 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir //------------------------------------------------------------------------------ 137*cdf0e10cSrcweir void SAL_CALL InitUpdateCheckJobThread::run() 138*cdf0e10cSrcweir { 139*cdf0e10cSrcweir if (!m_bShowDialog) { 140*cdf0e10cSrcweir TimeValue tv = { 25, 0 }; 141*cdf0e10cSrcweir m_aCondition.wait( &tv ); 142*cdf0e10cSrcweir if ( m_bTerminating ) 143*cdf0e10cSrcweir return; 144*cdf0e10cSrcweir } 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir rtl::Reference< UpdateCheck > aController( UpdateCheck::get() ); 147*cdf0e10cSrcweir aController->initialize( m_xParameters, m_xContext ); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir if ( m_bShowDialog ) 150*cdf0e10cSrcweir aController->showDialog( true ); 151*cdf0e10cSrcweir } 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir void InitUpdateCheckJobThread::setTerminating() { 154*cdf0e10cSrcweir m_bTerminating = true; 155*cdf0e10cSrcweir m_aCondition.set(); 156*cdf0e10cSrcweir } 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir //------------------------------------------------------------------------------ 159*cdf0e10cSrcweir //------------------------------------------------------------------------------ 160*cdf0e10cSrcweir //------------------------------------------------------------------------------ 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir UpdateCheckJob::UpdateCheckJob( const uno::Reference<uno::XComponentContext>& xContext ) : 163*cdf0e10cSrcweir m_xContext(xContext) 164*cdf0e10cSrcweir { 165*cdf0e10cSrcweir m_xDesktop.set( xContext->getServiceManager()->createInstanceWithContext( UNISTRING("com.sun.star.frame.Desktop"), xContext ), uno::UNO_QUERY ); 166*cdf0e10cSrcweir if ( m_xDesktop.is() ) 167*cdf0e10cSrcweir m_xDesktop->addTerminateListener( this ); 168*cdf0e10cSrcweir } 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir //------------------------------------------------------------------------------ 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir UpdateCheckJob::~UpdateCheckJob() 173*cdf0e10cSrcweir { 174*cdf0e10cSrcweir } 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir //------------------------------------------------------------------------------ 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir uno::Sequence< rtl::OUString > 179*cdf0e10cSrcweir UpdateCheckJob::getServiceNames() 180*cdf0e10cSrcweir { 181*cdf0e10cSrcweir uno::Sequence< rtl::OUString > aServiceList(1); 182*cdf0e10cSrcweir aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheck"); 183*cdf0e10cSrcweir return aServiceList; 184*cdf0e10cSrcweir }; 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir //------------------------------------------------------------------------------ 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir rtl::OUString 189*cdf0e10cSrcweir UpdateCheckJob::getImplName() 190*cdf0e10cSrcweir { 191*cdf0e10cSrcweir return UNISTRING( "vnd.sun.UpdateCheck"); 192*cdf0e10cSrcweir } 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir //------------------------------------------------------------------------------ 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir uno::Any 198*cdf0e10cSrcweir UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues) 199*cdf0e10cSrcweir throw (lang::IllegalArgumentException, uno::Exception) 200*cdf0e10cSrcweir { 201*cdf0e10cSrcweir for ( sal_Int32 n=namedValues.getLength(); n-- > 0; ) 202*cdf0e10cSrcweir { 203*cdf0e10cSrcweir if ( namedValues[ n ].Name.equalsAscii( "DynamicData" ) ) 204*cdf0e10cSrcweir { 205*cdf0e10cSrcweir uno::Sequence<beans::NamedValue> aListProp; 206*cdf0e10cSrcweir if ( namedValues[n].Value >>= aListProp ) 207*cdf0e10cSrcweir { 208*cdf0e10cSrcweir for ( sal_Int32 i=aListProp.getLength(); i-- > 0; ) 209*cdf0e10cSrcweir { 210*cdf0e10cSrcweir if ( aListProp[ i ].Name.equalsAscii( "updateList" ) ) 211*cdf0e10cSrcweir { 212*cdf0e10cSrcweir handleExtensionUpdates( aListProp ); 213*cdf0e10cSrcweir return uno::Any(); 214*cdf0e10cSrcweir } 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir } 217*cdf0e10cSrcweir } 218*cdf0e10cSrcweir } 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir uno::Sequence<beans::NamedValue> aConfig = 221*cdf0e10cSrcweir getValue< uno::Sequence<beans::NamedValue> > (namedValues, "JobConfig"); 222*cdf0e10cSrcweir 223*cdf0e10cSrcweir /* Determine the way we got invoked here - 224*cdf0e10cSrcweir * see Developers Guide Chapter "4.7.2 Jobs" to understand the magic 225*cdf0e10cSrcweir */ 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir uno::Sequence<beans::NamedValue> aEnvironment = 228*cdf0e10cSrcweir getValue< uno::Sequence<beans::NamedValue> > (namedValues, "Environment"); 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir rtl::OUString aEventName = getValue< rtl::OUString > (aEnvironment, "EventName"); 231*cdf0e10cSrcweir 232*cdf0e10cSrcweir m_pInitThread.reset( 233*cdf0e10cSrcweir new InitUpdateCheckJobThread( 234*cdf0e10cSrcweir m_xContext, aConfig, 235*cdf0e10cSrcweir !aEventName.equalsAscii("onFirstVisibleTask"))); 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir return uno::Any(); 238*cdf0e10cSrcweir } 239*cdf0e10cSrcweir 240*cdf0e10cSrcweir //------------------------------------------------------------------------------ 241*cdf0e10cSrcweir void UpdateCheckJob::handleExtensionUpdates( const uno::Sequence< beans::NamedValue > &rListProp ) 242*cdf0e10cSrcweir { 243*cdf0e10cSrcweir try { 244*cdf0e10cSrcweir uno::Sequence< uno::Sequence< rtl::OUString > > aList = 245*cdf0e10cSrcweir getValue< uno::Sequence< uno::Sequence< rtl::OUString > > > ( rListProp, "updateList" ); 246*cdf0e10cSrcweir bool bPrepareOnly = getValue< bool > ( rListProp, "prepareOnly" ); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir // we will first store any new found updates and then check, if there are any 249*cdf0e10cSrcweir // pending updates. 250*cdf0e10cSrcweir storeExtensionUpdateInfos( m_xContext, aList ); 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir if ( bPrepareOnly ) 253*cdf0e10cSrcweir return; 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir bool bHasUpdates = checkForPendingUpdates( m_xContext ); 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir rtl::Reference<UpdateCheck> aController( UpdateCheck::get() ); 258*cdf0e10cSrcweir if ( ! aController.is() ) 259*cdf0e10cSrcweir return; 260*cdf0e10cSrcweir 261*cdf0e10cSrcweir aController->setHasExtensionUpdates( bHasUpdates ); 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir if ( ! aController->hasOfficeUpdate() ) 264*cdf0e10cSrcweir { 265*cdf0e10cSrcweir if ( bHasUpdates ) 266*cdf0e10cSrcweir aController->setUIState( UPDATESTATE_EXT_UPD_AVAIL, true ); 267*cdf0e10cSrcweir else 268*cdf0e10cSrcweir aController->setUIState( UPDATESTATE_NO_UPDATE_AVAIL, true ); 269*cdf0e10cSrcweir } 270*cdf0e10cSrcweir } 271*cdf0e10cSrcweir catch( const uno::Exception& e ) 272*cdf0e10cSrcweir { 273*cdf0e10cSrcweir OSL_TRACE( "Caught exception: %s\n thread terminated.\n", 274*cdf0e10cSrcweir rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); 275*cdf0e10cSrcweir } 276*cdf0e10cSrcweir } 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir //------------------------------------------------------------------------------ 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir rtl::OUString SAL_CALL 281*cdf0e10cSrcweir UpdateCheckJob::getImplementationName() throw (uno::RuntimeException) 282*cdf0e10cSrcweir { 283*cdf0e10cSrcweir return getImplName(); 284*cdf0e10cSrcweir } 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir //------------------------------------------------------------------------------ 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir uno::Sequence< rtl::OUString > SAL_CALL 289*cdf0e10cSrcweir UpdateCheckJob::getSupportedServiceNames() throw (uno::RuntimeException) 290*cdf0e10cSrcweir { 291*cdf0e10cSrcweir return getServiceNames(); 292*cdf0e10cSrcweir } 293*cdf0e10cSrcweir 294*cdf0e10cSrcweir //------------------------------------------------------------------------------ 295*cdf0e10cSrcweir 296*cdf0e10cSrcweir sal_Bool SAL_CALL 297*cdf0e10cSrcweir UpdateCheckJob::supportsService( rtl::OUString const & serviceName ) throw (uno::RuntimeException) 298*cdf0e10cSrcweir { 299*cdf0e10cSrcweir uno::Sequence< rtl::OUString > aServiceNameList = getServiceNames(); 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ ) 302*cdf0e10cSrcweir if( aServiceNameList[n].equals(serviceName) ) 303*cdf0e10cSrcweir return sal_True; 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir return sal_False; 306*cdf0e10cSrcweir } 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir //------------------------------------------------------------------------------ 309*cdf0e10cSrcweir // XEventListener 310*cdf0e10cSrcweir void SAL_CALL UpdateCheckJob::disposing( lang::EventObject const & rEvt ) 311*cdf0e10cSrcweir throw ( uno::RuntimeException ) 312*cdf0e10cSrcweir { 313*cdf0e10cSrcweir bool shutDown = ( rEvt.Source == m_xDesktop ); 314*cdf0e10cSrcweir 315*cdf0e10cSrcweir if ( shutDown && m_xDesktop.is() ) 316*cdf0e10cSrcweir { 317*cdf0e10cSrcweir m_xDesktop->removeTerminateListener( this ); 318*cdf0e10cSrcweir m_xDesktop.clear(); 319*cdf0e10cSrcweir } 320*cdf0e10cSrcweir } 321*cdf0e10cSrcweir 322*cdf0e10cSrcweir //------------------------------------------------------------------------------ 323*cdf0e10cSrcweir // XTerminateListener 324*cdf0e10cSrcweir void SAL_CALL UpdateCheckJob::queryTermination( lang::EventObject const & ) 325*cdf0e10cSrcweir throw ( frame::TerminationVetoException, uno::RuntimeException ) 326*cdf0e10cSrcweir { 327*cdf0e10cSrcweir } 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir //------------------------------------------------------------------------------ 330*cdf0e10cSrcweir void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & ) 331*cdf0e10cSrcweir throw ( uno::RuntimeException ) 332*cdf0e10cSrcweir { 333*cdf0e10cSrcweir if ( m_pInitThread.get() != 0 ) 334*cdf0e10cSrcweir { 335*cdf0e10cSrcweir m_pInitThread->setTerminating(); 336*cdf0e10cSrcweir m_pInitThread->join(); 337*cdf0e10cSrcweir } 338*cdf0e10cSrcweir } 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir } // anonymous namespace 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir //------------------------------------------------------------------------------ 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir static uno::Reference<uno::XInterface> SAL_CALL 345*cdf0e10cSrcweir createJobInstance(const uno::Reference<uno::XComponentContext>& xContext) 346*cdf0e10cSrcweir { 347*cdf0e10cSrcweir return *new UpdateCheckJob(xContext); 348*cdf0e10cSrcweir } 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir //------------------------------------------------------------------------------ 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir static uno::Reference<uno::XInterface> SAL_CALL 353*cdf0e10cSrcweir createConfigInstance(const uno::Reference<uno::XComponentContext>& xContext) 354*cdf0e10cSrcweir { 355*cdf0e10cSrcweir return *UpdateCheckConfig::get(xContext, *UpdateCheck::get()); 356*cdf0e10cSrcweir } 357*cdf0e10cSrcweir 358*cdf0e10cSrcweir //------------------------------------------------------------------------------ 359*cdf0e10cSrcweir 360*cdf0e10cSrcweir static const cppu::ImplementationEntry kImplementations_entries[] = 361*cdf0e10cSrcweir { 362*cdf0e10cSrcweir { 363*cdf0e10cSrcweir createJobInstance, 364*cdf0e10cSrcweir UpdateCheckJob::getImplName, 365*cdf0e10cSrcweir UpdateCheckJob::getServiceNames, 366*cdf0e10cSrcweir cppu::createSingleComponentFactory, 367*cdf0e10cSrcweir NULL, 368*cdf0e10cSrcweir 0 369*cdf0e10cSrcweir }, 370*cdf0e10cSrcweir { 371*cdf0e10cSrcweir createConfigInstance, 372*cdf0e10cSrcweir UpdateCheckConfig::getImplName, 373*cdf0e10cSrcweir UpdateCheckConfig::getServiceNames, 374*cdf0e10cSrcweir cppu::createSingleComponentFactory, 375*cdf0e10cSrcweir NULL, 376*cdf0e10cSrcweir 0 377*cdf0e10cSrcweir }, 378*cdf0e10cSrcweir { NULL, NULL, NULL, NULL, NULL, 0 } 379*cdf0e10cSrcweir } ; 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir //------------------------------------------------------------------------------ 382*cdf0e10cSrcweir 383*cdf0e10cSrcweir extern "C" void SAL_CALL 384*cdf0e10cSrcweir component_getImplementationEnvironment( const sal_Char **aEnvTypeName, uno_Environment **) 385*cdf0e10cSrcweir { 386*cdf0e10cSrcweir *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; 387*cdf0e10cSrcweir } 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir //------------------------------------------------------------------------------ 390*cdf0e10cSrcweir 391*cdf0e10cSrcweir extern "C" void * 392*cdf0e10cSrcweir component_getFactory(const sal_Char *pszImplementationName, void *pServiceManager, void *pRegistryKey) 393*cdf0e10cSrcweir { 394*cdf0e10cSrcweir return cppu::component_getFactoryHelper( 395*cdf0e10cSrcweir pszImplementationName, 396*cdf0e10cSrcweir pServiceManager, 397*cdf0e10cSrcweir pRegistryKey, 398*cdf0e10cSrcweir kImplementations_entries) ; 399*cdf0e10cSrcweir } 400