1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Aservices.cxx,v $
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>
34 #ifndef _OSL_DIAGNOSE_H_
35 #include <osl/diagnose.h>
37 #ifndef _EXTENSIONS_COMPONENT_MODULE_HXX_
38 #include "Acomponentmodule.hxx"
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 //***************************************************************************************
53 extern "C" void SAL_CALL
createRegistryInfo_OAdabasCreateDialog();
55 //***************************************************************************************
56 extern "C" void SAL_CALL
createRegistryInfo_adabasui()
58 static sal_Bool bInit
= sal_False
;
61 createRegistryInfo_OAdabasCreateDialog();
62 ::adabasui::OModule::setResourceFilePrefix("adabasui");
67 //---------------------------------------------------------------------------------------
69 extern "C" SAL_DLLPUBLIC_EXPORT
void SAL_CALL
70 component_getImplementationEnvironment(
71 const sal_Char
**ppEnvTypeName
,
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
,
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 !");
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
));