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