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