xref: /aoo41x/main/sd/source/ui/unoidl/facreg.cxx (revision 7a32b0c8)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 #include <com/sun/star/registry/XRegistryKey.hpp>
27 
28 #include "sddll.hxx"
29 
30 #include <cppuhelper/factory.hxx>
31 #include <uno/lbnames.h>
32 #include <sfx2/sfxmodelfactory.hxx>
33 #include "osl/diagnose.h"
34 #include "sal/types.h"
35 
36 #ifndef INCLUDED_STRING_H
37 #include <string.h>
38 #define INCLUDED_STRING_H
39 #endif
40 #include <comphelper/stl_types.hxx>
41 #include <hash_map>
42 #include <boost/shared_ptr.hpp>
43 
44 using namespace rtl;
45 using namespace com::sun::star;
46 
47 
48 // Forward declarations of the factories.
49 
50 extern uno::Reference< uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory, const sal_uInt64 _nCreationFlags );
51 extern OUString SdDrawingDocument_getImplementationName() throw( uno::RuntimeException );
52 extern uno::Sequence< OUString > SAL_CALL SdDrawingDocument_getSupportedServiceNames() throw( uno::RuntimeException );
53 
54 extern uno::Reference< uno::XInterface > SAL_CALL SdPresentationDocument_createInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory, const sal_uInt64 _nCreationFlags );
55 extern OUString SdPresentationDocument_getImplementationName() throw( uno::RuntimeException );
56 extern uno::Sequence< OUString > SAL_CALL SdPresentationDocument_getSupportedServiceNames() throw( uno::RuntimeException );
57 
58 extern uno::Reference< uno::XInterface > SAL_CALL SdHtmlOptionsDialog_CreateInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory );
59 extern OUString SdHtmlOptionsDialog_getImplementationName() throw( uno::RuntimeException );
60 extern uno::Sequence< OUString > SAL_CALL SdHtmlOptionsDialog_getSupportedServiceNames() throw( uno::RuntimeException );
61 
62 extern uno::Reference< uno::XInterface > SAL_CALL SdUnoModule_createInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory );
63 extern OUString SdUnoModule_getImplementationName() throw( uno::RuntimeException );
64 extern uno::Sequence< OUString > SAL_CALL SdUnoModule_getSupportedServiceNames() throw( uno::RuntimeException );
65 
66 namespace sd
67 {
68 extern uno::Reference< uno::XInterface > SAL_CALL RandomNode_createInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory );
69 extern OUString RandomNode__getImplementationName() throw( uno::RuntimeException );
70 extern uno::Sequence< OUString > SAL_CALL RandomNode_getSupportedServiceNames() throw( uno::RuntimeException );
71 
72 extern uno::Reference< uno::XInterface > SAL_CALL SlideLayoutController_createInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory );
73 extern OUString SlideLayoutController_getImplementationName() throw( uno::RuntimeException );
74 extern uno::Sequence< OUString >  SlideLayoutController_getSupportedServiceNames() throw( uno::RuntimeException );
75 
76 extern uno::Reference< uno::XInterface > SAL_CALL InsertSlideController_createInstance( const uno::Reference< lang::XMultiServiceFactory > & _rxFactory );
77 extern OUString InsertSlideController_getImplementationName() throw( uno::RuntimeException );
78 extern uno::Sequence< OUString >  InsertSlideController_getSupportedServiceNames() throw( uno::RuntimeException );
79 }
80 
81 namespace sd { namespace framework {
82 
83 extern uno::Reference<uno::XInterface> SAL_CALL Configuration_createInstance(
84     const uno::Reference<uno::XComponentContext>& rxContext)
85     throw(uno::Exception);
86 extern OUString Configuration_getImplementationName(void) throw (uno::RuntimeException);
87 extern uno::Sequence<OUString> SAL_CALL Configuration_getSupportedServiceNames (void)
88     throw (uno::RuntimeException);
89 
90 extern uno::Reference<uno::XInterface> SAL_CALL ConfigurationController_createInstance(
91     const uno::Reference<uno::XComponentContext>& rxContext)
92     throw(uno::Exception);
93 extern OUString ConfigurationController_getImplementationName(void) throw (uno::RuntimeException);
94 extern uno::Sequence<OUString> SAL_CALL ConfigurationController_getSupportedServiceNames (void)
95     throw (uno::RuntimeException);
96 
97 extern uno::Reference<uno::XInterface> SAL_CALL ModuleController_createInstance(
98     const uno::Reference<uno::XComponentContext>& rxContext)
99     throw(uno::Exception);
100 extern OUString ModuleController_getImplementationName(void) throw (uno::RuntimeException);
101 extern uno::Sequence<OUString> SAL_CALL ModuleController_getSupportedServiceNames (void)
102     throw (uno::RuntimeException);
103 
104 extern uno::Reference<uno::XInterface> SAL_CALL BasicPaneFactory_createInstance(
105     const uno::Reference<uno::XComponentContext>& rxContext)
106     throw(uno::Exception);
107 extern OUString BasicPaneFactory_getImplementationName(void) throw (uno::RuntimeException);
108 extern uno::Sequence<OUString> SAL_CALL BasicPaneFactory_getSupportedServiceNames (void)
109     throw (uno::RuntimeException);
110 
111 extern uno::Reference<uno::XInterface> SAL_CALL BasicToolBarFactory_createInstance(
112     const uno::Reference<uno::XComponentContext>& rxContext)
113     throw(uno::Exception);
114 extern OUString BasicToolBarFactory_getImplementationName(void) throw (uno::RuntimeException);
115 extern uno::Sequence<OUString> SAL_CALL BasicToolBarFactory_getSupportedServiceNames (void)
116     throw (uno::RuntimeException);
117 
118 extern uno::Reference<uno::XInterface> SAL_CALL BasicViewFactory_createInstance(
119     const uno::Reference<uno::XComponentContext>& rxContext)
120     throw(uno::Exception);
121 extern OUString BasicViewFactory_getImplementationName(void) throw (uno::RuntimeException);
122 extern uno::Sequence<OUString> SAL_CALL BasicViewFactory_getSupportedServiceNames (void)
123     throw (uno::RuntimeException);
124 
125 extern uno::Reference<uno::XInterface> SAL_CALL TaskPanelFactory_createInstance(
126     const uno::Reference<uno::XComponentContext>& rxContext)
127     throw(uno::Exception);
128 extern OUString TaskPanelFactory_getImplementationName(void) throw (uno::RuntimeException);
129 extern uno::Sequence<OUString> SAL_CALL TaskPanelFactory_getSupportedServiceNames (void)
130     throw (uno::RuntimeException);
131 
132 extern uno::Reference<uno::XInterface> SAL_CALL ResourceId_createInstance(
133     const uno::Reference<uno::XComponentContext>& rxContext)
134     throw(uno::Exception);
135 extern OUString ResourceId_getImplementationName(void) throw (uno::RuntimeException);
136 extern uno::Sequence<OUString> SAL_CALL ResourceId_getSupportedServiceNames (void)
137     throw (uno::RuntimeException);
138 
139 extern uno::Reference<uno::XInterface> SAL_CALL PresentationFactoryProvider_createInstance(
140     const uno::Reference<uno::XComponentContext>& rxContext)
141     throw(uno::Exception);
142 extern OUString PresentationFactoryProvider_getImplementationName(void)
143     throw (uno::RuntimeException);
144 extern uno::Sequence<OUString> SAL_CALL PresentationFactoryProvider_getSupportedServiceNames (void)
145     throw (uno::RuntimeException);
146 } }
147 
148 namespace sd { namespace sidebar {
149 
150 extern uno::Reference<uno::XInterface> SAL_CALL SidebarFactory_createInstance(
151     const uno::Reference<uno::XComponentContext>& rxContext)
152     throw(uno::Exception);
153 extern OUString SidebarFactory_getImplementationName(void) throw (uno::RuntimeException);
154 extern uno::Sequence<OUString> SAL_CALL SidebarFactory_getSupportedServiceNames (void)
155     throw (uno::RuntimeException);
156 
157 } }
158 
159 namespace sd { namespace presenter {
160 extern uno::Reference<uno::XInterface> SAL_CALL SlideRenderer_createInstance(
161     const uno::Reference<uno::XComponentContext>& rxContext)
162     throw(uno::Exception);
163 extern OUString SlideRenderer_getImplementationName(void)
164     throw (uno::RuntimeException);
165 extern uno::Sequence<OUString> SAL_CALL SlideRenderer_getSupportedServiceNames (void)
166     throw (uno::RuntimeException);
167 
168 extern uno::Reference<uno::XInterface> SAL_CALL PresenterCanvas_createInstance(
169     const uno::Reference<uno::XComponentContext>& rxContext)
170     throw(uno::Exception);
171 extern OUString PresenterCanvas_getImplementationName(void)
172     throw (uno::RuntimeException);
173 extern uno::Sequence<OUString> SAL_CALL PresenterCanvas_getSupportedServiceNames (void)
174     throw (uno::RuntimeException);
175 
176 extern uno::Reference<uno::XInterface> SAL_CALL PresenterTextViewService_createInstance(
177     const uno::Reference<uno::XComponentContext>& rxContext)
178     throw(uno::Exception);
179 extern OUString PresenterTextViewService_getImplementationName(void)
180     throw (uno::RuntimeException);
181 extern uno::Sequence<OUString> SAL_CALL PresenterTextViewService_getSupportedServiceNames (void)
182     throw (uno::RuntimeException);
183 
184 extern uno::Reference<uno::XInterface> SAL_CALL PresenterHelperService_createInstance(
185     const uno::Reference<uno::XComponentContext>& rxContext)
186     throw(uno::Exception);
187 extern OUString PresenterHelperService_getImplementationName(void)
188     throw (uno::RuntimeException);
189 extern uno::Sequence<OUString> SAL_CALL PresenterHelperService_getSupportedServiceNames (void)
190     throw (uno::RuntimeException);
191 
192 extern uno::Reference<uno::XInterface> SAL_CALL PresenterPreviewCache_createInstance(
193     const uno::Reference<uno::XComponentContext>& rxContext)
194     throw(uno::Exception);
195 extern OUString PresenterPreviewCache_getImplementationName(void)
196     throw (uno::RuntimeException);
197 extern uno::Sequence<OUString> SAL_CALL PresenterPreviewCache_getSupportedServiceNames (void)
198     throw (uno::RuntimeException);
199 } }
200 
201 
202 namespace sd { namespace slidesorter {
203 extern uno::Reference<uno::XInterface> SAL_CALL SlideSorterService_createInstance(
204     const uno::Reference<uno::XComponentContext>& rxContext)
205     throw(uno::Exception);
206 extern OUString SlideSorterService_getImplementationName(void)
207     throw (uno::RuntimeException);
208 extern uno::Sequence<OUString> SAL_CALL SlideSorterService_getSupportedServiceNames (void)
209     throw (uno::RuntimeException);
210 } }
211 
212 using namespace ::sd;
213 using namespace ::sd::framework;
214 using namespace ::sd::presenter;
215 using namespace ::sd::slidesorter;
216 using namespace ::sd::sidebar;
217 
218 
219 
220 
221 // ----------------------------------------------------------------------------
222 // Declaration and initialization of a map from service names to locally
223 // unique factory identifiers.
224 
225 enum FactoryId
226 {
227     SdDrawingDocumentFactoryId,
228     SdPresentationDocumentFactoryId,
229     SdHtmlOptionsDialogFactoryId,
230     SdUnoModuleFactoryId,
231     RandomNodeFactoryId,
232 
233     ConfigurationFactoryId,
234     ConfigurationControllerFactoryId,
235     ModuleControllerFactoryId,
236     BasicPaneFactoryFactoryId,
237     BasicToolBarFactoryFactoryId,
238     BasicViewFactoryFactoryId,
239     TaskPanelFactoryFactoryId,
240     SidebarFactoryFactoryId,
241     ResourceIdFactoryId,
242     PresentationFactoryProviderFactoryId,
243     SlideRendererFactoryId,
244     PresenterCanvasFactoryId,
245     PresenterTextViewServiceFactoryId,
246     PresenterHelperServiceFactoryId,
247     PresenterPreviewCacheFactoryId,
248     SlideSorterServiceFactoryId,
249 	SlideLayoutControllerFactoryId,
250 	InsertSlideControllerFactoryId,
251 };
252 typedef ::std::hash_map<OUString, FactoryId, comphelper::UStringHash, comphelper::UStringEqual> FactoryMap;
253 
254 
255 namespace {
256 static ::boost::shared_ptr<FactoryMap> spFactoryMap;
257 ::boost::shared_ptr<FactoryMap> GetFactoryMap (void)
258 {
259     if (spFactoryMap.get() == NULL)
260     {
261         spFactoryMap.reset(new FactoryMap);
262         (*spFactoryMap)[SdDrawingDocument_getImplementationName()] = SdDrawingDocumentFactoryId;
263         (*spFactoryMap)[SdPresentationDocument_getImplementationName()] = SdPresentationDocumentFactoryId;
264         (*spFactoryMap)[SdHtmlOptionsDialog_getImplementationName()] = SdHtmlOptionsDialogFactoryId;
265         (*spFactoryMap)[SdUnoModule_getImplementationName()] = SdUnoModuleFactoryId;
266         (*spFactoryMap)[RandomNode__getImplementationName()] = RandomNodeFactoryId;
267         (*spFactoryMap)[Configuration_getImplementationName()] = ConfigurationFactoryId;
268         (*spFactoryMap)[ConfigurationController_getImplementationName()] = ConfigurationControllerFactoryId;
269         (*spFactoryMap)[ModuleController_getImplementationName()] = ModuleControllerFactoryId;
270         (*spFactoryMap)[BasicPaneFactory_getImplementationName()] = BasicPaneFactoryFactoryId;
271         (*spFactoryMap)[BasicToolBarFactory_getImplementationName()] = BasicToolBarFactoryFactoryId;
272         (*spFactoryMap)[BasicViewFactory_getImplementationName()] = BasicViewFactoryFactoryId;
273         (*spFactoryMap)[TaskPanelFactory_getImplementationName()] = TaskPanelFactoryFactoryId;
274         (*spFactoryMap)[sidebar::SidebarFactory_getImplementationName()] = SidebarFactoryFactoryId;
275         (*spFactoryMap)[ResourceId_getImplementationName()] = ResourceIdFactoryId;
276         (*spFactoryMap)[PresentationFactoryProvider_getImplementationName()] = PresentationFactoryProviderFactoryId;
277         (*spFactoryMap)[SlideRenderer_getImplementationName()] = SlideRendererFactoryId;
278         (*spFactoryMap)[PresenterCanvas_getImplementationName()] = PresenterCanvasFactoryId;
279         (*spFactoryMap)[PresenterTextViewService_getImplementationName()] = PresenterTextViewServiceFactoryId;
280         (*spFactoryMap)[PresenterHelperService_getImplementationName()] = PresenterHelperServiceFactoryId;
281         (*spFactoryMap)[PresenterPreviewCache_getImplementationName()] = PresenterPreviewCacheFactoryId;
282         (*spFactoryMap)[SlideSorterService_getImplementationName()] = SlideSorterServiceFactoryId;
283 		(*spFactoryMap)[SlideLayoutController_getImplementationName()] = SlideLayoutControllerFactoryId;
284 		(*spFactoryMap)[InsertSlideController_getImplementationName()] = InsertSlideControllerFactoryId;
285     }
286     return spFactoryMap;
287 };
288 } // end of anonymous namespace
289 
290 
291 extern "C"
292 {
293 
294 SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
295 	const sal_Char  ** ppEnvTypeName,
296 	uno_Environment **  )
297 {
298 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
299 }
300 
301 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
302 	const sal_Char * pImplName,
303 	void           * pServiceManager,
304 	void           *  )
305 {
306     void * pRet = 0;
307 
308 	if( pServiceManager )
309 	{
310 		uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
311 
312 		uno::Reference<lang::XSingleServiceFactory> xFactory;
313         uno::Reference<lang::XSingleComponentFactory> xComponentFactory;
314 
315         ::boost::shared_ptr<FactoryMap> pFactoryMap (GetFactoryMap());
316         OUString sImplementationName (OUString::createFromAscii(pImplName));
317         FactoryMap::const_iterator iFactory (pFactoryMap->find(sImplementationName));
318         if (iFactory != pFactoryMap->end())
319         {
320             switch (iFactory->second)
321             {
322                 case SdHtmlOptionsDialogFactoryId:
323                     xFactory = ::cppu::createSingleFactory(
324                         xMSF,
325                         SdHtmlOptionsDialog_getImplementationName(),
326                         SdHtmlOptionsDialog_CreateInstance,
327                         SdHtmlOptionsDialog_getSupportedServiceNames());
328                     break;
329 
330                 case SdDrawingDocumentFactoryId:
331                     xFactory = ::sfx2::createSfxModelFactory(
332                         xMSF,
333                         SdDrawingDocument_getImplementationName(),
334                         SdDrawingDocument_createInstance,
335                         SdDrawingDocument_getSupportedServiceNames());
336                     break;
337 
338                 case SdPresentationDocumentFactoryId:
339                     xFactory = ::sfx2::createSfxModelFactory(
340                         xMSF,
341                         SdPresentationDocument_getImplementationName(),
342                         SdPresentationDocument_createInstance,
343                         SdPresentationDocument_getSupportedServiceNames());
344                     break;
345 
346                 case SdUnoModuleFactoryId:
347                     xFactory = ::cppu::createSingleFactory(
348                         xMSF,
349                         SdUnoModule_getImplementationName(),
350                         SdUnoModule_createInstance,
351                         SdUnoModule_getSupportedServiceNames());
352                     break;
353 
354                 case RandomNodeFactoryId:
355                     xFactory = ::cppu::createSingleFactory(
356                         xMSF,
357                         sd::RandomNode__getImplementationName(),
358                         sd::RandomNode_createInstance,
359                         sd::RandomNode_getSupportedServiceNames());
360                     break;
361 
362                 case ConfigurationFactoryId:
363                     xComponentFactory = ::cppu::createSingleComponentFactory(
364                         sd::framework::Configuration_createInstance,
365                         sd::framework::Configuration_getImplementationName(),
366                         sd::framework::Configuration_getSupportedServiceNames());
367                     break;
368 
369                 case ConfigurationControllerFactoryId:
370                     xComponentFactory = ::cppu::createSingleComponentFactory(
371                         sd::framework::ConfigurationController_createInstance,
372                         sd::framework::ConfigurationController_getImplementationName(),
373                         sd::framework::ConfigurationController_getSupportedServiceNames());
374                     break;
375 
376                 case ModuleControllerFactoryId:
377                     xComponentFactory = ::cppu::createSingleComponentFactory(
378                         sd::framework::ModuleController_createInstance,
379                         sd::framework::ModuleController_getImplementationName(),
380                         sd::framework::ModuleController_getSupportedServiceNames());
381                     break;
382 
383                 case BasicPaneFactoryFactoryId:
384                     xComponentFactory = ::cppu::createSingleComponentFactory(
385                         sd::framework::BasicPaneFactory_createInstance,
386                         sd::framework::BasicPaneFactory_getImplementationName(),
387                         sd::framework::BasicPaneFactory_getSupportedServiceNames());
388                     break;
389 
390                 case BasicToolBarFactoryFactoryId:
391                     xComponentFactory = ::cppu::createSingleComponentFactory(
392                         sd::framework::BasicToolBarFactory_createInstance,
393                         sd::framework::BasicToolBarFactory_getImplementationName(),
394                         sd::framework::BasicToolBarFactory_getSupportedServiceNames());
395                     break;
396 
397                 case BasicViewFactoryFactoryId:
398                     xComponentFactory = ::cppu::createSingleComponentFactory(
399                         sd::framework::BasicViewFactory_createInstance,
400                         sd::framework::BasicViewFactory_getImplementationName(),
401                         sd::framework::BasicViewFactory_getSupportedServiceNames());
402                     break;
403 
404                 case TaskPanelFactoryFactoryId:
405                     xComponentFactory = ::cppu::createSingleComponentFactory(
406                         sd::framework::TaskPanelFactory_createInstance,
407                         sd::framework::TaskPanelFactory_getImplementationName(),
408                         sd::framework::TaskPanelFactory_getSupportedServiceNames());
409                     break;
410 
411                 case SidebarFactoryFactoryId:
412                     xComponentFactory = ::cppu::createSingleComponentFactory(
413                         sd::sidebar::SidebarFactory_createInstance,
414                         sd::sidebar::SidebarFactory_getImplementationName(),
415                         sd::sidebar::SidebarFactory_getSupportedServiceNames());
416                     break;
417 
418                 case ResourceIdFactoryId:
419                     xComponentFactory = ::cppu::createSingleComponentFactory(
420                         sd::framework::ResourceId_createInstance,
421                         sd::framework::ResourceId_getImplementationName(),
422                         sd::framework::ResourceId_getSupportedServiceNames());
423                     break;
424 
425                 case PresentationFactoryProviderFactoryId:
426                     xComponentFactory = ::cppu::createSingleComponentFactory(
427                         sd::framework::PresentationFactoryProvider_createInstance,
428                         sd::framework::PresentationFactoryProvider_getImplementationName(),
429                         sd::framework::PresentationFactoryProvider_getSupportedServiceNames());
430                     break;
431 
432                 case SlideRendererFactoryId:
433                     xComponentFactory = ::cppu::createSingleComponentFactory(
434                         sd::presenter::SlideRenderer_createInstance,
435                         sd::presenter::SlideRenderer_getImplementationName(),
436                         sd::presenter::SlideRenderer_getSupportedServiceNames());
437                     break;
438 
439                 case PresenterCanvasFactoryId:
440                     xComponentFactory = ::cppu::createSingleComponentFactory(
441                         sd::presenter::PresenterCanvas_createInstance,
442                         sd::presenter::PresenterCanvas_getImplementationName(),
443                         sd::presenter::PresenterCanvas_getSupportedServiceNames());
444                     break;
445 
446                 case PresenterTextViewServiceFactoryId:
447                     xComponentFactory = ::cppu::createSingleComponentFactory(
448                         sd::presenter::PresenterTextViewService_createInstance,
449                         sd::presenter::PresenterTextViewService_getImplementationName(),
450                         sd::presenter::PresenterTextViewService_getSupportedServiceNames());
451                     break;
452 
453                 case PresenterHelperServiceFactoryId:
454                     xComponentFactory = ::cppu::createSingleComponentFactory(
455                         sd::presenter::PresenterHelperService_createInstance,
456                         sd::presenter::PresenterHelperService_getImplementationName(),
457                         sd::presenter::PresenterHelperService_getSupportedServiceNames());
458                     break;
459 
460                 case PresenterPreviewCacheFactoryId:
461                     xComponentFactory = ::cppu::createSingleComponentFactory(
462                         sd::presenter::PresenterPreviewCache_createInstance,
463                         sd::presenter::PresenterPreviewCache_getImplementationName(),
464                         sd::presenter::PresenterPreviewCache_getSupportedServiceNames());
465                     break;
466 
467                 case SlideSorterServiceFactoryId:
468                     xComponentFactory = ::cppu::createSingleComponentFactory(
469                         sd::slidesorter::SlideSorterService_createInstance,
470                         sd::slidesorter::SlideSorterService_getImplementationName(),
471                         sd::slidesorter::SlideSorterService_getSupportedServiceNames());
472                     break;
473 
474 				case SlideLayoutControllerFactoryId:
475 					xFactory = ::cppu::createSingleFactory(
476                         xMSF,
477 						sd::SlideLayoutController_getImplementationName(),
478 						sd::SlideLayoutController_createInstance,
479 						sd::SlideLayoutController_getSupportedServiceNames());
480 					break;
481 
482 				case InsertSlideControllerFactoryId:
483 					xFactory = ::cppu::createSingleFactory(
484                         xMSF,
485 						sd::InsertSlideController_getImplementationName(),
486 						sd::InsertSlideController_createInstance,
487 						sd::InsertSlideController_getSupportedServiceNames());
488                 default:
489                     break;
490             }
491             if (xComponentFactory.is())
492             {
493                 xComponentFactory->acquire();
494                 pRet = xComponentFactory.get();
495             }
496             else if (xFactory.is())
497             {
498                 xFactory->acquire();
499                 pRet = xFactory.get();
500             }
501         }
502     }
503 
504     if (pRet != NULL)
505         SdDLL::Init();
506 	return pRet;
507 }
508 
509 } // end of extern "C"
510