xref: /aoo4110/main/desktop/source/so_comp/oemjob.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SOCOMP_OEMJOB_HXX_
25 #define _SOCOMP_OEMJOB_HXX_
26 
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/uno/Exception.hpp>
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/lang/XComponent.hpp>
31 #include <com/sun/star/task/XJob.hpp>
32 #include <cppuhelper/implbase3.hxx>
33 #include <cppuhelper/interfacecontainer.h>
34 
35 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
36 #include <osl/mutex.hxx>
37 
38 using namespace ::com::sun::star::uno;
39 using namespace ::com::sun::star::lang;
40 using namespace ::com::sun::star::beans;
41 using namespace ::com::sun::star::task;
42 
43 namespace desktop{
44 
45 class OEMPreloadJob : public ::cppu::WeakImplHelper3< XJob, XComponent, XServiceInfo >
46 {
47 
48 private:
49     ::osl::Mutex						m_aMutex;
50     ::cppu::OInterfaceContainerHelper	m_aListeners;
51     Reference< XMultiServiceFactory >	m_xServiceManager;
52 
53     sal_Bool checkOEMPreloadFlag();
54     void disableOEMPreloadFlag();
55 
56 public:
57     OEMPreloadJob( const Reference < XMultiServiceFactory >& xFactory );
58     virtual ~OEMPreloadJob();
59 
60     static ::rtl::OUString						GetImplementationName();
61     static Sequence< rtl::OUString >			GetSupportedServiceNames();
62 
63 
64 	// XComponent
65     virtual void SAL_CALL dispose() throw ( RuntimeException );
66     virtual void SAL_CALL addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException );
67     virtual void SAL_CALL removeEventListener(const Reference< XEventListener > & aListener) throw ( RuntimeException );
68 
69 	// XServiceInfo
70 	virtual ::rtl::OUString SAL_CALL	getImplementationName() throw ( RuntimeException );
71 	virtual sal_Bool SAL_CALL			supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException );
72 	virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( RuntimeException );
73 
74     //XJob
75     virtual Any SAL_CALL execute(const Sequence<NamedValue>& args)throw ( RuntimeException );
76 
77 
78     static const char* interfaces[];
79     static const char* implementationName;
80     static const char* serviceName;
81     static Reference<XInterface> SAL_CALL CreateInstance(
82         const Reference< XMultiServiceFactory >&);
83 
84 
85 };
86 }
87 
88 #endif // _SOCOMP_OEMJOB_HXX_
89