LibreOffice Module comphelper (master) 1
containermultiplexer.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#ifndef INCLUDED_COMPHELPER_CONTAINERMULTIPLEXER_HXX
21#define INCLUDED_COMPHELPER_CONTAINERMULTIPLEXER_HXX
22
23#include <com/sun/star/container/XContainerListener.hpp>
26#include <rtl/ref.hxx>
27
28namespace osl { class Mutex; }
29namespace com::sun::star::container { class XContainer; }
30
31
32namespace comphelper
33{
34
35
36 class OContainerListenerAdapter;
37
38 //= OContainerListener
39
46 {
49 ::osl::Mutex& m_rMutex;
50
51 public:
52 OContainerListener(::osl::Mutex& _rMutex);
53 virtual ~OContainerListener();
54
56 virtual void _elementInserted( const css::container::ContainerEvent& _rEvent );
58 virtual void _elementRemoved( const css::container::ContainerEvent& _rEvent );
60 virtual void _elementReplaced( const css::container::ContainerEvent& _rEvent );
62 virtual void _disposing(const css::lang::EventObject& _rSource);
63
64 protected:
65 void setAdapter(OContainerListenerAdapter* _pAdapter);
66 };
67
68 // workaround for incremental linking bugs in MSVC2015
69 class SAL_DLLPUBLIC_TEMPLATE OContainerListenerAdapter_Base : public cppu::WeakImplHelper< css::container::XContainerListener > {};
70
72 {
73 friend class OContainerListener;
74
75 private:
76 css::uno::Reference< css::container::XContainer >
79
80 virtual ~OContainerListenerAdapter() override;
81
82 public:
84 const css::uno::Reference< css::container::XContainer >& _rxContainer);
85
86 // XEventListener
87 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
88
89 // XContainerListener
90 virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
91 virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
92 virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
93
95 void dispose();
96
97 };
98
99
100} // namespace dbaui
101
102
103#endif // INCLUDED_COMPHELPER_CONTAINERMULTIPLEXER_HXX
104
105/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::container::XContainer > m_xContainer
a non-UNO container listener
rtl::Reference< OContainerListenerAdapter > m_xAdapter
#define COMPHELPER_DLLPUBLIC
void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
void dispose()