2010-10-14 01:27:31 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2005-04-13 05:51:04 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 16:14:43 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
2008-04-10 16:14:43 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
2008-04-10 16:14:43 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
2008-04-10 16:14:43 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
2008-04-10 16:14:43 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
2008-04-10 16:14:43 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2005-04-13 05:51:04 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include "sal/types.h"
|
|
|
|
#include "rtl/ustring.hxx"
|
|
|
|
#include <cppuhelper/factory.hxx>
|
|
|
|
#include <cppuhelper/weak.hxx>
|
|
|
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/registry/XRegistryKey.hpp>
|
2009-12-15 14:55:40 -06:00
|
|
|
#include <osl/diagnose.h>
|
|
|
|
#include <uno/mapping.hxx>
|
|
|
|
#include "provider.hxx"
|
|
|
|
#include "renderer.hxx"
|
2010-05-20 05:45:50 -05:00
|
|
|
#include "unowizard.hxx"
|
2009-12-15 14:55:40 -06:00
|
|
|
|
|
|
|
#include <com/sun/star/registry/XRegistryKey.hpp>
|
|
|
|
#include "comphelper/servicedecl.hxx"
|
2005-04-13 05:51:04 -05:00
|
|
|
|
2010-05-20 05:45:50 -05:00
|
|
|
#include "cppuhelper/implementationentry.hxx"
|
|
|
|
|
2005-04-13 05:51:04 -05:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::registry;
|
|
|
|
using namespace ::com::sun::star::lang;
|
2009-12-15 14:55:40 -06:00
|
|
|
using namespace unographic;
|
2005-04-13 05:51:04 -05:00
|
|
|
|
|
|
|
using rtl::OUString;
|
|
|
|
|
2009-12-15 14:55:40 -06:00
|
|
|
namespace sdecl = comphelper::service_decl;
|
|
|
|
|
|
|
|
namespace unographic {
|
|
|
|
extern sdecl::ServiceDecl const serviceDecl;
|
|
|
|
}
|
|
|
|
|
2005-04-13 05:51:04 -05:00
|
|
|
// -------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// for CreateInstance functions implemented elsewhere
|
|
|
|
#define DECLARE_CREATEINSTANCE( ImplName ) \
|
|
|
|
Reference< XInterface > SAL_CALL ImplName##_CreateInstance( const Reference< XMultiServiceFactory >& );
|
|
|
|
|
|
|
|
// for CreateInstance functions implemented elsewhere, while the function is within a namespace
|
|
|
|
#define DECLARE_CREATEINSTANCE_NAMESPACE( nmspe, ImplName ) \
|
|
|
|
namespace nmspe { \
|
|
|
|
Reference< XInterface > SAL_CALL ImplName##_CreateInstance( const Reference< XMultiServiceFactory >& ); \
|
|
|
|
}
|
|
|
|
|
2010-05-20 05:45:50 -05:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
static struct ::cppu::ImplementationEntry s_aServiceEntries[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
::svt::uno::Wizard::Create,
|
|
|
|
::svt::uno::Wizard::getImplementationName_static,
|
|
|
|
::svt::uno::Wizard::getSupportedServiceNames_static,
|
|
|
|
::cppu::createSingleComponentFactory, NULL, 0
|
|
|
|
},
|
|
|
|
{ 0, 0, 0, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2005-04-13 05:51:04 -05:00
|
|
|
// -------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
DECLARE_CREATEINSTANCE_NAMESPACE( svt, OAddressBookSourceDialogUno )
|
|
|
|
DECLARE_CREATEINSTANCE( SvFilterOptionsDialog )
|
2009-12-15 14:55:40 -06:00
|
|
|
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicProvider )
|
|
|
|
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL )
|
2005-04-13 05:51:04 -05:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
|
2011-06-24 08:56:31 -05:00
|
|
|
SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
|
2009-12-15 14:55:40 -06:00
|
|
|
const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
|
2005-04-13 05:51:04 -05:00
|
|
|
{
|
|
|
|
void * pResult = 0;
|
|
|
|
if ( _pServiceManager )
|
|
|
|
{
|
|
|
|
Reference< XSingleServiceFactory > xFactory;
|
|
|
|
if (rtl_str_compare (
|
|
|
|
pImplementationName, "com.sun.star.comp.svtools.OAddressBookSourceDialogUno") == 0)
|
|
|
|
{
|
|
|
|
Sequence< OUString > aServiceNames(1);
|
|
|
|
aServiceNames.getArray()[0] =
|
2010-11-18 17:47:55 -06:00
|
|
|
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.AddressBookSourceDialog" ));
|
2005-04-13 05:51:04 -05:00
|
|
|
|
|
|
|
xFactory = ::cppu::createSingleFactory (
|
|
|
|
reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
|
|
|
|
OUString::createFromAscii( pImplementationName ),
|
|
|
|
svt::OAddressBookSourceDialogUno_CreateInstance,
|
|
|
|
aServiceNames);
|
|
|
|
}
|
|
|
|
else if (rtl_str_compare (
|
2005-05-02 07:16:33 -05:00
|
|
|
pImplementationName, "com.sun.star.svtools.SvFilterOptionsDialog") == 0)
|
2005-04-13 05:51:04 -05:00
|
|
|
{
|
|
|
|
Sequence< OUString > aServiceNames(1);
|
|
|
|
aServiceNames.getArray()[0] =
|
2010-11-18 17:47:55 -06:00
|
|
|
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilterOptionsDialog" ));
|
2005-04-13 05:51:04 -05:00
|
|
|
|
|
|
|
xFactory = ::cppu::createSingleFactory (
|
|
|
|
reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
|
|
|
|
OUString::createFromAscii( pImplementationName ),
|
|
|
|
SvFilterOptionsDialog_CreateInstance,
|
|
|
|
aServiceNames);
|
|
|
|
}
|
2009-12-15 14:55:40 -06:00
|
|
|
else if( 0 == GraphicProvider::getImplementationName_Static().compareToAscii( pImplementationName ) )
|
|
|
|
{
|
|
|
|
xFactory = ::cppu::createOneInstanceFactory(
|
|
|
|
reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),
|
|
|
|
GraphicProvider::getImplementationName_Static(),
|
|
|
|
GraphicProvider_CreateInstance,
|
|
|
|
GraphicProvider::getSupportedServiceNames_Static() );
|
|
|
|
}
|
|
|
|
else if( 0 == GraphicRendererVCL::getImplementationName_Static().compareToAscii( pImplementationName ) )
|
|
|
|
{
|
|
|
|
xFactory = ::cppu::createOneInstanceFactory(
|
|
|
|
reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),
|
|
|
|
GraphicRendererVCL::getImplementationName_Static(),
|
|
|
|
GraphicRendererVCL_CreateInstance,
|
|
|
|
GraphicRendererVCL::getSupportedServiceNames_Static() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pResult = component_getFactoryHelper( pImplementationName, reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl );
|
2010-05-20 05:45:50 -05:00
|
|
|
if ( !pResult )
|
|
|
|
pResult = ::cppu::component_getFactoryHelper( pImplementationName, _pServiceManager, pRegistryKey, s_aServiceEntries );
|
2009-12-15 14:55:40 -06:00
|
|
|
}
|
|
|
|
|
2005-04-13 05:51:04 -05:00
|
|
|
if ( xFactory.is() )
|
|
|
|
{
|
|
|
|
xFactory->acquire();
|
|
|
|
pResult = xFactory.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // "C"
|
|
|
|
|
2010-10-14 01:27:31 -05:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|