Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #include <sal/config.h>
22 :
23 : #include <xmloff/dllapi.h>
24 :
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>
29 :
30 : #include <cppuhelper/factory.hxx>
31 : #include <xmloff/xmlreg.hxx>
32 :
33 : #include <facreg.hxx>
34 :
35 : using namespace com::sun::star;
36 :
37 : #ifdef __cplusplus
38 : extern "C"
39 : {
40 : #endif
41 :
42 : #define SINGLEFACTORY(classname)\
43 : if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
44 : {\
45 : xFactory = ::cppu::createSingleFactory( xMSF,\
46 : classname##_getImplementationName(),\
47 : classname##_createInstance,\
48 : classname##_getSupportedServiceNames() );\
49 : }
50 :
51 216 : XMLOFF_DLLPUBLIC void * SAL_CALL xo_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
52 : {
53 216 : void * pRet = 0;
54 216 : if( pServiceManager )
55 : {
56 216 : uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
57 :
58 432 : uno::Reference< lang::XSingleServiceFactory > xFactory;
59 :
60 216 : const sal_Int32 nImplNameLen = strlen( pImplName );
61 :
62 : // impress oasis import
63 216 : SINGLEFACTORY( XMLImpressImportOasis )
64 214 : else SINGLEFACTORY( XMLImpressStylesImportOasis )
65 200 : else SINGLEFACTORY( XMLImpressContentImportOasis )
66 186 : else SINGLEFACTORY( XMLImpressMetaImportOasis )
67 172 : else SINGLEFACTORY( XMLImpressSettingsImportOasis )
68 :
69 : // impress oasis export
70 160 : else SINGLEFACTORY( XMLImpressExportOasis )
71 160 : else SINGLEFACTORY( XMLImpressStylesExportOasis )
72 156 : else SINGLEFACTORY( XMLImpressContentExportOasis )
73 152 : else SINGLEFACTORY( XMLImpressMetaExportOasis )
74 150 : else SINGLEFACTORY( XMLImpressSettingsExportOasis )
75 :
76 146 : else SINGLEFACTORY( AnimationsImport )
77 :
78 : // impress OOo export
79 142 : else SINGLEFACTORY( XMLImpressExportOOO )
80 142 : else SINGLEFACTORY( XMLImpressStylesExportOOO )
81 142 : else SINGLEFACTORY( XMLImpressContentExportOOO )
82 142 : else SINGLEFACTORY( XMLImpressMetaExportOOO )
83 140 : else SINGLEFACTORY( XMLImpressSettingsExportOOO )
84 :
85 : // draw oasis import
86 140 : else SINGLEFACTORY( XMLDrawImportOasis )
87 134 : else SINGLEFACTORY( XMLDrawStylesImportOasis )
88 134 : else SINGLEFACTORY( XMLDrawContentImportOasis )
89 134 : else SINGLEFACTORY( XMLDrawMetaImportOasis )
90 134 : else SINGLEFACTORY( XMLDrawSettingsImportOasis )
91 :
92 : // draw oasis export
93 134 : else SINGLEFACTORY( XMLDrawExportOasis )
94 134 : else SINGLEFACTORY( XMLDrawStylesExportOasis )
95 130 : else SINGLEFACTORY( XMLDrawContentExportOasis )
96 126 : else SINGLEFACTORY( XMLDrawMetaExportOasis )
97 124 : else SINGLEFACTORY( XMLDrawSettingsExportOasis )
98 :
99 : // draw OOo export
100 120 : else SINGLEFACTORY( XMLDrawExportOOO )
101 118 : else SINGLEFACTORY( XMLDrawStylesExportOOO )
102 118 : else SINGLEFACTORY( XMLDrawContentExportOOO )
103 116 : else SINGLEFACTORY( XMLDrawMetaExportOOO )
104 114 : else SINGLEFACTORY( XMLDrawSettingsExportOOO )
105 :
106 : // drawing layer export
107 114 : else SINGLEFACTORY( XMLDrawingLayerExport )
108 :
109 : // impress xml clipboard export
110 114 : else SINGLEFACTORY( XMLImpressClipboardExport )
111 :
112 : // chart oasis import
113 114 : else SINGLEFACTORY( SchXMLImport )
114 112 : else SINGLEFACTORY( SchXMLImport_Meta )
115 96 : else SINGLEFACTORY( SchXMLImport_Styles )
116 78 : else SINGLEFACTORY( SchXMLImport_Content )
117 :
118 : // chart oasis export
119 60 : else SINGLEFACTORY( SchXMLExport_Oasis )
120 60 : else SINGLEFACTORY( SchXMLExport_Oasis_Meta )
121 42 : else SINGLEFACTORY( SchXMLExport_Oasis_Styles )
122 24 : else SINGLEFACTORY( SchXMLExport_Oasis_Content )
123 :
124 : // chart OOo export
125 6 : else SINGLEFACTORY( SchXMLExport )
126 6 : else SINGLEFACTORY( SchXMLExport_Styles )
127 6 : else SINGLEFACTORY( SchXMLExport_Content )
128 :
129 : // meta import/export
130 6 : else SINGLEFACTORY( XMLMetaExportComponent )
131 4 : else SINGLEFACTORY( XMLMetaImportComponent )
132 :
133 : // meta import/export OOo
134 0 : else SINGLEFACTORY( XMLMetaExportOOO )
135 :
136 : // auto text import/export
137 0 : else SINGLEFACTORY( XMLAutoTextEventExport )
138 0 : else SINGLEFACTORY( XMLAutoTextEventImport )
139 0 : else SINGLEFACTORY( XMLAutoTextEventExportOOO )
140 :
141 216 : if( xFactory.is())
142 : {
143 216 : xFactory->acquire();
144 216 : pRet = xFactory.get();
145 216 : }
146 : }
147 216 : return pRet;
148 : }
149 :
150 : #ifdef __cplusplus
151 : }
152 : #endif
153 :
154 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|