Update ooo320-m1
[ooovba.git] / desktop / source / so_comp / oemjob.hxx
blob921a25a32cec0619c4cabe57184e821c64fc3a8a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: oemjob.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SOCOMP_OEMJOB_HXX_
32 #define _SOCOMP_OEMJOB_HXX_
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/uno/Exception.hpp>
36 #include <com/sun/star/uno/Reference.h>
37 #include <com/sun/star/lang/XComponent.hpp>
38 #include <com/sun/star/task/XJob.hpp>
39 #include <cppuhelper/implbase3.hxx>
40 #include <cppuhelper/interfacecontainer.h>
42 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
43 #include <osl/mutex.hxx>
45 using namespace ::com::sun::star::uno;
46 using namespace ::com::sun::star::lang;
47 using namespace ::com::sun::star::beans;
48 using namespace ::com::sun::star::task;
50 namespace desktop{
52 class OEMPreloadJob : public ::cppu::WeakImplHelper3< XJob, XComponent, XServiceInfo >
55 private:
56 ::osl::Mutex m_aMutex;
57 ::cppu::OInterfaceContainerHelper m_aListeners;
58 Reference< XMultiServiceFactory > m_xServiceManager;
60 sal_Bool checkOEMPreloadFlag();
61 void disableOEMPreloadFlag();
63 public:
64 OEMPreloadJob( const Reference < XMultiServiceFactory >& xFactory );
65 virtual ~OEMPreloadJob();
67 static ::rtl::OUString GetImplementationName();
68 static Sequence< rtl::OUString > GetSupportedServiceNames();
71 // XComponent
72 virtual void SAL_CALL dispose() throw ( RuntimeException );
73 virtual void SAL_CALL addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException );
74 virtual void SAL_CALL removeEventListener(const Reference< XEventListener > & aListener) throw ( RuntimeException );
76 // XServiceInfo
77 virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( RuntimeException );
78 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException );
79 virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( RuntimeException );
81 //XJob
82 virtual Any SAL_CALL execute(const Sequence<NamedValue>& args)throw ( RuntimeException );
85 static const char* interfaces[];
86 static const char* implementationName;
87 static const char* serviceName;
88 static Reference<XInterface> SAL_CALL CreateInstance(
89 const Reference< XMultiServiceFactory >&);
95 #endif // _SOCOMP_OEMJOB_HXX_