xref: /aoo4110/main/sfx2/inc/sfx2/sfxmodelfactory.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 SFX2_SFXMODELFACTORY_HXX
25 #define SFX2_SFXMODELFACTORY_HXX
26 
27 #include "sfx2/dllapi.h"
28 
29 /** === begin UNO includes === **/
30 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
32 /** === end UNO includes === **/
33 
34 //........................................................................
35 namespace sfx2
36 {
37 //........................................................................
38 
39     #define SFXMODEL_STANDARD                   (sal_uInt64)(0x0000)
40     #define SFXMODEL_EMBEDDED_OBJECT            (sal_uInt64)(0x0001)
41     #define SFXMODEL_DISABLE_EMBEDDED_SCRIPTS   (sal_uInt64)(0x0002)
42     #define SFXMODEL_DISABLE_DOCUMENT_RECOVERY  (sal_uInt64)(0x0004)
43 
44     typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ( SAL_CALL * SfxModelFactoryFunc ) (
45         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
46         const sal_uInt64 _nCreationFlags
47     );
48 
49 	//====================================================================
50 	//= createSfxModelFactory
51 	//====================================================================
52     /** creates a XSingleServiceFactory which can be used to created instances
53         of classes derived from SfxBaseModel
54 
55         In opposite to the default implementations from module cppuhelper, this
56         factory evaluates certain creation arguments (passed to createInstanceWithArguments)
57         and passes them to the factory function of the derived class.
58     */
59     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
60         SFX2_DLLPUBLIC createSfxModelFactory(
61             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,
62             const ::rtl::OUString& _rImplementationName,
63             const SfxModelFactoryFunc _pComponentFactoryFunc,
64             const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rServiceNames
65         );
66 
67 //........................................................................
68 } // namespace sfx2
69 //........................................................................
70 
71 #endif // SFX2_SFXMODELFACTORY_HXX
72