LibreOffice Module embedserv (master) 1
servprov.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include "common.h"
23#include <oleidl.h>
24#include <com/sun/star/uno/Reference.h>
25#include <com/sun/star/uno/Sequence.h>
26#include <com/sun/star/uno/XInterface.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
29
30
32
33class EmbedServer_Impl: public cppu::WeakImplHelper<css::lang::XServiceInfo>
34{
35public:
36 EmbedServer_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory );
37 virtual ~EmbedServer_Impl() override;
38
39 OUString SAL_CALL getImplementationName() override;
40
41 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
42
43 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
44
45protected:
46
47 CComPtr< EmbedProviderFactory_Impl > m_pOLEFactories[ SUPPORTED_FACTORIES_NUM ];
48 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
49};
50
51class EmbedProviderFactory_Impl : public IClassFactory
52{
53public:
54
55 EmbedProviderFactory_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory, const GUID* pGuid);
57
58 bool registerClass();
59 bool deregisterClass();
60
61 /* IUnknown methods */
62 STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppvObj) override;
63 STDMETHOD_(ULONG, AddRef)() override;
64 STDMETHOD_(ULONG, Release)() override;
65
66 /* IClassFactory methods */
67 STDMETHOD(CreateInstance)(IUnknown* punkOuter, REFIID riid, void** ppv) override;
68 STDMETHOD(LockServer)(int fLock) override;
69
70protected:
71
72 oslInterlockedCount m_refCount;
73 GUID m_guid;
75
76 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
77};
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~EmbedProviderFactory_Impl()
Definition: servprov.cxx:108
STDMETHOD() QueryInterface(REFIID riid, LPVOID *ppvObj) override
Definition: servprov.cxx:135
oslInterlockedCount m_refCount
Definition: servprov.hxx:72
STDMETHOD_(ULONG, Release)() override
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory
Definition: servprov.hxx:76
EmbedProviderFactory_Impl(const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory, const GUID *pGuid)
Definition: servprov.cxx:101
STDMETHOD() CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppv) override
Definition: servprov.cxx:171
STDMETHOD_(ULONG, AddRef)() override
STDMETHOD() LockServer(int fLock) override
Definition: servprov.cxx:179
CComPtr< EmbedProviderFactory_Impl > m_pOLEFactories[SUPPORTED_FACTORIES_NUM]
Definition: servprov.hxx:47
OUString SAL_CALL getImplementationName() override
Definition: servprov.cxx:83
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: servprov.cxx:93
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory
Definition: servprov.hxx:48
virtual ~EmbedServer_Impl() override
Definition: servprov.cxx:74
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
Definition: servprov.cxx:88
EmbedServer_Impl(const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory)
Definition: servprov.cxx:64
#define SUPPORTED_FACTORIES_NUM
Definition: embservconst.h:27
Reference< XSingleServiceFactory > xFactory
unsigned char sal_Bool