xref: /trunk/main/svx/source/core/coreservices.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 /** this file contains the uno service registrations for all services in the svxcore lib */
29 
30 // MARKER(update_precomp.py): autogen include statement, do not remove
31 #include "precompiled_svx.hxx"
32 
33 #include "sal/types.h"
34 #include "osl/diagnose.h"
35 #include "cppuhelper/factory.hxx"
36 #include "uno/lbnames.h"
37 
38 using rtl::OUString;
39 
40 using namespace com::sun::star::uno;
41 using namespace com::sun::star::lang;
42 using namespace com::sun::star::registry;
43 
44 namespace svx
45 {
46 extern OUString SAL_CALL ExtrusionDepthController_getImplementationName();
47 extern Reference< XInterface > SAL_CALL ExtrusionDepthController_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
48 extern Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( RuntimeException );
49 
50 extern OUString SAL_CALL ExtrusionDirectionControl_getImplementationName();
51 extern Reference< XInterface > SAL_CALL ExtrusionDirectionControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
52 extern Sequence< OUString > SAL_CALL ExtrusionDirectionControl_getSupportedServiceNames() throw( RuntimeException );
53 
54 extern OUString SAL_CALL ExtrusionLightingControl_getImplementationName();
55 extern Reference< XInterface > SAL_CALL ExtrusionLightingControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
56 extern Sequence< OUString > SAL_CALL ExtrusionLightingControl_getSupportedServiceNames() throw( RuntimeException );
57 
58 extern OUString SAL_CALL ExtrusionSurfaceControl_getImplementationName();
59 extern Reference< XInterface > SAL_CALL ExtrusionSurfaceControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
60 extern Sequence< OUString > SAL_CALL ExtrusionSurfaceControl_getSupportedServiceNames() throw( RuntimeException );
61 
62 extern OUString SAL_CALL FontWorkAlignmentControl_getImplementationName();
63 extern Reference< XInterface > SAL_CALL FontWorkAlignmentControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
64 extern Sequence< OUString > SAL_CALL FontWorkAlignmentControl_getSupportedServiceNames() throw( RuntimeException );
65 
66 extern OUString SAL_CALL FontWorkCharacterSpacingControl_getImplementationName();
67 extern Reference< XInterface > SAL_CALL FontWorkCharacterSpacingControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
68 extern Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException );
69 }
70 
71 extern "C"
72 {
73 
74 SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
75     const sal_Char ** ppEnvTypeName, uno_Environment ** )
76 {
77     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
78 }
79 
80 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
81     const sal_Char * pImplName, void * pServiceManager, void *  )
82 {
83     void * pRet = 0;
84     if( pServiceManager  )
85     {
86         Reference< XSingleServiceFactory > xFactory;
87 
88         if( ::svx::ExtrusionDepthController_getImplementationName().equalsAscii( pImplName ) )
89         {
90             xFactory = ::cppu::createSingleFactory(
91                 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
92                 ::svx::ExtrusionDepthController_getImplementationName(),
93                 ::svx::ExtrusionDepthController_createInstance,
94                 ::svx::ExtrusionDepthController_getSupportedServiceNames() );
95         }
96         else if( ::svx::ExtrusionDirectionControl_getImplementationName().equalsAscii( pImplName ) )
97         {
98             xFactory = ::cppu::createSingleFactory(
99                 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
100                 ::svx::ExtrusionDirectionControl_getImplementationName(),
101                 ::svx::ExtrusionDirectionControl_createInstance,
102                 ::svx::ExtrusionDirectionControl_getSupportedServiceNames() );
103         }
104         else if( ::svx::ExtrusionLightingControl_getImplementationName().equalsAscii( pImplName ) )
105         {
106             xFactory = ::cppu::createSingleFactory(
107                 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
108                 ::svx::ExtrusionLightingControl_getImplementationName(),
109                 ::svx::ExtrusionLightingControl_createInstance,
110                 ::svx::ExtrusionLightingControl_getSupportedServiceNames() );
111         }
112         else if( ::svx::ExtrusionSurfaceControl_getImplementationName().equalsAscii( pImplName ) )
113         {
114             xFactory = ::cppu::createSingleFactory(
115                 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
116                 ::svx::ExtrusionSurfaceControl_getImplementationName(),
117                 ::svx::ExtrusionSurfaceControl_createInstance,
118                 ::svx::ExtrusionSurfaceControl_getSupportedServiceNames() );
119         }
120         else if( ::svx::FontWorkAlignmentControl_getImplementationName().equalsAscii( pImplName ) )
121         {
122             xFactory = ::cppu::createSingleFactory(
123                 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
124                 ::svx::FontWorkAlignmentControl_getImplementationName(),
125                 ::svx::FontWorkAlignmentControl_createInstance,
126                 ::svx::FontWorkAlignmentControl_getSupportedServiceNames() );
127         }
128         else if( ::svx::FontWorkCharacterSpacingControl_getImplementationName().equalsAscii( pImplName ) )
129         {
130             xFactory = ::cppu::createSingleFactory(
131                 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
132                 ::svx::FontWorkCharacterSpacingControl_getImplementationName(),
133                 ::svx::FontWorkCharacterSpacingControl_createInstance,
134                 ::svx::FontWorkCharacterSpacingControl_getSupportedServiceNames() );
135         }       if( xFactory.is())
136         {
137             xFactory->acquire();
138             pRet = xFactory.get();
139         }
140     }
141 
142     return pRet;
143 }
144 
145 }
146