Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / xmloff / source / core / facreg.cxx
blobc050b10c4407c8942af42a6647c235f0fe5734d9
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>
32 #include <facreg.hxx>
34 using namespace com::sun::star;
36 #ifdef __cplusplus
37 extern "C"
39 #endif
41 #define SINGLEFACTORY(classname)\
42 if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
44 xFactory = ::cppu::createSingleFactory( xMSF,\
45 classname##_getImplementationName(),\
46 classname##_createInstance,\
47 classname##_getSupportedServiceNames() );\
50 XMLOFF_DLLPUBLIC void * SAL_CALL xo_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
52 void * pRet = nullptr;
53 if( pServiceManager )
55 uno::Reference< lang::XMultiServiceFactory > xMSF( static_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
57 uno::Reference< lang::XSingleServiceFactory > xFactory;
59 const sal_Int32 nImplNameLen = strlen( pImplName );
61 // impress oasis import
62 SINGLEFACTORY( XMLImpressImportOasis )
63 else SINGLEFACTORY( XMLImpressStylesImportOasis )
64 else SINGLEFACTORY( XMLImpressContentImportOasis )
65 else SINGLEFACTORY( XMLImpressMetaImportOasis )
66 else SINGLEFACTORY( XMLImpressSettingsImportOasis )
68 // impress oasis export
69 else SINGLEFACTORY( XMLImpressExportOasis )
70 else SINGLEFACTORY( XMLImpressStylesExportOasis )
71 else SINGLEFACTORY( XMLImpressContentExportOasis )
72 else SINGLEFACTORY( XMLImpressMetaExportOasis )
73 else SINGLEFACTORY( XMLImpressSettingsExportOasis )
75 else SINGLEFACTORY( AnimationsImport )
77 // impress OOo export
78 else SINGLEFACTORY( XMLImpressExportOOO )
79 else SINGLEFACTORY( XMLImpressStylesExportOOO )
80 else SINGLEFACTORY( XMLImpressContentExportOOO )
81 else SINGLEFACTORY( XMLImpressMetaExportOOO )
82 else SINGLEFACTORY( XMLImpressSettingsExportOOO )
84 // draw oasis import
85 else SINGLEFACTORY( XMLDrawImportOasis )
86 else SINGLEFACTORY( XMLDrawStylesImportOasis )
87 else SINGLEFACTORY( XMLDrawContentImportOasis )
88 else SINGLEFACTORY( XMLDrawMetaImportOasis )
89 else SINGLEFACTORY( XMLDrawSettingsImportOasis )
91 // draw oasis export
92 else SINGLEFACTORY( XMLDrawExportOasis )
93 else SINGLEFACTORY( XMLDrawStylesExportOasis )
94 else SINGLEFACTORY( XMLDrawContentExportOasis )
95 else SINGLEFACTORY( XMLDrawMetaExportOasis )
96 else SINGLEFACTORY( XMLDrawSettingsExportOasis )
98 // draw OOo export
99 else SINGLEFACTORY( XMLDrawExportOOO )
100 else SINGLEFACTORY( XMLDrawStylesExportOOO )
101 else SINGLEFACTORY( XMLDrawContentExportOOO )
102 else SINGLEFACTORY( XMLDrawMetaExportOOO )
103 else SINGLEFACTORY( XMLDrawSettingsExportOOO )
105 // drawing layer export
106 else SINGLEFACTORY( XMLDrawingLayerExport )
108 // impress xml clipboard export
109 else SINGLEFACTORY( XMLImpressClipboardExport )
111 // chart oasis import
112 else SINGLEFACTORY( SchXMLImport )
113 else SINGLEFACTORY( SchXMLImport_Meta )
114 else SINGLEFACTORY( SchXMLImport_Styles )
115 else SINGLEFACTORY( SchXMLImport_Content )
117 // chart oasis export
118 else SINGLEFACTORY( SchXMLExport_Oasis )
119 else SINGLEFACTORY( SchXMLExport_Oasis_Meta )
120 else SINGLEFACTORY( SchXMLExport_Oasis_Styles )
121 else SINGLEFACTORY( SchXMLExport_Oasis_Content )
123 // chart OOo export
124 else SINGLEFACTORY( SchXMLExport )
125 else SINGLEFACTORY( SchXMLExport_Styles )
126 else SINGLEFACTORY( SchXMLExport_Content )
128 // meta import/export OOo
129 else SINGLEFACTORY( XMLMetaExportOOO )
131 // auto text import/export
132 else SINGLEFACTORY( XMLAutoTextEventExport )
133 else SINGLEFACTORY( XMLAutoTextEventImport )
134 else SINGLEFACTORY( XMLAutoTextEventExportOOO )
136 if( xFactory.is())
138 xFactory->acquire();
139 pRet = xFactory.get();
142 return pRet;
145 #ifdef __cplusplus
147 #endif
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */