xref: /AOO41X/main/cppuhelper/inc/cppuhelper/servicefactory.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _CPPUHELPER_SERVICEFACTORY_HXX_
28 #define _CPPUHELPER_SERVICEFACTORY_HXX_
29 
30 #include <rtl/ustring.hxx>
31 
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
34 
35 
36 namespace cppu
37 {
38 
39 /** Deprecated.  Use cppuhelper/bootstrap.hxx functions instead.
40 
41     This bootstraps an initial service factory working on a registry. If the first or both
42     parameters contain a value then the service factory is initialized with a simple registry
43     or a nested registry. Otherwise the service factory must be initialized later with a valid
44     registry.
45 
46     @param rWriteRegistryFile
47 	file name of the simple registry or the first registry file of
48     the nested registry which will be opened with read/write rights. This
49     file will be created if necessary.
50     @param rReadRegistryFile
51     file name of the second registry file of the nested registry
52     which will be opened with readonly rights.
53     @param bReadOnly
54     flag which specify that the first registry file will be opened with
55     readonly rights. Default is FALSE. If this flag is used the registry
56     will not be created if not exist.
57     @param rBootstrapPath
58     specifies a path where the bootstrap components could be find. If this
59     parameter is an empty string the compoents will be searched in the system
60     path.
61     @deprecated
62 */
63 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > SAL_CALL
64 createRegistryServiceFactory(
65 	const ::rtl::OUString & rWriteRegistryFile,
66 	const ::rtl::OUString & rReadRegistryFile,
67 	sal_Bool bReadOnly = sal_False,
68 	const ::rtl::OUString & rBootstrapPath = ::rtl::OUString() )
69 	SAL_THROW( (::com::sun::star::uno::Exception) );
70 
71 
72 /** Deprecated.  Use cppuhelper/bootstrap.hxx functions instead.
73 
74     This bootstraps an initial service factory working on a registry file.
75 
76     @param rRegistryFile
77     file name of the registry to use/ create; if this is an empty
78     string, the default registry is used instead
79     @param bReadOnly
80     flag which specify that the registry file will be opened with
81     readonly rights. Default is FALSE. If this flag is used the registry
82     will not be created if not exist.
83     @param rBootstrapPath
84     specifies a path where the bootstrap components could be find. If this
85     parameter is an empty string the compoents will be searched in the system
86     path.
87     @deprecated
88 */
89 inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > SAL_CALL
90 createRegistryServiceFactory(
91 	const ::rtl::OUString & rRegistryFile,
92 	sal_Bool bReadOnly = sal_False,
93 	const ::rtl::OUString & rBootstrapPath = ::rtl::OUString() )
94 	SAL_THROW( (::com::sun::star::uno::Exception) )
95 {
96 	return ::cppu::createRegistryServiceFactory(
97         rRegistryFile, ::rtl::OUString(), bReadOnly, rBootstrapPath );
98 }
99 
100 /** Deprecated.  Use cppuhelper/bootstrap.hxx functions instead.
101 
102     This bootstraps a service factory without initialize a registry.
103 
104     @param rBootstrapPath
105     specifies a path where the bootstrap components could be find. If this
106     parameter is an empty string the compoents will be searched in the system
107     path.
108     @deprecated
109 */
110 inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > SAL_CALL
111 createServiceFactory(
112 	const ::rtl::OUString & rBootstrapPath = ::rtl::OUString() )
113 	SAL_THROW( (::com::sun::star::uno::Exception) )
114 {
115 	return ::cppu::createRegistryServiceFactory(
116         ::rtl::OUString(), ::rtl::OUString(), sal_False, rBootstrapPath );
117 }
118 
119 } // end namespace cppu
120 
121 #endif
122 
123