bump product version to 4.1.6.2
[LibreOffice.git] / xmloff / source / core / facreg.cxx
blob1b7e60196768155c2243717d9eb82f884c504133
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "sal/config.h"
23 #include "xmloff/dllapi.h"
25 #include <string.h>
26 #include <com/sun/star/container/XSet.hpp>
27 #include <com/sun/star/registry/XRegistryKey.hpp>
28 #include <osl/diagnose.h>
30 #include <cppuhelper/factory.hxx>
31 #include <uno/lbnames.h>
32 #include "xmloff/xmlreg.hxx"
34 using namespace com::sun::star;
37 #define SERVICE( className ) \
38 extern OUString SAL_CALL className##_getImplementationName() throw(); \
39 extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\
40 extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \
41 const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) \
42 throw( uno::Exception )
44 // impress oasis import
45 SERVICE( XMLImpressImportOasis );
46 SERVICE( XMLImpressStylesImportOasis );
47 SERVICE( XMLImpressContentImportOasis );
48 SERVICE( XMLImpressMetaImportOasis );
49 SERVICE( XMLImpressSettingsImportOasis );
51 // impress oasis export
52 SERVICE( XMLImpressExportOasis );
53 SERVICE( XMLImpressStylesExportOasis );
54 SERVICE( XMLImpressContentExportOasis );
55 SERVICE( XMLImpressMetaExportOasis );
56 SERVICE( XMLImpressSettingsExportOasis );
58 // impress OOo import
60 // impress OOo export
61 SERVICE( XMLImpressExportOOO );
62 SERVICE( XMLImpressStylesExportOOO );
63 SERVICE( XMLImpressContentExportOOO );
64 SERVICE( XMLImpressMetaExportOOO );
65 SERVICE( XMLImpressSettingsExportOOO );
67 // draw oasis import
68 SERVICE( XMLDrawImportOasis );
69 SERVICE( XMLDrawStylesImportOasis );
70 SERVICE( XMLDrawContentImportOasis );
71 SERVICE( XMLDrawMetaImportOasis );
72 SERVICE( XMLDrawSettingsImportOasis );
74 // draw oasis export
75 SERVICE( XMLDrawExportOasis );
76 SERVICE( XMLDrawStylesExportOasis );
77 SERVICE( XMLDrawContentExportOasis );
78 SERVICE( XMLDrawMetaExportOasis );
79 SERVICE( XMLDrawSettingsExportOasis );
81 // draw OOo import
83 // draw OOo export
84 SERVICE( XMLDrawExportOOO );
85 SERVICE( XMLDrawStylesExportOOO );
86 SERVICE( XMLDrawContentExportOOO );
87 SERVICE( XMLDrawMetaExportOOO );
88 SERVICE( XMLDrawSettingsExportOOO );
90 // impress animation import
91 SERVICE( AnimationsImport );
93 // drawing layer export
94 SERVICE( XMLDrawingLayerExport );
96 // impress xml clipboard export
97 SERVICE( XMLImpressClipboardExport );
99 // chart oasis import
100 SERVICE( SchXMLImport );
101 SERVICE( SchXMLImport_Meta );
102 SERVICE( SchXMLImport_Styles );
103 SERVICE( SchXMLImport_Content );
105 // chart oasis export
106 SERVICE( SchXMLExport_Oasis );
107 SERVICE( SchXMLExport_Oasis_Meta );
108 SERVICE( SchXMLExport_Oasis_Styles );
109 SERVICE( SchXMLExport_Oasis_Content );
111 // chart OOo import
113 // chart OOo export
114 SERVICE( SchXMLExport );
115 SERVICE( SchXMLExport_Styles );
116 SERVICE( SchXMLExport_Content );
118 // version list import/export
119 SERVICE( XMLVersionListPersistence );
121 // meta export
122 SERVICE( XMLMetaExportComponent );
124 // meta import
125 SERVICE( XMLMetaImportComponent );
127 // meta export OOo
128 SERVICE( XMLMetaExportOOO );
130 // writer autotext event export
131 SERVICE( XMLAutoTextEventExport );
133 // writer autotext event import
134 SERVICE( XMLAutoTextEventImport );
136 // writer autotext event export OOo
137 SERVICE( XMLAutoTextEventExportOOO );
139 // writer autotext event import OOo
140 SERVICE( XMLAutoTextEventImportOOO );
142 // Oasis2OOo transformer
143 SERVICE( Oasis2OOoTransformer );
145 // OOo2Oasis transformer
146 SERVICE( OOo2OasisTransformer );
149 #ifdef __cplusplus
150 extern "C"
152 #endif
154 #define SINGLEFACTORY(classname)\
155 if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
157 xFactory = ::cppu::createSingleFactory( xMSF,\
158 classname##_getImplementationName(),\
159 classname##_createInstance,\
160 classname##_getSupportedServiceNames() );\
163 XMLOFF_DLLPUBLIC void * SAL_CALL xo_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
165 void * pRet = 0;
166 if( pServiceManager )
168 uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
170 uno::Reference< lang::XSingleServiceFactory > xFactory;
172 const sal_Int32 nImplNameLen = strlen( pImplName );
174 // impress oasis import
175 SINGLEFACTORY( XMLImpressImportOasis )
176 else SINGLEFACTORY( XMLImpressStylesImportOasis )
177 else SINGLEFACTORY( XMLImpressContentImportOasis )
178 else SINGLEFACTORY( XMLImpressMetaImportOasis )
179 else SINGLEFACTORY( XMLImpressSettingsImportOasis )
181 // impress oasis export
182 else SINGLEFACTORY( XMLImpressExportOasis )
183 else SINGLEFACTORY( XMLImpressStylesExportOasis )
184 else SINGLEFACTORY( XMLImpressContentExportOasis )
185 else SINGLEFACTORY( XMLImpressMetaExportOasis )
186 else SINGLEFACTORY( XMLImpressSettingsExportOasis )
188 else SINGLEFACTORY( AnimationsImport )
190 // impress OOo export
191 else SINGLEFACTORY( XMLImpressExportOOO )
192 else SINGLEFACTORY( XMLImpressStylesExportOOO )
193 else SINGLEFACTORY( XMLImpressContentExportOOO )
194 else SINGLEFACTORY( XMLImpressMetaExportOOO )
195 else SINGLEFACTORY( XMLImpressSettingsExportOOO )
197 // draw oasis import
198 else SINGLEFACTORY( XMLDrawImportOasis )
199 else SINGLEFACTORY( XMLDrawStylesImportOasis )
200 else SINGLEFACTORY( XMLDrawContentImportOasis )
201 else SINGLEFACTORY( XMLDrawMetaImportOasis )
202 else SINGLEFACTORY( XMLDrawSettingsImportOasis )
204 // draw oasis export
205 else SINGLEFACTORY( XMLDrawExportOasis )
206 else SINGLEFACTORY( XMLDrawStylesExportOasis )
207 else SINGLEFACTORY( XMLDrawContentExportOasis )
208 else SINGLEFACTORY( XMLDrawMetaExportOasis )
209 else SINGLEFACTORY( XMLDrawSettingsExportOasis )
211 // draw OOo export
212 else SINGLEFACTORY( XMLDrawExportOOO )
213 else SINGLEFACTORY( XMLDrawStylesExportOOO )
214 else SINGLEFACTORY( XMLDrawContentExportOOO )
215 else SINGLEFACTORY( XMLDrawMetaExportOOO )
216 else SINGLEFACTORY( XMLDrawSettingsExportOOO )
218 // drawing layer export
219 else SINGLEFACTORY( XMLDrawingLayerExport )
221 // impress xml clipboard export
222 else SINGLEFACTORY( XMLImpressClipboardExport )
224 // chart oasis import
225 else SINGLEFACTORY( SchXMLImport )
226 else SINGLEFACTORY( SchXMLImport_Meta )
227 else SINGLEFACTORY( SchXMLImport_Styles )
228 else SINGLEFACTORY( SchXMLImport_Content )
230 // chart oasis export
231 else SINGLEFACTORY( SchXMLExport_Oasis )
232 else SINGLEFACTORY( SchXMLExport_Oasis_Meta )
233 else SINGLEFACTORY( SchXMLExport_Oasis_Styles )
234 else SINGLEFACTORY( SchXMLExport_Oasis_Content )
236 // chart OOo export
237 else SINGLEFACTORY( SchXMLExport )
238 else SINGLEFACTORY( SchXMLExport_Styles )
239 else SINGLEFACTORY( SchXMLExport_Content )
241 // meta import/export
242 else SINGLEFACTORY( XMLMetaExportComponent )
243 else SINGLEFACTORY( XMLMetaImportComponent )
245 else SINGLEFACTORY( XMLVersionListPersistence )
247 // meta import/export OOo
248 else SINGLEFACTORY( XMLMetaExportOOO )
250 // auto text import/export
251 else SINGLEFACTORY( XMLAutoTextEventExport )
252 else SINGLEFACTORY( XMLAutoTextEventImport )
253 else SINGLEFACTORY( XMLAutoTextEventExportOOO )
255 if( xFactory.is())
257 xFactory->acquire();
258 pRet = xFactory.get();
261 return pRet;
264 #ifdef __cplusplus
266 #endif
268 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */