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 INCLUDED_TDOC_DOCUMENTCONTENTFACTORY_HXX
25 #define INCLUDED_TDOC_DOCUMENTCONTENTFACTORY_HXX
26 
27 #include "com/sun/star/lang/XServiceInfo.hpp"
28 #include "com/sun/star/lang/XSingleServiceFactory.hpp"
29 #include "com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp"
30 
31 #include "cppuhelper/implbase2.hxx"
32 
33 namespace tdoc_ucp {
34 
35 class DocumentContentFactory :
36         public cppu::WeakImplHelper2<
37             com::sun::star::frame::XTransientDocumentsDocumentContentFactory,
38             com::sun::star::lang::XServiceInfo >
39 {
40 public:
41     DocumentContentFactory( const com::sun::star::uno::Reference<
42                         com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
43     virtual ~DocumentContentFactory();
44 
45     // XServiceInfo
46     virtual ::rtl::OUString SAL_CALL getImplementationName()
47         throw ( com::sun::star::uno::RuntimeException );
48 
49     virtual sal_Bool SAL_CALL
50     supportsService( const ::rtl::OUString& ServiceName )
51         throw ( com::sun::star::uno::RuntimeException );
52 
53     virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
54     getSupportedServiceNames()
55         throw ( com::sun::star::uno::RuntimeException );
56 
57     // XTransientDocumentsDocumentContentFactory
58     virtual com::sun::star::uno::Reference<
59         com::sun::star::ucb::XContent > SAL_CALL
60     createDocumentContent( const ::com::sun::star::uno::Reference<
61                                 com::sun::star::frame::XModel >& Model )
62         throw ( com::sun::star::lang::IllegalArgumentException,
63                 com::sun::star::uno::RuntimeException );
64 
65     // Non-UNO interfaces
66     static rtl::OUString
67     getImplementationName_Static();
68     static com::sun::star::uno::Sequence< rtl::OUString >
69     getSupportedServiceNames_Static();
70 
71     static com::sun::star::uno::Reference<
72             com::sun::star::lang::XSingleServiceFactory >
73     createServiceFactory( const com::sun::star::uno::Reference<
74             com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr );
75 private:
76     com::sun::star::uno::Reference<
77         com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
78 };
79 
80 } // namespace tdoc_ucp
81 
82 #endif /* !INCLUDED_TDOC_DOCUMENTCONTENTFACTORY_HXX */
83