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_dbaccess.hxx"
26
27 #ifndef _CPPUHELPER_FACTORY_HXX_
28 #include <cppuhelper/factory.hxx>
29 #endif
30 #ifndef _OSL_DIAGNOSE_H_
31 #include <osl/diagnose.h>
32 #endif
33 #ifndef _DBU_REGHELPER_HXX_
34 #include "dbu_reghelper.hxx"
35 #endif
36 #ifndef INCLUDED_DBACCESSDLLAPI_H
37 #include "dbaccessdllapi.h"
38 #endif
39
40 /********************************************************************************************/
41
42 using namespace ::dbaui;
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::lang;
45 using namespace ::com::sun::star::registry;
46
47 //***************************************************************************************
48 //
49 // registry functions
50 extern "C" void SAL_CALL createRegistryInfo_OTableFilterDialog();
51 extern "C" void SAL_CALL createRegistryInfo_ODataSourcePropertyDialog();
52 extern "C" void SAL_CALL createRegistryInfo_OSQLMessageDialog();
53 extern "C" void SAL_CALL createRegistryInfo_OBrowser();
54 extern "C" void SAL_CALL createRegistryInfo_OFormGridView();
55 extern "C" void SAL_CALL createRegistryInfo_DBContentLoader();
56 extern "C" void SAL_CALL writeDBLoaderInfo(void* pRegistryKey);
57 extern "C" void SAL_CALL createRegistryInfo_OInteractionHandler();
58 extern "C" void SAL_CALL createRegistryInfo_SbaXGridControl();
59 extern "C" void SAL_CALL createRegistryInfo_OQueryControl();
60 extern "C" void SAL_CALL createRegistryInfo_OViewControl();
61 extern "C" void SAL_CALL createRegistryInfo_OTableControl();
62 extern "C" void SAL_CALL createRegistryInfo_ORelationControl();
63 extern "C" void SAL_CALL createRegistryInfo_ComposerDialogs();
64 extern "C" void SAL_CALL createRegistryInfo_ODBApplication();
65 extern "C" void SAL_CALL createRegistryInfo_ODirectSQLDialog();
66 extern "C" void SAL_CALL createRegistryInfo_OAdvancedSettingsDialog();
67 extern "C" void SAL_CALL createRegistryInfo_ODBTypeWizDialog();
68 extern "C" void SAL_CALL createRegistryInfo_OUserSettingsDialog();
69 extern "C" void SAL_CALL createRegistryInfo_ODBTypeWizDialogSetup();
70 extern "C" void SAL_CALL createRegistryInfo_OColumnControlModel();
71 extern "C" void SAL_CALL createRegistryInfo_OColumnControl();
72 extern "C" void SAL_CALL createRegistryInfo_OToolboxController();
73 extern "C" void SAL_CALL createRegistryInfo_CopyTableWizard();
74 extern "C" void SAL_CALL createRegistryInfo_OTextConnectionSettingsDialog();
75
76 //***************************************************************************************
createRegistryInfo_DBU()77 extern "C" void SAL_CALL createRegistryInfo_DBU()
78 {
79 static sal_Bool bInit = sal_False;
80 if (!bInit)
81 {
82 createRegistryInfo_OTableFilterDialog();
83 createRegistryInfo_ODataSourcePropertyDialog();
84 createRegistryInfo_OSQLMessageDialog();
85 createRegistryInfo_OBrowser();
86 createRegistryInfo_OFormGridView();
87 createRegistryInfo_DBContentLoader();
88 createRegistryInfo_OInteractionHandler();
89 createRegistryInfo_SbaXGridControl();
90 createRegistryInfo_OQueryControl();
91 createRegistryInfo_OViewControl();
92 createRegistryInfo_OTableControl();
93 createRegistryInfo_ORelationControl();
94 createRegistryInfo_ComposerDialogs();
95 createRegistryInfo_ODBApplication();
96 createRegistryInfo_ODirectSQLDialog();
97 createRegistryInfo_OAdvancedSettingsDialog();
98 createRegistryInfo_ODBTypeWizDialog();
99 createRegistryInfo_ODBTypeWizDialogSetup();
100 createRegistryInfo_OUserSettingsDialog();
101 createRegistryInfo_OColumnControlModel();
102 createRegistryInfo_OColumnControl();
103 createRegistryInfo_OToolboxController();
104 createRegistryInfo_CopyTableWizard();
105 createRegistryInfo_OTextConnectionSettingsDialog();
106 bInit = sal_True;
107 }
108 }
109
110 //---------------------------------------------------------------------------------------
111
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)112 extern "C" DBACCESS_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment(
113 const sal_Char **ppEnvTypeName,
114 uno_Environment **
115 )
116 {
117 createRegistryInfo_DBU();
118 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
119 }
120
121 //---------------------------------------------------------------------------------------
component_getFactory(const sal_Char * pImplementationName,void * pServiceManager,void *)122 extern "C" DBACCESS_DLLPUBLIC void* SAL_CALL component_getFactory(
123 const sal_Char* pImplementationName,
124 void* pServiceManager,
125 void* /*pRegistryKey*/)
126 {
127 Reference< XInterface > xRet;
128 if (pServiceManager && pImplementationName)
129 {
130 xRet = ::dbaui::OModuleRegistration::getComponentFactory(
131 ::rtl::OUString::createFromAscii(pImplementationName),
132 static_cast< XMultiServiceFactory* >(pServiceManager));
133 }
134
135 if (xRet.is())
136 xRet->acquire();
137 return xRet.get();
138 };
139