Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / svx / source / core / coreservices.cxx
blob85c9a2f3cb180b3216b546fce1d04360c842acfa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 /** this file contains the uno service registrations for all services in the svxcore lib */
32 #include "sal/types.h"
33 #include "osl/diagnose.h"
34 #include "cppuhelper/factory.hxx"
35 #include "uno/lbnames.h"
37 using rtl::OUString;
39 using namespace com::sun::star::uno;
40 using namespace com::sun::star::lang;
41 using namespace com::sun::star::registry;
43 namespace svx
45 extern OUString SAL_CALL ExtrusionDepthController_getImplementationName();
46 extern Reference< XInterface > SAL_CALL ExtrusionDepthController_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
47 extern Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( RuntimeException );
49 extern OUString SAL_CALL ExtrusionDirectionControl_getImplementationName();
50 extern Reference< XInterface > SAL_CALL ExtrusionDirectionControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
51 extern Sequence< OUString > SAL_CALL ExtrusionDirectionControl_getSupportedServiceNames() throw( RuntimeException );
53 extern OUString SAL_CALL ExtrusionLightingControl_getImplementationName();
54 extern Reference< XInterface > SAL_CALL ExtrusionLightingControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
55 extern Sequence< OUString > SAL_CALL ExtrusionLightingControl_getSupportedServiceNames() throw( RuntimeException );
57 extern OUString SAL_CALL ExtrusionSurfaceControl_getImplementationName();
58 extern Reference< XInterface > SAL_CALL ExtrusionSurfaceControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
59 extern Sequence< OUString > SAL_CALL ExtrusionSurfaceControl_getSupportedServiceNames() throw( RuntimeException );
61 extern OUString SAL_CALL FontWorkAlignmentControl_getImplementationName();
62 extern Reference< XInterface > SAL_CALL FontWorkAlignmentControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
63 extern Sequence< OUString > SAL_CALL FontWorkAlignmentControl_getSupportedServiceNames() throw( RuntimeException );
65 extern OUString SAL_CALL FontWorkCharacterSpacingControl_getImplementationName();
66 extern Reference< XInterface > SAL_CALL FontWorkCharacterSpacingControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
67 extern Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException );
70 extern "C"
73 SAL_DLLPUBLIC_EXPORT void * SAL_CALL svxcore_component_getFactory (
74 const sal_Char * pImplName, void * pServiceManager, void * )
76 void * pRet = 0;
77 if( pServiceManager )
79 Reference< XSingleServiceFactory > xFactory;
81 if( ::svx::ExtrusionDepthController_getImplementationName().equalsAscii( pImplName ) )
83 xFactory = ::cppu::createSingleFactory(
84 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
85 ::svx::ExtrusionDepthController_getImplementationName(),
86 ::svx::ExtrusionDepthController_createInstance,
87 ::svx::ExtrusionDepthController_getSupportedServiceNames() );
89 else if( ::svx::ExtrusionDirectionControl_getImplementationName().equalsAscii( pImplName ) )
91 xFactory = ::cppu::createSingleFactory(
92 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
93 ::svx::ExtrusionDirectionControl_getImplementationName(),
94 ::svx::ExtrusionDirectionControl_createInstance,
95 ::svx::ExtrusionDirectionControl_getSupportedServiceNames() );
97 else if( ::svx::ExtrusionLightingControl_getImplementationName().equalsAscii( pImplName ) )
99 xFactory = ::cppu::createSingleFactory(
100 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
101 ::svx::ExtrusionLightingControl_getImplementationName(),
102 ::svx::ExtrusionLightingControl_createInstance,
103 ::svx::ExtrusionLightingControl_getSupportedServiceNames() );
105 else if( ::svx::ExtrusionSurfaceControl_getImplementationName().equalsAscii( pImplName ) )
107 xFactory = ::cppu::createSingleFactory(
108 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
109 ::svx::ExtrusionSurfaceControl_getImplementationName(),
110 ::svx::ExtrusionSurfaceControl_createInstance,
111 ::svx::ExtrusionSurfaceControl_getSupportedServiceNames() );
113 else if( ::svx::FontWorkAlignmentControl_getImplementationName().equalsAscii( pImplName ) )
115 xFactory = ::cppu::createSingleFactory(
116 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
117 ::svx::FontWorkAlignmentControl_getImplementationName(),
118 ::svx::FontWorkAlignmentControl_createInstance,
119 ::svx::FontWorkAlignmentControl_getSupportedServiceNames() );
121 else if( ::svx::FontWorkCharacterSpacingControl_getImplementationName().equalsAscii( pImplName ) )
123 xFactory = ::cppu::createSingleFactory(
124 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
125 ::svx::FontWorkCharacterSpacingControl_getImplementationName(),
126 ::svx::FontWorkCharacterSpacingControl_createInstance,
127 ::svx::FontWorkCharacterSpacingControl_getSupportedServiceNames() );
128 } if( xFactory.is())
130 xFactory->acquire();
131 pRet = xFactory.get();
135 return pRet;
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */