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_FIRSTSTART_HXX_
25 #define _SOCOMP_FIRSTSTART_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/implbase4.hxx>
33 #include <cppuhelper/interfacecontainer.h>
34 #include <com/sun/star/task/XJobExecutor.hpp>
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 FirstStart : public ::cppu::WeakImplHelper4< XJob, XJobExecutor, XComponent, XServiceInfo >
46 {
47 
48 private:
49     ::osl::Mutex						m_aMutex;
50     ::cppu::OInterfaceContainerHelper	m_aListeners;
51     Reference< XMultiServiceFactory >	m_xServiceManager;
52 
53 public:
54     FirstStart( const Reference < XMultiServiceFactory >& xFactory );
55     virtual ~FirstStart();
56 
57     static ::rtl::OUString						GetImplementationName();
58     static Sequence< rtl::OUString >			GetSupportedServiceNames();
59 
60 
61 	// XComponent
62     virtual void SAL_CALL dispose() throw ( RuntimeException );
63     virtual void SAL_CALL addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException );
64     virtual void SAL_CALL removeEventListener(const Reference< XEventListener > & aListener) throw ( RuntimeException );
65 
66 	// XServiceInfo
67 	virtual ::rtl::OUString SAL_CALL	getImplementationName() throw ( RuntimeException );
68 	virtual sal_Bool SAL_CALL			supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException );
69 	virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( RuntimeException );
70 
71     //XJob
72     virtual Any SAL_CALL execute(const Sequence<NamedValue>& args)throw ( RuntimeException );
73     //XJobExecutor
74     virtual void SAL_CALL trigger(const rtl::OUString& arg)throw ( RuntimeException );
75 
76     static const char* interfaces[];
77     static const char* implementationName;
78     static const char* serviceName;
79     static Reference<XInterface> SAL_CALL CreateInstance(
80         const Reference< XMultiServiceFactory >&);
81 
82 
83 };
84 }
85 
86 #endif // _SOCOMP_FIRSTSTART_HXX_
87