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 "stocservices.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 using namespace com::sun::star;
40 using namespace com::sun::star::uno;
41 using namespace cppu;
42 using namespace osl;
43 using namespace rtl;
44 using namespace stoc_services;
45 
46 rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
47 
48 static struct ImplementationEntry g_entries[] =
49 {
50     // typeconv
51     {
52 	TypeConverter_Impl_CreateInstance, tcv_getImplementationName,
53 	tcv_getSupportedServiceNames, createSingleComponentFactory,
54 	&g_moduleCount.modCnt , 0
55     },
56     // uriproc
57     {
58 	ExternalUriReferenceTranslator::create,
59 	ExternalUriReferenceTranslator::getImplementationName,
60 	ExternalUriReferenceTranslator::getSupportedServiceNames,
61 	createSingleComponentFactory, 0, 0
62     },
63     {
64 	UriReferenceFactory::create,
65 	UriReferenceFactory::getImplementationName,
66 	UriReferenceFactory::getSupportedServiceNames,
67 	createSingleComponentFactory, 0, 0
68     },
69     {
70 	UriSchemeParser_vndDOTsunDOTstarDOTexpand::create,
71 	UriSchemeParser_vndDOTsunDOTstarDOTexpand::getImplementationName,
72 	UriSchemeParser_vndDOTsunDOTstarDOTexpand::getSupportedServiceNames,
73 	createSingleComponentFactory, 0, 0
74     },
75     {
76 	UriSchemeParser_vndDOTsunDOTstarDOTscript::create,
77 	UriSchemeParser_vndDOTsunDOTstarDOTscript::getImplementationName,
78 	UriSchemeParser_vndDOTsunDOTstarDOTscript::getSupportedServiceNames,
79 	createSingleComponentFactory, 0, 0
80     },
81     {
82 	VndSunStarPkgUrlReferenceFactory::create,
83 	VndSunStarPkgUrlReferenceFactory::getImplementationName,
84 	VndSunStarPkgUrlReferenceFactory::getSupportedServiceNames,
85 	createSingleComponentFactory, 0, 0
86     },
87     { 0, 0, 0, 0, 0, 0 }
88 };
89 
90 extern "C"
91 {
92 
93 sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
94 {
95 	return g_moduleCount.canUnload( &g_moduleCount , pTime );
96 }
97 
98 //==================================================================================================
99 void SAL_CALL component_getImplementationEnvironment(
100 	const sal_Char ** ppEnvTypeName, uno_Environment ** )
101 {
102 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
103 }
104 //==================================================================================================
105 void * SAL_CALL component_getFactory(
106 	const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
107 {
108 	return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
109 }
110 
111 }
112