xref: /trunk/main/io/source/stm/factreg.cxx (revision 290e3fa2b9b4674aaab37cec6e5234e51d0c3ef4)
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_io.hxx"
26 
27 #include <osl/diagnose.h>
28 #include <cppuhelper/factory.hxx>
29 #include <cppuhelper/implementationentry.hxx>
30 
31 #include "io/dllapi.h"
32 
33 #include <com/sun/star/registry/XRegistryKey.hpp>
34 
35 using namespace ::rtl;
36 using namespace ::cppu;
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::lang;
39 using namespace ::com::sun::star::registry;
40 
41 #include "factreg.hxx"
42 
43 namespace io_stm
44 {
45     rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
46 }
47 
48 using namespace io_stm;
49 
50 static struct ImplementationEntry g_entries[] =
51 {
52     {
53         OPipeImpl_CreateInstance, OPipeImpl_getImplementationName ,
54         OPipeImpl_getSupportedServiceNames, createSingleComponentFactory ,
55         &g_moduleCount.modCnt , 0
56     },
57     {
58         OPumpImpl_CreateInstance, OPumpImpl_getImplementationName ,
59         OPumpImpl_getSupportedServiceNames, createSingleComponentFactory ,
60         &g_moduleCount.modCnt , 0
61     },
62     {
63         ODataInputStream_CreateInstance, ODataInputStream_getImplementationName,
64         ODataInputStream_getSupportedServiceNames, createSingleComponentFactory,
65         &g_moduleCount.modCnt, 0
66     },
67     {
68         ODataOutputStream_CreateInstance, ODataOutputStream_getImplementationName,
69         ODataOutputStream_getSupportedServiceNames, createSingleComponentFactory,
70         &g_moduleCount.modCnt, 0
71     },
72     {
73         OObjectInputStream_CreateInstance, OObjectInputStream_getImplementationName,
74         OObjectInputStream_getSupportedServiceNames, createSingleComponentFactory,
75         &g_moduleCount.modCnt, 0
76     },
77     {
78         OObjectOutputStream_CreateInstance, OObjectOutputStream_getImplementationName,
79         OObjectOutputStream_getSupportedServiceNames, createSingleComponentFactory,
80         &g_moduleCount.modCnt, 0
81     },
82     {
83         OMarkableInputStream_CreateInstance, OMarkableInputStream_getImplementationName,
84         OMarkableInputStream_getSupportedServiceNames, createSingleComponentFactory,
85         &g_moduleCount.modCnt, 0
86     },
87     {
88         OMarkableOutputStream_CreateInstance, OMarkableOutputStream_getImplementationName,
89         OMarkableOutputStream_getSupportedServiceNames, createSingleComponentFactory,
90         &g_moduleCount.modCnt, 0
91     },
92     { 0, 0, 0, 0, 0, 0 }
93 
94 };
95 
96 extern "C"
97 {
98 
99 IO_DLLPUBLIC sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
100 {
101     return g_moduleCount.canUnload( &g_moduleCount , pTime );
102 }
103 
104 //==================================================================================================
105 IO_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment(
106     const sal_Char ** ppEnvTypeName, uno_Environment ** )
107 {
108     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
109 }
110 //==================================================================================================
111 IO_DLLPUBLIC void * SAL_CALL component_getFactory(
112     const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
113 {
114     return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
115 }
116 
117 }
118