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