1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SOCOMP_FIRSTSTART_HXX_ 29 #define _SOCOMP_FIRSTSTART_HXX_ 30 31 #include <com/sun/star/lang/XServiceInfo.hpp> 32 #include <com/sun/star/uno/Exception.hpp> 33 #include <com/sun/star/uno/Reference.h> 34 #include <com/sun/star/lang/XComponent.hpp> 35 #include <com/sun/star/task/XJob.hpp> 36 #include <cppuhelper/implbase4.hxx> 37 #include <cppuhelper/interfacecontainer.h> 38 #include <com/sun/star/task/XJobExecutor.hpp> 39 #include <com/sun/star/lang/XSingleServiceFactory.hpp> 40 #include <osl/mutex.hxx> 41 42 using namespace ::com::sun::star::uno; 43 using namespace ::com::sun::star::lang; 44 using namespace ::com::sun::star::beans; 45 using namespace ::com::sun::star::task; 46 47 namespace desktop{ 48 49 class FirstStart : public ::cppu::WeakImplHelper4< XJob, XJobExecutor, XComponent, XServiceInfo > 50 { 51 52 private: 53 ::osl::Mutex m_aMutex; 54 ::cppu::OInterfaceContainerHelper m_aListeners; 55 Reference< XMultiServiceFactory > m_xServiceManager; 56 57 public: 58 FirstStart( const Reference < XMultiServiceFactory >& xFactory ); 59 virtual ~FirstStart(); 60 61 static ::rtl::OUString GetImplementationName(); 62 static Sequence< rtl::OUString > GetSupportedServiceNames(); 63 64 65 // XComponent 66 virtual void SAL_CALL dispose() throw ( RuntimeException ); 67 virtual void SAL_CALL addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException ); 68 virtual void SAL_CALL removeEventListener(const Reference< XEventListener > & aListener) throw ( RuntimeException ); 69 70 // XServiceInfo 71 virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( RuntimeException ); 72 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException ); 73 virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( RuntimeException ); 74 75 //XJob 76 virtual Any SAL_CALL execute(const Sequence<NamedValue>& args)throw ( RuntimeException ); 77 //XJobExecutor 78 virtual void SAL_CALL trigger(const rtl::OUString& arg)throw ( RuntimeException ); 79 80 static const char* interfaces[]; 81 static const char* implementationName; 82 static const char* serviceName; 83 static Reference<XInterface> SAL_CALL CreateInstance( 84 const Reference< XMultiServiceFactory >&); 85 86 87 }; 88 } 89 90 #endif // _SOCOMP_FIRSTSTART_HXX_ 91