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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 
26 
27 #ifndef EXTENSIONS_OOOIMPROVEMENT_INVITEJOB_HXX
28 #define EXTENSIONS_OOOIMPROVEMENT_INVITEJOB_HXX
29 
30 #include <com/sun/star/task/XAsyncJob.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <cppuhelper/implbase2.hxx>
34 
35 
36 namespace oooimprovement
37 {
38     #ifdef css
39         #error css defined globally
40     #endif
41     #define css ::com::sun::star
42     class InviteJob : public ::cppu::WeakImplHelper2<
43         css::task::XAsyncJob,
44         css::lang::XServiceInfo>
45     {
46         public:
47             // XServiceInfo - static version
48             static ::rtl::OUString SAL_CALL getImplementationName_static();
49             static css::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames_static();
50             //static css::uno::Reference< css::uno::XInterface> SAL_CALL Create(
51             //    const css::uno::Reference< css::uno::XComponentContext>& context);
52 
53             static css::uno::Reference< css::uno::XInterface> SAL_CALL Create(const css::uno::Reference< css::lang::XMultiServiceFactory>& sm);
54 
55         protected:
56             InviteJob(const css::uno::Reference< css::uno::XComponentContext>& context);
57             InviteJob(const css::uno::Reference< css::lang::XMultiServiceFactory>& sf);
58             virtual ~InviteJob();
59 
60             // XAsyncJob
61             virtual void SAL_CALL executeAsync(
62                 const css::uno::Sequence< css::beans::NamedValue>& args,
63                 const css::uno::Reference< css::task::XJobListener>& listener)
64                 throw(css::uno::RuntimeException);
65 
66             // XServiceInfo
67             virtual ::rtl::OUString SAL_CALL getImplementationName()
68                 throw(css::uno::RuntimeException);
69             virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& service_name)
70                 throw(css::uno::RuntimeException);
71             virtual css::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames()
72                 throw(css::uno::RuntimeException);
73 
74         private:
75             css::uno::Reference< css::lang::XMultiServiceFactory> m_ServiceFactory;
76     };
77     #undef css
78 }
79 #endif
80