2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00: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 .
|
|
|
|
*/
|
2005-04-13 10:51:04 +00: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 21:55:40 +01:00
|
|
|
#include <osl/diagnose.h>
|
|
|
|
#include <uno/mapping.hxx>
|
|
|
|
#include "provider.hxx"
|
|
|
|
#include "renderer.hxx"
|
2010-05-20 12:45:50 +02:00
|
|
|
#include "unowizard.hxx"
|
2009-12-15 21:55:40 +01:00
|
|
|
|
|
|
|
#include "comphelper/servicedecl.hxx"
|
2005-04-13 10:51:04 +00:00
|
|
|
|
2010-05-20 12:45:50 +02:00
|
|
|
#include "cppuhelper/implementationentry.hxx"
|
|
|
|
|
2005-04-13 10:51:04 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::registry;
|
|
|
|
using namespace ::com::sun::star::lang;
|
2009-12-15 21:55:40 +01:00
|
|
|
using namespace unographic;
|
2005-04-13 10:51:04 +00:00
|
|
|
|
|
|
|
using rtl::OUString;
|
|
|
|
|
2009-12-15 21:55:40 +01:00
|
|
|
namespace sdecl = comphelper::service_decl;
|
|
|
|
|
|
|
|
namespace unographic {
|
|
|
|
extern sdecl::ServiceDecl const serviceDecl;
|
|
|
|
}
|
|
|
|
|
2005-04-13 10:51:04 +00: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 12:45:50 +02: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 10:51:04 +00:00
|
|
|
// -------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
DECLARE_CREATEINSTANCE( SvFilterOptionsDialog )
|
2009-12-15 21:55:40 +01:00
|
|
|
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicProvider )
|
|
|
|
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL )
|
2005-04-13 10:51:04 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
|
2011-06-24 14:56:31 +01:00
|
|
|
SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
|
2009-12-15 21:55:40 +01:00
|
|
|
const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
|
2005-04-13 10:51:04 +00:00
|
|
|
{
|
|
|
|
void * pResult = 0;
|
|
|
|
if ( _pServiceManager )
|
|
|
|
{
|
|
|
|
Reference< XSingleServiceFactory > xFactory;
|
|
|
|
if (rtl_str_compare (
|
2005-05-02 12:16:33 +00:00
|
|
|
pImplementationName, "com.sun.star.svtools.SvFilterOptionsDialog") == 0)
|
2005-04-13 10:51:04 +00:00
|
|
|
{
|
|
|
|
Sequence< OUString > aServiceNames(1);
|
|
|
|
aServiceNames.getArray()[0] =
|
2010-11-18 18:47:55 -05:00
|
|
|
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilterOptionsDialog" ));
|
2005-04-13 10:51:04 +00:00
|
|
|
|
|
|
|
xFactory = ::cppu::createSingleFactory (
|
|
|
|
reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
|
|
|
|
OUString::createFromAscii( pImplementationName ),
|
|
|
|
SvFilterOptionsDialog_CreateInstance,
|
|
|
|
aServiceNames);
|
|
|
|
}
|
2009-12-15 21:55:40 +01: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 12:45:50 +02:00
|
|
|
if ( !pResult )
|
|
|
|
pResult = ::cppu::component_getFactoryHelper( pImplementationName, _pServiceManager, pRegistryKey, s_aServiceEntries );
|
2009-12-15 21:55:40 +01:00
|
|
|
}
|
|
|
|
|
2005-04-13 10:51:04 +00:00
|
|
|
if ( xFactory.is() )
|
|
|
|
{
|
|
|
|
xFactory->acquire();
|
|
|
|
pResult = xFactory.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // "C"
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|