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