nss: upgrade to release 3.73
[LibreOffice.git] / dbaccess / source / core / inc / ContainerMediator.hxx
blob37bfc0ebac1a2f576c86b27edd35331df49b00fd
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 .
19 #pragma once
21 #include <com/sun/star/container/XContainerListener.hpp>
22 #include <com/sun/star/container/XContainer.hpp>
23 #include <com/sun/star/container/XNameAccess.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <cppuhelper/basemutex.hxx>
27 #include <cppuhelper/implbase.hxx>
28 #include <rtl/ref.hxx>
30 #include <map>
32 namespace dbaccess
35 class OPropertyForward;
37 class OContainerMediator : public ::cppu::BaseMutex
38 ,public ::cppu::WeakImplHelper< css::container::XContainerListener >
40 private:
41 typedef std::map< OUString, ::rtl::Reference< OPropertyForward > > PropertyForwardList;
42 PropertyForwardList m_aForwardList;
43 css::uno::Reference< css::container::XNameAccess > m_xSettings; // can not be weak
44 css::uno::Reference< css::container::XContainer > m_xContainer; // can not be weak
46 protected:
47 virtual ~OContainerMediator() override;
49 public:
50 OContainerMediator(
51 const css::uno::Reference< css::container::XContainer >& _xContainer,
52 const css::uno::Reference< css::container::XNameAccess >& _xSettings
55 virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& _rEvent ) override;
56 virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& _rEvent ) override;
57 virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& _rEvent ) override;
58 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
60 void notifyElementCreated(const OUString& _sElementName
61 ,const css::uno::Reference< css::beans::XPropertySet>& _xElement);
63 private:
64 /** cleans up the instance, by deregistering as listener at the containers,
65 and resetting them to <NULL/>
67 void impl_cleanup_nothrow();
69 /** initializes the properties of the given object from its counterpart in our settings container
71 void impl_initSettings_nothrow(
72 const OUString& _rName,
73 const css::uno::Reference< css::beans::XPropertySet >& _rxDestination
77 } // namespace dbaccess
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */