xref: /trunk/main/stoc/source/bootstrap/services.cxx (revision cdf0e10c)
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_stoc.hxx"
30 
31 #include "bootstrapservices.hxx"
32 
33 #include "cppuhelper/factory.hxx"
34 #include "cppuhelper/implementationentry.hxx"
35 #include "sal/types.h"
36 #include "uno/environment.h"
37 #include "uno/lbnames.h"
38 
39 #include <stdio.h>
40 
41 using namespace com::sun::star;
42 using namespace com::sun::star::uno;
43 using namespace cppu;
44 using namespace osl;
45 using namespace rtl;
46 
47 extern rtl_StandardModuleCount g_moduleCount;
48 
49 using namespace stoc_bootstrap;
50 
51 static struct ImplementationEntry g_entries[] =
52 {
53     //servicemanager
54     {
55 	OServiceManager_CreateInstance, smgr_getImplementationName,
56 	smgr_getSupportedServiceNames, createSingleComponentFactory,
57 	&g_moduleCount.modCnt , 0
58     },
59     {
60 	ORegistryServiceManager_CreateInstance, regsmgr_getImplementationName,
61 	regsmgr_getSupportedServiceNames, createSingleComponentFactory,
62 	&g_moduleCount.modCnt , 0
63     },
64     {
65 	OServiceManagerWrapper_CreateInstance, smgr_wrapper_getImplementationName,
66 	smgr_wrapper_getSupportedServiceNames, createSingleComponentFactory,
67 	&g_moduleCount.modCnt , 0
68     },
69     //security
70     {
71 	ac_create, ac_getImplementationName,
72 	ac_getSupportedServiceNames, createSingleComponentFactory,
73 	&g_moduleCount.modCnt, 0
74     },
75     {
76 	filepolicy_create, filepolicy_getImplementationName,
77 	filepolicy_getSupportedServiceNames, createSingleComponentFactory,
78 	&g_moduleCount.modCnt, 0
79     },
80     //simpleregistry
81     {
82 	SimpleRegistry_CreateInstance, simreg_getImplementationName,
83 	simreg_getSupportedServiceNames, createSingleComponentFactory,
84 	&g_moduleCount.modCnt , 0
85     },
86     //defaultregistry
87     {
88 	NestedRegistry_CreateInstance, defreg_getImplementationName,
89 	defreg_getSupportedServiceNames, createSingleComponentFactory,
90 	&g_moduleCount.modCnt , 0
91     },
92     //implementationregistry
93     {
94 	ImplementationRegistration_CreateInstance, impreg_getImplementationName,
95 	impreg_getSupportedServiceNames, createSingleComponentFactory,
96 	&g_moduleCount.modCnt , 0
97     },
98     //loader
99     {
100 	DllComponentLoader_CreateInstance, loader_getImplementationName,
101 	loader_getSupportedServiceNames, createSingleComponentFactory,
102 	&g_moduleCount.modCnt , 0
103     },
104     //registry_tdprovider
105     {
106 	ProviderImpl_create, rdbtdp_getImplementationName,
107 	rdbtdp_getSupportedServiceNames, createSingleComponentFactory,
108 	&g_moduleCount.modCnt , 0
109     },
110     //tdmanager
111     {
112 	ManagerImpl_create, tdmgr_getImplementationName,
113 	tdmgr_getSupportedServiceNames, createSingleComponentFactory,
114 	&g_moduleCount.modCnt , 0
115     },
116     //end
117     { 0, 0, 0, 0, 0, 0 }
118 };
119 
120 extern "C"
121 {
122 
123 sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
124 {
125 	return g_moduleCount.canUnload( &g_moduleCount , pTime );
126 }
127 
128 //==================================================================================================
129 void SAL_CALL component_getImplementationEnvironment(
130 	const sal_Char ** ppEnvTypeName, uno_Environment ** )
131 {
132 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
133 }
134 //==================================================================================================
135 void * SAL_CALL component_getFactory(
136 	const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
137 {
138 	return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
139 }
140 
141 }
142