delay, collect and compress LOK invalidations for Writer views
[LibreOffice.git] / binaryurp / source / bridgefactory.hxx
blob59023896010bdab66bdb77fdfcff1f607d206915
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <sal/config.h>
24 #include <vector>
25 #include <map>
27 #include <com/sun/star/bridge/XBridgeFactory2.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <cppuhelper/basemutex.hxx>
31 #include <cppuhelper/compbase.hxx>
32 #include <sal/types.h>
34 namespace com::sun::star {
35 namespace connection { class XConnection; }
36 namespace uno {
37 class XComponentContext;
38 class XInterface;
42 namespace binaryurp {
44 // That BridgeFactory derives from XComponent appears to be a historic mistake;
45 // the implementation does not care about a disposed state:
47 typedef
48 cppu::WeakComponentImplHelper<
49 com::sun::star::lang::XServiceInfo,
50 com::sun::star::bridge::XBridgeFactory2 >
51 BridgeFactoryBase;
53 class BridgeFactory : private cppu::BaseMutex, public BridgeFactoryBase
55 public:
56 void removeBridge(
57 com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
58 const & bridge);
60 using BridgeFactoryBase::acquire;
61 using BridgeFactoryBase::release;
63 BridgeFactory(const BridgeFactory&) = delete;
64 BridgeFactory& operator=(const BridgeFactory&) = delete;
66 BridgeFactory();
68 virtual ~BridgeFactory() override;
70 private:
71 virtual OUString SAL_CALL getImplementationName() override;
73 virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
75 virtual com::sun::star::uno::Sequence< OUString > SAL_CALL
76 getSupportedServiceNames() override;
78 virtual com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
79 SAL_CALL createBridge(
80 OUString const & sName, OUString const & sProtocol,
81 com::sun::star::uno::Reference<
82 com::sun::star::connection::XConnection > const & aConnection,
83 com::sun::star::uno::Reference<
84 com::sun::star::bridge::XInstanceProvider > const &
85 anInstanceProvider) override;
87 virtual com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
88 SAL_CALL getBridge(
89 OUString const & sName) override;
91 virtual
92 com::sun::star::uno::Sequence<
93 com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > >
94 SAL_CALL getExistingBridges() override;
96 void SAL_CALL disposing() override;
98 typedef
99 std::vector<
100 com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > >
101 BridgeVector;
103 typedef
104 std::map<
105 OUString,
106 com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > >
107 BridgeMap;
109 BridgeVector unnamed_;
110 BridgeMap named_;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */