2010-10-12 15:59:03 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2008-03-05 16:06:41 +00:00
|
|
|
#include <cppuhelper/factory.hxx>
|
|
|
|
#include <cppuhelper/implementationentry.hxx>
|
2008-01-30 07:37:09 +00:00
|
|
|
#include "module_dba.hxx"
|
2000-09-18 23:16:46 +00:00
|
|
|
#include <osl/diagnose.h>
|
2008-03-05 16:06:41 +00:00
|
|
|
#include "DatabaseDataProvider.hxx"
|
2008-12-30 13:32:01 +00:00
|
|
|
#include "dbadllapi.hxx"
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2011-05-06 11:34:20 +01:00
|
|
|
#include <../dataaccess/databasecontext.hxx>
|
2014-04-13 22:40:55 +02:00
|
|
|
#include <services.hxx>
|
2011-05-06 11:34:20 +01:00
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::registry;
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
namespace dba{
|
2008-03-05 16:06:41 +00:00
|
|
|
::cppu::ImplementationEntry entries[] = {
|
2011-05-06 11:34:20 +01:00
|
|
|
{
|
|
|
|
&::dbaccess::DatabaseDataProvider::Create,
|
|
|
|
&::dbaccess::DatabaseDataProvider::getImplementationName_Static,
|
|
|
|
&::dbaccess::DatabaseDataProvider::getSupportedServiceNames_Static,
|
|
|
|
&cppu::createSingleComponentFactory, 0, 0
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
&dbaccess::ODatabaseContext::Create,
|
|
|
|
&dbaccess::ODatabaseContext::getImplementationName_static,
|
|
|
|
&dbaccess::ODatabaseContext::getSupportedServiceNames_static,
|
|
|
|
&cppu::createOneInstanceComponentFactory, 0, 0
|
|
|
|
},
|
|
|
|
|
2008-03-05 16:06:41 +00:00
|
|
|
{ 0, 0, 0, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2010-11-10 09:30:11 +00:00
|
|
|
// The prescribed C api must be complied with
|
|
|
|
// It consists of three functions which must be exported by the module.
|
2000-12-15 15:46:23 +00:00
|
|
|
extern "C" void SAL_CALL createRegistryInfo_DBA()
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2014-04-17 11:16:55 +02:00
|
|
|
static bool bInit = false;
|
2000-09-18 23:16:46 +00:00
|
|
|
if (!bInit)
|
|
|
|
{
|
|
|
|
createRegistryInfo_OCommandDefinition();
|
2004-08-02 14:16:43 +00:00
|
|
|
createRegistryInfo_OComponentDefinition();
|
2005-03-10 15:38:14 +00:00
|
|
|
createRegistryInfo_ODatabaseDocument();
|
|
|
|
createRegistryInfo_ODatabaseSource();
|
2008-01-30 07:37:09 +00:00
|
|
|
createRegistryInfo_DataAccessDescriptorFactory();
|
2014-04-17 11:16:55 +02:00
|
|
|
bInit = true;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-13 17:56:47 +02:00
|
|
|
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL dba_component_getFactory(
|
2000-09-18 23:16:46 +00:00
|
|
|
const sal_Char* pImplementationName,
|
|
|
|
void* pServiceManager,
|
2008-03-05 16:06:41 +00:00
|
|
|
void* pRegistryKey)
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2011-07-02 17:28:27 +02:00
|
|
|
createRegistryInfo_DBA();
|
|
|
|
|
2014-06-12 10:23:06 +01:00
|
|
|
Reference<XInterface> xRet(::dba::DbaModule::getInstance().getComponentFactory(
|
|
|
|
OUString::createFromAscii(pImplementationName)));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
if (xRet.is())
|
|
|
|
xRet->acquire();
|
2008-03-05 16:06:41 +00:00
|
|
|
else
|
|
|
|
return cppu::component_getFactoryHelper(
|
2008-10-01 12:28:29 +00:00
|
|
|
pImplementationName, pServiceManager, pRegistryKey, dba::entries);
|
2000-09-18 23:16:46 +00:00
|
|
|
return xRet.get();
|
|
|
|
};
|
2010-10-12 15:59:03 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|