xref: /aoo41x/main/desktop/source/so_comp/oemjob.hxx (revision cdf0e10c)
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_OEMJOB_HXX_
29 #define _SOCOMP_OEMJOB_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/implbase3.hxx>
37 #include <cppuhelper/interfacecontainer.h>
38 
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 OEMPreloadJob : public ::cppu::WeakImplHelper3< XJob, XComponent, XServiceInfo >
50 {
51 
52 private:
53     ::osl::Mutex						m_aMutex;
54     ::cppu::OInterfaceContainerHelper	m_aListeners;
55     Reference< XMultiServiceFactory >	m_xServiceManager;
56 
57     sal_Bool checkOEMPreloadFlag();
58     void disableOEMPreloadFlag();
59 
60 public:
61     OEMPreloadJob( const Reference < XMultiServiceFactory >& xFactory );
62     virtual ~OEMPreloadJob();
63 
64     static ::rtl::OUString						GetImplementationName();
65     static Sequence< rtl::OUString >			GetSupportedServiceNames();
66 
67 
68 	// XComponent
69     virtual void SAL_CALL dispose() throw ( RuntimeException );
70     virtual void SAL_CALL addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException );
71     virtual void SAL_CALL removeEventListener(const Reference< XEventListener > & aListener) throw ( RuntimeException );
72 
73 	// XServiceInfo
74 	virtual ::rtl::OUString SAL_CALL	getImplementationName() throw ( RuntimeException );
75 	virtual sal_Bool SAL_CALL			supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException );
76 	virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( RuntimeException );
77 
78     //XJob
79     virtual Any SAL_CALL execute(const Sequence<NamedValue>& args)throw ( RuntimeException );
80 
81 
82     static const char* interfaces[];
83     static const char* implementationName;
84     static const char* serviceName;
85     static Reference<XInterface> SAL_CALL CreateInstance(
86         const Reference< XMultiServiceFactory >&);
87 
88 
89 };
90 }
91 
92 #endif // _SOCOMP_OEMJOB_HXX_
93