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_filter.hxx"
26
27 #include <stdio.h>
28
29
30
31 #include <osl/mutex.hxx>
32
33 #include <osl/thread.h>
34
35 #include <cppuhelper/factory.hxx>
36
37
38
39 #ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
40
41 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
42
43 #endif
44
45
46
47 #include "XmlFilterAdaptor.hxx"
48
49
50
51 using namespace ::rtl;
52
53 using namespace ::cppu;
54
55 using namespace ::com::sun::star::uno;
56
57 using namespace ::com::sun::star::lang;
58
59 using namespace ::com::sun::star::registry;
60
61
62
63 extern "C"
64
65 {
66
67 //==================================================================================================
68
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)69 void SAL_CALL component_getImplementationEnvironment(
70
71 const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
72
73 {
74
75 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
76
77 }
78
79 //==================================================================================================
80
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void *)81 void * SAL_CALL component_getFactory(
82
83 const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
84
85 {
86
87 void * pRet = 0;
88
89
90
91 OUString implName = OUString::createFromAscii( pImplName );
92
93 if ( pServiceManager && implName.equals(XmlFilterAdaptor_getImplementationName()) )
94
95 {
96
97 Reference< XSingleServiceFactory > xFactory( createSingleFactory(
98
99 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
100
101 OUString::createFromAscii( pImplName ),
102
103 XmlFilterAdaptor_createInstance, XmlFilterAdaptor_getSupportedServiceNames() ) );
104
105
106
107 if (xFactory.is())
108
109 {
110
111 xFactory->acquire();
112
113 pRet = xFactory.get();
114
115 }
116
117 }
118
119 return pRet;
120
121 }
122
123 }
124
125