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 .
20 #ifndef INCLUDED_EMBEDSERV_SOURCE_INC_SERVPROV_HXX
21 #define INCLUDED_EMBEDSERV_SOURCE_INC_SERVPROV_HXX
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <com/sun/star/uno/XInterface.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <cppuhelper/implbase.hxx>
32 class EmbedProviderFactory_Impl
;
34 class EmbedServer_Impl
: public cppu::WeakImplHelper
<css::lang::XServiceInfo
>
37 EmbedServer_Impl( const css::uno::Reference
< css::lang::XMultiServiceFactory
> &xFactory
);
38 virtual ~EmbedServer_Impl() override
;
40 OUString SAL_CALL
getImplementationName() override
;
42 sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
;
44 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
48 CComPtr
< EmbedProviderFactory_Impl
> m_pOLEFactories
[ SUPPORTED_FACTORIES_NUM
];
49 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
;
52 class EmbedProviderFactory_Impl
: public IClassFactory
56 EmbedProviderFactory_Impl( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xFactory
, const GUID
* pGuid
);
57 virtual ~EmbedProviderFactory_Impl();
60 bool deregisterClass();
62 /* IUnknown methods */
63 STDMETHOD(QueryInterface
)(REFIID riid
, LPVOID FAR
* ppvObj
) override
;
64 STDMETHOD_(ULONG
, AddRef
)() override
;
65 STDMETHOD_(ULONG
, Release
)() override
;
67 /* IClassFactory methods */
68 STDMETHOD(CreateInstance
)(IUnknown FAR
* punkOuter
, REFIID riid
, void FAR
* FAR
* ppv
) override
;
69 STDMETHOD(LockServer
)(int fLock
) override
;
73 oslInterlockedCount m_refCount
;
75 DWORD m_factoryHandle
;
77 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */