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 0 : XMLOFF_DLLPUBLIC void * SAL_CALL xo_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
52 : {
53 0 : void * pRet = 0;
54 0 : if( pServiceManager )
55 : {
56 0 : uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
57 :
58 0 : uno::Reference< lang::XSingleServiceFactory > xFactory;
59 :
60 0 : const sal_Int32 nImplNameLen = strlen( pImplName );
61 :
62 : // impress oasis import
63 0 : SINGLEFACTORY( XMLImpressImportOasis )
64 0 : else SINGLEFACTORY( XMLImpressStylesImportOasis )
65 0 : else SINGLEFACTORY( XMLImpressContentImportOasis )
66 0 : else SINGLEFACTORY( XMLImpressMetaImportOasis )
67 0 : else SINGLEFACTORY( XMLImpressSettingsImportOasis )
68 :
69 : // impress oasis export
70 0 : else SINGLEFACTORY( XMLImpressExportOasis )
71 0 : else SINGLEFACTORY( XMLImpressStylesExportOasis )
72 0 : else SINGLEFACTORY( XMLImpressContentExportOasis )
73 0 : else SINGLEFACTORY( XMLImpressMetaExportOasis )
74 0 : else SINGLEFACTORY( XMLImpressSettingsExportOasis )
75 :
76 0 : else SINGLEFACTORY( AnimationsImport )
77 :
78 : // impress OOo export
79 0 : else SINGLEFACTORY( XMLImpressExportOOO )
80 0 : else SINGLEFACTORY( XMLImpressStylesExportOOO )
81 0 : else SINGLEFACTORY( XMLImpressContentExportOOO )
82 0 : else SINGLEFACTORY( XMLImpressMetaExportOOO )
83 0 : else SINGLEFACTORY( XMLImpressSettingsExportOOO )
84 :
85 : // draw oasis import
86 0 : else SINGLEFACTORY( XMLDrawImportOasis )
87 0 : else SINGLEFACTORY( XMLDrawStylesImportOasis )
88 0 : else SINGLEFACTORY( XMLDrawContentImportOasis )
89 0 : else SINGLEFACTORY( XMLDrawMetaImportOasis )
90 0 : else SINGLEFACTORY( XMLDrawSettingsImportOasis )
91 :
92 : // draw oasis export
93 0 : else SINGLEFACTORY( XMLDrawExportOasis )
94 0 : else SINGLEFACTORY( XMLDrawStylesExportOasis )
95 0 : else SINGLEFACTORY( XMLDrawContentExportOasis )
96 0 : else SINGLEFACTORY( XMLDrawMetaExportOasis )
97 0 : else SINGLEFACTORY( XMLDrawSettingsExportOasis )
98 :
99 : // draw OOo export
100 0 : else SINGLEFACTORY( XMLDrawExportOOO )
101 0 : else SINGLEFACTORY( XMLDrawStylesExportOOO )
102 0 : else SINGLEFACTORY( XMLDrawContentExportOOO )
103 0 : else SINGLEFACTORY( XMLDrawMetaExportOOO )
104 0 : else SINGLEFACTORY( XMLDrawSettingsExportOOO )
105 :
106 : // drawing layer export
107 0 : else SINGLEFACTORY( XMLDrawingLayerExport )
108 :
109 : // impress xml clipboard export
110 0 : else SINGLEFACTORY( XMLImpressClipboardExport )
111 :
112 : // chart oasis import
113 0 : else SINGLEFACTORY( SchXMLImport )
114 0 : else SINGLEFACTORY( SchXMLImport_Meta )
115 0 : else SINGLEFACTORY( SchXMLImport_Styles )
116 0 : else SINGLEFACTORY( SchXMLImport_Content )
117 :
118 : // chart oasis export
119 0 : else SINGLEFACTORY( SchXMLExport_Oasis )
120 0 : else SINGLEFACTORY( SchXMLExport_Oasis_Meta )
121 0 : else SINGLEFACTORY( SchXMLExport_Oasis_Styles )
122 0 : else SINGLEFACTORY( SchXMLExport_Oasis_Content )
123 :
124 : // chart OOo export
125 0 : else SINGLEFACTORY( SchXMLExport )
126 0 : else SINGLEFACTORY( SchXMLExport_Styles )
127 0 : else SINGLEFACTORY( SchXMLExport_Content )
128 :
129 : // meta import/export
130 0 : else SINGLEFACTORY( XMLMetaExportComponent )
131 0 : 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 0 : if( xFactory.is())
142 : {
143 0 : xFactory->acquire();
144 0 : pRet = xFactory.get();
145 0 : }
146 : }
147 0 : return pRet;
148 : }
149 :
150 : #ifdef __cplusplus
151 : }
152 : #endif
153 :
154 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|