bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / core / facreg.cxx
blob2f2eb2bcfe7e74b749eaa2cb7e8ad7a10309bebf
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 <xmloff/xmlreg.hxx>
33 #include <facreg.hxx>
35 using namespace com::sun::star;
37 #ifdef __cplusplus
38 extern "C"
40 #endif
42 #define SINGLEFACTORY(classname)\
43 if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
45 xFactory = ::cppu::createSingleFactory( xMSF,\
46 classname##_getImplementationName(),\
47 classname##_createInstance,\
48 classname##_getSupportedServiceNames() );\
51 XMLOFF_DLLPUBLIC void * SAL_CALL xo_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
53 void * pRet = 0;
54 if( pServiceManager )
56 uno::Reference< lang::XMultiServiceFactory > xMSF( static_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
58 uno::Reference< lang::XSingleServiceFactory > xFactory;
60 const sal_Int32 nImplNameLen = strlen( pImplName );
62 // impress oasis import
63 SINGLEFACTORY( XMLImpressImportOasis )
64 else SINGLEFACTORY( XMLImpressStylesImportOasis )
65 else SINGLEFACTORY( XMLImpressContentImportOasis )
66 else SINGLEFACTORY( XMLImpressMetaImportOasis )
67 else SINGLEFACTORY( XMLImpressSettingsImportOasis )
69 // impress oasis export
70 else SINGLEFACTORY( XMLImpressExportOasis )
71 else SINGLEFACTORY( XMLImpressStylesExportOasis )
72 else SINGLEFACTORY( XMLImpressContentExportOasis )
73 else SINGLEFACTORY( XMLImpressMetaExportOasis )
74 else SINGLEFACTORY( XMLImpressSettingsExportOasis )
76 else SINGLEFACTORY( AnimationsImport )
78 // impress OOo export
79 else SINGLEFACTORY( XMLImpressExportOOO )
80 else SINGLEFACTORY( XMLImpressStylesExportOOO )
81 else SINGLEFACTORY( XMLImpressContentExportOOO )
82 else SINGLEFACTORY( XMLImpressMetaExportOOO )
83 else SINGLEFACTORY( XMLImpressSettingsExportOOO )
85 // draw oasis import
86 else SINGLEFACTORY( XMLDrawImportOasis )
87 else SINGLEFACTORY( XMLDrawStylesImportOasis )
88 else SINGLEFACTORY( XMLDrawContentImportOasis )
89 else SINGLEFACTORY( XMLDrawMetaImportOasis )
90 else SINGLEFACTORY( XMLDrawSettingsImportOasis )
92 // draw oasis export
93 else SINGLEFACTORY( XMLDrawExportOasis )
94 else SINGLEFACTORY( XMLDrawStylesExportOasis )
95 else SINGLEFACTORY( XMLDrawContentExportOasis )
96 else SINGLEFACTORY( XMLDrawMetaExportOasis )
97 else SINGLEFACTORY( XMLDrawSettingsExportOasis )
99 // draw OOo export
100 else SINGLEFACTORY( XMLDrawExportOOO )
101 else SINGLEFACTORY( XMLDrawStylesExportOOO )
102 else SINGLEFACTORY( XMLDrawContentExportOOO )
103 else SINGLEFACTORY( XMLDrawMetaExportOOO )
104 else SINGLEFACTORY( XMLDrawSettingsExportOOO )
106 // drawing layer export
107 else SINGLEFACTORY( XMLDrawingLayerExport )
109 // impress xml clipboard export
110 else SINGLEFACTORY( XMLImpressClipboardExport )
112 // chart oasis import
113 else SINGLEFACTORY( SchXMLImport )
114 else SINGLEFACTORY( SchXMLImport_Meta )
115 else SINGLEFACTORY( SchXMLImport_Styles )
116 else SINGLEFACTORY( SchXMLImport_Content )
118 // chart oasis export
119 else SINGLEFACTORY( SchXMLExport_Oasis )
120 else SINGLEFACTORY( SchXMLExport_Oasis_Meta )
121 else SINGLEFACTORY( SchXMLExport_Oasis_Styles )
122 else SINGLEFACTORY( SchXMLExport_Oasis_Content )
124 // chart OOo export
125 else SINGLEFACTORY( SchXMLExport )
126 else SINGLEFACTORY( SchXMLExport_Styles )
127 else SINGLEFACTORY( SchXMLExport_Content )
129 // meta import/export
130 else SINGLEFACTORY( XMLMetaExportComponent )
131 else SINGLEFACTORY( XMLMetaImportComponent )
133 // meta import/export OOo
134 else SINGLEFACTORY( XMLMetaExportOOO )
136 // auto text import/export
137 else SINGLEFACTORY( XMLAutoTextEventExport )
138 else SINGLEFACTORY( XMLAutoTextEventImport )
139 else SINGLEFACTORY( XMLAutoTextEventExportOOO )
141 if( xFactory.is())
143 xFactory->acquire();
144 pRet = xFactory.get();
147 return pRet;
150 #ifdef __cplusplus
152 #endif
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */