1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "ole2uno.hxx"
22 #include "servprov.hxx"
23 #include <rtl/ustring.hxx>
24 #include <cppuhelper/factory.hxx>
25 using namespace ole_adapter
;
32 Reference
<XInterface
> SAL_CALL
ConverterProvider_CreateInstance2( const Reference
<XMultiServiceFactory
> & xSMgr
)
35 Reference
<XInterface
> xService
= *new OleConverter_Impl2( xSMgr
);
39 Reference
<XInterface
> SAL_CALL
ConverterProvider_CreateInstanceVar1( const Reference
<XMultiServiceFactory
> & xSMgr
)
42 Reference
<XInterface
> xService
= *new OleConverter_Impl2( xSMgr
, UNO_OBJECT_WRAPPER_REMOTE_OPT
, IUNKNOWN_WRAPPER_IMPL
);
46 Reference
<XInterface
> SAL_CALL
OleClient_CreateInstance( const Reference
<XMultiServiceFactory
> & xSMgr
)
49 Reference
<XInterface
> xService
= *new OleClient_Impl( xSMgr
);
53 Reference
<XInterface
> SAL_CALL
OleServer_CreateInstance( const Reference
<XMultiServiceFactory
> & xSMgr
)
56 Reference
<XInterface
> xService
= *new OleServer_Impl(xSMgr
);
61 extern "C" SAL_DLLPUBLIC_EXPORT
void * SAL_CALL
oleautobridge_component_getFactory(
62 const sal_Char
* pImplName
, void * pServiceManager
, void * /*pRegistryKey*/ )
66 OUString
aImplName( OUString::createFromAscii( pImplName
) );
67 Reference
< XSingleServiceFactory
> xFactory
;
68 Sequence
<OUString
> seqServiceNames
;
69 if (pServiceManager
&& aImplName
.equals( reinterpret_cast<const sal_Unicode
*>(L
"com.sun.star.comp.ole.OleConverter2") ))
71 xFactory
= createSingleFactory( reinterpret_cast< XMultiServiceFactory
*>(pServiceManager
),
72 OUString("com.sun.star.comp.ole.OleConverter2"),
73 ConverterProvider_CreateInstance2
, seqServiceNames
);
75 else if (pServiceManager
&& aImplName
.equals( reinterpret_cast<const sal_Unicode
*>(L
"com.sun.star.comp.ole.OleConverterVar1") ))
77 xFactory
= createSingleFactory( reinterpret_cast<XMultiServiceFactory
*>(pServiceManager
),
78 OUString("com.sun.star.comp.ole.OleConverterVar1"),
79 ConverterProvider_CreateInstanceVar1
, seqServiceNames
);
81 else if(pServiceManager
&& aImplName
.equals(reinterpret_cast<const sal_Unicode
*>(L
"com.sun.star.comp.ole.OleClient")))
83 xFactory
= createSingleFactory( reinterpret_cast< XMultiServiceFactory
*>(pServiceManager
),
84 OUString("com.sun.star.comp.ole.OleClient"),
85 OleClient_CreateInstance
, seqServiceNames
);
87 else if(pServiceManager
&& aImplName
.equals(reinterpret_cast<const sal_Unicode
*>(L
"com.sun.star.comp.ole.OleServer")))
89 xFactory
= createOneInstanceFactory( reinterpret_cast< XMultiServiceFactory
*>(pServiceManager
),
90 OUString("com.sun.star.comp.ole.OleServer"),
91 OleServer_CreateInstance
, seqServiceNames
);
97 pRet
= xFactory
.get();
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */