xref: /trunk/main/filter/source/t602/filterenv.cxx (revision 9e0fc027)
1*9e0fc027SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9e0fc027SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9e0fc027SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9e0fc027SAndrew Rist  * distributed with this work for additional information
6*9e0fc027SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9e0fc027SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9e0fc027SAndrew Rist  * "License"); you may not use this file except in compliance
9*9e0fc027SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9e0fc027SAndrew Rist  *
11*9e0fc027SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9e0fc027SAndrew Rist  *
13*9e0fc027SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9e0fc027SAndrew Rist  * software distributed under the License is distributed on an
15*9e0fc027SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9e0fc027SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9e0fc027SAndrew Rist  * specific language governing permissions and limitations
18*9e0fc027SAndrew Rist  * under the License.
19*9e0fc027SAndrew Rist  *
20*9e0fc027SAndrew Rist  *************************************************************/
21*9e0fc027SAndrew Rist 
22*9e0fc027SAndrew Rist 
23cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
24cdf0e10cSrcweir #include "precompiled_filter.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <osl/mutex.hxx>
27cdf0e10cSrcweir #include <osl/thread.h>
28cdf0e10cSrcweir #include <cppuhelper/factory.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include "t602filter.hxx"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir using namespace ::rtl;
35cdf0e10cSrcweir using namespace ::cppu;
36cdf0e10cSrcweir using namespace ::com::sun::star::uno;
37cdf0e10cSrcweir using namespace ::com::sun::star::lang;
38cdf0e10cSrcweir using namespace ::com::sun::star::registry;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir using namespace T602ImportFilter;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir extern "C"
43cdf0e10cSrcweir {
44cdf0e10cSrcweir //==================================================================================================
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)45cdf0e10cSrcweir void SAL_CALL component_getImplementationEnvironment(
46cdf0e10cSrcweir 	const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
47cdf0e10cSrcweir {
48cdf0e10cSrcweir 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
49cdf0e10cSrcweir }
50cdf0e10cSrcweir //==================================================================================================
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void *)51cdf0e10cSrcweir void * SAL_CALL component_getFactory(
52cdf0e10cSrcweir 	const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	void * pRet = 0;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     OUString implName = OUString::createFromAscii( pImplName );
57cdf0e10cSrcweir 	if ( pServiceManager && implName.equals(T602ImportFilter_getImplementationName()) )
58cdf0e10cSrcweir 	{
59cdf0e10cSrcweir 		Reference< XSingleServiceFactory > xFactory( createSingleFactory(
60cdf0e10cSrcweir 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
61cdf0e10cSrcweir 			OUString::createFromAscii( pImplName ),
62cdf0e10cSrcweir 			T602ImportFilter_createInstance, T602ImportFilter_getSupportedServiceNames() ) );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 		if (xFactory.is())
65cdf0e10cSrcweir 		{
66cdf0e10cSrcweir 			xFactory->acquire();
67cdf0e10cSrcweir 			pRet = xFactory.get();
68cdf0e10cSrcweir 		}
69cdf0e10cSrcweir 	}
70cdf0e10cSrcweir 	else if ( pServiceManager && implName.equals(T602ImportFilterDialog_getImplementationName()) )
71cdf0e10cSrcweir 	{
72cdf0e10cSrcweir 		Reference< XSingleServiceFactory > xFactory( createSingleFactory(
73cdf0e10cSrcweir 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
74cdf0e10cSrcweir 			OUString::createFromAscii( pImplName ),
75cdf0e10cSrcweir 			T602ImportFilterDialog_createInstance, T602ImportFilterDialog_getSupportedServiceNames() ) );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 		if (xFactory.is())
78cdf0e10cSrcweir 		{
79cdf0e10cSrcweir 			xFactory->acquire();
80cdf0e10cSrcweir 			pRet = xFactory.get();
81cdf0e10cSrcweir 		}
82cdf0e10cSrcweir 	}
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	return pRet;
86cdf0e10cSrcweir }
87cdf0e10cSrcweir }
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 
90