update dev300-m58
[ooovba.git] / dbaccess / source / ext / adabas / Aservices.cxx
blob2a7f797aad94ff8d9044c8c5f120e19ccd967c06
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Aservices.cxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
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 _EXTENSIONS_COMPONENT_MODULE_HXX_
38 #include "Acomponentmodule.hxx"
39 #endif
42 /********************************************************************************************/
44 using namespace ::rtl;
45 using namespace ::adabasui;
46 using namespace ::com::sun::star::uno;
47 using namespace ::com::sun::star::lang;
48 using namespace ::com::sun::star::registry;
50 //***************************************************************************************
52 // registry functions
53 extern "C" void SAL_CALL createRegistryInfo_OAdabasCreateDialog();
55 //***************************************************************************************
56 extern "C" void SAL_CALL createRegistryInfo_adabasui()
58 static sal_Bool bInit = sal_False;
59 if (!bInit)
61 createRegistryInfo_OAdabasCreateDialog();
62 ::adabasui::OModule::setResourceFilePrefix("adabasui");
63 bInit = sal_True;
67 //---------------------------------------------------------------------------------------
69 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
70 component_getImplementationEnvironment(
71 const sal_Char **ppEnvTypeName,
72 uno_Environment **
75 createRegistryInfo_adabasui();
76 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
79 //---------------------------------------------------------------------------------------
80 extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
81 void* pServiceManager,
82 void* pRegistryKey
85 if (pRegistryKey)
86 try
88 return OModule::writeComponentInfos(
89 static_cast<XMultiServiceFactory*>(pServiceManager),
90 static_cast<XRegistryKey*>(pRegistryKey));
92 catch (InvalidRegistryException& )
94 OSL_ASSERT("DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
97 return sal_False;
100 //---------------------------------------------------------------------------------------
101 extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
102 const sal_Char* pImplementationName,
103 void* pServiceManager,
104 void* /*pRegistryKey*/)
106 Reference< XInterface > xRet;
107 if (pServiceManager && pImplementationName)
109 xRet = OModule::getComponentFactory(
110 ::rtl::OUString::createFromAscii(pImplementationName),
111 static_cast< XMultiServiceFactory* >(pServiceManager));
114 if (xRet.is())
115 xRet->acquire();
116 return xRet.get();