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_OStatusbarController();
74 extern "C" void SAL_CALL createRegistryInfo_CopyTableWizard();
75 extern "C" void SAL_CALL createRegistryInfo_OTextConnectionSettingsDialog();
76 
77 //***************************************************************************************
78 extern "C" void SAL_CALL createRegistryInfo_DBU()
79 {
80 	static sal_Bool bInit = sal_False;
81 	if (!bInit)
82 	{
83 		createRegistryInfo_OTableFilterDialog();
84 		createRegistryInfo_ODataSourcePropertyDialog();
85 		createRegistryInfo_OSQLMessageDialog();
86 		createRegistryInfo_OBrowser();
87 		createRegistryInfo_OFormGridView();
88 		createRegistryInfo_DBContentLoader();
89 		createRegistryInfo_OInteractionHandler();
90 		createRegistryInfo_SbaXGridControl();
91 		createRegistryInfo_OQueryControl();
92         createRegistryInfo_OViewControl();
93 		createRegistryInfo_OTableControl();
94 		createRegistryInfo_ORelationControl();
95 		createRegistryInfo_ComposerDialogs();
96 		createRegistryInfo_ODBApplication();
97 		createRegistryInfo_ODirectSQLDialog();
98 		createRegistryInfo_OAdvancedSettingsDialog();
99 		createRegistryInfo_ODBTypeWizDialog();
100 		createRegistryInfo_ODBTypeWizDialogSetup();
101         createRegistryInfo_OUserSettingsDialog();
102 		createRegistryInfo_OColumnControlModel();
103 		createRegistryInfo_OColumnControl();
104 		createRegistryInfo_OToolboxController();
105 		createRegistryInfo_OStatusbarController();
106         createRegistryInfo_CopyTableWizard();
107         createRegistryInfo_OTextConnectionSettingsDialog();
108 		bInit = sal_True;
109 	}
110 }
111 
112 //---------------------------------------------------------------------------------------
113 
114 extern "C" DBACCESS_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment(
115 				const sal_Char	**ppEnvTypeName,
116 				uno_Environment	**
117 			)
118 {
119 	createRegistryInfo_DBU();
120 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
121 }
122 
123 //---------------------------------------------------------------------------------------
124 extern "C" DBACCESS_DLLPUBLIC void* SAL_CALL component_getFactory(
125 					const sal_Char* pImplementationName,
126 					void* pServiceManager,
127 					void* /*pRegistryKey*/)
128 {
129 	Reference< XInterface > xRet;
130 	if (pServiceManager && pImplementationName)
131 	{
132 		xRet = ::dbaui::OModuleRegistration::getComponentFactory(
133 			::rtl::OUString::createFromAscii(pImplementationName),
134 			static_cast< XMultiServiceFactory* >(pServiceManager));
135 	}
136 
137 	if (xRet.is())
138 		xRet->acquire();
139 	return xRet.get();
140 };
141