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_dbaxml.hxx"
26
27 #include <cppuhelper/factory.hxx>
28 #include <osl/diagnose.h>
29 #include "flt_reghelper.hxx"
30 #include "dbaccessdllapi.h"
31
32 /********************************************************************************************/
33
34 using namespace ::dbaxml;
35 using namespace ::com::sun::star::uno;
36 using namespace ::com::sun::star::lang;
37 using namespace ::com::sun::star::registry;
38
39 //***************************************************************************************
40 //
41 // registry functions
42 extern "C" void SAL_CALL createRegistryInfo_ODBFilter();
43 extern "C" void SAL_CALL createRegistryInfo_ODBFilterExport();
44 extern "C" void SAL_CALL createRegistryInfo_OSettingsExport();
45 extern "C" void SAL_CALL createRegistryInfo_OFullExport();
46 extern "C" void SAL_CALL createRegistryInfo_DBContentLoader2();
47 extern "C" void SAL_CALL createRegistryInfo_DBTypeDetection();
48 extern "C" void SAL_CALL writeDBLoaderInfo2(void* pRegistryKey);
49
50 //***************************************************************************************
createRegistryInfo_dbaxml()51 extern "C" void SAL_CALL createRegistryInfo_dbaxml()
52 {
53 static sal_Bool bInit = sal_False;
54 if (!bInit)
55 {
56 createRegistryInfo_DBTypeDetection();
57 createRegistryInfo_ODBFilter();
58 createRegistryInfo_ODBFilterExport();
59 createRegistryInfo_OSettingsExport();
60 createRegistryInfo_OFullExport();
61 createRegistryInfo_DBContentLoader2();
62 bInit = sal_True;
63 }
64 }
65
66 //---------------------------------------------------------------------------------------
67
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)68 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
69 const sal_Char **ppEnvTypeName,
70 uno_Environment **
71 )
72 {
73 createRegistryInfo_dbaxml();
74 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
75 }
76
77 //---------------------------------------------------------------------------------------
78
component_getFactory(const sal_Char * pImplementationName,void * pServiceManager,void *)79 extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
80 const sal_Char* pImplementationName,
81 void* pServiceManager,
82 void* /*pRegistryKey*/)
83 {
84 Reference< XInterface > xRet;
85 if (pServiceManager && pImplementationName)
86 {
87 xRet = ::dbaxml::OModuleRegistration::getComponentFactory(
88 ::rtl::OUString::createFromAscii(pImplementationName),
89 static_cast< XMultiServiceFactory* >(pServiceManager));
90 }
91
92 if (xRet.is())
93 xRet->acquire();
94 return xRet.get();
95 };
96
97