xref: /trunk/main/svx/source/core/coreservices.cxx (revision 199633b5)
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 /** this file contains the uno service registrations for all services in the svxcore lib */
25 
26 // MARKER(update_precomp.py): autogen include statement, do not remove
27 #include "precompiled_svx.hxx"
28 
29 #include "sal/types.h"
30 #include "osl/diagnose.h"
31 #include "cppuhelper/factory.hxx"
32 #include "uno/lbnames.h"
33 
34 using rtl::OUString;
35 
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::lang;
38 using namespace com::sun::star::registry;
39 
40 namespace svx
41 {
42 extern OUString SAL_CALL ExtrusionDepthController_getImplementationName();
43 extern Reference< XInterface > SAL_CALL ExtrusionDepthController_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
44 extern Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( RuntimeException );
45 
46 extern OUString SAL_CALL ExtrusionDirectionControl_getImplementationName();
47 extern Reference< XInterface > SAL_CALL ExtrusionDirectionControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
48 extern Sequence< OUString > SAL_CALL ExtrusionDirectionControl_getSupportedServiceNames() throw( RuntimeException );
49 
50 extern OUString SAL_CALL ExtrusionLightingControl_getImplementationName();
51 extern Reference< XInterface > SAL_CALL ExtrusionLightingControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
52 extern Sequence< OUString > SAL_CALL ExtrusionLightingControl_getSupportedServiceNames() throw( RuntimeException );
53 
54 extern OUString SAL_CALL ExtrusionSurfaceControl_getImplementationName();
55 extern Reference< XInterface > SAL_CALL ExtrusionSurfaceControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
56 extern Sequence< OUString > SAL_CALL ExtrusionSurfaceControl_getSupportedServiceNames() throw( RuntimeException );
57 
58 extern OUString SAL_CALL FontworkAlignmentControl_getImplementationName();
59 extern Reference< XInterface > SAL_CALL FontworkAlignmentControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
60 extern Sequence< OUString > SAL_CALL FontworkAlignmentControl_getSupportedServiceNames() throw( RuntimeException );
61 
62 extern OUString SAL_CALL FontworkCharacterSpacingControl_getImplementationName();
63 extern Reference< XInterface > SAL_CALL FontworkCharacterSpacingControl_createInstance(const Reference< XMultiServiceFactory > &)  throw( RuntimeException );
64 extern Sequence< OUString > SAL_CALL FontworkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException );
65 }
66 
67 extern "C"
68 {
69 
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)70 SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
71 	const sal_Char ** ppEnvTypeName, uno_Environment ** )
72 {
73 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
74 }
75 
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void *)76 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
77 	const sal_Char * pImplName, void * pServiceManager, void *  )
78 {
79 	void * pRet = 0;
80 	if( pServiceManager  )
81 	{
82 		Reference< XSingleServiceFactory > xFactory;
83 
84 		if( ::svx::ExtrusionDepthController_getImplementationName().equalsAscii( pImplName ) )
85 		{
86 			xFactory = ::cppu::createSingleFactory(
87 				reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
88 				::svx::ExtrusionDepthController_getImplementationName(),
89 				::svx::ExtrusionDepthController_createInstance,
90 				::svx::ExtrusionDepthController_getSupportedServiceNames() );
91 		}
92 		else if( ::svx::ExtrusionDirectionControl_getImplementationName().equalsAscii( pImplName ) )
93 		{
94 			xFactory = ::cppu::createSingleFactory(
95 				reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
96 				::svx::ExtrusionDirectionControl_getImplementationName(),
97 				::svx::ExtrusionDirectionControl_createInstance,
98 				::svx::ExtrusionDirectionControl_getSupportedServiceNames() );
99 		}
100 		else if( ::svx::ExtrusionLightingControl_getImplementationName().equalsAscii( pImplName ) )
101 		{
102 			xFactory = ::cppu::createSingleFactory(
103 				reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
104 				::svx::ExtrusionLightingControl_getImplementationName(),
105 				::svx::ExtrusionLightingControl_createInstance,
106 				::svx::ExtrusionLightingControl_getSupportedServiceNames() );
107 		}
108 		else if( ::svx::ExtrusionSurfaceControl_getImplementationName().equalsAscii( pImplName ) )
109 		{
110 			xFactory = ::cppu::createSingleFactory(
111 				reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
112 				::svx::ExtrusionSurfaceControl_getImplementationName(),
113 				::svx::ExtrusionSurfaceControl_createInstance,
114 				::svx::ExtrusionSurfaceControl_getSupportedServiceNames() );
115 		}
116 		else if( ::svx::FontworkAlignmentControl_getImplementationName().equalsAscii( pImplName ) )
117 		{
118 			xFactory = ::cppu::createSingleFactory(
119 				reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
120 				::svx::FontworkAlignmentControl_getImplementationName(),
121 				::svx::FontworkAlignmentControl_createInstance,
122 				::svx::FontworkAlignmentControl_getSupportedServiceNames() );
123 		}
124 		else if( ::svx::FontworkCharacterSpacingControl_getImplementationName().equalsAscii( pImplName ) )
125 		{
126 			xFactory = ::cppu::createSingleFactory(
127 				reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
128 				::svx::FontworkCharacterSpacingControl_getImplementationName(),
129 				::svx::FontworkCharacterSpacingControl_createInstance,
130 				::svx::FontworkCharacterSpacingControl_getSupportedServiceNames() );
131 		}		if( xFactory.is())
132 		{
133 			xFactory->acquire();
134 			pRet = xFactory.get();
135 		}
136 	}
137 
138 	return pRet;
139 }
140 
141 }
142